Compare commits
	
		
			6 Commits
		
	
	
		
			ZhongBuZhanQu
			...
			master
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 
							
							
								
								 | 
						e84bf6ff49 | 
							 | 
					|
| 
							
							
								
								 | 
						6fa4cb7508 | 
							 | 
					|
| 
							
							
								
								 | 
						57e2636ba3 | 
							 | 
					|
| 
							
							
								
								 | 
						067400b221 | 
							 | 
					|
| 
							
							
								
								 | 
						289a1491f3 | 
							 | 
					|
| 
							
							
								
								 | 
						f4c09d52a1 | 
							 | 
					
							
								
								
									
										10739
									
								
								1-2华康毒麻药品柜系统操作手册.doc
								
								
								
								
							
							
						
						
									
										10739
									
								
								1-2华康毒麻药品柜系统操作手册.doc
								
								
								
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							| 
						 | 
					@ -33,7 +33,6 @@ namespace MasaBlazorApp3.DataAccess
 | 
				
			||||||
        public ITable<PlanDetails> PlanDetails => this.GetTable<PlanDetails>();
 | 
					        public ITable<PlanDetails> PlanDetails => this.GetTable<PlanDetails>();
 | 
				
			||||||
        public ITable<AccountBookG2> AccountBookG2 => this.GetTable<AccountBookG2>();
 | 
					        public ITable<AccountBookG2> AccountBookG2 => this.GetTable<AccountBookG2>();
 | 
				
			||||||
        public ITable<HkcChangeShifts> HkcChangeShifts => this.GetTable<HkcChangeShifts>();
 | 
					        public ITable<HkcChangeShifts> HkcChangeShifts => this.GetTable<HkcChangeShifts>();
 | 
				
			||||||
        public ITable<HkcChangeShiftsDetail> HkcChangeShiftsDetail => this.GetTable<HkcChangeShiftsDetail>();
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
        
 | 
					        
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,14 +0,0 @@
 | 
				
			||||||
using System;
 | 
					 | 
				
			||||||
using System.Collections.Generic;
 | 
					 | 
				
			||||||
using System.Linq;
 | 
					 | 
				
			||||||
using System.Text;
 | 
					 | 
				
			||||||
using System.Threading.Tasks;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
namespace MasaBlazorApp3.DataAccess
 | 
					 | 
				
			||||||
{
 | 
					 | 
				
			||||||
    public class CheckInfo<T>
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
        public string StrInfo { get; set; }
 | 
					 | 
				
			||||||
        public List<T> TEntity { get; set; } = new List<T>();
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
| 
						 | 
					@ -17,7 +17,7 @@ namespace MasaBlazorApp3.DataAccess.Dao
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        public Task<List<ChannelList>> GetAllDrugChannelList();
 | 
					        public Task<List<ChannelList>> GetAllDrugChannelList();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        public Task<bool> DrawerOperationFinish(List<ChannelStock> Stocks, int type,BoxModel boxNum,List<ChannelList> channelLists);
 | 
					        public Task<bool> DrawerOperationFinish(List<ChannelStock> Stocks, int type);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        public Task<bool> UnBind(string id);
 | 
					        public Task<bool> UnBind(string id);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -32,73 +32,54 @@ namespace MasaBlazorApp3.DataAccess.Dao
 | 
				
			||||||
        public Task<bool> DrawerCheckFinish(List<ChannelStock> Stocks);
 | 
					        public Task<bool> DrawerCheckFinish(List<ChannelStock> Stocks);
 | 
				
			||||||
        //抽屉获取库存数据--药品绑定
 | 
					        //抽屉获取库存数据--药品绑定
 | 
				
			||||||
        Task<ChannelStockWithDrawerCount<ChannelStock>> GetChannelStockByBiaoDing(int DrawerNo, int Quantity=0);
 | 
					        Task<ChannelStockWithDrawerCount<ChannelStock>> GetChannelStockByBiaoDing(int DrawerNo, int Quantity=0);
 | 
				
			||||||
        //手术室药盒获取绑定数据
 | 
					        //手术室药箱获取绑定数据
 | 
				
			||||||
        Task<PageMultiData<ChannelList, Plan>> GetAllChannelListWithPlan(int? take, int? skip);
 | 
					        Task<PageMultiData<ChannelList, Plan>> GetAllChannelListWithPlan(int? take, int? skip);
 | 
				
			||||||
        /// <summary>
 | 
					        /// <summary>
 | 
				
			||||||
        /// 手术室药盒绑定套餐
 | 
					        /// 手术室药箱绑定套餐
 | 
				
			||||||
        /// </summary>
 | 
					 | 
				
			||||||
        /// <returns></returns>
 | 
					 | 
				
			||||||
        Task<bool> BindBox(ChannelList list, Plan plan);
 | 
					 | 
				
			||||||
        /// <summary>
 | 
					 | 
				
			||||||
        /// 手术室药盒绑定套餐
 | 
					 | 
				
			||||||
        /// </summary>
 | 
					        /// </summary>
 | 
				
			||||||
        /// <returns></returns>
 | 
					        /// <returns></returns>
 | 
				
			||||||
        Task<bool> BindBox(ChannelList channelList);
 | 
					        Task<bool> BindBox(ChannelList channelList);
 | 
				
			||||||
        /// <summary>
 | 
					        /// <summary>
 | 
				
			||||||
        /// 手术室药盒解绑套餐
 | 
					        /// 手术室药箱解绑套餐
 | 
				
			||||||
        /// </summary>
 | 
					        /// </summary>
 | 
				
			||||||
        /// <param name="list"></param>
 | 
					        /// <param name="list"></param>
 | 
				
			||||||
        /// <returns></returns>
 | 
					        /// <returns></returns>
 | 
				
			||||||
        Task<bool> UnBindBox(ChannelList list);
 | 
					        Task<bool> UnBindBox(ChannelList list);
 | 
				
			||||||
        //获取手术室药盒中所有要补药的数据
 | 
					        //获取手术室药箱中所有要补药的数据
 | 
				
			||||||
        Task<PageData<ChannelList>> GetAllBoxAddDrug(int? take, int? skip);
 | 
					        Task<PageData<ChannelList>> GetAllBoxAddDrug(int? take, int? skip);
 | 
				
			||||||
        //手术室药盒补药获取毒麻柜中的药品信息
 | 
					        //手术室药箱补药获取毒麻柜中的药品信息
 | 
				
			||||||
        Task<List<BoxTakeVo>> getTakeInfoByBox(ChannelList cl);
 | 
					        Task<List<BoxTakeVo>> getTakeInfoByBox(ChannelList cl);
 | 
				
			||||||
        //手术室药盒补药完成
 | 
					        //手术室药箱补药完成
 | 
				
			||||||
        Task<bool> BoxTakeFinish(List<BoxTakeVo> datas, ChannelList boxChannelList);
 | 
					        Task<bool> BoxTakeFinish(List<BoxTakeVo> datas, ChannelList boxChannelList);
 | 
				
			||||||
        //手术室药盒入库
 | 
					        //手术室药箱入库
 | 
				
			||||||
        Task<PageData<ChannelList>> GetBoxWaitInfo(int? take, int? skip);
 | 
					        Task<PageData<ChannelList>> GetBoxWaitInfo(int? take, int? skip);
 | 
				
			||||||
        // 药盒入库弹窗页面获取要入库的药品明细信息
 | 
					        //手术室药箱入库获取待入库明细
 | 
				
			||||||
        Task<List<ChannelStock>> GetBoxAddToBox(ChannelList cl);
 | 
					 | 
				
			||||||
        //手术室药盒入库获取待入库明细
 | 
					 | 
				
			||||||
        Task<List<BoxTakeVo>> getBoxWaitByBox(ChannelList cl, int? take, int? skip);
 | 
					        Task<List<BoxTakeVo>> getBoxWaitByBox(ChannelList cl, int? take, int? skip);
 | 
				
			||||||
        // 手术室药盒待入库明细入库完成
 | 
					        // 手术室药箱待入库明细入库完成
 | 
				
			||||||
        Task<bool> BoxAddBoxFinish(ChannelList boxChannelList);
 | 
					        Task<bool> BoxAddBoxFinish(ChannelList boxChannelList);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        //手术室药盒获取药盒药品及库存信息
 | 
					        //手术室药箱获取药箱药品及库存信息
 | 
				
			||||||
        Task<PageData<PlanDetails>> GetBoxDrugInfo(string DrawerNo, int? take, int? skip);
 | 
					        Task<PageData<PlanDetails>> GetBoxDrugInfo(int DrawerNo, int? take, int? skip);
 | 
				
			||||||
        //药盒移库时获取选中药盒号的药品信息
 | 
					        //药箱移库时获取选中药箱号的药品信息
 | 
				
			||||||
        Task<PageData<ChannelStock>> GetChannelStockByDrug(ChannelStock cs, string drawerNo,int? take, int? skip);
 | 
					        Task<PageData<ChannelStock>> GetChannelStockByDrug(ChannelStock cs, int drawerNo, int? take, int? skip);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        /// <summary>
 | 
					        /// <summary>
 | 
				
			||||||
        /// 药盒交换药品获取所有除本药盒外的所有药盒号
 | 
					        /// 药箱交换药品获取所有除本药箱外的所有药箱号
 | 
				
			||||||
        /// </summary>
 | 
					        /// </summary>
 | 
				
			||||||
        /// <param name="machineId"></param>
 | 
					        /// <param name="machineId"></param>
 | 
				
			||||||
        /// <returns></returns>
 | 
					        /// <returns></returns>
 | 
				
			||||||
        Task<string[]> GetDrawerNum(ChannelStock channelStock);
 | 
					        Task<int[]> GetDrawerNum(ChannelStock channelStock);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        /// <summary>
 | 
					        /// <summary>
 | 
				
			||||||
        /// 药盒移除药品,获取所有除本药盒外的所有包含该药品的药盒号
 | 
					        /// 药箱移除药品,获取所有除本药箱外的所有包含该药品的药箱号
 | 
				
			||||||
        /// </summary>
 | 
					        /// </summary>
 | 
				
			||||||
        /// <param name="machineId"></param>
 | 
					        /// <param name="machineId"></param>
 | 
				
			||||||
        /// <returns></returns>
 | 
					        /// <returns></returns>
 | 
				
			||||||
        Task<string[]> GetDrawerNumForRemove(ChannelStock channelStock);
 | 
					        Task<int[]> GetDrawerNumForRemove(ChannelStock channelStock);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        //手术室药盒交换药品完成
 | 
					        //手术室药箱交换药品完成
 | 
				
			||||||
        Task<bool> BoxReplaceFinish(ChannelStock stock, List<ChannelStock> Stocks);
 | 
					        Task<bool> BoxReplaceFinish(ChannelStock stock, List<ChannelStock> Stocks);
 | 
				
			||||||
        //手术室药盒移出药品完成
 | 
					        //手术室药箱移出药品完成
 | 
				
			||||||
        Task<bool> BoxRemoveFinish(ChannelStock stock, string SelectedDrawerNo, int removeQuantity);
 | 
					        Task<bool> BoxRemoveFinish(ChannelStock stock, int SelectedDrawerNo, int removeQuantity);
 | 
				
			||||||
 | 
					 | 
				
			||||||
        Task<List<ChannelList>> GetAllBox();
 | 
					 | 
				
			||||||
        //根据药盒查询药品信息
 | 
					 | 
				
			||||||
        Task<List<ChannelStock>> GetChannelStockByBox(int BoxNum);
 | 
					 | 
				
			||||||
        //根据套餐下无库存的药箱
 | 
					 | 
				
			||||||
        Task<List<ChannelStock>> GetChannelStockByPlan(string plan);
 | 
					 | 
				
			||||||
        //手术室药盒获取绑定数据
 | 
					 | 
				
			||||||
        Task<List<ChannelList>> GetAllChannelList();
 | 
					 | 
				
			||||||
        //抽屉取药向药盒加药校验药盒中是否存在该药
 | 
					 | 
				
			||||||
        Task<CheckInfo<ChannelList>> CheckBoxDrugInfo(BoxModel BoxNum,List<ChannelStock> channelStockList);
 | 
					 | 
				
			||||||
        //药箱中的药移入到抽屉
 | 
					 | 
				
			||||||
        Task<bool> RemoveDrugToDrawerFinish(string SelectedDrawerNo, ChannelStock channelStock, int quantity);
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -11,8 +11,6 @@ namespace MasaBlazorApp3.DataAccess.Dao
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        Task<List<DrugInfo>> GetAllDrugAndStock();
 | 
					        Task<List<DrugInfo>> GetAllDrugAndStock();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        Task<List<DrugInfo>> GetAllDrugAndStockByBox(BoxModel boxModel);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
        Task<List<DrugInfo>> GetAllDrug();
 | 
					        Task<List<DrugInfo>> GetAllDrug();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -11,8 +11,7 @@ namespace MasaBlazorApp3.DataAccess.Dao
 | 
				
			||||||
    public interface IOrderInfoDao
 | 
					    public interface IOrderInfoDao
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        public Task<PageData<OrderInfo>> GetAllOrderInfo(string OrderrNo, DateTime OrderDate, int? take, int? skip);
 | 
					        public Task<PageData<OrderInfo>> GetAllOrderInfo(string OrderrNo, DateTime OrderDate, int? take, int? skip);
 | 
				
			||||||
        //导入处方查询数据
 | 
					
 | 
				
			||||||
        public Task<PageData<OrderInfo>> GetAllOrderInfoForImport(string name, string OrderrNo, DateTime OrderDate, BoxModel boxModel, int? take, int? skip);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
        public Task<PageData<OrderInfo>> GetAllCanReturnOrderInfo(string OrderrNo, DateTime OrderDate, int? take, int? skip);
 | 
					        public Task<PageData<OrderInfo>> GetAllCanReturnOrderInfo(string OrderrNo, DateTime OrderDate, int? take, int? skip);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -27,27 +26,11 @@ namespace MasaBlazorApp3.DataAccess.Dao
 | 
				
			||||||
        public Task<bool> OrderReturnFinish(List<OperationVo<MachineRecord>> datas, string OrderrNo);
 | 
					        public Task<bool> OrderReturnFinish(List<OperationVo<MachineRecord>> datas, string OrderrNo);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        public Task<List<OperationVo<MachineRecord>>> getReturnInfoByOrderNo(string OrderrNo);
 | 
					        public Task<List<OperationVo<MachineRecord>>> getReturnInfoByOrderNo(string OrderrNo);
 | 
				
			||||||
        //获取药盒中的用药信息
 | 
					        //获取药箱中的用药信息
 | 
				
			||||||
        public Task<PageData<OrderInfo>> GetAllOrderInfoByBox(int box,string OrderrNo, DateTime OrderDate, int? take, int? skip);
 | 
					        public Task<PageData<OrderInfo>> GetAllOrderInfoByBox(int box,string OrderrNo, DateTime OrderDate, int? take, int? skip);
 | 
				
			||||||
        //获取待处理处方中的麻醉师
 | 
					        //获取所有药箱号 
 | 
				
			||||||
        public Task<PageData<OrderInfo>> GetAllOrderInfo(string Name, string BoxNum, string PatientName,string OrderrNo, DateTime? OrderDate, int? take, int? skip);
 | 
					        public Task<int[]> GetDrawerNum(string machineId);
 | 
				
			||||||
 | 
					 | 
				
			||||||
        public Task<PageData<ChannelStock>> GetAllOrderInfoDrugByBox(BoxModel boxNum, string roomName, DateTime? OrderDate);
 | 
					 | 
				
			||||||
        //获取麻醉师信息
 | 
					 | 
				
			||||||
        public Task<List<Anaesthetist>> GetAnaesthetistName();
 | 
					 | 
				
			||||||
        //获取麻醉师单对应的手术间号
 | 
					 | 
				
			||||||
        public Task<List<BoxModel>> GetOperationNum(int boxColor);
 | 
					 | 
				
			||||||
        //获取麻醉师单对应的手术间号(查询全部手术间已绑套餐的手术间)
 | 
					 | 
				
			||||||
        public Task<List<BoxModel>> GetAllBindOperationNum();
 | 
					 | 
				
			||||||
        //获取所有药盒号 
 | 
					 | 
				
			||||||
        public Task<List<ChannelStock>> GetDrawerNum(string machineId);
 | 
					 | 
				
			||||||
        /// 获取指定药盒号
 | 
					 | 
				
			||||||
        public Task<List<BoxModel>> GetDrawerNumByOperationNum(string machineId, List<int> operationNum);
 | 
					 | 
				
			||||||
        //核对处方
 | 
					        //核对处方
 | 
				
			||||||
        public Task<bool> CheckOrderInfo(IList<OrderInfo> selectedOrderInfos, BoxModel boxModel);
 | 
					        public Task<bool> CheckOrderInfo(IList<OrderInfo> selectedOrderInfos, int DrawerNo);
 | 
				
			||||||
        //查询药品对应的库位 drawerType=1药品库位,其他则是回收库位
 | 
					 | 
				
			||||||
        public Task<List<ChannelStock>> GetStockByDRrug(string drugId, string manuNo, int drawerType);
 | 
					 | 
				
			||||||
        //核对处方通过库位下的药品
 | 
					 | 
				
			||||||
        public Task<bool> CheckOrderInfoByChannelStock(IList<ChannelStock> csList, BoxModel boxModel);
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -13,11 +13,5 @@ namespace MasaBlazorApp3.DataAccess.Dao
 | 
				
			||||||
        Task<PageData<ReportStockDateInfo>> GetStockExportData(string drugName);
 | 
					        Task<PageData<ReportStockDateInfo>> GetStockExportData(string drugName);
 | 
				
			||||||
        //专用账册导出数据
 | 
					        //专用账册导出数据
 | 
				
			||||||
        Task<PageData<ReportAccountDateInfo>> GetAccountExportData(DateTime? startDate, DateTime? endDate, string drugName);
 | 
					        Task<PageData<ReportAccountDateInfo>> GetAccountExportData(DateTime? startDate, DateTime? endDate, string drugName);
 | 
				
			||||||
        //手术室患者麻醉药品使用登记本主表数据
 | 
					 | 
				
			||||||
        Task<List<ReportUsageParentDateInfo>> GetOrderInfoParentData(DateTime? startDate);
 | 
					 | 
				
			||||||
        //手术室患者麻醉药品使用登记本
 | 
					 | 
				
			||||||
        Task<List<ReportUsageDateInfo>> GetOrderInfoData(DateTime? startDate);
 | 
					 | 
				
			||||||
        //请领登记表导出
 | 
					 | 
				
			||||||
        Task<PageData<ReportApplyInfo>> GetApplyInfoDate(DateTime searchDate);
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -9,6 +9,6 @@ namespace MasaBlazorApp3.DataAccess.Dao
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    interface ISettingManuDao
 | 
					    interface ISettingManuDao
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        public Task<List<SettingManu>> GetMenuItemsAsync();
 | 
					        public Task<List<SettingManu>> GetMenuItemsAsync(string culture);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							| 
						 | 
					@ -28,52 +28,11 @@ namespace MasaBlazorApp3.DataAccess.Impl
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            var query = _connection.DrugInfo.AsQueryable();
 | 
					            var query = _connection.DrugInfo.AsQueryable();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            List<DrugInfo> drugList = await query
 | 
					 | 
				
			||||||
                .LoadWith(di => di.Stocks.Where(cs => cs.Quantity > 0 && (cs.MachineId == _setting.machineId)))
 | 
					 | 
				
			||||||
                .InnerJoin(
 | 
					 | 
				
			||||||
                    _connection.ChannelStock.Where(cl => cl.MachineId == _setting.machineId && cl.DrawerType == 1).GroupBy(cl => cl.DrugId),
 | 
					 | 
				
			||||||
                    (di, cl) => di.DrugId == cl.Key,
 | 
					 | 
				
			||||||
                    (di, cl) => di
 | 
					 | 
				
			||||||
                )
 | 
					 | 
				
			||||||
                //.Where(cs => cs.Quantity > 0)
 | 
					 | 
				
			||||||
                .OrderBy((di) => di.DrugId)
 | 
					 | 
				
			||||||
                .ToListAsync();
 | 
					 | 
				
			||||||
            if(drugList!=null&&drugList.Count>0)
 | 
					 | 
				
			||||||
            {
 | 
					 | 
				
			||||||
                for (int i = 0; i < drugList.Count; i++)
 | 
					 | 
				
			||||||
                {
 | 
					 | 
				
			||||||
                    List<ChannelStock> channelStocks = _connection.ChannelStock.Where(cs => cs.MachineId.Equals(_setting.boxMachineId) && cs.DrugId == drugList[i].DrugId).OrderBy(cs=> new{ cs.DrawerNo, cs.ColNo}).ToList();
 | 
					 | 
				
			||||||
                    var  nomalBoxStockList= channelStocks.Where(cs => cs.DrawerNo <= 30).GroupBy(cs =>new { cs.ManuNo, cs.EffDate }).Select(g => new { manuNo=g.Key.ManuNo,effdate=g.Key.EffDate,Quantity=g.Sum(k=>k.Quantity)}).ToList();
 | 
					 | 
				
			||||||
                    foreach (var item in nomalBoxStockList)
 | 
					 | 
				
			||||||
                    {
 | 
					 | 
				
			||||||
                        ChannelStock nomalBox = new ChannelStock() { DrugId = drugList[i].DrugId,ManuNo=item.manuNo,Quantity=item.Quantity,EffDate=item.effdate,MachineId= "DM5" };
 | 
					 | 
				
			||||||
                        drugList[i].Stocks.Add(nomalBox);
 | 
					 | 
				
			||||||
                    }
 | 
					 | 
				
			||||||
                    drugList[i].Stocks.AddRange(channelStocks.Where(cs=>cs.DrawerNo>30));
 | 
					 | 
				
			||||||
                }
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
            return drugList;
 | 
					 | 
				
			||||||
            //return await query
 | 
					 | 
				
			||||||
            //    .LoadWith(di => di.Stocks.Where(cs => cs.Quantity > 0 && (cs.MachineId == _setting.machineId)))
 | 
					 | 
				
			||||||
            //    .InnerJoin(
 | 
					 | 
				
			||||||
            //        _connection.ChannelStock.Where(cl => cl.MachineId == _setting.machineId && cl.DrawerType == 1).GroupBy(cl => cl.DrugId),
 | 
					 | 
				
			||||||
            //        (di, cl) => di.DrugId == cl.Key,
 | 
					 | 
				
			||||||
            //        (di, cl) => di
 | 
					 | 
				
			||||||
            //    )
 | 
					 | 
				
			||||||
            //    //.Where(cs => cs.Quantity > 0)
 | 
					 | 
				
			||||||
            //    .OrderBy((di) => di.DrugId)
 | 
					 | 
				
			||||||
            //    .ToListAsync();
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        public async Task<List<DrugInfo>> GetAllDrugAndStockByBox(BoxModel boxModel)
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
            var query = _connection.DrugInfo.AsQueryable();
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
            return await query
 | 
					            return await query
 | 
				
			||||||
                .LoadWith(di => di.Stocks.Where(cs => cs.Quantity > 0 && cs.MachineId == _setting.boxMachineId&&cs.DrawerNo==boxModel.BoxName&&cs.ColNo==boxModel.BoxNo))
 | 
					                .LoadWith(di => di.Stocks.Where(cs => cs.Quantity > 0 && cs.MachineId == _setting.machineId))
 | 
				
			||||||
                .InnerJoin(
 | 
					                .InnerJoin(
 | 
				
			||||||
                    _connection.ChannelStock.Where(cl => cl.MachineId == _setting.boxMachineId && cl.DrawerNo==boxModel.BoxName&&cl.ColNo==boxModel.BoxNo).GroupBy(cl => cl.DrugId),
 | 
					                    _connection.ChannelStock.Where(cl => cl.MachineId == _setting.machineId && cl.DrawerType == 1).GroupBy(cl => cl.DrugId),
 | 
				
			||||||
                    (di, cl) => di.DrugId == cl.Key,
 | 
					                    (di, cl) => di.DrugId == cl.Key,
 | 
				
			||||||
                    (di, cl) => di
 | 
					                    (di, cl) => di
 | 
				
			||||||
                )
 | 
					                )
 | 
				
			||||||
| 
						 | 
					@ -160,7 +119,6 @@ namespace MasaBlazorApp3.DataAccess.Impl
 | 
				
			||||||
                    .Where(di => di.DrugId == drugInfo.DrugId)
 | 
					                    .Where(di => di.DrugId == drugInfo.DrugId)
 | 
				
			||||||
                    .Set(di => di.DrugName, drugInfo.DrugName)
 | 
					                    .Set(di => di.DrugName, drugInfo.DrugName)
 | 
				
			||||||
                    .Set(di => di.DrugSpec, drugInfo.DrugSpec)
 | 
					                    .Set(di => di.DrugSpec, drugInfo.DrugSpec)
 | 
				
			||||||
                    .Set(di=>di.PackH,drugInfo.PackH)
 | 
					 | 
				
			||||||
                    .Set(di => di.Manufactory, drugInfo.Manufactory);
 | 
					                    .Set(di => di.Manufactory, drugInfo.Manufactory);
 | 
				
			||||||
                return statement.Update() > 0;
 | 
					                return statement.Update() > 0;
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -33,90 +33,89 @@ namespace MasaBlazorApp3.DataAccess.Impl
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        public async Task<PageData<InOutInvoice>> GetAllInvoiceByType(string invoiceNo, DateTime invoiceDate, int? take, int? skip, int type = 1)
 | 
					        public async Task<PageData<InOutInvoice>> GetAllInvoiceByType(string invoiceNo, DateTime invoiceDate, int? take, int? skip, int type = 1)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            //var query2 = from cl in _connection.ChannelStock.Where(c => c.MachineId == _setting.machineId)
 | 
					            var query2 = from cl in _connection.ChannelList.Where(c => c.MachineId == _setting.machineId)
 | 
				
			||||||
            //             group cl by cl.DrugId into temp
 | 
					                         group cl by cl.DrugId into temp
 | 
				
			||||||
            //             select new { temp.Key };
 | 
					                         select new { temp.Key };
 | 
				
			||||||
            //var query3 = from ioi in _connection.InOutInvoice
 | 
					            var query3 = from ioi in _connection.InOutInvoice
 | 
				
			||||||
            //             from od in query2.InnerJoin(od => od.Key == ioi.DrugId)
 | 
					                         from od in query2.InnerJoin(od => od.Key == ioi.DrugId)
 | 
				
			||||||
            //             group ioi by ioi.InvoiceNo into temp
 | 
					                         group ioi by ioi.InvoiceNo into temp
 | 
				
			||||||
            //             select new InOutInvoice{
 | 
					                         select new InOutInvoice{
 | 
				
			||||||
            //                InvoiceNo= temp.First().InvoiceNo,
 | 
					                            InvoiceNo= temp.First().InvoiceNo,
 | 
				
			||||||
            //                InPharmacyId = temp.First().InPharmacyId,
 | 
					                            InPharmacyId = temp.First().InPharmacyId,
 | 
				
			||||||
            //                OutPharmacyId = temp.First().OutPharmacyId,
 | 
					                            OutPharmacyId = temp.First().OutPharmacyId,
 | 
				
			||||||
            //                InvoiceDate = temp.First().InvoiceDate,
 | 
					                            InvoiceDate = temp.First().InvoiceDate,
 | 
				
			||||||
            //                CreateTime = temp.First().CreateTime,
 | 
					                            CreateTime = temp.First().CreateTime,
 | 
				
			||||||
            //                Type = temp.First().Type,
 | 
					                            Type = temp.First().Type,
 | 
				
			||||||
            //                CancelFlag = temp.First().CancelFlag,
 | 
					                            CancelFlag = temp.First().CancelFlag,
 | 
				
			||||||
            //                Status = temp.First().Status,
 | 
					                            Status = temp.First().Status,
 | 
				
			||||||
            //             };
 | 
					                         };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            var query = _connection.FromSql<InOutInvoice>($@"
 | 
					            //var query = _connection.FromSql<InOutInvoice>($@"
 | 
				
			||||||
                SELECT ioi.invoice_no,ioi.in_pharmacy_id, ioi.out_pharmacy_id, ioi.invoice_date, ioi.create_time, ioi.type, ioi.cancel_flag, ioi.status FROM in_out_invoice ioi
 | 
					            //    SELECT ioi.invoice_no,ioi.in_pharmacy_id, ioi.out_pharmacy_id, ioi.invoice_date, ioi.create_time, ioi.type, ioi.cancel_flag, ioi.status FROM in_out_invoice ioi
 | 
				
			||||||
                INNER JOIN (SELECT drug_id FROM channel_stock WHERE machine_id = {_setting.machineId} GROUP BY drug_id) c ON c.drug_id = ioi.drug_id
 | 
					            //    INNER JOIN (SELECT drug_id FROM channel_list WHERE machine_id = ""{_setting.machineId}"" GROUP BY drug_id) c ON c.drug_id = ioi.drug_id
 | 
				
			||||||
                GROUP BY ioi.invoice_no");
 | 
					            //    GROUP BY ioi.invoice_no");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            if (!String.IsNullOrEmpty(invoiceNo))
 | 
					            if (!String.IsNullOrEmpty(invoiceNo))
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                query = query.Where(ioi => ioi.InvoiceNo.Contains(invoiceNo));
 | 
					                //query = query.Where(ioi => ioi.InvoiceNo.Contains(invoiceNo));
 | 
				
			||||||
                //query3 = query3.Where(ioi => ioi.InvoiceNo.Contains(invoiceNo));
 | 
					                query3 = query3.Where(ioi => ioi.InvoiceNo.Contains(invoiceNo));
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            if(invoiceDate != DateTime.MinValue)
 | 
					            if(invoiceDate != DateTime.MinValue)
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                query = query.Where(ioi => Convert.ToDateTime(ioi.InvoiceDate).Date.Equals(invoiceDate.Date));
 | 
					                //query = query.Where(ioi => ioi.CreateTime.Date.Equals(invoiceDate.Date));
 | 
				
			||||||
                //query3 = query3.Where(ioi => ioi.InvoiceNo.Contains(invoiceNo));
 | 
					                query3 = query3.Where(ioi => ioi.InvoiceNo.Contains(invoiceNo));
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            if (!String.IsNullOrEmpty(_setting.inPharmacyId))
 | 
					            if(!String.IsNullOrEmpty(_setting.storage))
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                if (type == 1)
 | 
					                if (type == 1)
 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
                    query = query.Where(ioi => ioi.InPharmacyId.Equals(_setting.inPharmacyId));
 | 
					                    //query = query.Where(ioi => ioi.OutPharmacyId.Equals(_setting.storage));
 | 
				
			||||||
                    //query = query.Where(ioi => ioi.OutPharmacyId.Equals(_setting.inPharmacyId));
 | 
					                    query3 = query3.Where(ioi => ioi.OutPharmacyId.Equals(_setting.storage));
 | 
				
			||||||
                    //query3 = query3.Where(ioi => ioi.OutPharmacyId.Equals(_setting.storage));
 | 
					 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
                // 调拨出库
 | 
					                // 调拨出库
 | 
				
			||||||
                else if (type == 2)
 | 
					                else if (type == 2)
 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
                    query = query.Where(ioi => ioi.InPharmacyId.Equals(_setting.inPharmacyId));
 | 
					                    //query = query.Where(ioi => ioi.InPharmacyId.Equals(_setting.storage));
 | 
				
			||||||
                    //query3 = query3.Where(ioi => ioi.OutPharmacyId.Equals(_setting.storage));
 | 
					                    query3 = query3.Where(ioi => ioi.OutPharmacyId.Equals(_setting.storage));
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
                
 | 
					                
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            // 调拨入库
 | 
					            // 调拨入库
 | 
				
			||||||
            if (type == 1)
 | 
					            if (type == 1)
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                query = query.Where(ioi => (ioi.Type == 2 && ioi.Status == 0));
 | 
					                //query = query.Where(ioi => (ioi.Type == 0 && ioi.Status == 2) || (ioi.Type == 1 && ioi.Status == 0));
 | 
				
			||||||
                //query3 = query3.Where(ioi => (ioi.Type == 0 && ioi.Status == 2) || (ioi.Type == 1 && ioi.Status == 0));
 | 
					                query3 = query3.Where(ioi => (ioi.Type == 0 && ioi.Status == 2) || (ioi.Type == 1 && ioi.Status == 0));
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            // 调拨出库
 | 
					            // 调拨出库
 | 
				
			||||||
            else if (type == 2)
 | 
					            else if (type == 2)
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                query = query.Where(ioi => new int[] { 0, 2 }.Contains(ioi.Type) && ioi.Status == 0);
 | 
					                //query = query.Where(ioi => new int[] { 0, 2 }.Contains(ioi.Type) && ioi.Status == 0);
 | 
				
			||||||
                //query3 = query3.Where(ioi => new int[] { 0, 2 }.Contains(ioi.Type) && ioi.Status == 0);
 | 
					                query3 = query3.Where(ioi => new int[] { 0, 2 }.Contains(ioi.Type) && ioi.Status == 0);
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            query = query.Where(ioi => ioi.CancelFlag == 0);
 | 
					            //query = query.Where(ioi => ioi.CancelFlag == 0);
 | 
				
			||||||
            query = query.Select(ioi => new InOutInvoice()
 | 
					            //query = query.Select(ioi => new InOutInvoice()
 | 
				
			||||||
            {
 | 
					            //{
 | 
				
			||||||
                InPharmacyId = ioi.InPharmacyId,
 | 
					            //    InPharmacyId = ioi.InPharmacyId,
 | 
				
			||||||
                OutPharmacyId = ioi.OutPharmacyId,
 | 
					            //    OutPharmacyId = ioi.OutPharmacyId,
 | 
				
			||||||
                InvoiceDate = ioi.InvoiceDate,
 | 
					            //    InvoiceDate = ioi.InvoiceDate,
 | 
				
			||||||
                InvoiceNo = ioi.InvoiceNo,
 | 
					            //    InvoiceNo = ioi.InvoiceNo,
 | 
				
			||||||
                CreateTime = ioi.CreateTime,
 | 
					            //    CreateTime = ioi.CreateTime,
 | 
				
			||||||
                Type = ioi.Type,
 | 
					            //    Type = ioi.Type,
 | 
				
			||||||
                Status = ioi.Status,
 | 
					            //    Status = ioi.Status,
 | 
				
			||||||
                CancelFlag = ioi.CancelFlag,
 | 
					            //    CancelFlag = ioi.CancelFlag,
 | 
				
			||||||
            });
 | 
					            //});
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            //query3 = query3.Where(ioi => ioi.CancelFlag == 0);
 | 
					            query3 = query3.Where(ioi => ioi.CancelFlag == 0);
 | 
				
			||||||
            List<InOutInvoice> list = await query
 | 
					            List <InOutInvoice> list = await query3
 | 
				
			||||||
                .OrderByDescending(ioi => ioi.CreateTime)
 | 
					                .OrderByDescending(ioi => ioi.CreateTime)
 | 
				
			||||||
                .Skip((int)skip)
 | 
					                .Skip((int)skip)
 | 
				
			||||||
                .Take((int)take)
 | 
					                .Take((int)take)
 | 
				
			||||||
                .ToListAsync();
 | 
					                .ToListAsync();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            int pagedData = await query.CountAsync();
 | 
					            int pagedData = await query3.CountAsync();
 | 
				
			||||||
            return new PageData<InOutInvoice>()
 | 
					            return new PageData<InOutInvoice>()
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -145,21 +144,19 @@ namespace MasaBlazorApp3.DataAccess.Impl
 | 
				
			||||||
            if (quantity > 0)
 | 
					            if (quantity > 0)
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                query = query.Where(cs => cs.Quantity > 0);
 | 
					                query = query.Where(cs => cs.Quantity > 0);
 | 
				
			||||||
                if (!String.IsNullOrEmpty(manuNo) && manuNo != "X")
 | 
					                if (!String.IsNullOrEmpty(manuNo))
 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
                    query = query.Where(cs => cs.ManuNo.Equals(manuNo));
 | 
					                    query = query.Where(cs => cs.ManuNo.Equals(manuNo));
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
            }
 | 
					            } else
 | 
				
			||||||
            else
 | 
					 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                if (!String.IsNullOrEmpty(manuNo) && manuNo != "X")
 | 
					                if (!String.IsNullOrEmpty(manuNo))
 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
                    query = query.Where(cs => cs.ManuNo.Equals(manuNo) || String.IsNullOrEmpty(cs.ManuNo) || cs.Quantity == 0);
 | 
					                    query = query.Where(cs => cs.ManuNo.Equals(manuNo) || String.IsNullOrEmpty(cs.ManuNo) || cs.Quantity == 0);
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
                
 | 
					                
 | 
				
			||||||
            return await query.LoadWith(cl => cl.drugManuNo)
 | 
					            return await query.OrderBy((cs) => cs.EffDate)
 | 
				
			||||||
                        .OrderBy((cs) => cs.EffDate)
 | 
					 | 
				
			||||||
                        .ThenBy((cs) => cs.DrawerNo)
 | 
					                        .ThenBy((cs) => cs.DrawerNo)
 | 
				
			||||||
                        .ThenBy((cs) => cs.ColNo)
 | 
					                        .ThenBy((cs) => cs.ColNo)
 | 
				
			||||||
                        .ToListAsync();
 | 
					                        .ToListAsync();
 | 
				
			||||||
| 
						 | 
					@ -180,7 +177,7 @@ namespace MasaBlazorApp3.DataAccess.Impl
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        public async Task<DrugInfo> getDrugInfoById(string DrugId)
 | 
					        public async Task<DrugInfo> getDrugInfoById(string DrugId)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            return await _connection.DrugInfo.Where(di => di.DrugId == DrugId).LoadWith(di => di.Manus).FirstOrDefaultAsync();
 | 
					            return await _connection.DrugInfo.Where(di => di.DrugId == DrugId).FirstOrDefaultAsync();
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -254,10 +251,6 @@ namespace MasaBlazorApp3.DataAccess.Impl
 | 
				
			||||||
                List<ChannelStock> stockList = await this.GetChannelStockByDrugId(detail.DrugId, detail.DrugManuNo);
 | 
					                List<ChannelStock> stockList = await this.GetChannelStockByDrugId(detail.DrugId, detail.DrugManuNo);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                DrugInfo Drug = await this.getDrugInfoById(detail.DrugId);
 | 
					                DrugInfo Drug = await this.getDrugInfoById(detail.DrugId);
 | 
				
			||||||
                if(Drug!=null&&stockList!=null&&stockList.Count>0)
 | 
					 | 
				
			||||||
                {
 | 
					 | 
				
			||||||
                    stockList.ForEach(sl => sl.Drug = Drug);
 | 
					 | 
				
			||||||
                }    
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
                // 当前药品的库存总量
 | 
					                // 当前药品的库存总量
 | 
				
			||||||
                var total = stockList.Aggregate(0, (current, next) => current + next.Quantity);
 | 
					                var total = stockList.Aggregate(0, (current, next) => current + next.Quantity);
 | 
				
			||||||
| 
						 | 
					@ -457,15 +450,15 @@ namespace MasaBlazorApp3.DataAccess.Impl
 | 
				
			||||||
                        .Set(cs => cs.Quantity, ChannelStock.Quantity + ChannelStock.AddQuantity);
 | 
					                        .Set(cs => cs.Quantity, ChannelStock.Quantity + ChannelStock.AddQuantity);
 | 
				
			||||||
                        if (String.IsNullOrEmpty(ChannelStock.ManuNo) || (ChannelStock.Quantity == 0 && !ChannelStock.ManuNo.Equals(invoiceVo.Invoice.DrugManuNo)))
 | 
					                        if (String.IsNullOrEmpty(ChannelStock.ManuNo) || (ChannelStock.Quantity == 0 && !ChannelStock.ManuNo.Equals(invoiceVo.Invoice.DrugManuNo)))
 | 
				
			||||||
                        {
 | 
					                        {
 | 
				
			||||||
                            DrugManuNo drugManuNo = await GetDrugManuNo(ChannelStock.DrugId, ChannelStock.drugManuNo.ManuNo);
 | 
					                            DrugManuNo drugManuNo = await GetDrugManuNo(ChannelStock.DrugId, invoiceVo.Invoice.DrugManuNo);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                            ChannelStock.Dmnguid = drugManuNo.Id;
 | 
					                            ChannelStock.Dmnguid = drugManuNo.Id;
 | 
				
			||||||
                            ChannelStock.ManuNo = drugManuNo.ManuNo;
 | 
					                            ChannelStock.ManuNo = drugManuNo.ManuNo;
 | 
				
			||||||
                            ChannelStock.EffDate = drugManuNo.EffDate?.ToString("yyyy-MM-dd");
 | 
					                            ChannelStock.EffDate = drugManuNo.EffDate.ToString();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                            q = q.Set(cs => cs.Dmnguid, ChannelStock.Dmnguid)
 | 
					                            q = q.Set(cs => cs.Dmnguid, drugManuNo.Id)
 | 
				
			||||||
                                .Set(cs => cs.ManuNo, ChannelStock.ManuNo)
 | 
					                                .Set(cs => cs.ManuNo, drugManuNo.ManuNo)
 | 
				
			||||||
                                .Set(cs => cs.EffDate, ChannelStock.EffDate);
 | 
					                                .Set(cs => cs.EffDate, drugManuNo.EffDate.ToString());
 | 
				
			||||||
                        }
 | 
					                        }
 | 
				
			||||||
                        int r = q.Update();
 | 
					                        int r = q.Update();
 | 
				
			||||||
                        if (!DateTime.TryParse(ChannelStock.EffDate, out DateTime dEffDate))
 | 
					                        if (!DateTime.TryParse(ChannelStock.EffDate, out DateTime dEffDate))
 | 
				
			||||||
| 
						 | 
					@ -517,29 +510,6 @@ namespace MasaBlazorApp3.DataAccess.Impl
 | 
				
			||||||
                            InvoiceId = invoiceVo.Invoice.InvoiceNo,
 | 
					                            InvoiceId = invoiceVo.Invoice.InvoiceNo,
 | 
				
			||||||
                        });
 | 
					                        });
 | 
				
			||||||
                        
 | 
					                        
 | 
				
			||||||
                        //更新回收箱库存,入库后回收箱的空瓶库存减少
 | 
					 | 
				
			||||||
                        //List<ChannelStock> returnChannelStockList = _connection.ChannelStock.Where(cs => cs.MachineId == _setting.machineId && cs.DrawerType == 2 && cs.DrugId == ChannelStock.DrugId && cs.Quantity > 0).OrderBy(cs => cs.Quantity).ToList();
 | 
					 | 
				
			||||||
                        //if (returnChannelStockList != null && returnChannelStockList.Count > 0 && returnChannelStockList.Sum(rcs => rcs.Quantity) <= ChannelStock.AddQuantity)
 | 
					 | 
				
			||||||
                        //{
 | 
					 | 
				
			||||||
                        //    //空瓶数小于等于入库数量,直接清空所有回收箱中药品空瓶数
 | 
					 | 
				
			||||||
                        //    returnChannelStockList.ForEach(rcs => rcs.Quantity = 0);
 | 
					 | 
				
			||||||
                        //    _connection.Update(returnChannelStockList);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                        //}
 | 
					 | 
				
			||||||
                        //else if(returnChannelStockList != null && returnChannelStockList.Count > 0)
 | 
					 | 
				
			||||||
                        //{
 | 
					 | 
				
			||||||
                        //    for (int rt = 0; rt < ChannelStock.AddQuantity; rt++)
 | 
					 | 
				
			||||||
                        //    {
 | 
					 | 
				
			||||||
                        //        int AddQuan = ChannelStock.AddQuantity;
 | 
					 | 
				
			||||||
                        //        int StockQuan = returnChannelStockList[rt].Quantity;
 | 
					 | 
				
			||||||
                        //        returnChannelStockList[rt].Quantity = (StockQuan - AddQuan) <= 0 ? 0 : (StockQuan - AddQuan);
 | 
					 | 
				
			||||||
                        //        ChannelStock.AddQuantity = AddQuan - StockQuan;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                        //    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                        //    _connection.Update(returnChannelStockList);
 | 
					 | 
				
			||||||
                        //}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                        // 获取更新完库存之后的药品库存
 | 
					                        // 获取更新完库存之后的药品库存
 | 
				
			||||||
                        List<ChannelStock> list = await _connection.ChannelStock.AsQueryable()
 | 
					                        List<ChannelStock> list = await _connection.ChannelStock.AsQueryable()
 | 
				
			||||||
                             .Where(cs => cs.MachineId.Equals(_setting.machineId))
 | 
					                             .Where(cs => cs.MachineId.Equals(_setting.machineId))
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -8,7 +8,6 @@ using MasaBlazorApp3.Pojo.Vo;
 | 
				
			||||||
using MasaBlazorApp3.Port;
 | 
					using MasaBlazorApp3.Port;
 | 
				
			||||||
using Microsoft.Extensions.Options;
 | 
					using Microsoft.Extensions.Options;
 | 
				
			||||||
using Mysqlx.Crud;
 | 
					using Mysqlx.Crud;
 | 
				
			||||||
using System.Collections.Generic;
 | 
					 | 
				
			||||||
using static LinqToDB.Common.Configuration;
 | 
					using static LinqToDB.Common.Configuration;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace MasaBlazorApp3.DataAccess.Impl
 | 
					namespace MasaBlazorApp3.DataAccess.Impl
 | 
				
			||||||
| 
						 | 
					@ -21,17 +20,15 @@ namespace MasaBlazorApp3.DataAccess.Impl
 | 
				
			||||||
        private readonly ILog logger = LogManager.GetLogger(typeof(MachineRecordDao));
 | 
					        private readonly ILog logger = LogManager.GetLogger(typeof(MachineRecordDao));
 | 
				
			||||||
        private readonly PortUtil _portUtil;
 | 
					        private readonly PortUtil _portUtil;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        private GlobalStateService _globalStateService;
 | 
					 | 
				
			||||||
        //public UserDao(MyContext context)
 | 
					        //public UserDao(MyContext context)
 | 
				
			||||||
        //{
 | 
					        //{
 | 
				
			||||||
        //    Context = context;
 | 
					        //    Context = context;
 | 
				
			||||||
        //}
 | 
					        //}
 | 
				
			||||||
        public MachineRecordDao(AppDataConnection connection, IOptions<SettingConfig> setting, PortUtil portUtil, GlobalStateService globalStateService)
 | 
					        public MachineRecordDao(AppDataConnection connection, IOptions<SettingConfig> setting, PortUtil portUtil)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            _connection = connection;
 | 
					            _connection = connection;
 | 
				
			||||||
            _setting = setting.Value;
 | 
					            _setting = setting.Value;
 | 
				
			||||||
            _portUtil = portUtil;
 | 
					            _portUtil = portUtil;
 | 
				
			||||||
            _globalStateService = globalStateService;
 | 
					 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        public async Task<List<ChannelStock>> GetChannelStockByDrugId(string DrugId, String ManuNo)
 | 
					        public async Task<List<ChannelStock>> GetChannelStockByDrugId(string DrugId, String ManuNo)
 | 
				
			||||||
| 
						 | 
					@ -70,14 +67,14 @@ namespace MasaBlazorApp3.DataAccess.Impl
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        public async Task<PageData<MachineRecord>> GetCanReturnRecords(DateTime start, DateTime end, int operatorId, string drugId, int? take, int? skip)
 | 
					        public async Task<PageData<MachineRecord>> GetCanReturnRecords(DateTime start, DateTime end, int operatorId, string drugId, int? take, int? skip)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            var query = _connection.MachineRecord.AsQueryable().Where(it => it.MachineId.Equals(_setting.machineId)&&it.InvoiceId.StartsWith("DRAWER_"));
 | 
					            var query = _connection.MachineRecord.AsQueryable().Where(it => it.MachineId.Equals(_setting.machineId));
 | 
				
			||||||
            if (start != null && start != DateTime.MinValue)
 | 
					            if (start != null && start != DateTime.MinValue)
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                query = query.Where(mr => mr.OperationTime > start);
 | 
					                query = query.Where(mr => mr.OperationTime > start);
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            if (end != null && end != DateTime.MinValue)
 | 
					            if (end != null && end != DateTime.MinValue)
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                query = query.Where(mr => mr.OperationTime < end.AddDays(1));
 | 
					                query = query.Where(mr => mr.OperationTime < end);
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            if (operatorId != 0)
 | 
					            if (operatorId != 0)
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
| 
						 | 
					@ -102,15 +99,14 @@ namespace MasaBlazorApp3.DataAccess.Impl
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        public async Task<PageData<MachineRecord>> GetMachineRecordAsync(DateTime start, DateTime end, int operatorId, string drugId, int type, int? take, int? skip)
 | 
					        public async Task<PageData<MachineRecord>> GetMachineRecordAsync(DateTime start, DateTime end, int operatorId, string drugId, int type, int? take, int? skip)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            var query = from mr in _connection.MachineRecord select mr ;
 | 
					            var query = _connection.MachineRecord.AsQueryable().Where(it => it.MachineId.Equals(_setting.machineId));
 | 
				
			||||||
 | 
					 | 
				
			||||||
            if (start != null && start != DateTime.MinValue)
 | 
					            if (start != null && start != DateTime.MinValue)
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                query = query.Where(mr => mr.OperationTime > start);
 | 
					                query = query.Where(mr => mr.OperationTime > start);
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            if (end != null && end != DateTime.MinValue)
 | 
					            if (end != null && end != DateTime.MinValue)
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                query = query.Where(mr => mr.OperationTime < end.AddDays(1));
 | 
					                query = query.Where(mr => mr.OperationTime < end);
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            if (operatorId != 0)
 | 
					            if (operatorId != 0)
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
| 
						 | 
					@ -124,48 +120,14 @@ namespace MasaBlazorApp3.DataAccess.Impl
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                query = query.Where(mr => mr.DrugId == drugId);
 | 
					                query = query.Where(mr => mr.DrugId == drugId);
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            query = query.OrderByDescending(mr => mr.OperationTime);
 | 
					 | 
				
			||||||
            query =from mr in query
 | 
					 | 
				
			||||||
                   from dr in _connection.DrugInfo.Where(d => d.DrugId == mr.DrugId)
 | 
					 | 
				
			||||||
                   from us in _connection.User.Where(u => u.Id == mr.Operator)
 | 
					 | 
				
			||||||
                   select MachineRecord.Build(mr, dr, us);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            int pagedData = await query.CountAsync();
 | 
					            int pagedData = await query.CountAsync();
 | 
				
			||||||
            List<MachineRecord> MachineRecords = await query
 | 
					            List<MachineRecord> MachineRecords = await query.LoadWith(mr => mr.Drug)
 | 
				
			||||||
                //.OrderByDescending(mr => mr.OperationTime)
 | 
					                .LoadWith(mr => mr.OperatorUser)
 | 
				
			||||||
 | 
					                .OrderByDescending(mr => mr.OperationTime)
 | 
				
			||||||
                .Skip((int)skip)
 | 
					                .Skip((int)skip)
 | 
				
			||||||
                .Take((int)take)
 | 
					                .Take((int)take)
 | 
				
			||||||
                .ToListAsync();
 | 
					                .ToListAsync();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            //var query = _connection.MachineRecord.AsQueryable().Where(it => it.MachineId.Equals(_setting.machineId));
 | 
					 | 
				
			||||||
            //if (start != null && start != DateTime.MinValue)
 | 
					 | 
				
			||||||
            //{
 | 
					 | 
				
			||||||
            //    query = query.Where(mr => mr.OperationTime > start);
 | 
					 | 
				
			||||||
            //}
 | 
					 | 
				
			||||||
            //if (end != null && end != DateTime.MinValue)
 | 
					 | 
				
			||||||
            //{
 | 
					 | 
				
			||||||
            //    query = query.Where(mr => mr.OperationTime < end.AddDays(1));
 | 
					 | 
				
			||||||
            //}
 | 
					 | 
				
			||||||
            //if (operatorId != 0)
 | 
					 | 
				
			||||||
            //{
 | 
					 | 
				
			||||||
            //    query = query.Where(mr => mr.Operator == operatorId);
 | 
					 | 
				
			||||||
            //}
 | 
					 | 
				
			||||||
            //if (type != 0)
 | 
					 | 
				
			||||||
            //{
 | 
					 | 
				
			||||||
            //    query = query.Where(mr => mr.Type == type);
 | 
					 | 
				
			||||||
            //}
 | 
					 | 
				
			||||||
            //if (!String.IsNullOrEmpty(drugId))
 | 
					 | 
				
			||||||
            //{
 | 
					 | 
				
			||||||
            //    query = query.Where(mr => mr.DrugId == drugId);
 | 
					 | 
				
			||||||
            //}
 | 
					 | 
				
			||||||
            //int pagedData = await query.CountAsync();
 | 
					 | 
				
			||||||
            //List<MachineRecord> MachineRecords = await query.LoadWith(mr => mr.Drug)
 | 
					 | 
				
			||||||
            //    .LoadWith(mr => mr.OperatorUser)
 | 
					 | 
				
			||||||
            //    .OrderByDescending(mr => mr.OperationTime)
 | 
					 | 
				
			||||||
            //    .Skip((int)skip)
 | 
					 | 
				
			||||||
            //    .Take((int)take)
 | 
					 | 
				
			||||||
            //    .ToListAsync();
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            return new PageData<MachineRecord>() { Desserts = MachineRecords, TotalDesserts = pagedData };
 | 
					            return new PageData<MachineRecord>() { Desserts = MachineRecords, TotalDesserts = pagedData };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
| 
						 | 
					@ -268,31 +230,6 @@ namespace MasaBlazorApp3.DataAccess.Impl
 | 
				
			||||||
                                    _portUtil.SetNumCount(record.DrawerNo, record.ColNo, record.ReturnQuantity);
 | 
					                                    _portUtil.SetNumCount(record.DrawerNo, record.ColNo, record.ReturnQuantity);
 | 
				
			||||||
                                    Thread.Sleep(80);
 | 
					                                    Thread.Sleep(80);
 | 
				
			||||||
                                }
 | 
					                                }
 | 
				
			||||||
                                // 获取更新完库存之后的药品库存
 | 
					 | 
				
			||||||
                                List<ChannelStock> list = await _connection.ChannelStock.AsQueryable()
 | 
					 | 
				
			||||||
                                     .InnerJoin(
 | 
					 | 
				
			||||||
                                         _connection.ChannelList.Where(cl => cl.MachineId.Equals(_setting.machineId)).Where(cl => cl.DrawerType == 1),
 | 
					 | 
				
			||||||
                                         (cs, cl) => cs.ListId == cl.Id,
 | 
					 | 
				
			||||||
                                         (cs, cl) => cs
 | 
					 | 
				
			||||||
                                     )
 | 
					 | 
				
			||||||
                                     .Where(cs => cs.DrugId.Equals(record.DrugId))
 | 
					 | 
				
			||||||
                                     .ToListAsync();
 | 
					 | 
				
			||||||
                                //账册添加入库记录
 | 
					 | 
				
			||||||
                                int accountID = _connection.InsertWithInt32Identity(new AccountBook()
 | 
					 | 
				
			||||||
                                {
 | 
					 | 
				
			||||||
                                    MachineId = _setting.machineId,
 | 
					 | 
				
			||||||
                                    DrugId = record.DrugId,
 | 
					 | 
				
			||||||
                                    ManuNo = record.ManuNo,
 | 
					 | 
				
			||||||
                                    EffDate = !String.IsNullOrEmpty(record.EffDate) ? DateTime.ParseExact(record.EffDate, "yyyy-MM-dd", System.Globalization.CultureInfo.CurrentCulture) : null,
 | 
					 | 
				
			||||||
                                    OperationTime = DateTime.Now,
 | 
					 | 
				
			||||||
                                    Type = 31,
 | 
					 | 
				
			||||||
                                    AddQuantity = record.ReturnQuantity,
 | 
					 | 
				
			||||||
                                    Operator = _globalStateService.Operator.Id,
 | 
					 | 
				
			||||||
                                    Reviewer = _globalStateService.Reviewer?.Id ?? _globalStateService.Operator.Id,
 | 
					 | 
				
			||||||
                                    ManuStock = list.Where(it => it.ManuNo == record.ManuNo).Sum(it => it.Quantity),
 | 
					 | 
				
			||||||
                                    TotalStock = list.Sum(it => it.Quantity),
 | 
					 | 
				
			||||||
                                    InvoiceId = data.data.First().InvoiceId,
 | 
					 | 
				
			||||||
                                });
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
                            }
 | 
					                            }
 | 
				
			||||||
                            // 更新 取药记录 设置还药数量、状态
 | 
					                            // 更新 取药记录 设置还药数量、状态
 | 
				
			||||||
| 
						 | 
					@ -300,28 +237,8 @@ namespace MasaBlazorApp3.DataAccess.Impl
 | 
				
			||||||
                            {
 | 
					                            {
 | 
				
			||||||
                                record.ReturnQuantity1 = record.ReturnQuantity1 + record.CurrentReturnQuantity;
 | 
					                                record.ReturnQuantity1 = record.ReturnQuantity1 + record.CurrentReturnQuantity;
 | 
				
			||||||
                                record.Id = record.Id;
 | 
					                                record.Id = record.Id;
 | 
				
			||||||
                                record.Status = (record.Quantity - (record.ReturnQuantity1 + record.ReturnQuantity2 + sumQuantity)) <= 0 ? 2 : 1;
 | 
					                                record.Status = (record.Quantity - (record.ReturnQuantity1 + record.ReturnQuantity2 + sumQuantity)) == 0 ? 2 : 1;
 | 
				
			||||||
                                _connection.Update(record);
 | 
					                                _connection.Update(record);
 | 
				
			||||||
 | 
					 | 
				
			||||||
                                //更新药盒库存(原库存减已还药数)
 | 
					 | 
				
			||||||
                                if(record.BoxDrawer>0)
 | 
					 | 
				
			||||||
                                {
 | 
					 | 
				
			||||||
                                    //查询药盒库位中对应的药品信息
 | 
					 | 
				
			||||||
                                    ChannelStock csBox = _connection.ChannelStock.Where(cs => cs.MachineId.Equals(_setting.boxMachineId) && cs.DrugId == record.DrugId && cs.ManuNo == record.ManuNo && cs.DrawerNo == record.BoxDrawer && cs.ColNo == record.BoxColNo).FirstOrDefault();
 | 
					 | 
				
			||||||
                                    if(csBox!=null)
 | 
					 | 
				
			||||||
                                    {
 | 
					 | 
				
			||||||
                                        csBox.Quantity = csBox.Quantity - sumQuantity;
 | 
					 | 
				
			||||||
                                       int iUpdateBox=  _connection.Update(csBox);
 | 
					 | 
				
			||||||
                                        if(iUpdateBox<=0)
 | 
					 | 
				
			||||||
                                        {
 | 
					 | 
				
			||||||
                                            logger.Info("更新药品库存失败");
 | 
					 | 
				
			||||||
                                        }
 | 
					 | 
				
			||||||
                                    }
 | 
					 | 
				
			||||||
                                    else
 | 
					 | 
				
			||||||
                                    {
 | 
					 | 
				
			||||||
                                        logger.Info($"未查询到药品{record.DrugId}批次{record.ManuNo}在库位{record.BoxDrawer}-{record.BoxColNo}中信息");
 | 
					 | 
				
			||||||
                                    }
 | 
					 | 
				
			||||||
                                }
 | 
					 | 
				
			||||||
                            }
 | 
					                            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                        }
 | 
					                        }
 | 
				
			||||||
| 
						 | 
					@ -421,7 +338,7 @@ namespace MasaBlazorApp3.DataAccess.Impl
 | 
				
			||||||
                        Operator = _MachineRecord.Operator,
 | 
					                        Operator = _MachineRecord.Operator,
 | 
				
			||||||
                        OperationTime = DateTime.Now,
 | 
					                        OperationTime = DateTime.Now,
 | 
				
			||||||
                        Quantity = _MachineRecord.CurrentReturnQuantity,
 | 
					                        Quantity = _MachineRecord.CurrentReturnQuantity,
 | 
				
			||||||
                        Type = 32,
 | 
					                        Type = 31,
 | 
				
			||||||
                        InvoiceId = _MachineRecord.InvoiceId,
 | 
					                        InvoiceId = _MachineRecord.InvoiceId,
 | 
				
			||||||
                        GetId = _MachineRecord.GetId
 | 
					                        GetId = _MachineRecord.GetId
 | 
				
			||||||
                    });
 | 
					                    });
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							| 
						 | 
					@ -1,13 +1,10 @@
 | 
				
			||||||
using Google.Protobuf;
 | 
					using LinqToDB;
 | 
				
			||||||
using LinqToDB;
 | 
					 | 
				
			||||||
using log4net;
 | 
					using log4net;
 | 
				
			||||||
using MasaBlazorApp3.DataAccess.Dao;
 | 
					using MasaBlazorApp3.DataAccess.Dao;
 | 
				
			||||||
using MasaBlazorApp3.Pojo;
 | 
					using MasaBlazorApp3.Pojo;
 | 
				
			||||||
using MasaBlazorApp3.Pojo.Config;
 | 
					using MasaBlazorApp3.Pojo.Config;
 | 
				
			||||||
using MasaBlazorApp3.Pojo.Vo;
 | 
					 | 
				
			||||||
using Microsoft.Extensions.Options;
 | 
					using Microsoft.Extensions.Options;
 | 
				
			||||||
using Org.BouncyCastle.Crypto;
 | 
					using Org.BouncyCastle.Crypto;
 | 
				
			||||||
using Radzen;
 | 
					 | 
				
			||||||
using System;
 | 
					using System;
 | 
				
			||||||
using System.Collections.Generic;
 | 
					using System.Collections.Generic;
 | 
				
			||||||
using System.Data.Common;
 | 
					using System.Data.Common;
 | 
				
			||||||
| 
						 | 
					@ -28,13 +25,11 @@ namespace MasaBlazorApp3.DataAccess.Impl
 | 
				
			||||||
        private readonly SettingConfig _setting;
 | 
					        private readonly SettingConfig _setting;
 | 
				
			||||||
        private readonly ILog logger = LogManager.GetLogger(typeof(DrugInfoDao));
 | 
					        private readonly ILog logger = LogManager.GetLogger(typeof(DrugInfoDao));
 | 
				
			||||||
        private GlobalStateService _globalStateService;
 | 
					        private GlobalStateService _globalStateService;
 | 
				
			||||||
        private NotificationService _message;
 | 
					        public PlanDao(AppDataConnection connection, IOptions<SettingConfig> setting, GlobalStateService globalStateService)
 | 
				
			||||||
        public PlanDao(AppDataConnection connection, IOptions<SettingConfig> setting, GlobalStateService globalStateService,NotificationService message)
 | 
					 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            _connection = connection;
 | 
					            _connection = connection;
 | 
				
			||||||
            _setting = setting.Value;
 | 
					            _setting = setting.Value;
 | 
				
			||||||
            _globalStateService = globalStateService;
 | 
					            _globalStateService = globalStateService;
 | 
				
			||||||
            _message = message;
 | 
					 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        /// <summary>
 | 
					        /// <summary>
 | 
				
			||||||
        /// 获取所有套餐数据
 | 
					        /// 获取所有套餐数据
 | 
				
			||||||
| 
						 | 
					@ -44,7 +39,7 @@ namespace MasaBlazorApp3.DataAccess.Impl
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            var query = _connection.Plan.AsQueryable();
 | 
					            var query = _connection.Plan.AsQueryable();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            List<Plan> list = await query.Where(p => p.UseState == 1 && p.MachineId==_setting.boxMachineId)
 | 
					            List<Plan> list = await query.Where(p => p.UseState == 1)
 | 
				
			||||||
                .LoadWith(p => p._PlanDetails.Where(pd => pd.UseState == 1))
 | 
					                .LoadWith(p => p._PlanDetails.Where(pd => pd.UseState == 1))
 | 
				
			||||||
                //.ThenLoad(p=>p._DrugInfo)
 | 
					                //.ThenLoad(p=>p._DrugInfo)
 | 
				
			||||||
                .OrderBy(r => r.Id)
 | 
					                .OrderBy(r => r.Id)
 | 
				
			||||||
| 
						 | 
					@ -84,7 +79,7 @@ namespace MasaBlazorApp3.DataAccess.Impl
 | 
				
			||||||
        /// <returns></returns>
 | 
					        /// <returns></returns>
 | 
				
			||||||
        public async Task<Plan> GetPlanById(int Id)
 | 
					        public async Task<Plan> GetPlanById(int Id)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            var query = _connection.Plan.AsQueryable().Where(p => p.Id == Id && p.UseState == 1 && p.MachineId == _setting.boxMachineId);
 | 
					            var query = _connection.Plan.AsQueryable().Where(p => p.Id == Id && p.UseState == 1);
 | 
				
			||||||
            List<Plan> list = await query
 | 
					            List<Plan> list = await query
 | 
				
			||||||
               .LoadWith(p => p._PlanDetails)
 | 
					               .LoadWith(p => p._PlanDetails)
 | 
				
			||||||
               //.ThenLoad(p=>p._DrugInfo)
 | 
					               //.ThenLoad(p=>p._DrugInfo)
 | 
				
			||||||
| 
						 | 
					@ -119,27 +114,7 @@ namespace MasaBlazorApp3.DataAccess.Impl
 | 
				
			||||||
                plan.OperatorUser = _globalStateService.Operator.Id;
 | 
					                plan.OperatorUser = _globalStateService.Operator.Id;
 | 
				
			||||||
                plan.ReviewerUser = _globalStateService.Reviewer?.Id ?? _globalStateService.Operator.Id;
 | 
					                plan.ReviewerUser = _globalStateService.Reviewer?.Id ?? _globalStateService.Operator.Id;
 | 
				
			||||||
                plan.UseState = 1;
 | 
					                plan.UseState = 1;
 | 
				
			||||||
                plan.MachineId = _setting.boxMachineId;
 | 
					                return _connection.InsertWithInt32Identity(plan) > 0;
 | 
				
			||||||
                if(_connection.InsertWithInt32Identity(plan) > 0)
 | 
					 | 
				
			||||||
                {
 | 
					 | 
				
			||||||
                    //保存操作记录
 | 
					 | 
				
			||||||
                    int mid = _connection.InsertWithInt32Identity(new MachineRecord()
 | 
					 | 
				
			||||||
                    {
 | 
					 | 
				
			||||||
                        MachineId = _setting.boxMachineId,
 | 
					 | 
				
			||||||
                        OperationTime = DateTime.Now,
 | 
					 | 
				
			||||||
                        Type = 50,
 | 
					 | 
				
			||||||
                        Operator = _globalStateService.Operator.Id,
 | 
					 | 
				
			||||||
                        Reviewer = _globalStateService.Reviewer?.Id ?? _globalStateService.Operator.Id,
 | 
					 | 
				
			||||||
                        InvoiceId = $"新增套餐{plan.Name}",
 | 
					 | 
				
			||||||
                    });
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                    return true;
 | 
					 | 
				
			||||||
                }
 | 
					 | 
				
			||||||
                else
 | 
					 | 
				
			||||||
                {
 | 
					 | 
				
			||||||
                    return false;
 | 
					 | 
				
			||||||
                }
 | 
					 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            catch (Exception ex)
 | 
					            catch (Exception ex)
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
| 
						 | 
					@ -159,7 +134,7 @@ namespace MasaBlazorApp3.DataAccess.Impl
 | 
				
			||||||
            try
 | 
					            try
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                var iResult = _connection.Plan
 | 
					                var iResult = _connection.Plan
 | 
				
			||||||
                  .Where(p => p.Id == plan.Id && p.MachineId == _setting.boxMachineId)
 | 
					                  .Where(p => p.Id == plan.Id)
 | 
				
			||||||
                  .Set(p => p.Name, plan.Name)
 | 
					                  .Set(p => p.Name, plan.Name)
 | 
				
			||||||
                  .Set(p => p.Description, plan.Description);
 | 
					                  .Set(p => p.Description, plan.Description);
 | 
				
			||||||
                return iResult.Update() > 0;
 | 
					                return iResult.Update() > 0;
 | 
				
			||||||
| 
						 | 
					@ -212,7 +187,16 @@ namespace MasaBlazorApp3.DataAccess.Impl
 | 
				
			||||||
            try
 | 
					            try
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                _connection.BeginTransaction();
 | 
					                _connection.BeginTransaction();
 | 
				
			||||||
 | 
					                bool flag = false;
 | 
				
			||||||
 | 
					                logger.Error($"删除套餐{planId}");
 | 
				
			||||||
 | 
					                //查询该套餐下是否有药品,如果有则一并删除
 | 
				
			||||||
 | 
					                int iHasPd = _connection.PlanDetails.Where(pd => pd.PlanId == planId).Count();
 | 
				
			||||||
 | 
					                int pdResult = 1;
 | 
				
			||||||
 | 
					                if (iHasPd > 0)
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                    pdResult =await _connection.PlanDetails.Where(pd => pd.PlanId == planId).Set(pd => pd.UseState, 0).UpdateAsync();
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					                int pResult = await _connection.Plan.Where(p => p.Id == planId).Set(pd => pd.UseState, 0).UpdateAsync();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                //如果套餐下有绑药且库存为0的也将绑定药品信息一并删除
 | 
					                //如果套餐下有绑药且库存为0的也将绑定药品信息一并删除
 | 
				
			||||||
                List<string> listIds =await _connection.ChannelList.Where(cl => cl.DrugId == planId.ToString()).Select(cl => cl.Id).ToListAsync();
 | 
					                List<string> listIds =await _connection.ChannelList.Where(cl => cl.DrugId == planId.ToString()).Select(cl => cl.Id).ToListAsync();
 | 
				
			||||||
| 
						 | 
					@ -226,32 +210,9 @@ namespace MasaBlazorApp3.DataAccess.Impl
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
                bool flag = false;
 | 
					 | 
				
			||||||
                logger.Error($"删除套餐{planId}");
 | 
					 | 
				
			||||||
                //查询该套餐下是否有药品,如果有则一并删除
 | 
					 | 
				
			||||||
                int iHasPd = _connection.PlanDetails.Where(pd => pd.PlanId == planId).Count();
 | 
					 | 
				
			||||||
                int pdResult = 1;
 | 
					 | 
				
			||||||
                if (iHasPd > 0)
 | 
					 | 
				
			||||||
                {
 | 
					 | 
				
			||||||
                    pdResult = await _connection.PlanDetails.Where(pd => pd.PlanId == planId).Set(pd => pd.UseState, 0).UpdateAsync();
 | 
					 | 
				
			||||||
                }
 | 
					 | 
				
			||||||
                int pResult = await _connection.Plan.Where(p => p.Id == planId).Set(pd => pd.UseState, 0).UpdateAsync();
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
                if (pdResult > 0 && pResult > 0 && iDelResult > 0 && iDelChannelListResult > 0)
 | 
					                if (pdResult > 0 && pResult > 0 && iDelResult > 0 && iDelChannelListResult > 0)
 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
                    //保存操作记录
 | 
					 | 
				
			||||||
                    int mid = _connection.InsertWithInt32Identity(new MachineRecord()
 | 
					 | 
				
			||||||
                    {
 | 
					 | 
				
			||||||
                        MachineId = _setting.boxMachineId,
 | 
					 | 
				
			||||||
                        OperationTime = DateTime.Now,
 | 
					 | 
				
			||||||
                        Type = 51,
 | 
					 | 
				
			||||||
                        Operator = _globalStateService.Operator.Id,
 | 
					 | 
				
			||||||
                        Reviewer = _globalStateService.Reviewer?.Id ?? _globalStateService.Operator.Id,
 | 
					 | 
				
			||||||
                        InvoiceId = $"删除套餐{planId}",
 | 
					 | 
				
			||||||
                    });
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                    flag = true;
 | 
					                    flag = true;
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -287,16 +248,6 @@ namespace MasaBlazorApp3.DataAccess.Impl
 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
                    int id =await _connection.InsertWithInt32IdentityAsync(details);
 | 
					                    int id =await _connection.InsertWithInt32IdentityAsync(details);
 | 
				
			||||||
                    details.Id = id;
 | 
					                    details.Id = id;
 | 
				
			||||||
                    //保存操作记录
 | 
					 | 
				
			||||||
                    int mid = _connection.InsertWithInt32Identity(new MachineRecord()
 | 
					 | 
				
			||||||
                    {
 | 
					 | 
				
			||||||
                        MachineId = _setting.boxMachineId,
 | 
					 | 
				
			||||||
                        OperationTime = DateTime.Now,
 | 
					 | 
				
			||||||
                        Type = 52,
 | 
					 | 
				
			||||||
                        Operator = _globalStateService.Operator.Id,
 | 
					 | 
				
			||||||
                        Reviewer = _globalStateService.Reviewer?.Id ?? _globalStateService.Operator.Id,
 | 
					 | 
				
			||||||
                        InvoiceId = $"套餐{details.PlanId}添加药品{details.DrugId},基数{details.BaseQuantity}",
 | 
					 | 
				
			||||||
                    });
 | 
					 | 
				
			||||||
                    return id > 0;
 | 
					                    return id > 0;
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
                else
 | 
					                else
 | 
				
			||||||
| 
						 | 
					@ -323,17 +274,6 @@ namespace MasaBlazorApp3.DataAccess.Impl
 | 
				
			||||||
                  .Where(p => p.Id == details.Id)
 | 
					                  .Where(p => p.Id == details.Id)
 | 
				
			||||||
                  .Set(p => p.DrugId, details._DrugInfo.DrugId)
 | 
					                  .Set(p => p.DrugId, details._DrugInfo.DrugId)
 | 
				
			||||||
                  .Set(p => p.BaseQuantity, details.BaseQuantity);
 | 
					                  .Set(p => p.BaseQuantity, details.BaseQuantity);
 | 
				
			||||||
 | 
					 | 
				
			||||||
                //保存操作记录
 | 
					 | 
				
			||||||
                int mid = _connection.InsertWithInt32Identity(new MachineRecord()
 | 
					 | 
				
			||||||
                {
 | 
					 | 
				
			||||||
                    MachineId = _setting.boxMachineId,
 | 
					 | 
				
			||||||
                    OperationTime = DateTime.Now,
 | 
					 | 
				
			||||||
                    Type = 53,
 | 
					 | 
				
			||||||
                    Operator = _globalStateService.Operator.Id,
 | 
					 | 
				
			||||||
                    Reviewer = _globalStateService.Reviewer?.Id ?? _globalStateService.Operator.Id,
 | 
					 | 
				
			||||||
                    InvoiceId = $"修改套餐{details.PlanId},药品{details.DrugId}-{details._DrugInfo.DrugId},基数{details.BaseQuantity}",
 | 
					 | 
				
			||||||
                });
 | 
					 | 
				
			||||||
                return await iResult.UpdateAsync() > 0;
 | 
					                return await iResult.UpdateAsync() > 0;
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            catch (Exception ex)
 | 
					            catch (Exception ex)
 | 
				
			||||||
| 
						 | 
					@ -381,21 +321,11 @@ namespace MasaBlazorApp3.DataAccess.Impl
 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
                    iDelResult= await _connection.ChannelStock.AsQueryable().Where(cs => idList.Contains(cs.ListId) && cs.DrugId == detail.DrugId).DeleteAsync();
 | 
					                    iDelResult= await _connection.ChannelStock.AsQueryable().Where(cs => idList.Contains(cs.ListId) && cs.DrugId == detail.DrugId).DeleteAsync();
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
                //if (iDelResult > 0)
 | 
					                if (iDelResult > 0)
 | 
				
			||||||
                //{
 | 
					                {
 | 
				
			||||||
                    bool bUpdateResult= _connection.PlanDetails.Where(p => p.Id == detail.Id).Set(p => p.UseState, 0).Update() > 0;
 | 
					                    bool bUpdateResult= _connection.PlanDetails.Where(p => p.Id == detail.Id).Set(p => p.UseState, 0).Update() > 0;
 | 
				
			||||||
                    if(bUpdateResult)
 | 
					                    if(bUpdateResult)
 | 
				
			||||||
                    {
 | 
					                    {
 | 
				
			||||||
                    //保存操作记录
 | 
					 | 
				
			||||||
                    int mid = _connection.InsertWithInt32Identity(new MachineRecord()
 | 
					 | 
				
			||||||
                    {
 | 
					 | 
				
			||||||
                        MachineId = _setting.boxMachineId,
 | 
					 | 
				
			||||||
                        OperationTime = DateTime.Now,
 | 
					 | 
				
			||||||
                        Type = 54,
 | 
					 | 
				
			||||||
                        Operator = _globalStateService.Operator.Id,
 | 
					 | 
				
			||||||
                        Reviewer = _globalStateService.Reviewer?.Id ?? _globalStateService.Operator.Id,
 | 
					 | 
				
			||||||
                        InvoiceId = $"删除套餐{detail.PlanId},中的药品{detail._DrugInfo.DrugName}ID:{detail.DrugId}",
 | 
					 | 
				
			||||||
                    });
 | 
					 | 
				
			||||||
                        _connection.CommitTransaction();
 | 
					                        _connection.CommitTransaction();
 | 
				
			||||||
                        return true;
 | 
					                        return true;
 | 
				
			||||||
                    }
 | 
					                    }
 | 
				
			||||||
| 
						 | 
					@ -404,12 +334,11 @@ namespace MasaBlazorApp3.DataAccess.Impl
 | 
				
			||||||
                        _connection.RollbackTransaction();
 | 
					                        _connection.RollbackTransaction();
 | 
				
			||||||
                        return false;
 | 
					                        return false;
 | 
				
			||||||
                    }
 | 
					                    }
 | 
				
			||||||
                //}
 | 
					                }
 | 
				
			||||||
                //else
 | 
					                else
 | 
				
			||||||
                //{
 | 
					                {
 | 
				
			||||||
                //    logger.Error($"套餐中的药品{detail._DrugInfo.DrugName}无绑定");
 | 
					                    return false;
 | 
				
			||||||
                //    return false;
 | 
					                }
 | 
				
			||||||
                //}
 | 
					 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            catch (Exception ex)
 | 
					            catch (Exception ex)
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -38,7 +38,7 @@ namespace MasaBlazorApp3.DataAccess.Impl
 | 
				
			||||||
                          WHERE cl.`machine_id` =  '{_setting.machineId}' AND cl.`drawer_type` = 1 ";
 | 
					                          WHERE cl.`machine_id` =  '{_setting.machineId}' AND cl.`drawer_type` = 1 ";
 | 
				
			||||||
                if (!string.IsNullOrEmpty(drugName))
 | 
					                if (!string.IsNullOrEmpty(drugName))
 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
                    SQL += $" and (di.drug_name like '%{drugName}%'|| di.py_code like '%{drugName}%'||di.drug_id like '%{drugName}%')";
 | 
					                    SQL += " and di.drug_name = '{drugName}'";
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
                SQL += " ORDER BY cl.`drug_id`";
 | 
					                SQL += " ORDER BY cl.`drug_id`";
 | 
				
			||||||
                // 加载模板文件
 | 
					                // 加载模板文件
 | 
				
			||||||
| 
						 | 
					@ -67,25 +67,26 @@ namespace MasaBlazorApp3.DataAccess.Impl
 | 
				
			||||||
                return null;
 | 
					                return null;
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        //中部战区总医院麻醉药品、第一类精神药品进出专用账册
 | 
					
 | 
				
			||||||
        public async Task<PageData<ReportAccountDateInfo>> GetAccountExportData(DateTime? startDate, DateTime? endDate, string drugName)
 | 
					        public async Task<PageData<ReportAccountDateInfo>> GetAccountExportData(DateTime? startDate, DateTime? endDate, string drugName)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            List<ReportAccountDateInfo> accountList = new List<ReportAccountDateInfo>();
 | 
					            List<ReportAccountDateInfo> accountList = new List<ReportAccountDateInfo>();
 | 
				
			||||||
            int pagedData = 0;
 | 
					            int pagedData = 0;
 | 
				
			||||||
            DateTime? p_startDate = startDate ?? Convert.ToDateTime("2010-1-1");
 | 
					            DateTime? p_startDate = startDate ?? Convert.ToDateTime("2010-1-1");
 | 
				
			||||||
            DateTime? p_endDate = endDate ?? DateTime.Now.AddDays(1);
 | 
					            DateTime? p_endDate = endDate ?? DateTime.Now.AddDays(1);
 | 
				
			||||||
            string SQL = $@"SELECT  ab.`create_time` AS `OperationTime`,ab.manu_no AS ManuNo,ab.eff_date as EffDate, ab.add_quantity AS `inQuantity`, 
 | 
					            string SQL = $@"SELECT  mr.`stock_quantity` AS `stockQuantity`, IF(mr.`type` IN (1, 31), mr.`quantity`, IF(mr.`type` = 4 AND mr.`quantity` > 0, mr.`quantity`, 0)) 
 | 
				
			||||||
                        ab.out_quantity AS `outQuantity`,ab.manu_quantity as ManuQuantity,ab.total_quantity as StockQuantity,
 | 
					                        AS `inQuantity`, IF(mr.`type` = 2, mr.`quantity`, IF(mr.`type` = 4 AND mr.`quantity` < 0, (0 - mr.`quantity`), 0)) AS `outQuantity`,
 | 
				
			||||||
                         u1.`user_name` AS `operatorName`, u2.`user_name` AS `reviewerName`, ab.`drug_id` AS `drugId`,di.`drug_name` AS `drugName`,di.`drug_spec` AS `drugSpec`,  di.`pack_unit` AS `BigUnit`, di.`dosage` AS `dosage`,
 | 
					                         mr.`operation_time` AS `operationTime`, mr.`invoice_id` AS `invoiceId`, di.`drug_name` AS `drugName`, di.`drug_id` AS `drugId`,
 | 
				
			||||||
                        di.`manufactory` AS `manufactory`,  ab.`invoice_id` AS `invoiceId`, ab.department as department,'' as Remarks FROM 
 | 
					                         di.`drug_spec` AS `drugSpec`, di.`big_unit` AS `BigUnit`, di.`dosage` AS `dosage`, di.`manufactory` AS `manufactory`, 
 | 
				
			||||||
                        account_book ab  LEFT JOIN drug_info di ON ab.`drug_id` = di.`drug_id`  LEFT JOIN user_list u1 ON ab.`operator` = u1.`id`  
 | 
					                        mr.`manu_no` AS `manuNo`, mr.`eff_date` AS `effDate`, u1.`user_name` AS `operatorName`, u2.`user_name` AS `reviewerName` FROM 
 | 
				
			||||||
                        LEFT JOIN user_list u2 ON ab.`reviewer` = u2.`id` WHERE ab.`machine_id` = '{_setting.machineId}' AND ab.type in(1,2,31)  DATE_FORMAT(ab.`create_time`,'%Y-%m-%d') > '{p_startDate}'
 | 
					                        dm_machine_record mr  LEFT JOIN drug_info di ON mr.`drug_id` = di.`drug_id`  LEFT JOIN user_list u1 ON mr.`operator` = u1.`id`  
 | 
				
			||||||
                        AND  DATE_FORMAT(ab.`create_time`,'%Y-%m-%d') < '{p_endDate}'";
 | 
					                        LEFT JOIN user_list u2 ON mr.`reviewer` = u2.`id` WHERE mr.`machine_id` = '{_setting.machineId}' AND mr.`operation_time` > '{p_startDate}'
 | 
				
			||||||
 | 
					                        AND mr.`operation_time` < '{p_endDate}'";
 | 
				
			||||||
            if (!string.IsNullOrEmpty(drugName))
 | 
					            if (!string.IsNullOrEmpty(drugName))
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                SQL += $" AND (di.drug_name like '%{drugName}%' or di.drug_id like '%{drugName}%' or di.py_code like '%{drugName}%')";
 | 
					                SQL += " AND di.drug_name= '{drugName}'";
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            SQL += " ORDER BY ab.`create_time`, ab.`drug_id`";
 | 
					            SQL += " ORDER BY mr.`drug_id`, mr.`operation_time`, mr.`id`";
 | 
				
			||||||
            var reportList = _connection.FromSql<ReportAccountDateInfo>(SQL);
 | 
					            var reportList = _connection.FromSql<ReportAccountDateInfo>(SQL);
 | 
				
			||||||
            if (reportList != null)
 | 
					            if (reportList != null)
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
| 
						 | 
					@ -103,76 +104,5 @@ namespace MasaBlazorApp3.DataAccess.Impl
 | 
				
			||||||
                Desserts = accountList
 | 
					                Desserts = accountList
 | 
				
			||||||
            };
 | 
					            };
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        //手术室患者麻醉药品使用登记本(主表数据)
 | 
					 | 
				
			||||||
        public async Task<List<ReportUsageParentDateInfo>> GetOrderInfoParentData(DateTime? searchDate)
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
            //List<ReportUsageParentDateInfo> accountList = new List<ReportUsageParentDateInfo>();
 | 
					 | 
				
			||||||
            int pagedData = 0;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            string SQL = $@"SELECT od.drug_id drugId1, di.drug_Name drugName1,od.set_manu_No as manuNo1,sum(od.quantity) quantity1 ,oi.charge_Date as portDate
 | 
					 | 
				
			||||||
                            from order_info oi inner join order_detail od on oi.order_no=od.order_no inner join drug_info di on od.drug_id=di.drug_id
 | 
					 | 
				
			||||||
                            WHERE DATE_FORMAT(oi.charge_Date,'%Y-%m-%d')='{searchDate?.ToString("yyyy-MM-dd")}' and oi.dm_status=2 and oi.cancel_flag=0 and oi.his_disp_flag=0 and di.pack_h=1 group by od.drug_id,od.set_manu_No";
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            var reportList =await _connection.FromSql<ReportUsageParentDateInfo>(SQL).ToListAsync();
 | 
					 | 
				
			||||||
            //if (reportList != null)
 | 
					 | 
				
			||||||
            //{
 | 
					 | 
				
			||||||
            //    foreach (var report in reportList)
 | 
					 | 
				
			||||||
            //    {
 | 
					 | 
				
			||||||
            //        accountList.Add(report);
 | 
					 | 
				
			||||||
            //    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            //    pagedData = await reportList.CountAsync();
 | 
					 | 
				
			||||||
            //}
 | 
					 | 
				
			||||||
            return reportList;
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        //手术室患者麻醉药品使用登记本(子数据)
 | 
					 | 
				
			||||||
        public async Task<List<ReportUsageDateInfo>> GetOrderInfoData(DateTime? searchDate)
 | 
					 | 
				
			||||||
        { 
 | 
					 | 
				
			||||||
            string SQL = $@"SELECT oi.charge_Date as portdate, od.drug_id as DrugId,1 as ShouShuJian,oi.anaesthetist_code as doctor1,oi.anaesthetist_name as doctor2,oi.patient_id as patientId,oi.p_name as PName,oi.disease as Diagnose,
 | 
					 | 
				
			||||||
                           CONCAT(di.drug_name,' ',di.drug_spec)  as DrugName,od.set_manu_No as ManuNo,od.use_dosage as UsageDosage,'' as CanYeLiang,'' as CanYeChuZhi,'' as UseUserName,'' as CheckUserName,od.quantity as quantity
 | 
					 | 
				
			||||||
                            from order_info oi inner join order_detail od on oi.order_no=od.order_no inner join drug_info di on od.drug_id=di.drug_id
 | 
					 | 
				
			||||||
                            WHERE DATE_FORMAT(oi.charge_Date,'%Y-%m-%d')='{searchDate?.ToString("yyyy-MM-dd")}' and oi.dm_status=2 and oi.cancel_flag=0 and oi.his_disp_flag=0 and di.pack_h=1 order by oi.anaesthetist_code,oi.anaesthetist_name, od.drug_id";
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            var reportList =await _connection.FromSql<ReportUsageDateInfo>(SQL).ToListAsync();
 | 
					 | 
				
			||||||
            return reportList;
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        //麻醉科毒麻药品请领登记表
 | 
					 | 
				
			||||||
        public async Task<PageData<ReportApplyInfo>> GetApplyInfoDate(DateTime searchDate)
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
            List<ReportApplyInfo> accountList = new List<ReportApplyInfo>();
 | 
					 | 
				
			||||||
            int pagedData = 0;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            string SQL = $@"SELECT Drawerno as BoxNum,Create_date AS applyinfo,userfirst,usersecond,drugid,doctor,manager 
 | 
					 | 
				
			||||||
                            from applyinfo ap inner join drug_info di on ap.drugid=di.drug_id
 | 
					 | 
				
			||||||
                            WHERE machine_id='{_setting.boxMachineId}'  and DATE_FORMAT(ap.Create_date,'%Y-%m-%d')='{searchDate.ToString("yyyy-MM-dd")}' ";
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            var reportList = _connection.FromSql<ReportApplyInfo>(SQL);
 | 
					 | 
				
			||||||
            if (reportList != null&& reportList.Count()>0)
 | 
					 | 
				
			||||||
            {
 | 
					 | 
				
			||||||
                foreach (var report in reportList)
 | 
					 | 
				
			||||||
                {
 | 
					 | 
				
			||||||
                    accountList.Add(report);
 | 
					 | 
				
			||||||
                }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                pagedData = await reportList.CountAsync();
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
            return new PageData<ReportApplyInfo>()
 | 
					 | 
				
			||||||
            {
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                TotalDesserts = pagedData,
 | 
					 | 
				
			||||||
                Desserts = accountList
 | 
					 | 
				
			||||||
            };
 | 
					 | 
				
			||||||
        } 
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -9,6 +9,7 @@ using System.Collections.Generic;
 | 
				
			||||||
using System.Data.Common;
 | 
					using System.Data.Common;
 | 
				
			||||||
using System.Linq;
 | 
					using System.Linq;
 | 
				
			||||||
using System.Text;
 | 
					using System.Text;
 | 
				
			||||||
 | 
					using System.Text.RegularExpressions;
 | 
				
			||||||
using System.Threading.Tasks;
 | 
					using System.Threading.Tasks;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace MasaBlazorApp3.DataAccess.Impl
 | 
					namespace MasaBlazorApp3.DataAccess.Impl
 | 
				
			||||||
| 
						 | 
					@ -24,9 +25,9 @@ namespace MasaBlazorApp3.DataAccess.Impl
 | 
				
			||||||
            _connection = connection;
 | 
					            _connection = connection;
 | 
				
			||||||
            _setting = setting.Value;
 | 
					            _setting = setting.Value;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        public async Task<List<SettingManu>> GetMenuItemsAsync()
 | 
					        public async Task<List<SettingManu>> GetMenuItemsAsync(string culture)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            var query = _connection.SettingManu.Where(s=>s.UseStatus==1).AsQueryable();
 | 
					            var query = _connection.SettingManu.AsQueryable().Where(it=>it.Culture==culture);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            return await query
 | 
					            return await query
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -145,38 +145,6 @@ namespace MasaBlazorApp3.DataAccess.Impl
 | 
				
			||||||
                     .Set(cs => cs.State, "1")
 | 
					                     .Set(cs => cs.State, "1")
 | 
				
			||||||
                     .Set(cs => cs.ToDate, DateTime.Now)
 | 
					                     .Set(cs => cs.ToDate, DateTime.Now)
 | 
				
			||||||
                     .Set(cs=>cs.ToOperator,changeShift.ToOperator).Update();
 | 
					                     .Set(cs=>cs.ToOperator,changeShift.ToOperator).Update();
 | 
				
			||||||
 | 
					 | 
				
			||||||
                //插入交接班时药品数据信息
 | 
					 | 
				
			||||||
                var channelStockList = _connection.ChannelStock
 | 
					 | 
				
			||||||
                     .Where(cs => (cs.MachineId == _setting.machineId || cs.MachineId == _setting.boxMachineId) && cs.DrawerType == 1)
 | 
					 | 
				
			||||||
                     .GroupBy(cs => cs.DrugId)
 | 
					 | 
				
			||||||
                     .Select(g => new
 | 
					 | 
				
			||||||
                     {
 | 
					 | 
				
			||||||
                         drugId = g.Key,
 | 
					 | 
				
			||||||
                         sumQuantity = g.Sum(cs => cs.Quantity)
 | 
					 | 
				
			||||||
                     }).ToList();
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                if (channelStockList != null && channelStockList.Count > 0)
 | 
					 | 
				
			||||||
                {
 | 
					 | 
				
			||||||
                    //将药品库存信息写入交接明细表
 | 
					 | 
				
			||||||
                    for (int i = 0; i < channelStockList.Count; i++)
 | 
					 | 
				
			||||||
                    {
 | 
					 | 
				
			||||||
                        //查询药品上次交接的明细,用于记录处方数
 | 
					 | 
				
			||||||
                        HkcChangeShiftsDetail? historyList = _connection.HkcChangeShiftsDetail
 | 
					 | 
				
			||||||
                            .Where(d => d.DrugId == channelStockList[i].drugId && d.ChangeshiftsId == changeShift.Id).FirstOrDefault();
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                        HkcChangeShiftsDetail detail = new HkcChangeShiftsDetail()
 | 
					 | 
				
			||||||
                        {
 | 
					 | 
				
			||||||
                            ChangeshiftsId = insertResult,
 | 
					 | 
				
			||||||
                            DrugId = channelStockList[i].drugId,
 | 
					 | 
				
			||||||
                            RealNumber = channelStockList[i].sumQuantity,
 | 
					 | 
				
			||||||
                            OrderNumber = historyList != null ? historyList.OrderNumber + historyList.RealNumber - channelStockList[i].sumQuantity : 0
 | 
					 | 
				
			||||||
                        };
 | 
					 | 
				
			||||||
                        var insertDetailResult = _connection.InsertWithInt32Identity(detail);
 | 
					 | 
				
			||||||
                    }
 | 
					 | 
				
			||||||
                }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                if (insertResult <= 0 || updateResult <= 0)
 | 
					                if (insertResult <= 0 || updateResult <= 0)
 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
                    _connection.RollbackTransaction();
 | 
					                    _connection.RollbackTransaction();
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -43,6 +43,7 @@
 | 
				
			||||||
		<PackageReference Include="System.IO.Ports" Version="8.0.0" />
 | 
							<PackageReference Include="System.IO.Ports" Version="8.0.0" />
 | 
				
			||||||
		<PackageReference Include="System.Management" Version="8.0.0" />
 | 
							<PackageReference Include="System.Management" Version="8.0.0" />
 | 
				
			||||||
		<PackageReference Include="System.Speech" Version="8.0.0" />
 | 
							<PackageReference Include="System.Speech" Version="8.0.0" />
 | 
				
			||||||
 | 
							<PackageReference Include="Toolbelt.Blazor.I18nText" Version="14.0.1" />
 | 
				
			||||||
	</ItemGroup>
 | 
						</ItemGroup>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	<ItemGroup>
 | 
						<ItemGroup>
 | 
				
			||||||
| 
						 | 
					@ -52,18 +53,11 @@
 | 
				
			||||||
	</ItemGroup>
 | 
						</ItemGroup>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	<ItemGroup>
 | 
						<ItemGroup>
 | 
				
			||||||
	  <Content Update="appsettings.json">
 | 
					 | 
				
			||||||
	    <CopyToOutputDirectory>Always</CopyToOutputDirectory>
 | 
					 | 
				
			||||||
	  </Content>
 | 
					 | 
				
			||||||
	  <Content Update="log4net.config">
 | 
						  <Content Update="log4net.config">
 | 
				
			||||||
	    <CopyToOutputDirectory>Always</CopyToOutputDirectory>
 | 
						    <CopyToOutputDirectory>Always</CopyToOutputDirectory>
 | 
				
			||||||
	  </Content>
 | 
						  </Content>
 | 
				
			||||||
	</ItemGroup>
 | 
						</ItemGroup>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	<ItemGroup>
 | 
					 | 
				
			||||||
	  <None Remove="i18ntext\MyText.zh.json" />
 | 
					 | 
				
			||||||
	</ItemGroup>
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	<ItemGroup>
 | 
						<ItemGroup>
 | 
				
			||||||
	  <None Remove="i18ntext\MyText.en.json" />
 | 
						  <None Remove="i18ntext\MyText.en.json" />
 | 
				
			||||||
	</ItemGroup>
 | 
						</ItemGroup>
 | 
				
			||||||
| 
						 | 
					@ -81,9 +75,6 @@
 | 
				
			||||||
	  <None Update="ReportTemp\account_book_temp.grf">
 | 
						  <None Update="ReportTemp\account_book_temp.grf">
 | 
				
			||||||
	    <CopyToOutputDirectory>Always</CopyToOutputDirectory>
 | 
						    <CopyToOutputDirectory>Always</CopyToOutputDirectory>
 | 
				
			||||||
	  </None>
 | 
						  </None>
 | 
				
			||||||
	  <None Update="ReportTemp\use_book.grf">
 | 
					 | 
				
			||||||
	    <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
 | 
					 | 
				
			||||||
	  </None>
 | 
					 | 
				
			||||||
	  <None Update="ReportTemp\machine_log_add.grf">
 | 
						  <None Update="ReportTemp\machine_log_add.grf">
 | 
				
			||||||
	    <CopyToOutputDirectory>Always</CopyToOutputDirectory>
 | 
						    <CopyToOutputDirectory>Always</CopyToOutputDirectory>
 | 
				
			||||||
	  </None>
 | 
						  </None>
 | 
				
			||||||
| 
						 | 
					@ -99,8 +90,5 @@
 | 
				
			||||||
	  <None Update="ReportTemp\stock_template.grf">
 | 
						  <None Update="ReportTemp\stock_template.grf">
 | 
				
			||||||
	    <CopyToOutputDirectory>Always</CopyToOutputDirectory>
 | 
						    <CopyToOutputDirectory>Always</CopyToOutputDirectory>
 | 
				
			||||||
	  </None>
 | 
						  </None>
 | 
				
			||||||
	  <None Update="ReportTemp\Usage_Temp.grf">
 | 
					 | 
				
			||||||
	    <CopyToOutputDirectory>Always</CopyToOutputDirectory>
 | 
					 | 
				
			||||||
	  </None>
 | 
					 | 
				
			||||||
	</ItemGroup>
 | 
						</ItemGroup>
 | 
				
			||||||
</Project>
 | 
					</Project>
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -43,7 +43,7 @@
 | 
				
			||||||
    LoadData="@LoadData"
 | 
					    LoadData="@LoadData"
 | 
				
			||||||
    IsLoading="@isLoading"
 | 
					    IsLoading="@isLoading"
 | 
				
			||||||
    Count="@count"
 | 
					    Count="@count"
 | 
				
			||||||
    EmptyText="无数据"
 | 
					    EmptyText="@myText.NoDate"
 | 
				
			||||||
    Data="@channels"
 | 
					    Data="@channels"
 | 
				
			||||||
    AllowColumnResize="true" AllowAlternatingRows="false"
 | 
					    AllowColumnResize="true" AllowAlternatingRows="false"
 | 
				
			||||||
    CellClick="@((DataGridCellMouseEventArgs<ChannelStock> args) => OnCellClick(args))"
 | 
					    CellClick="@((DataGridCellMouseEventArgs<ChannelStock> args) => OnCellClick(args))"
 | 
				
			||||||
| 
						 | 
					@ -52,34 +52,34 @@
 | 
				
			||||||
            <RadzenRow JustifyContent="JustifyContent.End">
 | 
					            <RadzenRow JustifyContent="JustifyContent.End">
 | 
				
			||||||
                @if (status < 3)
 | 
					                @if (status < 3)
 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
                    <RadzenButton IsBusy="@(status>0)" BusyText="抽屉已打开。。。" ButtonStyle="ButtonStyle.Warning" Variant="Variant.Flat" Shade="Shade.Light" Text="开抽屉" Click="@OpenDrawer" />
 | 
					                    <RadzenButton IsBusy="@(status > 0)" BusyText="@myText.DrawOpened" ButtonStyle="ButtonStyle.Warning" Variant="Variant.Flat" Shade="Shade.Light" Text="@myText.OpenDraw" Click="@OpenDrawer" />
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
                @if (status > 0 && status <= 3)
 | 
					                @if (status > 0 && status <= 3)
 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
                    <RadzenButton Visible="@CancleIsEnable" Variant="Variant.Flat" Text="取消" Click="@Cancel" Style="width: 120px" />
 | 
					                    <RadzenButton Visible="@CancleIsEnable" Variant="Variant.Flat" Text="@myText.Cancel" Click="@Cancel" Style="width: 120px" />
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
            </RadzenRow>
 | 
					            </RadzenRow>
 | 
				
			||||||
        </HeaderTemplate>
 | 
					        </HeaderTemplate>
 | 
				
			||||||
        <Columns>
 | 
					        <Columns>
 | 
				
			||||||
            <RadzenDataGridColumn Width="70px" Title="库位" Property="ColNo"></RadzenDataGridColumn>
 | 
					            <RadzenDataGridColumn Width="70px" Title="@myText.StorageLocation" Property="ColNo"></RadzenDataGridColumn>
 | 
				
			||||||
            <RadzenDataGridColumn Title="药品名称" Property="Drug.DrugName">
 | 
					            <RadzenDataGridColumn Title="@myText.DrugName" Property="Drug.DrugName">
 | 
				
			||||||
                <Template Context="channel">
 | 
					                <Template Context="channel">
 | 
				
			||||||
                    <RadzenText TextStyle="TextStyle.Subtitle2" class="mb-0">@channel.Drug?.DrugName</RadzenText>
 | 
					                    <RadzenText TextStyle="TextStyle.Subtitle2" class="mb-0">@channel.Drug?.DrugName</RadzenText>
 | 
				
			||||||
                    <RadzenText TextStyle="TextStyle.Caption">@channel.Drug?.DrugSpec</RadzenText>
 | 
					                    <RadzenText TextStyle="TextStyle.Caption">@channel.Drug?.DrugSpec</RadzenText>
 | 
				
			||||||
                </Template>
 | 
					                </Template>
 | 
				
			||||||
            </RadzenDataGridColumn>
 | 
					            </RadzenDataGridColumn>
 | 
				
			||||||
            <RadzenDataGridColumn Title="批次" Property="ManuNo">
 | 
					            <RadzenDataGridColumn Title="@myText.Batch" Property="ManuNo">
 | 
				
			||||||
                <Template Context="channel">
 | 
					                <Template Context="channel">
 | 
				
			||||||
                    <RadzenText TextStyle="TextStyle.Subtitle2" class="mb-0">@channel.drugManuNo?.ManuNo</RadzenText>
 | 
					                    <RadzenText TextStyle="TextStyle.Subtitle2" class="mb-0">@channel.drugManuNo?.ManuNo</RadzenText>
 | 
				
			||||||
                    <RadzenText TextStyle="TextStyle.Caption">@channel.drugManuNo?.EffDate.ToString().Substring(0,10)</RadzenText>
 | 
					                    <RadzenText TextStyle="TextStyle.Caption">@channel.drugManuNo?.EffDate.ToString().Substring(0,10)</RadzenText>
 | 
				
			||||||
                </Template>
 | 
					                </Template>
 | 
				
			||||||
            </RadzenDataGridColumn>
 | 
					            </RadzenDataGridColumn>
 | 
				
			||||||
            <RadzenDataGridColumn Title="库存" Property="Quantity">
 | 
					            <RadzenDataGridColumn Title="@myText.Inventory" Property="Quantity">
 | 
				
			||||||
                <Template Context="cs">
 | 
					                <Template Context="cs">
 | 
				
			||||||
                    <RadzenButton ButtonStyle="ButtonStyle.Info" Variant="Variant.Flat" Shade="Shade.Lighter" class="m-1" Text="@cs.Quantity.ToString()" />
 | 
					                    <RadzenButton ButtonStyle="ButtonStyle.Info" Variant="Variant.Flat" Shade="Shade.Lighter" class="m-1" Text="@cs.Quantity.ToString()" />
 | 
				
			||||||
                </Template>
 | 
					                </Template>
 | 
				
			||||||
            </RadzenDataGridColumn>
 | 
					            </RadzenDataGridColumn>
 | 
				
			||||||
            <RadzenGridColumn Title="状态" Property="BiaoDingStatus">
 | 
					            <RadzenGridColumn Title="@myText.State" Property="BiaoDingStatus">
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            </RadzenGridColumn>
 | 
					            </RadzenGridColumn>
 | 
				
			||||||
        </Columns>
 | 
					        </Columns>
 | 
				
			||||||
| 
						 | 
					@ -92,6 +92,8 @@
 | 
				
			||||||
    @inject NotificationService _message
 | 
					    @inject NotificationService _message
 | 
				
			||||||
    @inject IOptions<DrawerConfig> setting;
 | 
					    @inject IOptions<DrawerConfig> setting;
 | 
				
			||||||
    @inject DialogService dialogService;
 | 
					    @inject DialogService dialogService;
 | 
				
			||||||
 | 
					    @inject Toolbelt.Blazor.I18nText.I18nText I18nText;
 | 
				
			||||||
 | 
					    private I18nText.local myText = new I18nText.local();
 | 
				
			||||||
    int status = 0;
 | 
					    int status = 0;
 | 
				
			||||||
    int drawerNo = 0;
 | 
					    int drawerNo = 0;
 | 
				
			||||||
    RadzenDataGrid<ChannelStock> grid;
 | 
					    RadzenDataGrid<ChannelStock> grid;
 | 
				
			||||||
| 
						 | 
					@ -158,7 +160,7 @@
 | 
				
			||||||
                        else
 | 
					                        else
 | 
				
			||||||
                        {
 | 
					                        {
 | 
				
			||||||
                            _message.Notify(
 | 
					                            _message.Notify(
 | 
				
			||||||
                            new NotificationMessage { Severity = NotificationSeverity.Error, Summary = "提示", Detail = $"抽屉【{drawerNo}】打开失败,请检测硬件", Duration = 4000 }
 | 
					                            new NotificationMessage { Severity = NotificationSeverity.Error, Summary =myText.Tips, Detail = $"抽屉【{drawerNo}】打开失败,请检测硬件", Duration = 4000 }
 | 
				
			||||||
                            );
 | 
					                            );
 | 
				
			||||||
                            logger.Info($"抽屉打开失败");
 | 
					                            logger.Info($"抽屉打开失败");
 | 
				
			||||||
                            RestData();
 | 
					                            RestData();
 | 
				
			||||||
| 
						 | 
					@ -211,7 +213,7 @@
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                logger.Info($"标定药品发生错误,{e.Message}");
 | 
					                logger.Info($"标定药品发生错误,{e.Message}");
 | 
				
			||||||
                _message.Notify(
 | 
					                _message.Notify(
 | 
				
			||||||
                new NotificationMessage { Severity = NotificationSeverity.Error, Summary = "提示", Detail = $"发生错误,{e.Message}", Duration = 4000 }
 | 
					                new NotificationMessage { Severity = NotificationSeverity.Error, Summary = myText.Tips, Detail = $"发生错误,{e.Message}", Duration = 4000 }
 | 
				
			||||||
            );
 | 
					            );
 | 
				
			||||||
                if (setting.Value.single != null && setting.Value.single.Contains(this.drawerNo))
 | 
					                if (setting.Value.single != null && setting.Value.single.Contains(this.drawerNo))
 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
| 
						 | 
					@ -253,4 +255,12 @@
 | 
				
			||||||
            // }
 | 
					            // }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    protected override async Task OnInitializedAsync()
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        myText = await I18nText.GetTextTableAsync<I18nText.local>(this);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        base.OnInitializedAsync();
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -34,6 +34,8 @@
 | 
				
			||||||
    @inject Radzen.DialogService dialogService;
 | 
					    @inject Radzen.DialogService dialogService;
 | 
				
			||||||
    @inject NotificationService _message
 | 
					    @inject NotificationService _message
 | 
				
			||||||
    @inject PortUtil PortUtil;
 | 
					    @inject PortUtil PortUtil;
 | 
				
			||||||
 | 
					    @inject Toolbelt.Blazor.I18nText.I18nText I18nText;
 | 
				
			||||||
 | 
					    private I18nText.local myText = new I18nText.local();
 | 
				
			||||||
    [Parameter] public ChannelStock channelStockInfo { get; set; }
 | 
					    [Parameter] public ChannelStock channelStockInfo { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    PromiseUtil<object> promiseUtil = new PromiseUtil<object>();
 | 
					    PromiseUtil<object> promiseUtil = new PromiseUtil<object>();
 | 
				
			||||||
| 
						 | 
					@ -47,6 +49,7 @@
 | 
				
			||||||
    int iClearFinish = 1;
 | 
					    int iClearFinish = 1;
 | 
				
			||||||
    protected override async Task OnInitializedAsync()
 | 
					    protected override async Task OnInitializedAsync()
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
 | 
					        myText = await I18nText.GetTextTableAsync<I18nText.local>(this);
 | 
				
			||||||
        if(channelStockInfo!=null&&channelStockInfo.Quantity<=0)
 | 
					        if(channelStockInfo!=null&&channelStockInfo.Quantity<=0)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            //库存为零,直接进行清空操作
 | 
					            //库存为零,直接进行清空操作
 | 
				
			||||||
| 
						 | 
					@ -93,7 +96,7 @@
 | 
				
			||||||
                        {
 | 
					                        {
 | 
				
			||||||
                            _message.Notify(
 | 
					                            _message.Notify(
 | 
				
			||||||
                                                new NotificationMessage
 | 
					                                                new NotificationMessage
 | 
				
			||||||
                                                    { Severity = NotificationSeverity.Success, Summary = "提示", Detail = "清空操作成功", Duration = 3000 }
 | 
					                                                { Severity = NotificationSeverity.Success, Summary = myText.Tips, Detail = "清空操作成功", Duration = 3000 }
 | 
				
			||||||
                                            );
 | 
					                                            );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                            PortUtil.speechSynthesizer.SpeakAsyncCancelAll();
 | 
					                            PortUtil.speechSynthesizer.SpeakAsyncCancelAll();
 | 
				
			||||||
| 
						 | 
					@ -147,7 +150,7 @@
 | 
				
			||||||
                            status = 0; 
 | 
					                            status = 0; 
 | 
				
			||||||
                            _message.Notify(
 | 
					                            _message.Notify(
 | 
				
			||||||
                                                new NotificationMessage
 | 
					                                                new NotificationMessage
 | 
				
			||||||
                                                    { Severity = NotificationSeverity.Success, Summary = "提示", Detail = "标定成功", Duration = 3000 }
 | 
					                                                { Severity = NotificationSeverity.Success, Summary = myText.Tips, Detail = "标定成功", Duration = 3000 }
 | 
				
			||||||
                                            );
 | 
					                                            );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                            PortUtil.speechSynthesizer.SpeakAsyncCancelAll();
 | 
					                            PortUtil.speechSynthesizer.SpeakAsyncCancelAll();
 | 
				
			||||||
| 
						 | 
					@ -173,7 +176,7 @@
 | 
				
			||||||
                logger.Error($"标定异常{ex.Message}");
 | 
					                logger.Error($"标定异常{ex.Message}");
 | 
				
			||||||
                _message.Notify(
 | 
					                _message.Notify(
 | 
				
			||||||
                                    new NotificationMessage
 | 
					                                    new NotificationMessage
 | 
				
			||||||
                                        { Severity = NotificationSeverity.Error, Summary = "提示", Detail = "标定异常", Duration = 3000 }
 | 
					                                    { Severity = NotificationSeverity.Error, Summary = myText.Tips, Detail = "标定异常", Duration = 3000 }
 | 
				
			||||||
                                );
 | 
					                                );
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
| 
						 | 
					@ -181,7 +184,7 @@
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            _message.Notify(
 | 
					            _message.Notify(
 | 
				
			||||||
                    new NotificationMessage
 | 
					                    new NotificationMessage
 | 
				
			||||||
                        { Severity = NotificationSeverity.Error, Summary = "提示", Detail = "请输入标定数量", Duration = 3000 });
 | 
					                    { Severity = NotificationSeverity.Error, Summary = myText.Tips, Detail = "请输入标定数量", Duration = 3000 });
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    // 取消
 | 
					    // 取消
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -44,38 +44,38 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    <RadzenDataGrid @ref="grid" RowSelect="@OnRowSelect" TItem="ChannelList"
 | 
					    <RadzenDataGrid @ref="grid" RowSelect="@OnRowSelect" TItem="ChannelList"
 | 
				
			||||||
                    RowRender="@RowRender"
 | 
					                    RowRender="@RowRender"
 | 
				
			||||||
                    EmptyText="无数据"
 | 
					                    EmptyText="@myText.NoDate"
 | 
				
			||||||
                    Data="@_forecasts" @bind-Value=@selectedChannelLists
 | 
					                    Data="@_forecasts" @bind-Value=@selectedChannelLists
 | 
				
			||||||
                    AllowColumnResize="true" AllowAlternatingRows="false"
 | 
					                    AllowColumnResize="true" AllowAlternatingRows="false"
 | 
				
			||||||
                    SelectionMode="DataGridSelectionMode.Single" LoadData="@LoadData" IsLoading="@isLoading" 
 | 
					                    SelectionMode="DataGridSelectionMode.Single" LoadData="@LoadData" IsLoading="@isLoading" 
 | 
				
			||||||
                    Count="@count" AllowPaging="true" PageSize="10" PagerHorizontalAlign="HorizontalAlign.Left" ShowPagingSummary="true" PagingSummaryFormat="{0}/{1} 共{2}条数据"
 | 
					                    Count="@count" AllowPaging="true" PageSize="10" PagerHorizontalAlign="HorizontalAlign.Left" ShowPagingSummary="true" PagingSummaryFormat="{0}/{1} 共{2}条数据"
 | 
				
			||||||
                    ExpandMode="DataGridExpandMode.Multiple">
 | 
					                    ExpandMode="DataGridExpandMode.Multiple">
 | 
				
			||||||
        <Template Context="cs">
 | 
					        <Template Context="cs">
 | 
				
			||||||
            <RadzenDataGrid Data="@cs.ChannelStocks" EmptyText="无数据">
 | 
					            <RadzenDataGrid Data="@cs.ChannelStocks" EmptyText="@myText.NoDate">
 | 
				
			||||||
                <Columns>
 | 
					                <Columns>
 | 
				
			||||||
                    <RadzenDataGridColumn Title="药品名称" Property="Drug.DrugName">
 | 
					                    <RadzenDataGridColumn Title="@myText.DrugName" Property="Drug.DrugName">
 | 
				
			||||||
                    </RadzenDataGridColumn>
 | 
					                    </RadzenDataGridColumn>
 | 
				
			||||||
                    <RadzenDataGridColumn Title="规格" Property="Drug.DrugSpec">
 | 
					                    <RadzenDataGridColumn Title="@myText.Spec" Property="Drug.DrugSpec">
 | 
				
			||||||
                    </RadzenDataGridColumn>
 | 
					                    </RadzenDataGridColumn>
 | 
				
			||||||
                    <RadzenDataGridColumn Title="厂家" Property="Drug.Manufactory">
 | 
					                    <RadzenDataGridColumn Title="@myText.Factory" Property="Drug.Manufactory">
 | 
				
			||||||
                    </RadzenDataGridColumn>
 | 
					                    </RadzenDataGridColumn>
 | 
				
			||||||
                    @*  <RadzenDataGridColumn Title="批次" Property="ManuNo"></RadzenDataGridColumn>
 | 
					                    @*  <RadzenDataGridColumn Title="批次" Property="ManuNo"></RadzenDataGridColumn>
 | 
				
			||||||
                    <RadzenDataGridColumn Title="效期" Property="EffDate">
 | 
					                    <RadzenDataGridColumn Title="效期" Property="EffDate">
 | 
				
			||||||
                    </RadzenDataGridColumn> *@
 | 
					                    </RadzenDataGridColumn> *@
 | 
				
			||||||
                    <RadzenDataGridColumn Title="基数" Property="BaseQuantity">
 | 
					                    <RadzenDataGridColumn Title="@myText.BaseQuantity" Property="BaseQuantity">
 | 
				
			||||||
                    </RadzenDataGridColumn>
 | 
					                    </RadzenDataGridColumn>
 | 
				
			||||||
                    <RadzenDataGridColumn Title="需补药数" Property="NeedQuantity">
 | 
					                    <RadzenDataGridColumn Title="@myText.NeedAddQuantity" Property="NeedQuantity">
 | 
				
			||||||
                    </RadzenDataGridColumn>
 | 
					                    </RadzenDataGridColumn>
 | 
				
			||||||
                </Columns>
 | 
					                </Columns>
 | 
				
			||||||
            </RadzenDataGrid>
 | 
					            </RadzenDataGrid>
 | 
				
			||||||
        </Template>
 | 
					        </Template>
 | 
				
			||||||
        <Columns>
 | 
					        <Columns>
 | 
				
			||||||
            <RadzenDataGridColumn Frozen="true" Width="200px" Title="药盒号" Property="DrawerNo">
 | 
					            <RadzenDataGridColumn Frozen="true" Width="200px" Title="@myText.BoxNum" Property="DrawerNo">
 | 
				
			||||||
                <Template Context="DrawerNo">
 | 
					                <Template Context="DrawerNo">
 | 
				
			||||||
                    @DrawerNo.DrawerNo 号药盒
 | 
					                    @DrawerNo.DrawerNo @myText.BoxNum
 | 
				
			||||||
                </Template>
 | 
					                </Template>
 | 
				
			||||||
            </RadzenDataGridColumn>
 | 
					            </RadzenDataGridColumn>
 | 
				
			||||||
            <RadzenDataGridColumn Title="总库存" Property="TotalQuantity"></RadzenDataGridColumn>
 | 
					            <RadzenDataGridColumn Title="@myText.TotalStock" Property="TotalQuantity"></RadzenDataGridColumn>
 | 
				
			||||||
        </Columns>
 | 
					        </Columns>
 | 
				
			||||||
    </RadzenDataGrid>
 | 
					    </RadzenDataGrid>
 | 
				
			||||||
</div>
 | 
					</div>
 | 
				
			||||||
| 
						 | 
					@ -83,6 +83,8 @@
 | 
				
			||||||
@code {
 | 
					@code {
 | 
				
			||||||
    @inject IChannelListDao channelStockDao;
 | 
					    @inject IChannelListDao channelStockDao;
 | 
				
			||||||
    @inject DialogService dialogService;
 | 
					    @inject DialogService dialogService;
 | 
				
			||||||
 | 
					    @inject Toolbelt.Blazor.I18nText.I18nText I18nText;
 | 
				
			||||||
 | 
					    private I18nText.local myText = new I18nText.local();
 | 
				
			||||||
    RadzenDataGrid<ChannelList> grid;
 | 
					    RadzenDataGrid<ChannelList> grid;
 | 
				
			||||||
    bool isLoading;
 | 
					    bool isLoading;
 | 
				
			||||||
    int count;
 | 
					    int count;
 | 
				
			||||||
| 
						 | 
					@ -94,6 +96,7 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    protected override async Task OnInitializedAsync()
 | 
					    protected override async Task OnInitializedAsync()
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
 | 
					        myText = await I18nText.GetTextTableAsync<I18nText.local>(this);
 | 
				
			||||||
        await base.OnInitializedAsync();
 | 
					        await base.OnInitializedAsync();
 | 
				
			||||||
       
 | 
					       
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
| 
						 | 
					@ -124,7 +127,7 @@
 | 
				
			||||||
    async void OnRowSelect(ChannelList cl)
 | 
					    async void OnRowSelect(ChannelList cl)
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        var b = await dialogService.OpenAsync<BoxAddBoxDetailDialog>(
 | 
					        var b = await dialogService.OpenAsync<BoxAddBoxDetailDialog>(
 | 
				
			||||||
               $"{cl.DrawerNo}号药盒药品入库",
 | 
					               $"{cl.DrawerNo}号药箱药品入库",
 | 
				
			||||||
             new Dictionary<string, object>() { { "boxChannelList", cl } },
 | 
					             new Dictionary<string, object>() { { "boxChannelList", cl } },
 | 
				
			||||||
             new DialogOptions() { Width = "85vw", Resizable = true, Draggable = true, ShowClose = false }
 | 
					             new DialogOptions() { Width = "85vw", Resizable = true, Draggable = true, ShowClose = false }
 | 
				
			||||||
       );
 | 
					       );
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -8,39 +8,13 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
<RadzenStack Gap="1rem" Orientation="Orientation.Vertical" Style="height: 100%;">
 | 
					<RadzenStack Gap="1rem" Orientation="Orientation.Vertical" Style="height: 100%;">
 | 
				
			||||||
    <RadzenStack>
 | 
					    <RadzenStack>
 | 
				
			||||||
        <RadzenDataGrid Data="@channelStockList" AllowAlternatingRows="true" LoadData="@LoadData"
 | 
					        <RadzenDataGrid Data="@boxChannelList.ChannelStocks" AllowAlternatingRows="true" 
 | 
				
			||||||
                      AllowPaging="true" PageSize="10" PagerHorizontalAlign="HorizontalAlign.Left" ShowPagingSummary="true" PagingSummaryFormat="{0}/{1} 共{2}条数据">
 | 
					                      AllowPaging="true" PageSize="10" PagerHorizontalAlign="HorizontalAlign.Left" ShowPagingSummary="true" PagingSummaryFormat="{0}/{1} 共{2}条数据">
 | 
				
			||||||
                <Columns>
 | 
					                <Columns>
 | 
				
			||||||
                <RadzenDataGridColumn Property="Drug.DrugName" Title="药品" />
 | 
					                <RadzenDataGridColumn Property="ChannelStocks.Drug.DrugName" Title="药品" />
 | 
				
			||||||
                <RadzenDataGridColumn Property="Drug.DrugSpec" Title="规格" />
 | 
					                <RadzenDataGridColumn Property="ChannelStocks.Drug.DrugSpec" Title="规格" />
 | 
				
			||||||
 | 
					                <RadzenDataGridColumn Property="AddToQuantity" Title="入药箱数量" />
 | 
				
			||||||
                <RadzenDataGridColumn Property="Quantity" Title="库存" />
 | 
					                <RadzenDataGridColumn Property="Quantity" Title="库存" />
 | 
				
			||||||
                <RadzenDataGridColumn  Title="药品批次">
 | 
					 | 
				
			||||||
                    <Template Context="channelStockList">
 | 
					 | 
				
			||||||
                        @for (int i = 0; i < channelStockList.drugManuNoList.Count; i++)
 | 
					 | 
				
			||||||
                        {
 | 
					 | 
				
			||||||
                            DrugManuNo manu = channelStockList.drugManuNoList[i];
 | 
					 | 
				
			||||||
                            <RadzenText TextStyle="TextStyle.Subtitle2" class="rz-mb-0">@manu.ManuNo</RadzenText>
 | 
					 | 
				
			||||||
                        }
 | 
					 | 
				
			||||||
                    </Template>
 | 
					 | 
				
			||||||
                </RadzenDataGridColumn>
 | 
					 | 
				
			||||||
                <RadzenDataGridColumn Title="效期">
 | 
					 | 
				
			||||||
                    <Template Context="channelStockList">
 | 
					 | 
				
			||||||
                        @for (int i = 0; i < channelStockList.drugManuNoList.Count; i++)
 | 
					 | 
				
			||||||
                        {
 | 
					 | 
				
			||||||
                            DrugManuNo manu = channelStockList.drugManuNoList[i];
 | 
					 | 
				
			||||||
                            <RadzenText TextStyle="TextStyle.Subtitle2" class="rz-mb-0">@manu.EffDate?.ToString("yyyy-MM-dd")</RadzenText>
 | 
					 | 
				
			||||||
                        }
 | 
					 | 
				
			||||||
                    </Template>
 | 
					 | 
				
			||||||
                </RadzenDataGridColumn>
 | 
					 | 
				
			||||||
                <RadzenDataGridColumn Title="入药盒数量">
 | 
					 | 
				
			||||||
                    <Template Context="channelStockList">
 | 
					 | 
				
			||||||
                        @for (int i = 0; i < channelStockList.drugManuNoList.Count; i++)
 | 
					 | 
				
			||||||
                        {
 | 
					 | 
				
			||||||
                            DrugManuNo manu = channelStockList.drugManuNoList[i];
 | 
					 | 
				
			||||||
                            <RadzenText TextStyle="TextStyle.Subtitle2" class="rz-mb-0">@manu.Quantity</RadzenText>
 | 
					 | 
				
			||||||
                        }
 | 
					 | 
				
			||||||
                    </Template>
 | 
					 | 
				
			||||||
                </RadzenDataGridColumn>
 | 
					 | 
				
			||||||
                </Columns>
 | 
					                </Columns>
 | 
				
			||||||
            </RadzenDataGrid>
 | 
					            </RadzenDataGrid>
 | 
				
			||||||
            </RadzenStack>
 | 
					            </RadzenStack>
 | 
				
			||||||
| 
						 | 
					@ -64,8 +38,6 @@
 | 
				
			||||||
    int count;
 | 
					    int count;
 | 
				
			||||||
    [Parameter] public ChannelList boxChannelList { get; set; }
 | 
					    [Parameter] public ChannelList boxChannelList { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    List<ChannelStock> channelStockList = new List<ChannelStock>();
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    public List<BoxTakeVo> data { get; set; }
 | 
					    public List<BoxTakeVo> data { get; set; }
 | 
				
			||||||
    //称重取药数量
 | 
					    //称重取药数量
 | 
				
			||||||
    int[] WeightFinnalQuantity { get; set; } = new int[] { 0, 0, 0, 0, 0, 0, 0, 0, 0 };
 | 
					    int[] WeightFinnalQuantity { get; set; } = new int[] { 0, 0, 0, 0, 0, 0, 0, 0, 0 };
 | 
				
			||||||
| 
						 | 
					@ -75,7 +47,6 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    protected override async Task OnInitializedAsync()
 | 
					    protected override async Task OnInitializedAsync()
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        channelStockList = await channelListDao.GetBoxAddToBox(boxChannelList);
 | 
					 | 
				
			||||||
        base.OnInitializedAsync();
 | 
					        base.OnInitializedAsync();
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    async Task LoadData(LoadDataArgs args)
 | 
					    async Task LoadData(LoadDataArgs args)
 | 
				
			||||||
| 
						 | 
					@ -285,7 +256,7 @@
 | 
				
			||||||
        if (!b)
 | 
					        if (!b)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            _message.Notify(new NotificationMessage { Severity = NotificationSeverity.Error, Summary = "提示", Detail = $"数据保存失败", Duration = 4000 });
 | 
					            _message.Notify(new NotificationMessage { Severity = NotificationSeverity.Error, Summary = "提示", Detail = $"数据保存失败", Duration = 4000 });
 | 
				
			||||||
            logger.Error($"手术室药盒取药保存数据库失败,数据{JsonConvert.SerializeObject(data)}");
 | 
					            logger.Error($"手术室药箱取药保存数据库失败,数据{JsonConvert.SerializeObject(data)}");
 | 
				
			||||||
            // 关闭弹窗
 | 
					            // 关闭弹窗
 | 
				
			||||||
            dialogService.Close(false);
 | 
					            dialogService.Close(false);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,380 +0,0 @@
 | 
				
			||||||
@page "/Box/BoxAddDetail-复制"
 | 
					 | 
				
			||||||
@using MasaBlazorApp3.Pojo.Config;
 | 
					 | 
				
			||||||
@using MasaBlazorApp3.Pojo.Vo;
 | 
					 | 
				
			||||||
@using MasaBlazorApp3.Util;
 | 
					 | 
				
			||||||
@using Microsoft.Extensions.Options;
 | 
					 | 
				
			||||||
@using Newtonsoft.Json;
 | 
					 | 
				
			||||||
@using log4net;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
<RadzenStack Gap="1rem" Orientation="Orientation.Vertical" Style="height: 100%;">
 | 
					 | 
				
			||||||
    <RadzenStack>
 | 
					 | 
				
			||||||
        @if (CanTakeDrug)
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
            <RadzenDataGrid Data="@data" AllowAlternatingRows="false" ExpandMode="DataGridExpandMode.Multiple">
 | 
					 | 
				
			||||||
                <Template Context="manu">
 | 
					 | 
				
			||||||
                    <RadzenDataGrid @ref="grid" Data="@manu.ChannelStock.DrawerChanneStockList" CellClick="@((DataGridCellMouseEventArgs<ChannelStock> args) => OnCellClick(args))" EmptyText="无数据">
 | 
					 | 
				
			||||||
                        <Columns>
 | 
					 | 
				
			||||||
                            <RadzenDataGridColumn Title="库位">
 | 
					 | 
				
			||||||
                                <Template>
 | 
					 | 
				
			||||||
                                    @context.DrawerNo - @context.ColNo
 | 
					 | 
				
			||||||
                                </Template>
 | 
					 | 
				
			||||||
                            </RadzenDataGridColumn>
 | 
					 | 
				
			||||||
                            <RadzenDataGridColumn Property="manu.ManuNo" Title="批次" />
 | 
					 | 
				
			||||||
                            <RadzenDataGridColumn Property="manu.EffDate" Title="效期" />
 | 
					 | 
				
			||||||
                            <RadzenDataGridColumn Property="manu.Quantity" Title="库存" />
 | 
					 | 
				
			||||||
                            <RadzenDataGridColumn Property="manu.TakeQuantity" Title="取药数量">
 | 
					 | 
				
			||||||
                                @*  <Template>
 | 
					 | 
				
			||||||
                                    @manu.Quantity
 | 
					 | 
				
			||||||
                                </Template> *@
 | 
					 | 
				
			||||||
                                <EditTemplate Context="cs">
 | 
					 | 
				
			||||||
                                    <RadzenNumeric Style="display: block" Name="takeQuantity" @bind-Value=@cs.TakeQuantity>
 | 
					 | 
				
			||||||
                                        <RadzenNumericRangeValidator Style="position: absolute;z-index: 9999;" Min="1" Max="100" Text="请填写正确的取出数量" Component="takeQuantity" />
 | 
					 | 
				
			||||||
                                    </RadzenNumeric>
 | 
					 | 
				
			||||||
                                </EditTemplate>
 | 
					 | 
				
			||||||
                            </RadzenDataGridColumn>
 | 
					 | 
				
			||||||
                        </Columns>
 | 
					 | 
				
			||||||
                    </RadzenDataGrid>
 | 
					 | 
				
			||||||
                </Template>
 | 
					 | 
				
			||||||
                <Columns>
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                    <RadzenDataGridColumn Property="Drug.DrugName" Title="药品" />
 | 
					 | 
				
			||||||
                    <RadzenDataGridColumn Property="Drug.DrugSpec" Title="规格" />
 | 
					 | 
				
			||||||
                </Columns>
 | 
					 | 
				
			||||||
            </RadzenDataGrid>
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
        else
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
            <RadzenDataGrid Data="@data" AllowAlternatingRows="false">
 | 
					 | 
				
			||||||
                <Columns>
 | 
					 | 
				
			||||||
                    <RadzenDataGridColumn Property="Drug.DrugName" Title="药品" />
 | 
					 | 
				
			||||||
                    <RadzenDataGridColumn Property="Drug.DrugSpec" Title="规格" />
 | 
					 | 
				
			||||||
                    <RadzenDataGridColumn Property="Quantity" Title="取药数量" />
 | 
					 | 
				
			||||||
                    <RadzenDataGridColumn Property="StockQuantity" Title="库存" />
 | 
					 | 
				
			||||||
                </Columns>
 | 
					 | 
				
			||||||
            </RadzenDataGrid>
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    </RadzenStack>
 | 
					 | 
				
			||||||
    <RadzenStack Orientation="Orientation.Horizontal" JustifyContent="JustifyContent.Center" Gap="0.5rem">
 | 
					 | 
				
			||||||
        @if (status < 2)
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
            <RadzenButton Click="@OpenDrawer" Disabled="!CanTakeDrug" IsBusy="status > 0" BusyText="取药中。。。" ButtonStyle="ButtonStyle.Warning" Variant="Variant.Flat" Text="取药" Style="width: 120px" />
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
        @if (status == 2)
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
            <RadzenButton Click="@TakeFinish" ButtonStyle="ButtonStyle.Success" Variant="Variant.Flat" Text="完成" Style="width: 120px" />
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
        @if (status <= 2)
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
            <RadzenButton Click="@Cancel" Variant="Variant.Flat" Text="取消" Style="width: 120px" />
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
    </RadzenStack>
 | 
					 | 
				
			||||||
</RadzenStack>
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
@code {
 | 
					 | 
				
			||||||
    @inject Radzen.DialogService dialogService;
 | 
					 | 
				
			||||||
    @inject IChannelListDao channelListDao;
 | 
					 | 
				
			||||||
    @inject IOptions<DrawerConfig> setting;
 | 
					 | 
				
			||||||
    @inject NotificationService _message
 | 
					 | 
				
			||||||
    @inject PortUtil PortUtil;
 | 
					 | 
				
			||||||
    private readonly ILog logger = LogManager.GetLogger(typeof(OrderDetailDialog));
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    int status;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    [Parameter] public ChannelList boxChannelList { get; set; }
 | 
					 | 
				
			||||||
    private bool CanTakeDrug = true;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    public List<BoxTakeVo> data { get; set; }
 | 
					 | 
				
			||||||
    //称重取药数量
 | 
					 | 
				
			||||||
    int[] WeightFinnalQuantity { get; set; } = new int[] { 0, 0, 0, 0, 0, 0, 0, 0, 0 };
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    //开抽屉前操作标识
 | 
					 | 
				
			||||||
    List<string> DrawerNoColNoList = new List<string>();
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    protected override async Task OnInitializedAsync()
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
        data = await channelListDao.getTakeInfoByBox(boxChannelList);
 | 
					 | 
				
			||||||
        // 如果有【stockQuantity】字段说明有药品库存不足
 | 
					 | 
				
			||||||
        if (data.Any(it => it.ChannelStock == null))
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
            CanTakeDrug = false;
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
        base.OnInitializedAsync();
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    async Task OpenDrawer()
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
        this.status = 1;
 | 
					 | 
				
			||||||
        PortUtil.PowerOn();
 | 
					 | 
				
			||||||
        await Task.Delay(200);
 | 
					 | 
				
			||||||
        // 解析需要打开的抽屉列表
 | 
					 | 
				
			||||||
        List<BoxTakeVo> drawerNos = this.data.GroupBy(it => it.ChannelStock.DrawerNo).Select(it => it.First()).ToList();
 | 
					 | 
				
			||||||
        // for (int i = 0; i < data.Count; i++)
 | 
					 | 
				
			||||||
        // {
 | 
					 | 
				
			||||||
        //     if (data[i].ChannelStock != null && data[i].ChannelStock.DrawerChanneStockList != null && data[i].ChannelStock.DrawerChanneStockList.Count > 0)
 | 
					 | 
				
			||||||
        //     {
 | 
					 | 
				
			||||||
        //         for (int j = 0; j < data[i].ChannelStock.DrawerChanneStockList.Count; j++)
 | 
					 | 
				
			||||||
        //         {
 | 
					 | 
				
			||||||
        //             if (data[i].ChannelStock.DrawerChanneStockList[j].TakeQuantity <= 0)
 | 
					 | 
				
			||||||
        //             {
 | 
					 | 
				
			||||||
        //                 continue;
 | 
					 | 
				
			||||||
        //             }
 | 
					 | 
				
			||||||
        //             BoxTakeVo boxTakeVo = new BoxTakeVo() { ChannelStock = data[i].ChannelStock.DrawerChanneStockList[j] };
 | 
					 | 
				
			||||||
        //             if (!drawerNos.Contains(boxTakeVo))
 | 
					 | 
				
			||||||
        //             {
 | 
					 | 
				
			||||||
        //                 // if (!(drawerNos.Where(dn => dn.ChannelStock.DrawerNo == boxTakeVo.ChannelStock.DrawerNo).Count() > 0))
 | 
					 | 
				
			||||||
        //                 // {
 | 
					 | 
				
			||||||
        //                     drawerNos.Add(boxTakeVo);
 | 
					 | 
				
			||||||
        //                 // }
 | 
					 | 
				
			||||||
        //             }
 | 
					 | 
				
			||||||
        //         }
 | 
					 | 
				
			||||||
        //     }
 | 
					 | 
				
			||||||
        // }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        // 根据抽屉类型来决定打开前是否需要查询数量
 | 
					 | 
				
			||||||
        var promiseUtil = new PromiseUtil<int>();
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        await promiseUtil.taskAsyncLoop(500, 0, async (options, next, stop) =>
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
            var orderTakeVo = drawerNos[options._data];
 | 
					 | 
				
			||||||
            var drawerNo = orderTakeVo.ChannelStock.DrawerNo;
 | 
					 | 
				
			||||||
            try
 | 
					 | 
				
			||||||
            {
 | 
					 | 
				
			||||||
                if (this.status == 0)
 | 
					 | 
				
			||||||
                {
 | 
					 | 
				
			||||||
                    stop();
 | 
					 | 
				
			||||||
                }
 | 
					 | 
				
			||||||
                // 开启抽屉
 | 
					 | 
				
			||||||
                else if (this.status == 1)
 | 
					 | 
				
			||||||
                {
 | 
					 | 
				
			||||||
                    if (orderTakeVo.Status == 0)
 | 
					 | 
				
			||||||
                    {
 | 
					 | 
				
			||||||
                        // 判断是否为单支抽屉
 | 
					 | 
				
			||||||
                        if (setting.Value.single.Contains(drawerNo))
 | 
					 | 
				
			||||||
                        {
 | 
					 | 
				
			||||||
                            byte[] quantity = await PortUtil.CheckQuantityByDrawer(drawerNo);
 | 
					 | 
				
			||||||
                            orderTakeVo.BeforeQuantity = quantity.Select(it => Convert.ToInt32(it)).ToArray().Skip(3).Take(9).ToArray();
 | 
					 | 
				
			||||||
                            logger.Info($"单支抽屉,开抽屉前检测数量【{string.Join(",", orderTakeVo.BeforeQuantity)}】");
 | 
					 | 
				
			||||||
                            var drawerChanneStockList = data.Where(ot => ot.ChannelStock.DrawerNo == drawerNo).Select(ot => ot.ChannelStock.DrawerChanneStockList).ToList();
 | 
					 | 
				
			||||||
                            await PortUtil.HasLightOnByCol(drawerNo, drawerChanneStockList[0].Where(i => i.TakeQuantity > 0).ToList().Select(i => i.ColNo).ToArray());
 | 
					 | 
				
			||||||
                        }
 | 
					 | 
				
			||||||
                        for (int i = 0; i < data.Count; i++)
 | 
					 | 
				
			||||||
                        {
 | 
					 | 
				
			||||||
                            if (!DrawerNoColNoList.Contains(data[i].ChannelStock.DrawerNo.ToString() + data[i].ChannelStock.ColNo))
 | 
					 | 
				
			||||||
                            {
 | 
					 | 
				
			||||||
                                if (data[i].ChannelStock.BoardType.ToString().Contains("6"))
 | 
					 | 
				
			||||||
                                {
 | 
					 | 
				
			||||||
                                    PortUtil.DrawerNo = data[i].ChannelStock.DrawerNo;
 | 
					 | 
				
			||||||
                                    PortUtil.ColNoLst.Add(data[i].ChannelStock.ColNo);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                                    data[i].BeforeQuantity[data[i].ChannelStock.ColNo - 1] = await PortUtil.CheckQuantityForSingle(data[i].ChannelStock.ColNo);
 | 
					 | 
				
			||||||
                                    logger.Info($"称重抽屉,开抽屉前检测数量【{string.Join(",", orderTakeVo.BeforeQuantity)}】");
 | 
					 | 
				
			||||||
                                    await Task.Delay(200);
 | 
					 | 
				
			||||||
                                }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                                //是药盒抽屉开药盒
 | 
					 | 
				
			||||||
                                if (data[i].ChannelStock.BoardType.ToString().Contains("3"))
 | 
					 | 
				
			||||||
                                {
 | 
					 | 
				
			||||||
                                    PortUtil.DrawerNo = data[i].ChannelStock.DrawerNo;
 | 
					 | 
				
			||||||
                                    await PortUtil.OpenBoxByColNo(data[i].ChannelStock.ColNo);
 | 
					 | 
				
			||||||
                                    await Task.Delay(200);
 | 
					 | 
				
			||||||
                                }
 | 
					 | 
				
			||||||
                                DrawerNoColNoList.Add(data[i].ChannelStock.DrawerNo.ToString() + data[i].ChannelStock.ColNo);
 | 
					 | 
				
			||||||
                            }
 | 
					 | 
				
			||||||
                        }
 | 
					 | 
				
			||||||
                        var b = await PortUtil.OpenDrawerStatus(drawerNo);
 | 
					 | 
				
			||||||
                        if (b)
 | 
					 | 
				
			||||||
                        {
 | 
					 | 
				
			||||||
                            PortUtil.speechSynthesizer.SpeakAsyncCancelAll();
 | 
					 | 
				
			||||||
                            PortUtil.SpeakAsync($"{drawerNo}号抽屉已经打开,请,取药");
 | 
					 | 
				
			||||||
                            orderTakeVo.Status = 1;
 | 
					 | 
				
			||||||
                            next();
 | 
					 | 
				
			||||||
                        }
 | 
					 | 
				
			||||||
                        else
 | 
					 | 
				
			||||||
                        {
 | 
					 | 
				
			||||||
                            _message.Notify(
 | 
					 | 
				
			||||||
                            new NotificationMessage { Severity = NotificationSeverity.Error, Summary = "提示", Detail = $"抽屉【{drawerNo}】打开失败,请检测硬件", Duration = 4000 }
 | 
					 | 
				
			||||||
                        );
 | 
					 | 
				
			||||||
                            logger.Info($"抽屉打开失败");
 | 
					 | 
				
			||||||
                            PortUtil.PowerOff();
 | 
					 | 
				
			||||||
                            RestData();
 | 
					 | 
				
			||||||
                            stop();
 | 
					 | 
				
			||||||
                        }
 | 
					 | 
				
			||||||
                    }
 | 
					 | 
				
			||||||
                    // 检测状态
 | 
					 | 
				
			||||||
                    else if (orderTakeVo.Status == 1)
 | 
					 | 
				
			||||||
                    {
 | 
					 | 
				
			||||||
                        // 查询抽屉是否为关闭状态
 | 
					 | 
				
			||||||
                        var b = await PortUtil.CheckDrawerStatus2(drawerNo);
 | 
					 | 
				
			||||||
                        // 关闭则改变状态并终止循环
 | 
					 | 
				
			||||||
                        if (b)
 | 
					 | 
				
			||||||
                        {
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                            data.ForEach(cl =>
 | 
					 | 
				
			||||||
                            {
 | 
					 | 
				
			||||||
                                if (cl.ChannelStock.DrawerNo == drawerNo)
 | 
					 | 
				
			||||||
                                {
 | 
					 | 
				
			||||||
                                    cl.GetQuantity = cl.Quantity;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                                }
 | 
					 | 
				
			||||||
                            });
 | 
					 | 
				
			||||||
                            orderTakeVo.Status = 2;
 | 
					 | 
				
			||||||
                            // if (data.Any(it => it.ChannelStock.BoardType.ToString().Contains("2")))
 | 
					 | 
				
			||||||
                            // {
 | 
					 | 
				
			||||||
                            //     //有单支抽屉则广播灭灯
 | 
					 | 
				
			||||||
                            //     PortUtil.AllLightOff();
 | 
					 | 
				
			||||||
                            // }
 | 
					 | 
				
			||||||
                            if (options._data == drawerNos.Count - 1)
 | 
					 | 
				
			||||||
                            {
 | 
					 | 
				
			||||||
                                PortUtil.speechSynthesizer.SpeakAsyncCancelAll();
 | 
					 | 
				
			||||||
                                PortUtil.speechSynthesizer.SpeakAsyncCancelAll();
 | 
					 | 
				
			||||||
                                PortUtil.SpeakAsync($"取药完成,请,点击完成按钮进行确认");
 | 
					 | 
				
			||||||
                                this.status = 2;
 | 
					 | 
				
			||||||
                                string alertMessage = string.Empty;
 | 
					 | 
				
			||||||
                                //检查是否称重抽屉,核对实际取出数量是否与应取数量一致,不一致则弹出提示
 | 
					 | 
				
			||||||
                                for (int i = 0; i < data.Count; i++)
 | 
					 | 
				
			||||||
                                {
 | 
					 | 
				
			||||||
                                    if (data[i].ChannelStock.BoardType.ToString().Contains("6"))
 | 
					 | 
				
			||||||
                                    {
 | 
					 | 
				
			||||||
                                        PortUtil.DrawerNo = data[i].ChannelStock.DrawerNo;// drawerNo;
 | 
					 | 
				
			||||||
                                        PortUtil.ColNoLst.Add(data[i].ChannelStock.ColNo);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                                        orderTakeVo.AfterQuantity[data[i].ChannelStock.ColNo - 1] = await PortUtil.CheckQuantityForSingle(data[i].ChannelStock.ColNo);
 | 
					 | 
				
			||||||
                                        logger.Info($"称重抽屉,关抽屉后检测数量【{string.Join(",", orderTakeVo.AfterQuantity)}】");
 | 
					 | 
				
			||||||
                                        WeightFinnalQuantity[data[i].ChannelStock.ColNo - 1] = data[i].BeforeQuantity[data[i].ChannelStock.ColNo - 1] - orderTakeVo.AfterQuantity[data[i].ChannelStock.ColNo - 1];
 | 
					 | 
				
			||||||
                                        if (data[i].Quantity != WeightFinnalQuantity[data[i].ChannelStock.ColNo - 1])
 | 
					 | 
				
			||||||
                                        {
 | 
					 | 
				
			||||||
                                            //称重自动计数数量与实际要取数量不一致弹出提示,确认后保存数据
 | 
					 | 
				
			||||||
                                            alertMessage += $"{data[i].Drug.DrugName}应取数量【{data[i].Quantity}】,实际取出数量【{WeightFinnalQuantity[data[i].ChannelStock.ColNo - 1]}】";
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                                        }
 | 
					 | 
				
			||||||
                                        await Task.Delay(200);
 | 
					 | 
				
			||||||
                                    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                                    if (data[i].ChannelStock.BoardType.ToString().Contains("2") && data[i].ChannelStock.DrawerNo == drawerNo)
 | 
					 | 
				
			||||||
                                    {
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                                        byte[] quantity = await PortUtil.CheckQuantityByDrawer(drawerNo);
 | 
					 | 
				
			||||||
                                        orderTakeVo.AfterQuantity = quantity.Select(it => Convert.ToInt32(it)).ToArray().Skip(3).Take(9).ToArray();
 | 
					 | 
				
			||||||
                                        logger.Info($"单支抽屉,关抽屉后检测数量【{string.Join(",", orderTakeVo.AfterQuantity)}】");
 | 
					 | 
				
			||||||
                                        // WeightFinnalQuantity[data[i].ChannelStock.ColNo - 1] = orderTakeVo.BeforeQuantity[data[i].ChannelStock.ColNo - 1] - orderTakeVo.AfterQuantity[data[i].ChannelStock.ColNo - 1];
 | 
					 | 
				
			||||||
                                        // if (data[i].Quantity != WeightFinnalQuantity[data[i].ChannelStock.ColNo - 1])
 | 
					 | 
				
			||||||
                                        // {
 | 
					 | 
				
			||||||
                                        //     alertMessage += $"{data[i].Drug.DrugName}应取数量【{data[i].Quantity}】,实际取出数量【{WeightFinnalQuantity[data[i].ChannelStock.ColNo - 1]}】";
 | 
					 | 
				
			||||||
                                        // }
 | 
					 | 
				
			||||||
                                        for (int j = 0; j < data[i].ChannelStock.DrawerChanneStockList.Count; j++)
 | 
					 | 
				
			||||||
                                        {
 | 
					 | 
				
			||||||
                                            WeightFinnalQuantity[data[i].ChannelStock.DrawerChanneStockList[j].ColNo - 1] = orderTakeVo.BeforeQuantity[data[i].ChannelStock.DrawerChanneStockList[j].ColNo - 1] - orderTakeVo.AfterQuantity[data[i].ChannelStock.DrawerChanneStockList[j].ColNo - 1];
 | 
					 | 
				
			||||||
                                            if (data[i].ChannelStock.DrawerChanneStockList[j].TakeQuantity != WeightFinnalQuantity[data[i].ChannelStock.DrawerChanneStockList[j].ColNo - 1])
 | 
					 | 
				
			||||||
                                            {
 | 
					 | 
				
			||||||
                                                alertMessage += $"{data[i].Drug.DrugName}应取数量【{data[i].ChannelStock.DrawerChanneStockList[j].TakeQuantity}】,实际取出数量【{WeightFinnalQuantity[data[i].ChannelStock.ColNo - 1]}】";
 | 
					 | 
				
			||||||
                                            }
 | 
					 | 
				
			||||||
                                        }
 | 
					 | 
				
			||||||
                                    }
 | 
					 | 
				
			||||||
                                }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                                //有单支抽屉则广播灭灯
 | 
					 | 
				
			||||||
                                PortUtil.PowerOff();
 | 
					 | 
				
			||||||
                                // if (!string.IsNullOrEmpty(alertMessage))
 | 
					 | 
				
			||||||
                                // {
 | 
					 | 
				
			||||||
                                //     //弹出确认对话框
 | 
					 | 
				
			||||||
                                alertMessage += "应取数与实际取出数不一致确认要保存吗?";
 | 
					 | 
				
			||||||
                                //     //弹出确认提示框
 | 
					 | 
				
			||||||
                                //     var confirm = await dialogService.OpenAsync<ConfirmDialog>(
 | 
					 | 
				
			||||||
                                //           $"保存确认",
 | 
					 | 
				
			||||||
                                //           new Dictionary<string, object>() { { "confirmInfo", alertMessage } },
 | 
					 | 
				
			||||||
                                //           new DialogOptions() { Width = "45vw", Resizable = true, Draggable = true, ShowClose = false });
 | 
					 | 
				
			||||||
                                logger.Info(alertMessage);
 | 
					 | 
				
			||||||
                                //     if (!confirm)
 | 
					 | 
				
			||||||
                                //     {
 | 
					 | 
				
			||||||
                                //         RestData();
 | 
					 | 
				
			||||||
                                //         logger.Info("取消保存");
 | 
					 | 
				
			||||||
                                //         // 关闭弹窗
 | 
					 | 
				
			||||||
                                //         dialogService.Close(false);
 | 
					 | 
				
			||||||
                                //     }
 | 
					 | 
				
			||||||
                                // }
 | 
					 | 
				
			||||||
                                stop();
 | 
					 | 
				
			||||||
                            }
 | 
					 | 
				
			||||||
                            else
 | 
					 | 
				
			||||||
                            {
 | 
					 | 
				
			||||||
                                options._data += 1;
 | 
					 | 
				
			||||||
                                next();
 | 
					 | 
				
			||||||
                            }
 | 
					 | 
				
			||||||
                        }
 | 
					 | 
				
			||||||
                        else
 | 
					 | 
				
			||||||
                        {
 | 
					 | 
				
			||||||
                            next(); // continue iteration
 | 
					 | 
				
			||||||
                        }
 | 
					 | 
				
			||||||
                    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
            catch (Exception e)
 | 
					 | 
				
			||||||
            {
 | 
					 | 
				
			||||||
                RestData();
 | 
					 | 
				
			||||||
                logger.Info($"{boxChannelList.DrawerNo}药盒取药发生错误,{e.Message}");
 | 
					 | 
				
			||||||
                _message.Notify(
 | 
					 | 
				
			||||||
                new NotificationMessage { Severity = NotificationSeverity.Error, Summary = "提示", Detail = $"发生错误,{e.Message}", Duration = 4000 }
 | 
					 | 
				
			||||||
            );
 | 
					 | 
				
			||||||
                if (setting.Value.single.Contains(drawerNo))
 | 
					 | 
				
			||||||
                {
 | 
					 | 
				
			||||||
                    PortUtil.PowerOff();
 | 
					 | 
				
			||||||
                }
 | 
					 | 
				
			||||||
                stop();
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
        });
 | 
					 | 
				
			||||||
        PortUtil.PowerOff();
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    void RestData()
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
        PortUtil.PowerOff();
 | 
					 | 
				
			||||||
        PortUtil.speechSynthesizer.SpeakAsyncCancelAll();
 | 
					 | 
				
			||||||
        this.status = 0;
 | 
					 | 
				
			||||||
        data.ForEach(it =>
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
            it.Status = 0;
 | 
					 | 
				
			||||||
            it.BeforeQuantity = new int[9];
 | 
					 | 
				
			||||||
            it.AfterQuantity = new int[9];
 | 
					 | 
				
			||||||
        });
 | 
					 | 
				
			||||||
        this.WeightFinnalQuantity = new int[9];
 | 
					 | 
				
			||||||
        DrawerNoColNoList.Clear();
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    void Cancel()
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
        RestData();
 | 
					 | 
				
			||||||
        // 关闭弹窗
 | 
					 | 
				
			||||||
        dialogService.Close(false);
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    async Task TakeFinish()
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        // 保存账册、操作记录
 | 
					 | 
				
			||||||
        var b = await channelListDao.BoxTakeFinish(data, boxChannelList);
 | 
					 | 
				
			||||||
        if (!b)
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
            _message.Notify(new NotificationMessage { Severity = NotificationSeverity.Error, Summary = "提示", Detail = $"数据保存失败", Duration = 4000 });
 | 
					 | 
				
			||||||
            logger.Error($"手术室药盒取药保存数据库失败,数据{JsonConvert.SerializeObject(data)}");
 | 
					 | 
				
			||||||
            // 关闭弹窗
 | 
					 | 
				
			||||||
            dialogService.Close(false);
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
        else
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
            // 关闭弹窗
 | 
					 | 
				
			||||||
            dialogService.Close(true);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
        //重置状态
 | 
					 | 
				
			||||||
        this.RestData();
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    RadzenDataGrid<ChannelStock> grid;
 | 
					 | 
				
			||||||
    void OnCellClick(DataGridCellMouseEventArgs<ChannelStock> args)
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
        this.grid.EditRow(args.Data);
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
| 
						 | 
					@ -8,6 +8,17 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
<RadzenStack Gap="1rem" Orientation="Orientation.Vertical" Style="height: 100%;">
 | 
					<RadzenStack Gap="1rem" Orientation="Orientation.Vertical" Style="height: 100%;">
 | 
				
			||||||
    <RadzenStack>
 | 
					    <RadzenStack>
 | 
				
			||||||
 | 
					      @*   <RadzenStack class="rz-p-4 rz-border-radius-1" Style="border: var(--rz-grid-cell-border)" Orientation="Orientation.Horizontal" Gap="1rem">
 | 
				
			||||||
 | 
					            <RadzenText TextStyle="TextStyle.Overline" Class="rz-mt-2 rz-my-0" Style="color: var(--rz-text-tertiary-color);">处方号:</RadzenText>
 | 
				
			||||||
 | 
					            <RadzenText TextStyle="TextStyle.Body1" Class="rz-text-truncate"><b>@(order?.OrderNo)</b></RadzenText>
 | 
				
			||||||
 | 
					            <RadzenText TextStyle="TextStyle.Overline" Class="rz-mt-2 rz-my-0" Style="color: var(--rz-text-tertiary-color);">患者姓名:</RadzenText>
 | 
				
			||||||
 | 
					            <RadzenText TextStyle="TextStyle.Body1" Class="rz-text-truncate"><b>@(order?.PatientName)</b></RadzenText>
 | 
				
			||||||
 | 
					            <RadzenText TextStyle="TextStyle.Overline" Class="rz-mt-2 rz-my-0" Style="color: var(--rz-text-tertiary-color);">性别:</RadzenText>
 | 
				
			||||||
 | 
					            <RadzenText TextStyle="TextStyle.Body1" Class="rz-text-truncate"><b>@(order?.Sex)</b></RadzenText>
 | 
				
			||||||
 | 
					            <RadzenText TextStyle="TextStyle.Overline" Class="rz-mt-2 rz-my-0" Style="color: var(--rz-text-tertiary-color);">年龄:</RadzenText>
 | 
				
			||||||
 | 
					            <RadzenText TextStyle="TextStyle.Body1" Class="rz-text-truncate"><b>@(order?.Age)</b></RadzenText>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        </RadzenStack> *@
 | 
				
			||||||
        @if (CanTakeDrug)
 | 
					        @if (CanTakeDrug)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            <RadzenDataGrid Data="@data" AllowAlternatingRows="false">
 | 
					            <RadzenDataGrid Data="@data" AllowAlternatingRows="false">
 | 
				
			||||||
| 
						 | 
					@ -90,8 +101,6 @@
 | 
				
			||||||
    async Task OpenDrawer()
 | 
					    async Task OpenDrawer()
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        this.status = 1;
 | 
					        this.status = 1;
 | 
				
			||||||
        PortUtil.PowerOn();
 | 
					 | 
				
			||||||
        await Task.Delay(200);
 | 
					 | 
				
			||||||
        // 解析需要打开的抽屉列表
 | 
					        // 解析需要打开的抽屉列表
 | 
				
			||||||
        List<BoxTakeVo> drawerNos = this.data.GroupBy(it => it.ChannelStock.DrawerNo).Select(it => it.First()).ToList();
 | 
					        List<BoxTakeVo> drawerNos = this.data.GroupBy(it => it.ChannelStock.DrawerNo).Select(it => it.First()).ToList();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -160,7 +169,7 @@
 | 
				
			||||||
                            new NotificationMessage { Severity = NotificationSeverity.Error, Summary = "提示", Detail = $"抽屉【{drawerNo}】打开失败,请检测硬件", Duration = 4000 }
 | 
					                            new NotificationMessage { Severity = NotificationSeverity.Error, Summary = "提示", Detail = $"抽屉【{drawerNo}】打开失败,请检测硬件", Duration = 4000 }
 | 
				
			||||||
                        );
 | 
					                        );
 | 
				
			||||||
                            logger.Info($"抽屉打开失败");
 | 
					                            logger.Info($"抽屉打开失败");
 | 
				
			||||||
                            PortUtil.PowerOff();
 | 
					                            PortUtil.AllLightOff();
 | 
				
			||||||
                            RestData();
 | 
					                            RestData();
 | 
				
			||||||
                            stop();
 | 
					                            stop();
 | 
				
			||||||
                        }
 | 
					                        }
 | 
				
			||||||
| 
						 | 
					@ -183,11 +192,7 @@
 | 
				
			||||||
                                }
 | 
					                                }
 | 
				
			||||||
                            });
 | 
					                            });
 | 
				
			||||||
                            orderTakeVo.Status = 2;
 | 
					                            orderTakeVo.Status = 2;
 | 
				
			||||||
                            // if (data.Any(it => it.ChannelStock.BoardType.ToString().Contains("2")))
 | 
					                            PortUtil.AllLightOff();
 | 
				
			||||||
                            // {
 | 
					 | 
				
			||||||
                            //     //有单支抽屉则广播灭灯
 | 
					 | 
				
			||||||
                            //     PortUtil.AllLightOff();
 | 
					 | 
				
			||||||
                            // }
 | 
					 | 
				
			||||||
                            if (options._data == drawerNos.Count - 1)
 | 
					                            if (options._data == drawerNos.Count - 1)
 | 
				
			||||||
                            {
 | 
					                            {
 | 
				
			||||||
                                PortUtil.speechSynthesizer.SpeakAsyncCancelAll();
 | 
					                                PortUtil.speechSynthesizer.SpeakAsyncCancelAll();
 | 
				
			||||||
| 
						 | 
					@ -215,40 +220,36 @@
 | 
				
			||||||
                                        await Task.Delay(200);
 | 
					                                        await Task.Delay(200);
 | 
				
			||||||
                                    }
 | 
					                                    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                                    if (data[i].ChannelStock.BoardType.ToString().Contains("2") && data[i].ChannelStock.DrawerNo == drawerNo)
 | 
					                                    if (data[i].ChannelStock.BoardType.ToString().Contains("2"))
 | 
				
			||||||
                                    {
 | 
					                                    {
 | 
				
			||||||
 | 
					 | 
				
			||||||
                                        byte[] quantity = await PortUtil.CheckQuantityByDrawer(drawerNo);
 | 
					                                        byte[] quantity = await PortUtil.CheckQuantityByDrawer(drawerNo);
 | 
				
			||||||
                                        orderTakeVo.AfterQuantity = quantity.Select(it => Convert.ToInt32(it)).ToArray().Skip(3).Take(9).ToArray();
 | 
					                                        orderTakeVo.AfterQuantity = quantity.Select(it => Convert.ToInt32(it)).ToArray().Skip(3).Take(9).ToArray();
 | 
				
			||||||
                                        logger.Info($"单支抽屉,关抽屉后检测数量【{string.Join(",", orderTakeVo.AfterQuantity)}】");
 | 
					                                        logger.Info($"单支抽屉,关抽屉后检测数量【{string.Join(",", orderTakeVo.AfterQuantity)}】");
 | 
				
			||||||
                                        WeightFinnalQuantity[data[i].ChannelStock.ColNo - 1] = orderTakeVo.BeforeQuantity[data[i].ChannelStock.ColNo - 1] - orderTakeVo.AfterQuantity[data[i].ChannelStock.ColNo - 1];
 | 
					                                        WeightFinnalQuantity[data[i].ChannelStock.ColNo - 1] = orderTakeVo.BeforeQuantity[data[i].ChannelStock.ColNo - 1] - orderTakeVo.AfterQuantity[data[i].ChannelStock.ColNo - 1];
 | 
				
			||||||
                                        if (data[i].Quantity != WeightFinnalQuantity[data[i].ChannelStock.ColNo - 1])
 | 
					                                        if (data[i].Quantity != WeightFinnalQuantity[data[i].ChannelStock.ColNo - 1])
 | 
				
			||||||
                                        {
 | 
					                                        {
 | 
				
			||||||
                                            alertMessage += $"{data[i].Drug.DrugName}应取数量【{data[i].Quantity}】,实际取出数量【{WeightFinnalQuantity[data[i].ChannelStock.ColNo - 1]}】";
 | 
					                                            alertMessage += $"{data[i].Drug.DrugName}应取数量【{orderTakeVo.Quantity}】,实际取出数量【{WeightFinnalQuantity[data[i].ChannelStock.ColNo - 1]}】";
 | 
				
			||||||
                                        }
 | 
					                                        }
 | 
				
			||||||
                                    }
 | 
					                                    }
 | 
				
			||||||
                                }
 | 
					                                }
 | 
				
			||||||
 | 
					                                if (!string.IsNullOrEmpty(alertMessage))
 | 
				
			||||||
                                //有单支抽屉则广播灭灯
 | 
					                                {
 | 
				
			||||||
                                PortUtil.PowerOff();
 | 
					                                    //弹出确认对话框
 | 
				
			||||||
                                // if (!string.IsNullOrEmpty(alertMessage))
 | 
					 | 
				
			||||||
                                // {
 | 
					 | 
				
			||||||
                                //     //弹出确认对话框
 | 
					 | 
				
			||||||
                                    alertMessage += "应取数与实际取出数不一致确认要保存吗?";
 | 
					                                    alertMessage += "应取数与实际取出数不一致确认要保存吗?";
 | 
				
			||||||
                                //     //弹出确认提示框
 | 
					                                    //弹出确认提示框
 | 
				
			||||||
                                //     var confirm = await dialogService.OpenAsync<ConfirmDialog>(
 | 
					                                    var confirm = await dialogService.OpenAsync<ConfirmDialog>(
 | 
				
			||||||
                                //           $"保存确认",
 | 
					                                          $"保存确认",
 | 
				
			||||||
                                //           new Dictionary<string, object>() { { "confirmInfo", alertMessage } },
 | 
					                                          new Dictionary<string, object>() { { "confirmInfo", alertMessage } },
 | 
				
			||||||
                                //           new DialogOptions() { Width = "45vw", Resizable = true, Draggable = true, ShowClose = false });
 | 
					                                          new DialogOptions() { Width = "45vw", Resizable = true, Draggable = true, ShowClose = false });
 | 
				
			||||||
                                    logger.Info(alertMessage);
 | 
					                                    logger.Info(alertMessage);
 | 
				
			||||||
                                //     if (!confirm)
 | 
					                                    if (!confirm)
 | 
				
			||||||
                                //     {
 | 
					                                    {
 | 
				
			||||||
                                //         RestData();
 | 
					                                        RestData();
 | 
				
			||||||
                                //         logger.Info("取消保存");
 | 
					                                        logger.Info("取消保存");
 | 
				
			||||||
                                //         // 关闭弹窗
 | 
					                                        // 关闭弹窗
 | 
				
			||||||
                                //         dialogService.Close(false);
 | 
					                                        dialogService.Close(false);
 | 
				
			||||||
                                //     }
 | 
					                                    }
 | 
				
			||||||
                                // }
 | 
					                                }
 | 
				
			||||||
                                stop();
 | 
					                                stop();
 | 
				
			||||||
                            }
 | 
					                            }
 | 
				
			||||||
                            else
 | 
					                            else
 | 
				
			||||||
| 
						 | 
					@ -276,17 +277,15 @@
 | 
				
			||||||
            );
 | 
					            );
 | 
				
			||||||
                if (setting.Value.single.Contains(drawerNo))
 | 
					                if (setting.Value.single.Contains(drawerNo))
 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
                    PortUtil.PowerOff();
 | 
					                    PortUtil.AllLightOff();
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
                stop();
 | 
					                stop();
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        });
 | 
					        });
 | 
				
			||||||
        PortUtil.PowerOff();
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    void RestData()
 | 
					    void RestData()
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        PortUtil.PowerOff();
 | 
					 | 
				
			||||||
        PortUtil.speechSynthesizer.SpeakAsyncCancelAll();
 | 
					        PortUtil.speechSynthesizer.SpeakAsyncCancelAll();
 | 
				
			||||||
        this.status = 0;
 | 
					        this.status = 0;
 | 
				
			||||||
        data.ForEach(it =>
 | 
					        data.ForEach(it =>
 | 
				
			||||||
| 
						 | 
					@ -312,7 +311,7 @@
 | 
				
			||||||
        if (!b)
 | 
					        if (!b)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            _message.Notify(new NotificationMessage { Severity = NotificationSeverity.Error, Summary = "提示", Detail = $"数据保存失败", Duration = 4000 });
 | 
					            _message.Notify(new NotificationMessage { Severity = NotificationSeverity.Error, Summary = "提示", Detail = $"数据保存失败", Duration = 4000 });
 | 
				
			||||||
            logger.Error($"手术室药盒取药保存数据库失败,数据{JsonConvert.SerializeObject(data)}");
 | 
					            logger.Error($"手术室药箱取药保存数据库失败,数据{JsonConvert.SerializeObject(data)}");
 | 
				
			||||||
            // 关闭弹窗
 | 
					            // 关闭弹窗
 | 
				
			||||||
            dialogService.Close(false);
 | 
					            dialogService.Close(false);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,6 +1,4 @@
 | 
				
			||||||
@page "/Box/BoxAdd"
 | 
					@page "/Box/BoxAdd"
 | 
				
			||||||
@using MasaBlazorApp3.Report
 | 
					 | 
				
			||||||
@using Radzen.Blazor.Rendering
 | 
					 | 
				
			||||||
<style>
 | 
					<style>
 | 
				
			||||||
    @@keyframes shake {
 | 
					    @@keyframes shake {
 | 
				
			||||||
    0% {
 | 
					    0% {
 | 
				
			||||||
| 
						 | 
					@ -39,88 +37,44 @@
 | 
				
			||||||
    transition: color 0.5s linear,opacity 0.5s linear;
 | 
					    transition: color 0.5s linear,opacity 0.5s linear;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    .my-popup {
 | 
					 | 
				
			||||||
        display: none;
 | 
					 | 
				
			||||||
        position:absolute;
 | 
					 | 
				
			||||||
        overflow: hidden;
 | 
					 | 
				
			||||||
        /*     height: 360px;
 | 
					 | 
				
			||||||
            width: 600px; */
 | 
					 | 
				
			||||||
        border: var(--rz-panel-border);
 | 
					 | 
				
			||||||
        background-color: var(--rz-panel-background-color);
 | 
					 | 
				
			||||||
        box-shadow: var(--rz-panel-shadow);
 | 
					 | 
				
			||||||
        border-radius: var(--rz-border-radius);
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
</style>
 | 
					</style>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
<div class="container-fluid">
 | 
					<div class="container-fluid">
 | 
				
			||||||
@*     <RadzenFieldset Text="报表导出">
 | 
					
 | 
				
			||||||
        <RadzenStack Orientation="Orientation.Horizontal" Gap="1rem">
 | 
					 | 
				
			||||||
            <RadzenRow JustifyContent="JustifyContent.End" AlignItems="AlignItems.Center">
 | 
					 | 
				
			||||||
                <RadzenButton @ref=button Icon="download" Text="请领登记表导出" Variant="Variant.Outlined" Click="@(args => popup.ToggleAsync(button.Element))" />
 | 
					 | 
				
			||||||
                <Popup @ref=popup Lazy=true class="my-popup">
 | 
					 | 
				
			||||||
                    <RadzenStack Orientation="Orientation.Vertical" Gap="1rem" class="rz-h-100 rz-p-4">
 | 
					 | 
				
			||||||
                        <RadzenFieldset Text="条件选择">
 | 
					 | 
				
			||||||
                            <RadzenStack Orientation="Orientation.Horizontal" Gap="1rem">
 | 
					 | 
				
			||||||
                                <RadzenRow AlignItems="AlignItems.Center">
 | 
					 | 
				
			||||||
                                    <RadzenColumn Size="4">
 | 
					 | 
				
			||||||
                                        <RadzenLabel Text="查询时间" Component="Start" />
 | 
					 | 
				
			||||||
                                    </RadzenColumn>
 | 
					 | 
				
			||||||
                                    <RadzenColumn Size="8">
 | 
					 | 
				
			||||||
                                        <RadzenDatePicker DateFormat="yyyy-MM-dd" @bind-Value="start" Style="width: 100%;" Name="Start" />
 | 
					 | 
				
			||||||
                                    </RadzenColumn>
 | 
					 | 
				
			||||||
                                </RadzenRow>
 | 
					 | 
				
			||||||
                                <RadzenRow JustifyContent="JustifyContent.End" AlignItems="AlignItems.Center">
 | 
					 | 
				
			||||||
                                    <RadzenButton Icon="download" Text="导出" Variant="Variant.Outlined" Click="AccountBookExport" />
 | 
					 | 
				
			||||||
                                </RadzenRow>
 | 
					 | 
				
			||||||
                            </RadzenStack>
 | 
					 | 
				
			||||||
                        </RadzenFieldset>
 | 
					 | 
				
			||||||
                    </RadzenStack>
 | 
					 | 
				
			||||||
                </Popup>
 | 
					 | 
				
			||||||
            </RadzenRow>
 | 
					 | 
				
			||||||
        </RadzenStack>
 | 
					 | 
				
			||||||
    </RadzenFieldset> *@
 | 
					 | 
				
			||||||
    <RadzenDataGrid @ref="grid" RowSelect="@OnRowSelect" TItem="ChannelList"
 | 
					    <RadzenDataGrid @ref="grid" RowSelect="@OnRowSelect" TItem="ChannelList"
 | 
				
			||||||
    RowRender="@RowRender"
 | 
					    RowRender="@RowRender"
 | 
				
			||||||
                    EmptyText="无数据"
 | 
					    EmptyText="@myText.NoDate"
 | 
				
			||||||
    Data="@_forecasts" @bind-Value=@selectedChannelLists
 | 
					    Data="@_forecasts" @bind-Value=@selectedChannelLists
 | 
				
			||||||
    AllowColumnResize="true" AllowAlternatingRows="false"
 | 
					    AllowColumnResize="true" AllowAlternatingRows="false"
 | 
				
			||||||
    SelectionMode="DataGridSelectionMode.Single"
 | 
					    SelectionMode="DataGridSelectionMode.Single"
 | 
				
			||||||
                    ExpandMode="DataGridExpandMode.Multiple" LoadData="@LoadData" IsLoading="@isLoading" Count="@count"
 | 
					                    ExpandMode="DataGridExpandMode.Multiple" LoadData="@LoadData" IsLoading="@isLoading" Count="@count"
 | 
				
			||||||
                    AllowPaging="true" PageSize="10" PagerHorizontalAlign="HorizontalAlign.Left" ShowPagingSummary="true" PagingSummaryFormat="{0}/{1} 共{2}条数据">
 | 
					                    AllowPaging="true" PageSize="10" PagerHorizontalAlign="HorizontalAlign.Left" ShowPagingSummary="true" PagingSummaryFormat="{0}/{1} 共{2}条数据">
 | 
				
			||||||
        <Template Context="cs">
 | 
					        <Template Context="cs">
 | 
				
			||||||
            <RadzenDataGrid Data="@cs.ChannelStocks" EmptyText="无数据">
 | 
					            <RadzenDataGrid Data="@cs.ChannelStocks" EmptyText="@myText.NoDate">
 | 
				
			||||||
                <Columns>
 | 
					                <Columns>
 | 
				
			||||||
                    <RadzenDataGridColumn Title="药品名称" Property="Drug.DrugName">
 | 
					                    <RadzenDataGridColumn Title="@myText.DrugName" Property="Drug.DrugName">
 | 
				
			||||||
                    </RadzenDataGridColumn>
 | 
					                    </RadzenDataGridColumn>
 | 
				
			||||||
                    <RadzenDataGridColumn Title="规格" Property="Drug.DrugSpec">
 | 
					                    <RadzenDataGridColumn Title="@myText.Spec" Property="Drug.DrugSpec">
 | 
				
			||||||
                    </RadzenDataGridColumn>
 | 
					                    </RadzenDataGridColumn>
 | 
				
			||||||
                    <RadzenDataGridColumn Title="厂家" Property="Drug.Manufactory">
 | 
					                    <RadzenDataGridColumn Title="@myText.Factory" Property="Drug.Manufactory">
 | 
				
			||||||
                    </RadzenDataGridColumn>
 | 
					                    </RadzenDataGridColumn>
 | 
				
			||||||
                   @*  <RadzenDataGridColumn Title="批次" Property="ManuNo"></RadzenDataGridColumn>
 | 
					                   @*  <RadzenDataGridColumn Title="批次" Property="ManuNo"></RadzenDataGridColumn>
 | 
				
			||||||
                    <RadzenDataGridColumn Title="效期" Property="EffDate">
 | 
					                    <RadzenDataGridColumn Title="效期" Property="EffDate">
 | 
				
			||||||
                    </RadzenDataGridColumn> *@
 | 
					                    </RadzenDataGridColumn> *@
 | 
				
			||||||
                    <RadzenDataGridColumn Title="基数" Property="BaseQuantity">
 | 
					                    <RadzenDataGridColumn Title="@myText.BaseQuantity" Property="BaseQuantity">
 | 
				
			||||||
                    </RadzenDataGridColumn>
 | 
					                    </RadzenDataGridColumn>
 | 
				
			||||||
                    <RadzenDataGridColumn Title="需补药数" Property="NeedQuantity">
 | 
					                    <RadzenDataGridColumn Title="@myText.NeedAddQuantity" Property="NeedQuantity">
 | 
				
			||||||
                    </RadzenDataGridColumn>
 | 
					                    </RadzenDataGridColumn>
 | 
				
			||||||
                </Columns>
 | 
					                </Columns>
 | 
				
			||||||
            </RadzenDataGrid>
 | 
					            </RadzenDataGrid>
 | 
				
			||||||
        </Template>
 | 
					        </Template>
 | 
				
			||||||
        <Columns>
 | 
					        <Columns>
 | 
				
			||||||
            <RadzenDataGridColumn Frozen="true" Width="200px" Title="药盒号" Property="DrawerNo">
 | 
					            <RadzenDataGridColumn Frozen="true" Width="200px" Title="@myText.BoxNum" Property="DrawerNo">
 | 
				
			||||||
                <Template Context="DrawerNo">
 | 
					                <Template Context="DrawerNo">
 | 
				
			||||||
 | 
					                    @DrawerNo.DrawerNo @myText.BoxNum
 | 
				
			||||||
                    @(DrawerNo.DrawerNo == 99 ? "急诊药盒" : DrawerNo.DrawerNo == 111 ? "恢复室药盒" :
 | 
					 | 
				
			||||||
                        DrawerNo.DrawerNo == 31 ? "胃镜药盒" :
 | 
					 | 
				
			||||||
                        DrawerNo.DrawerNo == 32 ? "导管药盒" :
 | 
					 | 
				
			||||||
                        DrawerNo.DrawerNo == 33 ? "生殖药盒" :
 | 
					 | 
				
			||||||
                        DrawerNo.DrawerNo == 34 ? "妇门药盒" : $"{DrawerNo.DrawerNo}-{(DrawerNo.ColNo == 1 ? '白' : '绿')}")
 | 
					 | 
				
			||||||
                    @* @(DrawerNo.DrawerNo == 99 ? "急诊药盒" : DrawerNo.DrawerNo == 111 ? "恢复室药盒" : $"{DrawerNo.DrawerNo}-{(DrawerNo.ColNo==1?'白':'绿')}") *@
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                    @* @($"{DrawerNo.DrawerNo}-{DrawerNo.ColNo}") *@
 | 
					 | 
				
			||||||
                </Template>
 | 
					                </Template>
 | 
				
			||||||
            </RadzenDataGridColumn>
 | 
					            </RadzenDataGridColumn>
 | 
				
			||||||
            <RadzenDataGridColumn Title="总库存" Property="TotalQuantity"></RadzenDataGridColumn>
 | 
					            <RadzenDataGridColumn Title="@myText.TotalStock" Property="TotalQuantity"></RadzenDataGridColumn>
 | 
				
			||||||
        </Columns>
 | 
					        </Columns>
 | 
				
			||||||
    </RadzenDataGrid>
 | 
					    </RadzenDataGrid>
 | 
				
			||||||
</div>
 | 
					</div>
 | 
				
			||||||
| 
						 | 
					@ -128,19 +82,20 @@
 | 
				
			||||||
@code {
 | 
					@code {
 | 
				
			||||||
    @inject IChannelListDao channelStockDao;
 | 
					    @inject IChannelListDao channelStockDao;
 | 
				
			||||||
    @inject DialogService dialogService;
 | 
					    @inject DialogService dialogService;
 | 
				
			||||||
    @inject IReportDataDao reportDataDao;
 | 
					    @inject Toolbelt.Blazor.I18nText.I18nText I18nText;
 | 
				
			||||||
 | 
					    private I18nText.local myText = new I18nText.local();
 | 
				
			||||||
    RadzenDataGrid<ChannelList> grid;
 | 
					    RadzenDataGrid<ChannelList> grid;
 | 
				
			||||||
    bool isLoading;
 | 
					    bool isLoading;
 | 
				
			||||||
    int count;
 | 
					    int count;
 | 
				
			||||||
    private IEnumerable<ChannelList>? _forecasts;
 | 
					    private IEnumerable<ChannelList>? _forecasts;
 | 
				
			||||||
    DateTime start;
 | 
					    DateTime start;
 | 
				
			||||||
    DateTime end;
 | 
					    DateTime end;
 | 
				
			||||||
    RadzenButton button;
 | 
					
 | 
				
			||||||
    Popup popup;
 | 
					 | 
				
			||||||
    IList<ChannelList> selectedChannelLists;
 | 
					    IList<ChannelList> selectedChannelLists;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    protected override async Task OnInitializedAsync()
 | 
					    protected override async Task OnInitializedAsync()
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
 | 
					        myText = await I18nText.GetTextTableAsync<I18nText.local>(this);
 | 
				
			||||||
        await base.OnInitializedAsync();
 | 
					        await base.OnInitializedAsync();
 | 
				
			||||||
       
 | 
					       
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
| 
						 | 
					@ -171,7 +126,7 @@
 | 
				
			||||||
    async void OnRowSelect(ChannelList cl)
 | 
					    async void OnRowSelect(ChannelList cl)
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        var b = await dialogService.OpenAsync<BoxAddDetailDialog>(
 | 
					        var b = await dialogService.OpenAsync<BoxAddDetailDialog>(
 | 
				
			||||||
               cl.DrawerNo==99?"急诊药盒":cl.DrawerNo==111?"恢复室药盒":$"{cl.DrawerNo}-{(cl.ColNo==1?'白':'绿')} 药盒加药",
 | 
					               $"{cl.DrawerNo}号药箱取药",
 | 
				
			||||||
             new Dictionary<string, object>() { { "boxChannelList", cl } },
 | 
					             new Dictionary<string, object>() { { "boxChannelList", cl } },
 | 
				
			||||||
             new DialogOptions() { Width = "85vw", Resizable = true, Draggable = true, ShowClose = false }
 | 
					             new DialogOptions() { Width = "85vw", Resizable = true, Draggable = true, ShowClose = false }
 | 
				
			||||||
       );
 | 
					       );
 | 
				
			||||||
| 
						 | 
					@ -182,14 +137,14 @@
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    async void StockExport()
 | 
				
			||||||
    //请领登记表导出
 | 
					 | 
				
			||||||
    async Task AccountBookExport()
 | 
					 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        // string drugId = drugName != null ? drugName.Split('/').Last().Trim():"";
 | 
					
 | 
				
			||||||
        // GridReportUtil gridReportUtil = new GridReportUtil();
 | 
					    }
 | 
				
			||||||
        PageData<ReportApplyInfo> pageData = await reportDataDao.GetApplyInfoDate(start);
 | 
					
 | 
				
			||||||
        GridReportUtil.PrintReport("account_book_temp.grf", pageData);
 | 
					    async void AccountBookExport()
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,101 +1,50 @@
 | 
				
			||||||
@page "/Box/BoxBindings"
 | 
					@page "/Box/BoxBindings"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
<style>
 | 
					
 | 
				
			||||||
    .mycol {
 | 
					 | 
				
			||||||
    width: calc(100%/8);
 | 
					 | 
				
			||||||
    margin: 4px !important;
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
</style>
 | 
					 | 
				
			||||||
<div class="container-fluid">
 | 
					<div class="container-fluid">
 | 
				
			||||||
 | 
					 | 
				
			||||||
    <div class="row">
 | 
					 | 
				
			||||||
        <div class="col-12 mb-4">
 | 
					 | 
				
			||||||
            @*  <RadzenFieldset Text="查询">
 | 
					 | 
				
			||||||
                <RadzenStack Orientation="Orientation.Horizontal" AlignItems="AlignItems.Center">
 | 
					 | 
				
			||||||
                    <RadzenText TextStyle="TextStyle.Overline" class="rz-display-flex rz-mt-2 rz-my-0">选择套餐</RadzenText>
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                    <RadzenDropDownDataGrid AllowVirtualization="true" Name="planName" TValue="Plan" Data="@plans" Value="@selectedPlan" ValueChanged="@OnPlanSelected"
 | 
					 | 
				
			||||||
                                            Style="width:100%; display: block;" AllowFilteringByAllStringColumns="true" TextProperty="Name">
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                        <Columns>
 | 
					 | 
				
			||||||
                            <RadzenDropDownDataGridColumn Property="Name" Title="套餐名称" Sortable="false" />
 | 
					 | 
				
			||||||
                        </Columns>
 | 
					 | 
				
			||||||
                    </RadzenDropDownDataGrid>
 | 
					 | 
				
			||||||
                    <RadzenButton ButtonStyle="ButtonStyle.Secondary" Variant="Variant.Outlined" Size="ButtonSize.Small" Click="@EditChannel" Text="绑定/解绑" />
 | 
					 | 
				
			||||||
                </RadzenStack>
 | 
					 | 
				
			||||||
            </RadzenFieldset> *@
 | 
					 | 
				
			||||||
            <form onsubmit="@(() => EditChannel())">
 | 
					 | 
				
			||||||
                <RadzenFieldset Text="选择套餐">
 | 
					 | 
				
			||||||
                    <RadzenStack Orientation="Orientation.Horizontal" Gap="1rem">
 | 
					 | 
				
			||||||
                        <RadzenRow AlignItems="AlignItems.Center">
 | 
					 | 
				
			||||||
                            <RadzenDropDownDataGrid AllowVirtualization="true" Name="planName" TValue="Plan" Data="@plans" Value="@selectedPlan" ValueChanged="@OnPlanSelected"
 | 
					 | 
				
			||||||
                            Style="width:100%; display: block;" AllowFilteringByAllStringColumns="true" TextProperty="Name">
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                                <Columns>
 | 
					 | 
				
			||||||
                                    <RadzenDropDownDataGridColumn Property="Name" Title="套餐名称" Sortable="false" />
 | 
					 | 
				
			||||||
                                </Columns>
 | 
					 | 
				
			||||||
                            </RadzenDropDownDataGrid>
 | 
					 | 
				
			||||||
                        </RadzenRow>
 | 
					 | 
				
			||||||
                        <RadzenRow AlignItems="AlignItems.Center">
 | 
					 | 
				
			||||||
                            <RadzenColumn Size="12">
 | 
					 | 
				
			||||||
                                <RadzenButton ButtonType="ButtonType.Submit" Size="ButtonSize.Medium" Text="绑定/解绑" />
 | 
					 | 
				
			||||||
                                @* <RadzenButton Size="ButtonSize.Medium" Click="@EditChannel" IsBusy="isLoading" Text="解绑" ButtonStyle="ButtonStyle.Warning" /> *@
 | 
					 | 
				
			||||||
                            </RadzenColumn>
 | 
					 | 
				
			||||||
                        </RadzenRow>
 | 
					 | 
				
			||||||
                    </RadzenStack>
 | 
					 | 
				
			||||||
                </RadzenFieldset>
 | 
					 | 
				
			||||||
            </form>
 | 
					 | 
				
			||||||
        </div>
 | 
					 | 
				
			||||||
    </div>
 | 
					 | 
				
			||||||
    <div class="row">
 | 
					    <div class="row">
 | 
				
			||||||
        <div class="col-12 mb-4">
 | 
					        <div class="col-12 mb-4">
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            <RadzenDataList @ref="grid" LoadData="@LoadData" WrapItems="true" Count="@count" IsLoading="@isLoading" Data="@_forecasts" PageSize="56" style="height:61vh; overflow:auto">
 | 
					            <RadzenDataList @ref="grid" LoadData="@LoadData" WrapItems="true" Count="@count" IsLoading="@isLoading" Data="@_forecasts" PageSize="6" AllowPaging="true" PagerHorizontalAlign="HorizontalAlign.Left"
 | 
				
			||||||
 | 
					                            ShowPagingSummary="true" PagingSummaryFormat="{0}/{1} 共{2}条数据">
 | 
				
			||||||
                <Template Context="channel">
 | 
					                <Template Context="channel">
 | 
				
			||||||
                    <RadzenCard class="mycol" onclick="@(() => CardClick(channel))">
 | 
					                    <RadzenCard class="col-3">
 | 
				
			||||||
                        <RadzenRow>
 | 
					                        <RadzenRow>
 | 
				
			||||||
                            <RadzenColumn Size="8" Class="rz-text-truncate">
 | 
					                            <RadzenColumn Size="8" Class="rz-text-truncate">
 | 
				
			||||||
                                @if (channel.DrawerNo == 99)
 | 
					                                <b class="rz-pr-3">@(channel.DrawerNo)</b>
 | 
				
			||||||
                                {
 | 
					                                <b>@myText.Box</b>
 | 
				
			||||||
                                    <b class="rz-pr-3">@($"急诊药盒")</b>
 | 
					 | 
				
			||||||
                                }
 | 
					 | 
				
			||||||
                                else if(channel.DrawerNo==111)
 | 
					 | 
				
			||||||
                                {
 | 
					 | 
				
			||||||
                                    <b class="rz-pr-3">@($"恢复室药盒")</b>
 | 
					 | 
				
			||||||
                                }
 | 
					 | 
				
			||||||
                                else if (channel.DrawerNo == 31)
 | 
					 | 
				
			||||||
                                {
 | 
					 | 
				
			||||||
                                    <b class="rz-pr-3">@($"胃镜药盒")</b>
 | 
					 | 
				
			||||||
                                }
 | 
					 | 
				
			||||||
                                else if(channel.DrawerNo==32)
 | 
					 | 
				
			||||||
                                {
 | 
					 | 
				
			||||||
                                    <b class="rz-pr-3">@($"导管药盒")</b>
 | 
					 | 
				
			||||||
                                }
 | 
					 | 
				
			||||||
                                else if (channel.DrawerNo == 33)
 | 
					 | 
				
			||||||
                                {
 | 
					 | 
				
			||||||
                                    <b class="rz-pr-3">@($"生殖药盒")</b>
 | 
					 | 
				
			||||||
                                }
 | 
					 | 
				
			||||||
                                else if(channel.DrawerNo==34)
 | 
					 | 
				
			||||||
                                {
 | 
					 | 
				
			||||||
                                    <b class="rz-pr-3">@($"妇门药盒")</b>
 | 
					 | 
				
			||||||
                                }
 | 
					 | 
				
			||||||
                                else
 | 
					 | 
				
			||||||
                                {
 | 
					 | 
				
			||||||
                                    <b class="rz-pr-3">@($"{channel.DrawerNo}-{(channel.ColNo == 1 ? '白':'绿')}")</b>
 | 
					 | 
				
			||||||
                                }
 | 
					 | 
				
			||||||
                               @*  <b>号药盒</b> *@
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
                            </RadzenColumn>
 | 
					                            </RadzenColumn>
 | 
				
			||||||
                            <RadzenColumn Size="4" class="rz-text-align-end">
 | 
					                            <RadzenColumn Size="4" Class="rz-text-align-end">
 | 
				
			||||||
                                <RadzenCheckBox TValue="bool" Disabled=@channel.BoxDisabled @bind-Value=@channel.IsChecked />
 | 
					                                @if (channel.TotalQuantity == 0)
 | 
				
			||||||
 | 
					                                {
 | 
				
			||||||
 | 
					                                    <RadzenButton ButtonStyle="ButtonStyle.Secondary" Variant="Variant.Outlined" Size="ButtonSize.Small" Click="@(() => EditChannel(channel))" Text="@myText.BindUnBind" />
 | 
				
			||||||
 | 
					                                }
 | 
				
			||||||
                            </RadzenColumn>
 | 
					                            </RadzenColumn>
 | 
				
			||||||
                        </RadzenRow>
 | 
					                        </RadzenRow>
 | 
				
			||||||
                        <hr style="border: none; background-color: rgba(0,0,0,.2); height: 1px; margin: 1rem 0;" />
 | 
					                        <hr style="border: none; background-color: rgba(0,0,0,.2); height: 1px; margin: 1rem 0;" />
 | 
				
			||||||
                        <RadzenStack Orientation="Orientation.Horizontal" AlignItems="AlignItems.Center">
 | 
					                        <RadzenStack Orientation="Orientation.Horizontal" AlignItems="AlignItems.Center">
 | 
				
			||||||
                            <RadzenStack Gap="0">
 | 
					                            <RadzenStack Gap="0">
 | 
				
			||||||
                                <RadzenText TextStyle="TextStyle.Overline" class="rz-display-flex rz-mt-2 rz-my-0">套餐</RadzenText>
 | 
					                                <RadzenText TextStyle="TextStyle.Overline" class="rz-display-flex rz-mt-2 rz-my-0">@myText.SetMenu</RadzenText>
 | 
				
			||||||
 | 
					                                @if (channel.DrugId == null || channel.TotalQuantity == 0)
 | 
				
			||||||
 | 
					                                {
 | 
				
			||||||
 | 
					                                    <RadzenDropDownDataGrid AllowVirtualization="true" Name="planName" TValue="Plan" @bind-Value="channel.PlanInfo" Data="@plans"
 | 
				
			||||||
 | 
					                                                            Style="width:100%; display: block;" AllowFilteringByAllStringColumns="true" TextProperty="Name">
 | 
				
			||||||
 | 
					                                    
 | 
				
			||||||
 | 
					                                        <Columns>
 | 
				
			||||||
 | 
					                                            <RadzenDropDownDataGridColumn Property="Name" Title="@myText.MenuName" Sortable="false" />
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                                            <RadzenDropDownDataGridColumn Property="Description" Width="120px" Title="@myText.MenuDescrip" Sortable="false" />
 | 
				
			||||||
 | 
					                                        </Columns>
 | 
				
			||||||
 | 
					                                    </RadzenDropDownDataGrid>
 | 
				
			||||||
 | 
					                                    <RadzenCustomValidator Component="planName" Validator="@(() => (channel.PlanInfo.Id > 0))" Popup=true Text="@myText.SelectMenu" />
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                                }
 | 
				
			||||||
 | 
					                                else
 | 
				
			||||||
 | 
					                                {
 | 
				
			||||||
                                    <RadzenText TextStyle="TextStyle.Body1"><b>@(channel.PlanInfo.Name)</b></RadzenText>
 | 
					                                    <RadzenText TextStyle="TextStyle.Body1"><b>@(channel.PlanInfo.Name)</b></RadzenText>
 | 
				
			||||||
                                <RadzenText TextStyle="TextStyle.Overline" class="rz-display-flex rz-mt-4 rz-mb-0">总库存</RadzenText>
 | 
					                                }
 | 
				
			||||||
 | 
					                                <RadzenText TextStyle="TextStyle.Overline" class="rz-display-flex rz-mt-4 rz-mb-0">@myText.TotalStock</RadzenText>
 | 
				
			||||||
                                <RadzenText TextStyle="TextStyle.Body1"><b>@(channel.TotalQuantity)</b></RadzenText>
 | 
					                                <RadzenText TextStyle="TextStyle.Body1"><b>@(channel.TotalQuantity)</b></RadzenText>
 | 
				
			||||||
                            </RadzenStack>
 | 
					                            </RadzenStack>
 | 
				
			||||||
                        </RadzenStack>
 | 
					                        </RadzenStack>
 | 
				
			||||||
| 
						 | 
					@ -111,7 +60,8 @@
 | 
				
			||||||
    @inject IDrugInfoDao drugInfoDao;
 | 
					    @inject IDrugInfoDao drugInfoDao;
 | 
				
			||||||
    @inject DialogService dialogService;
 | 
					    @inject DialogService dialogService;
 | 
				
			||||||
    @inject NotificationService _message
 | 
					    @inject NotificationService _message
 | 
				
			||||||
    @inject IPlanDao planDao;
 | 
					    @inject Toolbelt.Blazor.I18nText.I18nText I18nText;
 | 
				
			||||||
 | 
					    private I18nText.local myText = new I18nText.local();
 | 
				
			||||||
    RadzenDataList<ChannelList> grid;
 | 
					    RadzenDataList<ChannelList> grid;
 | 
				
			||||||
    bool isLoading;
 | 
					    bool isLoading;
 | 
				
			||||||
    int count;
 | 
					    int count;
 | 
				
			||||||
| 
						 | 
					@ -126,26 +76,23 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    List<Plan> plans;
 | 
					    List<Plan> plans;
 | 
				
			||||||
    int firstFlag = 0;
 | 
					
 | 
				
			||||||
    protected override async Task OnInitializedAsync()
 | 
					    protected override async Task OnInitializedAsync()
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
 | 
					        myText = await I18nText.GetTextTableAsync<I18nText.local>(this);
 | 
				
			||||||
        await base.OnInitializedAsync();
 | 
					        await base.OnInitializedAsync();
 | 
				
			||||||
        var resultPlan = await planDao.GetAllPlanInfo();
 | 
					 | 
				
			||||||
        plans = resultPlan.Desserts.Where(p => p._PlanDetails.Count > 0).ToList();
 | 
					 | 
				
			||||||
        firstFlag = 0;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        //drugInfos = await drugInfoDao.GetAllDrug();
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    async Task LoadData(LoadDataArgs args)
 | 
					    async Task LoadData(LoadDataArgs args)
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
 | 
					 | 
				
			||||||
        isLoading = true;
 | 
					        isLoading = true;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        var result = await channelListDao.GetAllChannelListWithPlan(args.Top, args.Skip);
 | 
					        var result = await channelListDao.GetAllChannelListWithPlan(args.Top, args.Skip);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        // Update the Data property
 | 
					        // Update the Data property
 | 
				
			||||||
        _forecasts = result.Desserts;
 | 
					        _forecasts = result.Desserts;
 | 
				
			||||||
 | 
					 | 
				
			||||||
        // Update the count
 | 
					        // Update the count
 | 
				
			||||||
        count = result.TotalDesserts;
 | 
					        count = result.TotalDesserts;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -159,120 +106,60 @@
 | 
				
			||||||
        await grid.Reload();
 | 
					        await grid.Reload();
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    async Task EditChannel(ChannelList list)
 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    // 默认选中的项
 | 
					 | 
				
			||||||
    private Plan selectedPlan = new();
 | 
					 | 
				
			||||||
    // 处理选择变更(可选)
 | 
					 | 
				
			||||||
    private void OnPlanSelected(Plan plan)
 | 
					 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        selectedPlan = plan;
 | 
					        if (list.PlanInfo.Id > 0)
 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    //绑定
 | 
					 | 
				
			||||||
    async Task EditChannel()
 | 
					 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
        List<ChannelList> bindList = _forecasts.Where(b => b.IsChecked).ToList();
 | 
					            // 说明之前有绑定并且未改变,那么就是在进行解绑
 | 
				
			||||||
        if (bindList == null || bindList.Count <= 0)
 | 
					            if (list.DrugId != null && list.DrugId.Equals(list.PlanInfo.Id.ToString()))
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
            _message.Notify(
 | 
					                var b = await channelListDao.UnBindBox(list);
 | 
				
			||||||
                      new NotificationMessage { Severity = NotificationSeverity.Error, Summary = "提示", Detail = $"请先选择药箱号再点击按钮", Duration = 4000 }
 | 
					 | 
				
			||||||
                  );
 | 
					 | 
				
			||||||
            return;
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
        if (!string.IsNullOrEmpty(bindList[0].DrugId))
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
            //之前有绑定,在进行解绑
 | 
					 | 
				
			||||||
            foreach (var item in bindList)
 | 
					 | 
				
			||||||
            {
 | 
					 | 
				
			||||||
                var b = await channelListDao.UnBindBox(item);
 | 
					 | 
				
			||||||
                if (b)
 | 
					                if (b)
 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
                    _message.Notify(
 | 
					                    _message.Notify(
 | 
				
			||||||
                        new NotificationMessage { Severity = NotificationSeverity.Success, Summary = "提示", Detail = $"解除绑定成功", Duration = 4000 }
 | 
					                        new NotificationMessage { Severity = NotificationSeverity.Success, Summary = "提示", Detail = $"解除绑定成功", Duration = 4000 }
 | 
				
			||||||
                    );
 | 
					                    );
 | 
				
			||||||
 | 
					                    await reloadGrid();
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
                await grid.Reload();
 | 
					
 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
					            // 否则是进行绑定
 | 
				
			||||||
            else
 | 
					            else
 | 
				
			||||||
        {// 否则是进行解绑
 | 
					 | 
				
			||||||
            if (selectedPlan != null && selectedPlan.Id > 0)
 | 
					 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                foreach (var item in bindList)
 | 
					                var b = await channelListDao.BindBox(list);
 | 
				
			||||||
                {
 | 
					 | 
				
			||||||
                    var b = await channelListDao.BindBox(item, selectedPlan);
 | 
					 | 
				
			||||||
                if (b)
 | 
					                if (b)
 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
                    _message.Notify(
 | 
					                    _message.Notify(
 | 
				
			||||||
                        new NotificationMessage { Severity = NotificationSeverity.Success, Summary = "提示", Detail = $"绑定成功", Duration = 4000 }
 | 
					                        new NotificationMessage { Severity = NotificationSeverity.Success, Summary = "提示", Detail = $"绑定成功", Duration = 4000 }
 | 
				
			||||||
                    );
 | 
					                    );
 | 
				
			||||||
 | 
					                    await reloadGrid();
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
                await grid.Reload();
 | 
					 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        else
 | 
					        else
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            if (list.PlanInfo != null)
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                // 说明只设置了药品
 | 
				
			||||||
 | 
					                var b = await channelListDao.BindBox(list);
 | 
				
			||||||
 | 
					                if (b)
 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
                    _message.Notify(
 | 
					                    _message.Notify(
 | 
				
			||||||
                            new NotificationMessage { Severity = NotificationSeverity.Error, Summary = "提示", Detail = $"请选择套餐", Duration = 4000 }
 | 
					                        new NotificationMessage { Severity = NotificationSeverity.Success, Summary = "提示", Detail = $"绑定成功", Duration = 4000 }
 | 
				
			||||||
                    );
 | 
					                    );
 | 
				
			||||||
 | 
					                    await reloadGrid();
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
    }
 | 
					            // 什么都没有选择或者么有改变,只是点击了按钮,此时不操作
 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    async Task CardClick(ChannelList list)
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
        if (firstFlag == 0 && !(list.BoxDisabled))
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
            firstFlag = 1;
 | 
					 | 
				
			||||||
            if (!string.IsNullOrEmpty(list.DrugId))
 | 
					 | 
				
			||||||
            {
 | 
					 | 
				
			||||||
                list.IsChecked = !list.IsChecked;
 | 
					 | 
				
			||||||
                //已绑药品需要解绑,未绑定的不可选
 | 
					 | 
				
			||||||
                if (list.IsChecked)
 | 
					 | 
				
			||||||
                {
 | 
					 | 
				
			||||||
                    _forecasts.Where(it => it.DrugId != list.DrugId || it.TotalQuantity > 0).ToList().ForEach(it => it.BoxDisabled = true);
 | 
					 | 
				
			||||||
                    selectedPlan = await planDao.GetPlanById(Convert.ToInt32(list.DrugId));
 | 
					 | 
				
			||||||
                }
 | 
					 | 
				
			||||||
            else
 | 
					            else
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                    _forecasts.Where(it => it.TotalQuantity <= 0).ToList().ForEach(it => it.BoxDisabled = false);
 | 
					 | 
				
			||||||
                    firstFlag = 0;
 | 
					 | 
				
			||||||
                }
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            else
 | 
					 | 
				
			||||||
            {
 | 
					 | 
				
			||||||
                list.IsChecked = !list.IsChecked;
 | 
					 | 
				
			||||||
                //未绑定药品则已绑定的不可选
 | 
					 | 
				
			||||||
                if (list.IsChecked)
 | 
					 | 
				
			||||||
                {
 | 
					 | 
				
			||||||
                    _forecasts.Where(it => !string.IsNullOrEmpty(it.DrugId) || it.TotalQuantity > 0).ToList().ForEach(it => it.BoxDisabled = true);
 | 
					 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
                else
 | 
					 | 
				
			||||||
                {
 | 
					 | 
				
			||||||
                    _forecasts.ToList().Where(it => it.TotalQuantity <= 0).ToList().ForEach(it => it.BoxDisabled = false);
 | 
					 | 
				
			||||||
                    firstFlag = 0;
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            }
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
        else
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
            if (!list.BoxDisabled)
 | 
					 | 
				
			||||||
            {
 | 
					 | 
				
			||||||
                list.IsChecked = !list.IsChecked;
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
            //isChecked==false 1)是否全部是false,是则将所有isChecked==true,不是则不做改变
 | 
					 | 
				
			||||||
            if (!_forecasts.Any(b => b.IsChecked == true))
 | 
					 | 
				
			||||||
            {
 | 
					 | 
				
			||||||
                _forecasts.Where(it => it.TotalQuantity <= 0).ToList().ForEach(it => it.BoxDisabled = false);
 | 
					 | 
				
			||||||
                firstFlag = 0;
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
        await InvokeAsync(StateHasChanged);
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,212 +0,0 @@
 | 
				
			||||||
@page "/Box/BoxBindings123"
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
<div class="container-fluid">
 | 
					 | 
				
			||||||
    <div class="row">
 | 
					 | 
				
			||||||
        <RadzenFieldset class="col-12 mb-4" Text="选择药盒">
 | 
					 | 
				
			||||||
            <div class="col-12 row justify-content-center align-items-center text-center">
 | 
					 | 
				
			||||||
                <div class="row justify-content-around align-items-center" style="overflow:auto">
 | 
					 | 
				
			||||||
                    @if (BoxList != null)
 | 
					 | 
				
			||||||
                    {
 | 
					 | 
				
			||||||
                        foreach (var item in BoxList)
 | 
					 | 
				
			||||||
                        {
 | 
					 | 
				
			||||||
                            <div class="col-2">
 | 
					 | 
				
			||||||
                                <RadzenCheckBox Style="width:40px;height:40px;margin:2px" TValue="bool" Disabled=@item.BoxDisabled @bind-Value=@item.IsChecked Name="@($"CheckBox_{item.DrawerNo}")" Change="@((bool isChecked) => OnCheckBoxChange(isChecked, item.DrawerNo))" />
 | 
					 | 
				
			||||||
                              @if(item.DrawerNo<51)
 | 
					 | 
				
			||||||
                                  {
 | 
					 | 
				
			||||||
                                    <RadzenLabel Text="@($"{(item.DrawerNo % 2 == 0 ? item.DrawerNo : item.DrawerNo+1)/2}-{(item.DrawerNo % 2 == 0 ? 2 : 1)}")" Component="@($"CheckBox_{item.DrawerNo}")" />
 | 
					 | 
				
			||||||
                                }
 | 
					 | 
				
			||||||
                                else
 | 
					 | 
				
			||||||
                                {
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                                    <RadzenLabel Text="@($"{item.DrawerNo -25}")" Component="@($"CheckBox_{item.DrawerNo}")" />
 | 
					 | 
				
			||||||
                                }
 | 
					 | 
				
			||||||
                            </div>
 | 
					 | 
				
			||||||
                        }
 | 
					 | 
				
			||||||
                    }
 | 
					 | 
				
			||||||
                </div>
 | 
					 | 
				
			||||||
            </div>
 | 
					 | 
				
			||||||
        </RadzenFieldset>
 | 
					 | 
				
			||||||
        <RadzenCard class="col-12 mb-2">
 | 
					 | 
				
			||||||
            <RadzenButton ButtonStyle="ButtonStyle.Secondary" Variant="Variant.Outlined" Size="ButtonSize.Small" Click="@EditChannel" Text="绑定/解绑" />
 | 
					 | 
				
			||||||
            <hr style="border: none; background-color: rgba(0,0,0,.2); height: 1px; margin: 1rem 0;" />
 | 
					 | 
				
			||||||
            <RadzenStack Orientation="Orientation.Horizontal" AlignItems="AlignItems.Center">
 | 
					 | 
				
			||||||
                <RadzenStack Gap="0">
 | 
					 | 
				
			||||||
                    <RadzenText TextStyle="TextStyle.Overline" class="rz-display-flex rz-mt-2 rz-my-0">选择套餐</RadzenText>
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                    <RadzenDropDownDataGrid AllowVirtualization="true" Name="planName" TValue="Plan" Data="@plans" Value="@selectedPlan" ValueChanged="@OnPlanSelected"
 | 
					 | 
				
			||||||
                                            Style="width:100%; display: block;" AllowFilteringByAllStringColumns="true" TextProperty="Name">
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                        <Columns>
 | 
					 | 
				
			||||||
                            <RadzenDropDownDataGridColumn Property="Name" Title="套餐名称" Sortable="false" />
 | 
					 | 
				
			||||||
                        </Columns>
 | 
					 | 
				
			||||||
                    </RadzenDropDownDataGrid>
 | 
					 | 
				
			||||||
                </RadzenStack>
 | 
					 | 
				
			||||||
            </RadzenStack>
 | 
					 | 
				
			||||||
        </RadzenCard>
 | 
					 | 
				
			||||||
    </div>
 | 
					 | 
				
			||||||
</div>
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
@code {
 | 
					 | 
				
			||||||
    @inject IChannelListDao channelListDao;
 | 
					 | 
				
			||||||
    @inject IDrugInfoDao drugInfoDao;
 | 
					 | 
				
			||||||
    @inject DialogService dialogService;
 | 
					 | 
				
			||||||
    @inject NotificationService _message;
 | 
					 | 
				
			||||||
    @inject IPlanDao planDao;
 | 
					 | 
				
			||||||
    int count;
 | 
					 | 
				
			||||||
    private List<ChannelList>? _forecasts;
 | 
					 | 
				
			||||||
    private List<ChannelList>? BoxList;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    List<DrugInfo> drugInfos;
 | 
					 | 
				
			||||||
    List<DrugManuNo> drugManuNos;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    DrugInfo drugInfo;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    DrugManuNo drugManuNo;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    int firstFlag = 0;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    List<Plan> plans;
 | 
					 | 
				
			||||||
    // 默认选中的项
 | 
					 | 
				
			||||||
    private Plan selectedPlan = new();
 | 
					 | 
				
			||||||
    protected override async Task OnInitializedAsync()
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
        await LoadData();
 | 
					 | 
				
			||||||
        await base.OnInitializedAsync();
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        //drugInfos = await drugInfoDao.GetAllDrug();
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    async Task LoadData()
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
        BoxList = await channelListDao.GetAllBox();
 | 
					 | 
				
			||||||
        var result = await planDao.GetAllPlanInfo();
 | 
					 | 
				
			||||||
        plans = result.Desserts.Where(p=>p._PlanDetails.Count>0).ToList();
 | 
					 | 
				
			||||||
        _forecasts = await channelListDao.GetAllChannelList();
 | 
					 | 
				
			||||||
        firstFlag = 0;
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    // 处理选择变更(可选)
 | 
					 | 
				
			||||||
    private void OnPlanSelected(Plan plan)
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
        selectedPlan = plan;
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    //绑定
 | 
					 | 
				
			||||||
    async Task EditChannel()
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
        List<ChannelList> bindList = BoxList.Where(b => b.IsChecked).ToList();
 | 
					 | 
				
			||||||
        if (bindList == null || bindList.Count <= 0)
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
            _message.Notify(
 | 
					 | 
				
			||||||
                      new NotificationMessage { Severity = NotificationSeverity.Error, Summary = "提示", Detail = $"请先选择药箱号再点击按钮", Duration = 4000 }
 | 
					 | 
				
			||||||
                  );
 | 
					 | 
				
			||||||
            return;
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
        if (!string.IsNullOrEmpty(bindList[0].DrugId))
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
            //之前有绑定,在进行解绑
 | 
					 | 
				
			||||||
            foreach (var item in bindList)
 | 
					 | 
				
			||||||
            {
 | 
					 | 
				
			||||||
                var b = await channelListDao.UnBindBox(item);
 | 
					 | 
				
			||||||
                if (b)
 | 
					 | 
				
			||||||
                {
 | 
					 | 
				
			||||||
                    _message.Notify(
 | 
					 | 
				
			||||||
                        new NotificationMessage { Severity = NotificationSeverity.Success, Summary = "提示", Detail = $"解除绑定成功", Duration = 4000 }
 | 
					 | 
				
			||||||
                    );
 | 
					 | 
				
			||||||
                }
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
            await LoadData();
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
        else
 | 
					 | 
				
			||||||
        {// 否则是进行绑定
 | 
					 | 
				
			||||||
            if (selectedPlan != null && selectedPlan.Id > 0)
 | 
					 | 
				
			||||||
            {
 | 
					 | 
				
			||||||
                foreach (var item in bindList)
 | 
					 | 
				
			||||||
                {
 | 
					 | 
				
			||||||
                    var b = await channelListDao.BindBox(item, selectedPlan);
 | 
					 | 
				
			||||||
                    if (b)
 | 
					 | 
				
			||||||
                    {
 | 
					 | 
				
			||||||
                        _message.Notify(
 | 
					 | 
				
			||||||
                            new NotificationMessage { Severity = NotificationSeverity.Success, Summary = "提示", Detail = $"绑定成功", Duration = 4000 }
 | 
					 | 
				
			||||||
                        );
 | 
					 | 
				
			||||||
                    }
 | 
					 | 
				
			||||||
                }
 | 
					 | 
				
			||||||
                await LoadData();
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
            else
 | 
					 | 
				
			||||||
            {
 | 
					 | 
				
			||||||
                _message.Notify(
 | 
					 | 
				
			||||||
                            new NotificationMessage { Severity = NotificationSeverity.Error, Summary = "提示", Detail = $"请选择套餐", Duration = 4000 }
 | 
					 | 
				
			||||||
                        );
 | 
					 | 
				
			||||||
                
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    private async Task OnCheckBoxChange(bool isChecked, int DrawerNo)
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
        //isChecked==true 1)当前选择的药箱已经绑药套餐且库存<=0,如果有库存则提示不能选择,如果无库存则列出与之绑定相同套餐且库存<=0的药箱号,其他药箱号不可选择
 | 
					 | 
				
			||||||
        //                2)当前选择的药箱未绑定套餐则将所有未绑定套餐的药箱号列出来,其他药箱不可操作
 | 
					 | 
				
			||||||
        if (firstFlag == 0)
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
            if (isChecked)
 | 
					 | 
				
			||||||
            {
 | 
					 | 
				
			||||||
                firstFlag = 1;
 | 
					 | 
				
			||||||
                string drugId = BoxList.Where(b => b.DrawerNo == DrawerNo).Select(b => b.DrugId).FirstOrDefault();
 | 
					 | 
				
			||||||
                //所选药箱已绑定套餐
 | 
					 | 
				
			||||||
                if (!string.IsNullOrEmpty(drugId))
 | 
					 | 
				
			||||||
                {
 | 
					 | 
				
			||||||
                    //查询该药箱下的药品库存是否存在不为0的,存在则不让选择
 | 
					 | 
				
			||||||
                    List<ChannelStock> stockList = await channelListDao.GetChannelStockByBox(DrawerNo);
 | 
					 | 
				
			||||||
                    if (stockList != null && stockList.Count > 0)
 | 
					 | 
				
			||||||
                    {
 | 
					 | 
				
			||||||
                        //该药箱下存在库存不为0的药品
 | 
					 | 
				
			||||||
                        _message.Notify(
 | 
					 | 
				
			||||||
                                      new NotificationMessage { Severity = NotificationSeverity.Error, Summary = "提示", Detail = $"该药盒下的药品仍有库存,请清库存后再操作", Duration = 4000 }
 | 
					 | 
				
			||||||
                               );
 | 
					 | 
				
			||||||
                        BoxList.ForEach(it => it.IsChecked = false);
 | 
					 | 
				
			||||||
                        firstFlag = 0;
 | 
					 | 
				
			||||||
                        return;
 | 
					 | 
				
			||||||
                    }
 | 
					 | 
				
			||||||
                    else
 | 
					 | 
				
			||||||
                    {
 | 
					 | 
				
			||||||
                        //无库存则列出与之绑定相同套餐且库存 <= 0的药箱号,其他药箱号不可选择
 | 
					 | 
				
			||||||
                        // BoxList.Where(b => string.IsNullOrEmpty(b.DrugId)).ToList().ForEach(b => b.BoxDisabled = true);
 | 
					 | 
				
			||||||
                        //1)查询套餐下无库存的药箱号
 | 
					 | 
				
			||||||
                        List<ChannelStock>? lists = await channelListDao.GetChannelStockByPlan(drugId);
 | 
					 | 
				
			||||||
                        if (lists != null && lists.Count > 0)
 | 
					 | 
				
			||||||
                        {
 | 
					 | 
				
			||||||
                            int[] boxNum = lists.Select(l => l.DrawerNo).ToArray();
 | 
					 | 
				
			||||||
                            //不在该lists下的药箱号不可选择
 | 
					 | 
				
			||||||
                            BoxList.Where(b => !boxNum.Contains(b.DrawerNo)).ToList().ForEach(b => b.BoxDisabled = true);
 | 
					 | 
				
			||||||
                        }
 | 
					 | 
				
			||||||
                        selectedPlan = await planDao.GetPlanById(Convert.ToInt32(drugId));
 | 
					 | 
				
			||||||
                    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                }
 | 
					 | 
				
			||||||
                else
 | 
					 | 
				
			||||||
                {
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                    //未绑定套餐 ,列出所有未绑的药箱号,其他不可操作
 | 
					 | 
				
			||||||
                    BoxList.Where(b => !string.IsNullOrEmpty(b.DrugId)).ToList().ForEach(b => b.BoxDisabled = true);
 | 
					 | 
				
			||||||
                }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
        else
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
            if (!isChecked)
 | 
					 | 
				
			||||||
            {
 | 
					 | 
				
			||||||
                //isChecked==false 1)是否全部是false,是则将所有isChecked==true,不是则不做改变
 | 
					 | 
				
			||||||
                if (!BoxList.Any(b => b.IsChecked == true))
 | 
					 | 
				
			||||||
                {
 | 
					 | 
				
			||||||
                    BoxList.ForEach(b => b.BoxDisabled = false);
 | 
					 | 
				
			||||||
                    firstFlag = 0;
 | 
					 | 
				
			||||||
                }
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
| 
						 | 
					@ -9,7 +9,7 @@
 | 
				
			||||||
<RadzenStack Gap="1rem" Orientation="Orientation.Vertical" Style="height: 100%;">
 | 
					<RadzenStack Gap="1rem" Orientation="Orientation.Vertical" Style="height: 100%;">
 | 
				
			||||||
    <RadzenStack>
 | 
					    <RadzenStack>
 | 
				
			||||||
        <RadzenStack class="rz-p-4 rz-border-radius-1" Style="border: var(--rz-grid-cell-border)" Orientation="Orientation.Horizontal" Gap="1rem">
 | 
					        <RadzenStack class="rz-p-4 rz-border-radius-1" Style="border: var(--rz-grid-cell-border)" Orientation="Orientation.Horizontal" Gap="1rem">
 | 
				
			||||||
            @*   <RadzenText Class="rz-mt-2 rz-my-0" Style="color: var(--rz-text-tertiary-color);">药名:</RadzenText>
 | 
					            <RadzenText Class="rz-mt-2 rz-my-0" Style="color: var(--rz-text-tertiary-color);">药名:</RadzenText>
 | 
				
			||||||
            <RadzenText Class="rz-text-truncate"><b>@(channelStock.Drug.DrugName)</b></RadzenText>
 | 
					            <RadzenText Class="rz-text-truncate"><b>@(channelStock.Drug.DrugName)</b></RadzenText>
 | 
				
			||||||
            <RadzenText Class="rz-mt-2 rz-my-0" Style="color: var(--rz-text-tertiary-color);">规格:</RadzenText>
 | 
					            <RadzenText Class="rz-mt-2 rz-my-0" Style="color: var(--rz-text-tertiary-color);">规格:</RadzenText>
 | 
				
			||||||
            <RadzenText TextStyle="TextStyle.Body1" Class="rz-text-truncate"><b>@(channelStock.Drug.DrugSpec)</b></RadzenText>
 | 
					            <RadzenText TextStyle="TextStyle.Body1" Class="rz-text-truncate"><b>@(channelStock.Drug.DrugSpec)</b></RadzenText>
 | 
				
			||||||
| 
						 | 
					@ -18,71 +18,27 @@
 | 
				
			||||||
            <RadzenText Class="rz-mt-2 rz-my-0" Style="color: var(--rz-text-tertiary-color);">效期:</RadzenText>
 | 
					            <RadzenText Class="rz-mt-2 rz-my-0" Style="color: var(--rz-text-tertiary-color);">效期:</RadzenText>
 | 
				
			||||||
            <RadzenText TextStyle="TextStyle.Body1" Class="rz-text-truncate"><b>@(channelStock.EffDate)</b></RadzenText>
 | 
					            <RadzenText TextStyle="TextStyle.Body1" Class="rz-text-truncate"><b>@(channelStock.EffDate)</b></RadzenText>
 | 
				
			||||||
            <RadzenText Class="rz-mt-2 rz-my-0" Style="color: var(--rz-text-tertiary-color);">库存:</RadzenText>
 | 
					            <RadzenText Class="rz-mt-2 rz-my-0" Style="color: var(--rz-text-tertiary-color);">库存:</RadzenText>
 | 
				
			||||||
            <RadzenText TextStyle="TextStyle.Body1" Class="rz-text-truncate"><b>@(channelStock.Quantity)</b></RadzenText> *@
 | 
					            <RadzenText TextStyle="TextStyle.Body1" Class="rz-text-truncate"><b>@(channelStock.Quantity)</b></RadzenText>
 | 
				
			||||||
            <div style="text-align: left;width:15vw">
 | 
					 | 
				
			||||||
                <div class="rz-text-h6 rz-mb-0">药品名称</div>
 | 
					 | 
				
			||||||
                @(channelStock.Drug.DrugName)
 | 
					 | 
				
			||||||
            </div>
 | 
					 | 
				
			||||||
            <div style="text-align: left;width:6vw">
 | 
					 | 
				
			||||||
                <div class="rz-text-h6 rz-mb-0">规格</div>
 | 
					 | 
				
			||||||
                @(channelStock.Drug.DrugSpec)
 | 
					 | 
				
			||||||
            </div>
 | 
					 | 
				
			||||||
            <div style="text-align: left;width:8vw;">
 | 
					 | 
				
			||||||
                <div class="rz-text-h6 rz-mb-0">批次</div>
 | 
					 | 
				
			||||||
                @(channelStock.ManuNo)
 | 
					 | 
				
			||||||
            </div>
 | 
					 | 
				
			||||||
            <div style="text-align: left;width:8vw;">
 | 
					 | 
				
			||||||
                <div class="rz-text-h6 rz-mb-0">效期</div>
 | 
					 | 
				
			||||||
                @(channelStock.EffDate)
 | 
					 | 
				
			||||||
            </div>
 | 
					 | 
				
			||||||
            <div style="text-align: left;width:4vw;">
 | 
					 | 
				
			||||||
                <div class="rz-text-h6 rz-mb-0">库存</div>
 | 
					 | 
				
			||||||
                @(channelStock.Quantity)
 | 
					 | 
				
			||||||
            </div>
 | 
					 | 
				
			||||||
        </RadzenStack>
 | 
					        </RadzenStack>
 | 
				
			||||||
    </RadzenStack>
 | 
					    </RadzenStack>
 | 
				
			||||||
    <RadzenStack style="align-content:center">
 | 
					    <RadzenStack style="align-content:center">
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        <RadzenStack class="rz-p-4 rz-border-radius-1" Style="border: var(--rz-grid-cell-border);align-content:center" Orientation="Orientation.Horizontal" Gap="1rem">
 | 
					        <RadzenStack class="rz-p-4 rz-border-radius-1" Style="border: var(--rz-grid-cell-border);align-content:center" Orientation="Orientation.Horizontal" Gap="1rem">
 | 
				
			||||||
            <RadzenText Class="rz-mt-2 rz-my-0" Style="color: var(--rz-text-tertiary-color);">移入</RadzenText>
 | 
					            <RadzenText Class="rz-mt-2 rz-my-0" Style="color: var(--rz-text-tertiary-color);">移入药箱:</RadzenText>
 | 
				
			||||||
            <RadzenDropDownDataGrid AllowVirtualization="true" Name="BoxColorList" TValue="BoxModel" Data="@BoxColorList" Value="BoxColor" Style="width: 11vw;"
 | 
					 | 
				
			||||||
            ValueChanged="@((args) => OnColorChanged(args))" AllowFiltering="false"
 | 
					 | 
				
			||||||
            AllowFilteringByAllStringColumns="true" TextProperty="药箱号">
 | 
					 | 
				
			||||||
                <Template>
 | 
					 | 
				
			||||||
                    @((context as BoxModel).BoxNo == 1 ? "白" : (context as BoxModel).BoxNo == 2 ? "绿" : (context as BoxModel).BoxNo == 3 ? "非常规" : "抽屉")
 | 
					 | 
				
			||||||
                </Template>
 | 
					 | 
				
			||||||
                <Columns>
 | 
					 | 
				
			||||||
                    <RadzenDropDownDataGridColumn Property="BoxNo" Title="药箱颜色" Sortable="false" />
 | 
					 | 
				
			||||||
                </Columns>
 | 
					 | 
				
			||||||
            </RadzenDropDownDataGrid>
 | 
					 | 
				
			||||||
            <RadzenDropDown @bind-Value="SelectedDrawerNo" Data="@DrawerNos" Style="display: block;" Name="DropDownChangeEvent">
 | 
					            <RadzenDropDown @bind-Value="SelectedDrawerNo" Data="@DrawerNos" Style="display: block;" Name="DropDownChangeEvent">
 | 
				
			||||||
                <RadzenText TextStyle="TextStyle.Subtitle2" class="mb-0">@(SelectedDrawerNo)</RadzenText>
 | 
					                <RadzenText TextStyle="TextStyle.Subtitle2" class="mb-0">@(SelectedDrawerNo)</RadzenText>
 | 
				
			||||||
            </RadzenDropDown>
 | 
					            </RadzenDropDown>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            <RadzenText Class="rz-mt-2 rz-my-0" Style="color: var(--rz-text-tertiary-color);">移入数量</RadzenText>
 | 
					            <RadzenText Class="rz-mt-2 rz-my-0" Style="color: var(--rz-text-tertiary-color);">移入数量:</RadzenText>         
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            <RadzenNumeric Min="0" Style="display: block" Max=@channelStock.Quantity Name="Quantity" @bind-Value="removeQuantity" />
 | 
					            <RadzenNumeric Min="0" Style="display: block" Max=@channelStock.Quantity Name="Quantity" @bind-Value="removeQuantity" />
 | 
				
			||||||
        </RadzenStack>
 | 
					        </RadzenStack>
 | 
				
			||||||
    </RadzenStack>
 | 
					    </RadzenStack>
 | 
				
			||||||
    <RadzenStack Orientation="Orientation.Horizontal" JustifyContent="JustifyContent.Center" Gap="0.5rem">
 | 
					    <RadzenStack Orientation="Orientation.Horizontal" JustifyContent="JustifyContent.Center" Gap="0.5rem">
 | 
				
			||||||
        @if (BoxColor.BoxNo == 4)
 | 
					
 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
            @if (status < 3)
 | 
					 | 
				
			||||||
            {
 | 
					 | 
				
			||||||
                <RadzenButton IsBusy="@(status>0)" BusyText="加药中。。。" ButtonStyle="ButtonStyle.Warning" Variant="Variant.Flat" Shade="Shade.Light" Text="加药" Click="@OpenDrawer" Style="width: 120px" />
 | 
					 | 
				
			||||||
                <RadzenButton Visible="@CancleIsEnable" Variant="Variant.Flat" Text="取消" Click="@Cancel" Style="width: 120px" />
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
            @if (status == 3)
 | 
					 | 
				
			||||||
            {
 | 
					 | 
				
			||||||
                <RadzenButton Visible="@CompleteIsEnable" ButtonStyle="ButtonStyle.Warning" Variant="Variant.Flat" Shade="Shade.Light" Text="完成" Click="@AddFinish" Style="width: 120px" />
 | 
					 | 
				
			||||||
                <RadzenButton Visible="@CancleIsEnable" Variant="Variant.Flat" Text="取消" Click="@Cancel" Style="width: 120px" />
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
        else
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
        <RadzenButton Click="@Save" ButtonStyle="ButtonStyle.Success" Variant="Variant.Flat" Text="完成" Style="width: 120px" />
 | 
					        <RadzenButton Click="@Save" ButtonStyle="ButtonStyle.Success" Variant="Variant.Flat" Text="完成" Style="width: 120px" />
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        <RadzenButton Click="@Cancel" Variant="Variant.Flat" Text="取消" Style="width: 120px" />
 | 
					        <RadzenButton Click="@Cancel" Variant="Variant.Flat" Text="取消" Style="width: 120px" />
 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    </RadzenStack>
 | 
					    </RadzenStack>
 | 
				
			||||||
</RadzenStack>
 | 
					</RadzenStack>
 | 
				
			||||||
| 
						 | 
					@ -90,34 +46,17 @@
 | 
				
			||||||
@code {
 | 
					@code {
 | 
				
			||||||
    @inject Radzen.DialogService dialogService;
 | 
					    @inject Radzen.DialogService dialogService;
 | 
				
			||||||
    @inject IChannelListDao channelListDao;
 | 
					    @inject IChannelListDao channelListDao;
 | 
				
			||||||
    @inject IOptions<SettingConfig> setting
 | 
					    @inject IOptions<SettingConfig> setting;
 | 
				
			||||||
    @inject IOptions<DrawerConfig> drawerSetting;
 | 
					 | 
				
			||||||
    @inject NotificationService _message
 | 
					    @inject NotificationService _message
 | 
				
			||||||
    @inject PortUtil PortUtil;
 | 
					    @inject PortUtil PortUtil;
 | 
				
			||||||
    private readonly ILog logger = LogManager.GetLogger(typeof(OrderDetailDialog));
 | 
					    private readonly ILog logger = LogManager.GetLogger(typeof(OrderDetailDialog));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    bool CompleteIsEnable = true;
 | 
					    int removeQuantity;
 | 
				
			||||||
    bool CancleIsEnable = true;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    int removeQuantity = 0;
 | 
					 | 
				
			||||||
    int status;
 | 
					    int status;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    string[] AllDrawerNos;
 | 
					    int[] DrawerNos;
 | 
				
			||||||
    string[] DrawerNos;
 | 
					    int SelectedDrawerNo = 0;
 | 
				
			||||||
    string SelectedDrawerNo = "1-1";
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    //药盒集合
 | 
					 | 
				
			||||||
    List<BoxModel> BoxList = new List<BoxModel>();
 | 
					 | 
				
			||||||
    //药盒颜色集合
 | 
					 | 
				
			||||||
    List<BoxModel> BoxColorList = new List<BoxModel>()
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
            new  BoxModel{BoxNo=1,BoxName=1 },
 | 
					 | 
				
			||||||
            new  BoxModel{BoxNo=2 ,BoxName=1},
 | 
					 | 
				
			||||||
            new  BoxModel{BoxNo=3 ,BoxName=1},
 | 
					 | 
				
			||||||
            new  BoxModel{BoxNo=4 ,BoxName=1}
 | 
					 | 
				
			||||||
        };
 | 
					 | 
				
			||||||
    BoxModel BoxColor = new BoxModel { BoxNo = 1, BoxName = 1 };
 | 
					 | 
				
			||||||
    BoxModel BoxNum;
 | 
					 | 
				
			||||||
    [Parameter] public ChannelStock channelStock { get; set; }
 | 
					    [Parameter] public ChannelStock channelStock { get; set; }
 | 
				
			||||||
    private bool CanTakeDrug = true;
 | 
					    private bool CanTakeDrug = true;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -132,24 +71,18 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    protected override async Task OnInitializedAsync()
 | 
					    protected override async Task OnInitializedAsync()
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        AllDrawerNos = await channelListDao.GetDrawerNumForRemove(channelStock);
 | 
					        DrawerNos = await channelListDao.GetDrawerNumForRemove(channelStock);
 | 
				
			||||||
        if (AllDrawerNos != null && AllDrawerNos.Count() > 0)
 | 
					        if (DrawerNos != null && DrawerNos.Count() > 0)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            DrawerNos = AllDrawerNos.Where(d => d.EndsWith('白')).ToArray();
 | 
					 | 
				
			||||||
            if (DrawerNos != null && DrawerNos.Length > 0)
 | 
					 | 
				
			||||||
            SelectedDrawerNo = DrawerNos[0];
 | 
					            SelectedDrawerNo = DrawerNos[0];
 | 
				
			||||||
            // var result = await channelListDao.GetChannelStockByDrug(channelStock, SelectedDrawerNo, 8, 0);
 | 
					            // var result = await channelListDao.GetChannelStockByDrug(channelStock, SelectedDrawerNo, 8, 0);
 | 
				
			||||||
            // selectedDrawerData = result.Desserts;
 | 
					            // selectedDrawerData = result.Desserts;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        else
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
            DrawerNos = new string[] { "无库位" };
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
        base.OnInitializedAsync();
 | 
					        base.OnInitializedAsync();
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    // void RestData()
 | 
					    void RestData()
 | 
				
			||||||
    // {
 | 
					    {
 | 
				
			||||||
        // PortUtil.speechSynthesizer.SpeakAsyncCancelAll();
 | 
					        // PortUtil.speechSynthesizer.SpeakAsyncCancelAll();
 | 
				
			||||||
        // this.status = 0;
 | 
					        // this.status = 0;
 | 
				
			||||||
        // data.ForEach(it =>
 | 
					        // data.ForEach(it =>
 | 
				
			||||||
| 
						 | 
					@ -160,70 +93,6 @@
 | 
				
			||||||
        // });
 | 
					        // });
 | 
				
			||||||
        // this.WeightFinnalQuantity = new int[9];
 | 
					        // this.WeightFinnalQuantity = new int[9];
 | 
				
			||||||
        // DrawerNoColNoList.Clear();
 | 
					        // DrawerNoColNoList.Clear();
 | 
				
			||||||
    // }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    private async Task OnColorChanged(object value)
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
        BoxColor = (BoxModel)value;
 | 
					 | 
				
			||||||
        if (AllDrawerNos != null && AllDrawerNos.Length > 0 && AllDrawerNos[0] != "无库位")
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
            if ((((BoxModel)value).BoxNo) == 3)
 | 
					 | 
				
			||||||
            {
 | 
					 | 
				
			||||||
                DrawerNos = AllDrawerNos.Where(d => !(d.EndsWith('白')) && !(d.EndsWith('绿')) && !(d.Contains('-'))).ToArray();
 | 
					 | 
				
			||||||
                if (DrawerNos != null && DrawerNos.Length > 0 && DrawerNos[0] != "无库位")
 | 
					 | 
				
			||||||
                {
 | 
					 | 
				
			||||||
                    SelectedDrawerNo = DrawerNos[0];
 | 
					 | 
				
			||||||
                }
 | 
					 | 
				
			||||||
                else
 | 
					 | 
				
			||||||
                {
 | 
					 | 
				
			||||||
                    SelectedDrawerNo = "无库位";
 | 
					 | 
				
			||||||
                }
 | 
					 | 
				
			||||||
                await InvokeAsync(StateHasChanged);
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
            else
 | 
					 | 
				
			||||||
            {
 | 
					 | 
				
			||||||
                if ((((BoxModel)value).BoxNo) == 1)
 | 
					 | 
				
			||||||
                {
 | 
					 | 
				
			||||||
                    DrawerNos = AllDrawerNos.Where(d => d.EndsWith('白')).ToArray();
 | 
					 | 
				
			||||||
                    if (DrawerNos != null && DrawerNos.Length > 0 && DrawerNos[0] != "无库位")
 | 
					 | 
				
			||||||
                    {
 | 
					 | 
				
			||||||
                        SelectedDrawerNo = DrawerNos[0];
 | 
					 | 
				
			||||||
                    }
 | 
					 | 
				
			||||||
                    else
 | 
					 | 
				
			||||||
                    {
 | 
					 | 
				
			||||||
                        SelectedDrawerNo = "无库位";
 | 
					 | 
				
			||||||
                    }
 | 
					 | 
				
			||||||
                    await InvokeAsync(StateHasChanged);
 | 
					 | 
				
			||||||
                }
 | 
					 | 
				
			||||||
                else if ((((BoxModel)value).BoxNo) == 2)
 | 
					 | 
				
			||||||
                {
 | 
					 | 
				
			||||||
                    DrawerNos = AllDrawerNos.Where(d => d.EndsWith('绿')).ToArray();
 | 
					 | 
				
			||||||
                    if (DrawerNos != null && DrawerNos.Length > 0 && DrawerNos[0] != "无库位")
 | 
					 | 
				
			||||||
                    {
 | 
					 | 
				
			||||||
                        SelectedDrawerNo = DrawerNos[0];
 | 
					 | 
				
			||||||
                    }
 | 
					 | 
				
			||||||
                    else
 | 
					 | 
				
			||||||
                    {
 | 
					 | 
				
			||||||
                        SelectedDrawerNo = "无库位";
 | 
					 | 
				
			||||||
                    }
 | 
					 | 
				
			||||||
                    await InvokeAsync(StateHasChanged);
 | 
					 | 
				
			||||||
                }
 | 
					 | 
				
			||||||
                else if ((((BoxModel)value).BoxNo) == 4)
 | 
					 | 
				
			||||||
                {
 | 
					 | 
				
			||||||
                    DrawerNos = AllDrawerNos.Where(d => !(d.EndsWith('绿')) && !(d.EndsWith('白')) && d.Contains('-')).ToArray();
 | 
					 | 
				
			||||||
                    if (DrawerNos != null && DrawerNos.Length > 0 && DrawerNos[0] != "无库位")
 | 
					 | 
				
			||||||
                    {
 | 
					 | 
				
			||||||
                        SelectedDrawerNo = DrawerNos[0];
 | 
					 | 
				
			||||||
                    }
 | 
					 | 
				
			||||||
                    else
 | 
					 | 
				
			||||||
                    {
 | 
					 | 
				
			||||||
                        SelectedDrawerNo = "无库位";
 | 
					 | 
				
			||||||
                    }
 | 
					 | 
				
			||||||
                    await InvokeAsync(StateHasChanged);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                }
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    void Cancel()
 | 
					    void Cancel()
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
| 
						 | 
					@ -238,17 +107,16 @@
 | 
				
			||||||
            _message.Notify(new NotificationMessage { Severity = NotificationSeverity.Error, Summary = "提示", Detail = "请输入移入数量", Duration = 4000 });
 | 
					            _message.Notify(new NotificationMessage { Severity = NotificationSeverity.Error, Summary = "提示", Detail = "请输入移入数量", Duration = 4000 });
 | 
				
			||||||
            return;
 | 
					            return;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        if (string.IsNullOrEmpty(SelectedDrawerNo) || SelectedDrawerNo == "无库位")
 | 
					        if (SelectedDrawerNo<=0)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            _message.Notify(new NotificationMessage { Severity = NotificationSeverity.Error, Summary = "提示", Detail = "无可移入的药盒", Duration = 4000 });
 | 
					            _message.Notify(new NotificationMessage { Severity = NotificationSeverity.Error, Summary = "提示", Detail = "无可移入的药箱", Duration = 4000 });
 | 
				
			||||||
            return;            
 | 
					            return;            
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        SelectedDrawerNo = SelectedDrawerNo == "急诊药盒" ? "99-1" : SelectedDrawerNo == "恢复室药盒" ? "111-1" : SelectedDrawerNo;
 | 
					 | 
				
			||||||
        var b = await channelListDao.BoxRemoveFinish(channelStock, SelectedDrawerNo,removeQuantity);
 | 
					        var b = await channelListDao.BoxRemoveFinish(channelStock, SelectedDrawerNo,removeQuantity);
 | 
				
			||||||
        if (!b)
 | 
					        if (!b)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            _message.Notify(new NotificationMessage { Severity = NotificationSeverity.Error, Summary = "提示", Detail = $"数据保存失败", Duration = 4000 });
 | 
					            _message.Notify(new NotificationMessage { Severity = NotificationSeverity.Error, Summary = "提示", Detail = $"数据保存失败", Duration = 4000 });
 | 
				
			||||||
            logger.Error($"药盒移出保存数据失败,数据{JsonConvert.SerializeObject(channelStock)}");
 | 
					            logger.Error($"药箱移出保存数据失败,数据{JsonConvert.SerializeObject(channelStock)}");
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        else
 | 
					        else
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
| 
						 | 
					@ -260,139 +128,4 @@
 | 
				
			||||||
        //重置状态
 | 
					        //重置状态
 | 
				
			||||||
        this.RestData();
 | 
					        this.RestData();
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					 | 
				
			||||||
    int drawerNo = 1;
 | 
					 | 
				
			||||||
    int colNo = 1;
 | 
					 | 
				
			||||||
    int[] BeforeQuantity = new int[9];
 | 
					 | 
				
			||||||
    int[] AfterQuantity = new int[9];
 | 
					 | 
				
			||||||
    async Task OpenDrawer()
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
        this.status = 1;
 | 
					 | 
				
			||||||
        PortUtil.PowerOn();
 | 
					 | 
				
			||||||
        var selectSpl = SelectedDrawerNo.Split('-');
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        if (selectSpl != null && selectSpl.Count() > 0)
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
            drawerNo = Convert.ToInt32(selectSpl[0]);
 | 
					 | 
				
			||||||
            colNo = Convert.ToInt32(selectSpl[1]);
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
        await Task.Delay(200);
 | 
					 | 
				
			||||||
        PortUtil.DrawerNo = drawerNo;
 | 
					 | 
				
			||||||
        // 根据抽屉类型来决定打开前是否需要查询数量
 | 
					 | 
				
			||||||
        var promiseUtil = new PromiseUtil<object>();
 | 
					 | 
				
			||||||
        await promiseUtil.taskAsyncLoop(500, null, async (data, next, stop) =>
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
            try
 | 
					 | 
				
			||||||
            {
 | 
					 | 
				
			||||||
                if (this.status == 0)
 | 
					 | 
				
			||||||
                {
 | 
					 | 
				
			||||||
                    stop();
 | 
					 | 
				
			||||||
                }
 | 
					 | 
				
			||||||
                // 开启抽屉
 | 
					 | 
				
			||||||
                else if (this.status == 1)
 | 
					 | 
				
			||||||
                {
 | 
					 | 
				
			||||||
                    // 判断是否为单支抽屉
 | 
					 | 
				
			||||||
                    if (drawerSetting.Value.single != null && drawerSetting.Value.single.Contains(this.drawerNo))
 | 
					 | 
				
			||||||
                    {
 | 
					 | 
				
			||||||
                        byte[] quantity = await PortUtil.CheckQuantityByDrawer(this.drawerNo);
 | 
					 | 
				
			||||||
                        BeforeQuantity = quantity.Select(it => Convert.ToInt32(it)).ToArray().Skip(3).Take(9).ToArray();
 | 
					 | 
				
			||||||
                        logger.Info($"单支抽屉,开抽屉前检测数量【{string.Join(",", BeforeQuantity)}】");
 | 
					 | 
				
			||||||
                    }
 | 
					 | 
				
			||||||
                    var b = await PortUtil.OpenDrawerStatus(this.drawerNo);
 | 
					 | 
				
			||||||
                    if (b)
 | 
					 | 
				
			||||||
                    {
 | 
					 | 
				
			||||||
                        PortUtil.speechSynthesizer.SpeakAsyncCancelAll();
 | 
					 | 
				
			||||||
                        PortUtil.SpeakAsync($"{drawerNo}号抽屉已经打开,请,加药");
 | 
					 | 
				
			||||||
                        this.status = 2;
 | 
					 | 
				
			||||||
                        PortUtil.Operate = true;
 | 
					 | 
				
			||||||
                        next();
 | 
					 | 
				
			||||||
                    }
 | 
					 | 
				
			||||||
                    else
 | 
					 | 
				
			||||||
                    {
 | 
					 | 
				
			||||||
                        _message.Notify(
 | 
					 | 
				
			||||||
                            new NotificationMessage { Severity = NotificationSeverity.Error, Summary = "提示", Detail = $"抽屉【{drawerNo}】打开失败,请检测硬件", Duration = 4000 }
 | 
					 | 
				
			||||||
                        );
 | 
					 | 
				
			||||||
                        logger.Info($"抽屉打开失败");
 | 
					 | 
				
			||||||
                        RestData();
 | 
					 | 
				
			||||||
                        PortUtil.Operate = false;
 | 
					 | 
				
			||||||
                        stop();
 | 
					 | 
				
			||||||
                    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                }
 | 
					 | 
				
			||||||
                // 检测状态
 | 
					 | 
				
			||||||
                else if (this.status == 2)
 | 
					 | 
				
			||||||
                {
 | 
					 | 
				
			||||||
                    // 查询抽屉是否为关闭状态
 | 
					 | 
				
			||||||
                    var b = await PortUtil.CheckDrawerStatus2(drawerNo);
 | 
					 | 
				
			||||||
                    // 关闭则改变状态并终止循环
 | 
					 | 
				
			||||||
                    if (b)
 | 
					 | 
				
			||||||
                    {
 | 
					 | 
				
			||||||
                        PortUtil.speechSynthesizer.SpeakAsyncCancelAll();
 | 
					 | 
				
			||||||
                        PortUtil.SpeakAsync($"加药完成,请,点击完成按钮");
 | 
					 | 
				
			||||||
                        this.status = 3;
 | 
					 | 
				
			||||||
                        PortUtil.Operate = false;
 | 
					 | 
				
			||||||
                        stop();
 | 
					 | 
				
			||||||
                    }
 | 
					 | 
				
			||||||
                    else
 | 
					 | 
				
			||||||
                    {
 | 
					 | 
				
			||||||
                        if (drawerSetting.Value.single != null && drawerSetting.Value.single.Contains(this.drawerNo))
 | 
					 | 
				
			||||||
                        {
 | 
					 | 
				
			||||||
                            byte[] quantity = await PortUtil.CheckQuantityByDrawer(this.drawerNo);
 | 
					 | 
				
			||||||
                            AfterQuantity = quantity.Select(it => Convert.ToInt32(it)).ToArray().Skip(3).Take(9).ToArray();
 | 
					 | 
				
			||||||
                            logger.Info($"单支抽屉,抽屉未关检测数量【{string.Join(",", AfterQuantity)}】");
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                            removeQuantity = this.AfterQuantity[colNo - 1] - this.BeforeQuantity[colNo - 1];
 | 
					 | 
				
			||||||
                            await InvokeAsync(StateHasChanged);
 | 
					 | 
				
			||||||
                        }
 | 
					 | 
				
			||||||
                        next(); // continue iteration
 | 
					 | 
				
			||||||
                    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                }
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
            catch (Exception e)
 | 
					 | 
				
			||||||
            {
 | 
					 | 
				
			||||||
                logger.Info($"抽屉加药发生错误,{e.Message}");
 | 
					 | 
				
			||||||
                _message.Notify(
 | 
					 | 
				
			||||||
                    new NotificationMessage { Severity = NotificationSeverity.Error, Summary = "提示", Detail = $"发生错误,{e.Message}", Duration = 4000 }
 | 
					 | 
				
			||||||
                );
 | 
					 | 
				
			||||||
                if (drawerSetting.Value.single != null && drawerSetting.Value.single.Contains(this.drawerNo))
 | 
					 | 
				
			||||||
                {
 | 
					 | 
				
			||||||
                    PortUtil.PowerOff();
 | 
					 | 
				
			||||||
                }
 | 
					 | 
				
			||||||
                RestData();
 | 
					 | 
				
			||||||
                stop();
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
        });
 | 
					 | 
				
			||||||
        PortUtil.PowerOff();
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    void RestData()
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
        PortUtil.PowerOff();
 | 
					 | 
				
			||||||
        PortUtil.speechSynthesizer.SpeakAsyncCancelAll();
 | 
					 | 
				
			||||||
        this.status = 0;
 | 
					 | 
				
			||||||
        // this.BeforeQuantity = new int[9];
 | 
					 | 
				
			||||||
        // this.AfterQuantity = new int[9];
 | 
					 | 
				
			||||||
        // currentCol = 0;
 | 
					 | 
				
			||||||
        // ColNos.Clear();
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    async Task AddFinish()
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
        if (removeQuantity <= 0)
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
            _message.Notify(new NotificationMessage { Severity = NotificationSeverity.Error, Summary = "提示", Detail = "请输入移入数量", Duration = 4000 });
 | 
					 | 
				
			||||||
            return;
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
        // 保存账册、操作记录
 | 
					 | 
				
			||||||
        var b = await channelListDao.RemoveDrugToDrawerFinish(SelectedDrawerNo, channelStock, removeQuantity);
 | 
					 | 
				
			||||||
        if (!b)
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
            _message.Notify(new NotificationMessage { Severity = NotificationSeverity.Error, Summary = "提示", Detail = $"数据保存失败", Duration = 4000 });
 | 
					 | 
				
			||||||
            logger.Error($"抽屉加药保存数据库失败,数据{JsonConvert.SerializeObject(channelStock)}");
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
        //重置状态
 | 
					 | 
				
			||||||
        this.RestData();
 | 
					 | 
				
			||||||
        // 关闭弹窗
 | 
					 | 
				
			||||||
        dialogService.Close(true);
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -9,78 +9,39 @@
 | 
				
			||||||
<RadzenStack Gap="1rem" Orientation="Orientation.Vertical" Style="height: 100%;">
 | 
					<RadzenStack Gap="1rem" Orientation="Orientation.Vertical" Style="height: 100%;">
 | 
				
			||||||
    <RadzenStack>
 | 
					    <RadzenStack>
 | 
				
			||||||
        <RadzenStack class="rz-p-4 rz-border-radius-1" Style="border: var(--rz-grid-cell-border)" Orientation="Orientation.Horizontal" Gap="1rem">
 | 
					        <RadzenStack class="rz-p-4 rz-border-radius-1" Style="border: var(--rz-grid-cell-border)" Orientation="Orientation.Horizontal" Gap="1rem">
 | 
				
			||||||
            @*<RadzenText Class="rz-mt-2 rz-my-0" Style="color: var(--rz-text-tertiary-color);">药名:</RadzenText> 
 | 
					            <RadzenText Class="rz-mt-2 rz-my-0" Style="color: var(--rz-text-tertiary-color);">@myText.DrugName:</RadzenText>
 | 
				
			||||||
            <RadzenText  Class="rz-text-truncate"><b>@(channelStock.Drug.DrugName)</b></RadzenText>
 | 
					            <RadzenText  Class="rz-text-truncate"><b>@(channelStock.Drug.DrugName)</b></RadzenText>
 | 
				
			||||||
            <RadzenText Class="rz-mt-2 rz-my-0" Style="color: var(--rz-text-tertiary-color);">规格:</RadzenText>
 | 
					            <RadzenText Class="rz-mt-2 rz-my-0" Style="color: var(--rz-text-tertiary-color);">@myText.Spec:</RadzenText>
 | 
				
			||||||
            <RadzenText TextStyle="TextStyle.Body1" Class="rz-text-truncate"><b>@(channelStock.Drug.DrugSpec)</b></RadzenText>
 | 
					            <RadzenText TextStyle="TextStyle.Body1" Class="rz-text-truncate"><b>@(channelStock.Drug.DrugSpec)</b></RadzenText>
 | 
				
			||||||
            <RadzenText Class="rz-mt-2 rz-my-0" Style="color: var(--rz-text-tertiary-color);">批次:</RadzenText>
 | 
					            <RadzenText Class="rz-mt-2 rz-my-0" Style="color: var(--rz-text-tertiary-color);">@myText.Batch:</RadzenText>
 | 
				
			||||||
            <RadzenText TextStyle="TextStyle.Body1" Class="rz-text-truncate"><b>@(channelStock.ManuNo)</b></RadzenText>
 | 
					            <RadzenText TextStyle="TextStyle.Body1" Class="rz-text-truncate"><b>@(channelStock.ManuNo)</b></RadzenText>
 | 
				
			||||||
            <RadzenText Class="rz-mt-2 rz-my-0" Style="color: var(--rz-text-tertiary-color);">效期:</RadzenText>
 | 
					            <RadzenText Class="rz-mt-2 rz-my-0" Style="color: var(--rz-text-tertiary-color);">@myText.Expiration:</RadzenText>
 | 
				
			||||||
            <RadzenText TextStyle="TextStyle.Body1" Class="rz-text-truncate"><b>@(channelStock.EffDate)</b></RadzenText>
 | 
					            <RadzenText TextStyle="TextStyle.Body1" Class="rz-text-truncate"><b>@(channelStock.EffDate)</b></RadzenText>
 | 
				
			||||||
            <RadzenText Class="rz-mt-2 rz-my-0" Style="color: var(--rz-text-tertiary-color);">库存:</RadzenText>
 | 
					            <RadzenText Class="rz-mt-2 rz-my-0" Style="color: var(--rz-text-tertiary-color);">@myText.Inventory:</RadzenText>
 | 
				
			||||||
            <RadzenText TextStyle="TextStyle.Body1" Class="rz-text-truncate"><b>@(channelStock.Quantity)</b></RadzenText>
 | 
					            <RadzenText TextStyle="TextStyle.Body1" Class="rz-text-truncate"><b>@(channelStock.Quantity)</b></RadzenText>
 | 
				
			||||||
            <RadzenText Class="rz-mt-2 rz-my-0" Style="color: var(--rz-text-tertiary-color);">交换药盒:</RadzenText> *@
 | 
					            <RadzenText Class="rz-mt-2 rz-my-0" Style="color: var(--rz-text-tertiary-color);">@myText.ReplaceDrug:</RadzenText>
 | 
				
			||||||
            <div style="text-align: left;width:15vw">
 | 
					            <RadzenDropDown @bind-Value="SelectedDrawerNo" Data="@DrawerNos" Style="display: block;" Change="@(args => SelectedDrawerChange(args))" Name="DropDownChangeEvent">
 | 
				
			||||||
                <div class="rz-text-h6 rz-mb-0">药品名称</div>
 | 
					 | 
				
			||||||
                @(channelStock.Drug.DrugName)
 | 
					 | 
				
			||||||
            </div>
 | 
					 | 
				
			||||||
            <div style="text-align: left;width:6vw">
 | 
					 | 
				
			||||||
                <div class="rz-text-h6 rz-mb-0">规格</div>
 | 
					 | 
				
			||||||
                @(channelStock.Drug.DrugSpec)
 | 
					 | 
				
			||||||
            </div>
 | 
					 | 
				
			||||||
            <div style="text-align: left;width:8vw;">
 | 
					 | 
				
			||||||
                <div class="rz-text-h6 rz-mb-0">批次</div>
 | 
					 | 
				
			||||||
                @(channelStock.ManuNo)
 | 
					 | 
				
			||||||
            </div>
 | 
					 | 
				
			||||||
            <div style="text-align: left;width:8vw;">
 | 
					 | 
				
			||||||
                <div class="rz-text-h6 rz-mb-0">效期</div>
 | 
					 | 
				
			||||||
                @(channelStock.EffDate)
 | 
					 | 
				
			||||||
            </div>
 | 
					 | 
				
			||||||
            <div style="text-align: left;width:4vw;">
 | 
					 | 
				
			||||||
                <div class="rz-text-h6 rz-mb-0">库存</div>
 | 
					 | 
				
			||||||
                @(channelStock.Quantity)
 | 
					 | 
				
			||||||
            </div>
 | 
					 | 
				
			||||||
            <div class="rz-text-h6 rz-mb-0;width:10vw">
 | 
					 | 
				
			||||||
                交换药盒
 | 
					 | 
				
			||||||
                <RadzenDropDownDataGrid AllowVirtualization="true" Name="BoxColorList" TValue="BoxModel" Data="@BoxColorList" Value="BoxColor" Style="width: 8vw;"
 | 
					 | 
				
			||||||
                                        ValueChanged="@((args) => OnColorChanged(args))" AllowFiltering="false"
 | 
					 | 
				
			||||||
                                        AllowFilteringByAllStringColumns="true" TextProperty="药箱号">
 | 
					 | 
				
			||||||
                    <Template>
 | 
					 | 
				
			||||||
                        @((context as BoxModel).BoxNo == 1 ? "白" : (context as BoxModel).BoxNo == 2 ? "绿" : "非常规")
 | 
					 | 
				
			||||||
                    </Template>
 | 
					 | 
				
			||||||
                    <Columns>
 | 
					 | 
				
			||||||
                        <RadzenDropDownDataGridColumn Property="BoxNo" Title="药箱颜色" Sortable="false" />
 | 
					 | 
				
			||||||
                    </Columns>
 | 
					 | 
				
			||||||
                </RadzenDropDownDataGrid>
 | 
					 | 
				
			||||||
                <RadzenDropDown @bind-Value="SelectedDrawerNo" Data="@DrawerNos" Style="width:10vw" Change="@(args => SelectedDrawerChange(args))" Name="DropDownChangeEvent">
 | 
					 | 
				
			||||||
              
 | 
					              
 | 
				
			||||||
                    <RadzenText TextStyle="TextStyle.Subtitle2" class="mb-0">@(SelectedDrawerNo)</RadzenText>
 | 
					                    <RadzenText TextStyle="TextStyle.Subtitle2" class="mb-0">@(SelectedDrawerNo)</RadzenText>
 | 
				
			||||||
           
 | 
					           
 | 
				
			||||||
            </RadzenDropDown>
 | 
					            </RadzenDropDown>
 | 
				
			||||||
            </div>
 | 
					
 | 
				
			||||||
        </RadzenStack>
 | 
					        </RadzenStack>
 | 
				
			||||||
        <RadzenDataGrid @ref="grid" Data="@selectedDrawerData" AllowAlternatingRows="true" LoadData="@LoadData" IsLoading="@isLoading" Count="@count" EmptyText="无数据"
 | 
					        <RadzenDataGrid @ref="grid" Data="@selectedDrawerData" AllowAlternatingRows="true" LoadData="@LoadData" IsLoading="@isLoading" Count="@count" EmptyText="@myText.NoDate"
 | 
				
			||||||
                        CellClick="@((DataGridCellMouseEventArgs<ChannelStock> args) => OnCellClick(args))" 
 | 
					                        CellClick="@((DataGridCellMouseEventArgs<ChannelStock> args) => OnCellClick(args))" 
 | 
				
			||||||
                            AllowPaging="true" PageSize="10" PagerHorizontalAlign="HorizontalAlign.Left" ShowPagingSummary="true" PagingSummaryFormat="{0}/{1} 共{2}条数据">
 | 
					                            AllowPaging="true" PageSize="10" PagerHorizontalAlign="HorizontalAlign.Left" ShowPagingSummary="true" PagingSummaryFormat="{0}/{1} 共{2}条数据">
 | 
				
			||||||
            <Columns>
 | 
					            <Columns>
 | 
				
			||||||
                <RadzenDataGridColumn Property="DrawerNo" Title="药盒号">
 | 
					                <RadzenDataGridColumn Property="DrawerNo" Title="@myText.Box">
 | 
				
			||||||
                    <Template Context="DrawerNo">
 | 
					 | 
				
			||||||
                        @(DrawerNo.DrawerNo == 99 ? "急诊药盒" : DrawerNo.DrawerNo == 111 ? "恢复室药盒" :
 | 
					 | 
				
			||||||
                            DrawerNo.DrawerNo == 31 ? "胃镜药盒" :
 | 
					 | 
				
			||||||
                            DrawerNo.DrawerNo == 32 ? "导管药盒" :
 | 
					 | 
				
			||||||
                            DrawerNo.DrawerNo == 33 ? "生殖药盒" :
 | 
					 | 
				
			||||||
                            DrawerNo.DrawerNo == 34 ? "妇门药盒" : $"{DrawerNo.DrawerNo}-{(DrawerNo.ColNo == 1 ? '白' : '绿')}")
 | 
					 | 
				
			||||||
                    </Template>
 | 
					 | 
				
			||||||
                </RadzenDataGridColumn>
 | 
					                </RadzenDataGridColumn>
 | 
				
			||||||
                <RadzenDataGridColumn Property="Drug.DrugName" Title="药品" />
 | 
					                <RadzenDataGridColumn Property="Drug.DrugName" Title="@myText.DrugName" />
 | 
				
			||||||
                <RadzenDataGridColumn Property="Drug.DrugSpec" Title="规格" />
 | 
					                <RadzenDataGridColumn Property="Drug.DrugSpec" Title="@myText.Spec" />
 | 
				
			||||||
                <RadzenDataGridColumn Property="ChannelStock.ManuNo" Title="批次" />
 | 
					                <RadzenDataGridColumn Property="ChannelStock.ManuNo" Title="@myText.Batch" />
 | 
				
			||||||
                <RadzenDataGridColumn Property="ChannelStock.EffDate" Title="效期" />
 | 
					                <RadzenDataGridColumn Property="ChannelStock.EffDate" Title="@myText.Expiration" />
 | 
				
			||||||
                <RadzenDataGridColumn Property="Quantity" Title="库存" />
 | 
					                <RadzenDataGridColumn Property="Quantity" Title="@myText.Inventory" />
 | 
				
			||||||
                <RadzenDataGridColumn MinWidth="100px" Title="交换数量" Property="AddQuantity">
 | 
					                <RadzenDataGridColumn MinWidth="100px" Title="@myText.ExchangeNum" Property="AddQuantity">
 | 
				
			||||||
                    <EditTemplate Context="cs">
 | 
					                    <EditTemplate Context="cs">
 | 
				
			||||||
                            <RadzenNumeric Min="0" Style="display: block" Max=@cs.Quantity Name="Quantity" @bind-Value=@cs.AddQuantity />
 | 
					                            <RadzenNumeric Min="0" Style="display: block" Max=@cs.Quantity Name="Quantity" @bind-Value=@cs.AddQuantity />
 | 
				
			||||||
                        <RadzenNumericRangeValidator Style="position: absolute;z-index: 9999;" Min="0" Text="请填写正确的交换数量" Component="Quantity" Popup="true" />
 | 
					                        <RadzenNumericRangeValidator Style="position: absolute;z-index: 9999;" Min="0" Text="@myText.InputCorrectNum" Component="Quantity" Popup="true" />
 | 
				
			||||||
                    </EditTemplate>
 | 
					                    </EditTemplate>
 | 
				
			||||||
            </RadzenDataGridColumn>
 | 
					            </RadzenDataGridColumn>
 | 
				
			||||||
            </Columns>
 | 
					            </Columns>
 | 
				
			||||||
| 
						 | 
					@ -89,9 +50,9 @@
 | 
				
			||||||
    </RadzenStack>
 | 
					    </RadzenStack>
 | 
				
			||||||
    <RadzenStack Orientation="Orientation.Horizontal" JustifyContent="JustifyContent.Center" Gap="0.5rem">
 | 
					    <RadzenStack Orientation="Orientation.Horizontal" JustifyContent="JustifyContent.Center" Gap="0.5rem">
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        <RadzenButton Click="@Save" ButtonStyle="ButtonStyle.Success" Variant="Variant.Flat" Text="完成" Style="width: 120px" />
 | 
					        <RadzenButton Click="@Save" ButtonStyle="ButtonStyle.Success" Variant="Variant.Flat" Text="@myText.SaveSet" Style="width: 120px" />
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        <RadzenButton Click="@Cancel" Variant="Variant.Flat" Text="取消" Style="width: 120px" />
 | 
					        <RadzenButton Click="@Cancel" Variant="Variant.Flat" Text="@myText.Cancel" Style="width: 120px" />
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    </RadzenStack>
 | 
					    </RadzenStack>
 | 
				
			||||||
</RadzenStack>
 | 
					</RadzenStack>
 | 
				
			||||||
| 
						 | 
					@ -100,17 +61,17 @@
 | 
				
			||||||
@inject Radzen.DialogService dialogService;
 | 
					@inject Radzen.DialogService dialogService;
 | 
				
			||||||
    @inject IChannelListDao channelListDao;
 | 
					    @inject IChannelListDao channelListDao;
 | 
				
			||||||
    @inject IOptions<SettingConfig> setting;
 | 
					    @inject IOptions<SettingConfig> setting;
 | 
				
			||||||
    @inject IOptions<DrawerConfig> drawerSetting;
 | 
					 | 
				
			||||||
    @inject NotificationService _message
 | 
					    @inject NotificationService _message
 | 
				
			||||||
    @inject PortUtil PortUtil;
 | 
					    @inject PortUtil PortUtil;
 | 
				
			||||||
 | 
					    @inject Toolbelt.Blazor.I18nText.I18nText I18nText;
 | 
				
			||||||
 | 
					    private I18nText.local myText = new I18nText.local();
 | 
				
			||||||
    private readonly ILog logger = LogManager.GetLogger(typeof(OrderDetailDialog));
 | 
					    private readonly ILog logger = LogManager.GetLogger(typeof(OrderDetailDialog));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    bool CompleteIsEnable = true;
 | 
					 | 
				
			||||||
    bool CancleIsEnable = true;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    int status;
 | 
					    int status;
 | 
				
			||||||
    bool isLoading;
 | 
					    bool isLoading;
 | 
				
			||||||
    int count;
 | 
					    int count;
 | 
				
			||||||
 | 
					    int[] DrawerNos;
 | 
				
			||||||
 | 
					    int SelectedDrawerNo=0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    [Parameter] public ChannelStock channelStock { get; set; }
 | 
					    [Parameter] public ChannelStock channelStock { get; set; }
 | 
				
			||||||
    private bool CanTakeDrug = true;
 | 
					    private bool CanTakeDrug = true;
 | 
				
			||||||
| 
						 | 
					@ -125,141 +86,37 @@
 | 
				
			||||||
    //开抽屉前操作标识
 | 
					    //开抽屉前操作标识
 | 
				
			||||||
    List<string> DrawerNoColNoList = new List<string>();
 | 
					    List<string> DrawerNoColNoList = new List<string>();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    //药盒集合
 | 
					 | 
				
			||||||
    List<BoxModel> BoxList = new List<BoxModel>();
 | 
					 | 
				
			||||||
    BoxModel BoxColor = new BoxModel { BoxNo = 1, BoxName = 1 };
 | 
					 | 
				
			||||||
    string[] AllDrawerNos;
 | 
					 | 
				
			||||||
    string[] DrawerNos;
 | 
					 | 
				
			||||||
    string SelectedDrawerNo = "1-1";
 | 
					 | 
				
			||||||
    //药盒颜色集合
 | 
					 | 
				
			||||||
    List<BoxModel> BoxColorList = new List<BoxModel>()
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
            new  BoxModel{BoxNo=1,BoxName=1 },
 | 
					 | 
				
			||||||
            new  BoxModel{BoxNo=2 ,BoxName=1},
 | 
					 | 
				
			||||||
            new  BoxModel{BoxNo=3 ,BoxName=1}
 | 
					 | 
				
			||||||
        };
 | 
					 | 
				
			||||||
    protected override async Task OnInitializedAsync()
 | 
					    protected override async Task OnInitializedAsync()
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        // AllDrawerNos = await channelListDao.GetDrawerNum(channelStock);
 | 
					        myText = await I18nText.GetTextTableAsync<I18nText.local>(this);
 | 
				
			||||||
        // if (AllDrawerNos != null && AllDrawerNos.Count() > 0)
 | 
					        DrawerNos = await channelListDao.GetDrawerNum(channelStock);
 | 
				
			||||||
        // {
 | 
					        await  base.OnInitializedAsync();
 | 
				
			||||||
        //     if (DrawerNos == null || DrawerNos.Length <= 0)
 | 
					 | 
				
			||||||
        //     {
 | 
					 | 
				
			||||||
        //         DrawerNos = new string[] { "无库位" };
 | 
					 | 
				
			||||||
        //     }
 | 
					 | 
				
			||||||
        // }
 | 
					 | 
				
			||||||
        AllDrawerNos = await channelListDao.GetDrawerNumForRemove(channelStock);
 | 
					 | 
				
			||||||
        if (AllDrawerNos != null && AllDrawerNos.Count() > 0)
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
            DrawerNos = AllDrawerNos.Where(d => d.EndsWith('白')).ToArray();
 | 
					 | 
				
			||||||
            if (DrawerNos != null && DrawerNos.Length > 0)
 | 
					 | 
				
			||||||
                SelectedDrawerNo = DrawerNos[0];
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
        else
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
            DrawerNos = new string[] { "无库位" };
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
        base.OnInitializedAsync();
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    async Task LoadData(LoadDataArgs args)
 | 
					    async Task LoadData(LoadDataArgs args)
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        isLoading = true;
 | 
					        isLoading = true;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if (DrawerNos != null && !DrawerNos.Contains("无库位") && DrawerNos.Count() > 0)
 | 
					        if (DrawerNos != null && DrawerNos.Count() > 0)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            SelectedDrawerNo = DrawerNos[0];
 | 
					            SelectedDrawerNo = DrawerNos[0];
 | 
				
			||||||
            var result = await channelListDao.GetChannelStockByDrug(channelStock, SelectedDrawerNo, args.Top, args.Skip);
 | 
					            var result = await channelListDao.GetChannelStockByDrug(channelStock, SelectedDrawerNo, args.Top, args.Skip);
 | 
				
			||||||
            selectedDrawerData = result.Desserts;
 | 
					            selectedDrawerData = result.Desserts;
 | 
				
			||||||
            if (selectedDrawerData != null && selectedDrawerData.Count > 0)
 | 
					 | 
				
			||||||
            {
 | 
					 | 
				
			||||||
                if (selectedDrawerData[0].DrawerNo <= 30)
 | 
					 | 
				
			||||||
                {
 | 
					 | 
				
			||||||
                    if (selectedDrawerData[0].ColNo == 1)
 | 
					 | 
				
			||||||
                    {
 | 
					 | 
				
			||||||
                        BoxColor = BoxColorList[0];
 | 
					 | 
				
			||||||
                    }
 | 
					 | 
				
			||||||
                    else
 | 
					 | 
				
			||||||
                    {
 | 
					 | 
				
			||||||
                        BoxColor = BoxColorList[1];
 | 
					 | 
				
			||||||
                    }
 | 
					 | 
				
			||||||
                }
 | 
					 | 
				
			||||||
                else
 | 
					 | 
				
			||||||
                {
 | 
					 | 
				
			||||||
                    BoxColor = BoxColorList[2];
 | 
					 | 
				
			||||||
                }
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
        count = result.TotalDesserts;
 | 
					        count = result.TotalDesserts;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        isLoading = false;
 | 
					        isLoading = false;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					    void RestData()
 | 
				
			||||||
    private async Task OnColorChanged(object value)
 | 
					 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        BoxColor = (BoxModel)value;
 | 
					        // PortUtil.speechSynthesizer.SpeakAsyncCancelAll();
 | 
				
			||||||
        if (AllDrawerNos != null && AllDrawerNos.Length > 0 && AllDrawerNos[0] != "无库位")
 | 
					        // this.status = 0;
 | 
				
			||||||
        {
 | 
					        // data.ForEach(it =>
 | 
				
			||||||
            if (BoxColor.BoxNo == 3)
 | 
					 | 
				
			||||||
            {
 | 
					 | 
				
			||||||
                DrawerNos = AllDrawerNos.Where(d => !(d.EndsWith('白')) && !(d.EndsWith('绿')) && !(d.Contains('-'))).ToArray();
 | 
					 | 
				
			||||||
                if (DrawerNos != null && DrawerNos.Length > 0 && DrawerNos[0] != "无库位")
 | 
					 | 
				
			||||||
                {
 | 
					 | 
				
			||||||
                    SelectedDrawerNo = DrawerNos[0];
 | 
					 | 
				
			||||||
                    await SelectedDrawerChange(SelectedDrawerNo);
 | 
					 | 
				
			||||||
                }
 | 
					 | 
				
			||||||
                else
 | 
					 | 
				
			||||||
                {
 | 
					 | 
				
			||||||
                    SelectedDrawerNo = "无库位";
 | 
					 | 
				
			||||||
                }
 | 
					 | 
				
			||||||
                await InvokeAsync(StateHasChanged);
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
            else
 | 
					 | 
				
			||||||
            {
 | 
					 | 
				
			||||||
                if (BoxColor.BoxNo == 1)
 | 
					 | 
				
			||||||
                {
 | 
					 | 
				
			||||||
                    DrawerNos = AllDrawerNos.Where(d => d.EndsWith('白')).ToArray();
 | 
					 | 
				
			||||||
                    if (DrawerNos != null && DrawerNos.Length > 0 && DrawerNos[0] != "无库位")
 | 
					 | 
				
			||||||
                    {
 | 
					 | 
				
			||||||
                        SelectedDrawerNo = DrawerNos[0];
 | 
					 | 
				
			||||||
                        await SelectedDrawerChange(SelectedDrawerNo);
 | 
					 | 
				
			||||||
                    }
 | 
					 | 
				
			||||||
                    else
 | 
					 | 
				
			||||||
                    {
 | 
					 | 
				
			||||||
                        SelectedDrawerNo = "无库位";
 | 
					 | 
				
			||||||
                    }
 | 
					 | 
				
			||||||
                    await InvokeAsync(StateHasChanged);
 | 
					 | 
				
			||||||
                }
 | 
					 | 
				
			||||||
                else if (BoxColor.BoxNo == 2)
 | 
					 | 
				
			||||||
                {
 | 
					 | 
				
			||||||
                    DrawerNos = AllDrawerNos.Where(d => d.EndsWith('绿')).ToArray();
 | 
					 | 
				
			||||||
                    if (DrawerNos != null && DrawerNos.Length > 0 && DrawerNos[0] != "无库位")
 | 
					 | 
				
			||||||
                    {
 | 
					 | 
				
			||||||
                        SelectedDrawerNo = DrawerNos[0];
 | 
					 | 
				
			||||||
                        await SelectedDrawerChange(SelectedDrawerNo);
 | 
					 | 
				
			||||||
                    }
 | 
					 | 
				
			||||||
                    else
 | 
					 | 
				
			||||||
                    {
 | 
					 | 
				
			||||||
                        SelectedDrawerNo = "无库位";
 | 
					 | 
				
			||||||
                    }
 | 
					 | 
				
			||||||
                    await InvokeAsync(StateHasChanged);
 | 
					 | 
				
			||||||
                }
 | 
					 | 
				
			||||||
                // else if (BoxColor.BoxNo == 4)
 | 
					 | 
				
			||||||
        // {
 | 
					        // {
 | 
				
			||||||
                //     DrawerNos = AllDrawerNos.Where(d => !(d.EndsWith('绿')) && !(d.EndsWith('白')) && d.Contains('-')).ToArray();
 | 
					        //     it.Status = 0;
 | 
				
			||||||
                //     if (DrawerNos != null && DrawerNos.Length > 0 && DrawerNos[0] != "无库位")
 | 
					        //     it.BeforeQuantity = new int[9];
 | 
				
			||||||
                //     {
 | 
					        //     it.AfterQuantity = new int[9];
 | 
				
			||||||
                //         SelectedDrawerNo = DrawerNos[0];
 | 
					        // });
 | 
				
			||||||
                //         await SelectedDrawerChange(SelectedDrawerNo);
 | 
					        // this.WeightFinnalQuantity = new int[9];
 | 
				
			||||||
                //     }
 | 
					        // DrawerNoColNoList.Clear();
 | 
				
			||||||
                //     else
 | 
					 | 
				
			||||||
                //     {
 | 
					 | 
				
			||||||
                //         SelectedDrawerNo = "无库位";
 | 
					 | 
				
			||||||
                //     }
 | 
					 | 
				
			||||||
                //     await InvokeAsync(StateHasChanged);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                // }
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    void Cancel()
 | 
					    void Cancel()
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
| 
						 | 
					@ -271,20 +128,20 @@
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        if (selectedDrawerData!=null&&selectedDrawerData.Any(cl => cl.AddQuantity != 0 && cl.DrugId != null && cl.ManuNo != null))
 | 
					        if (selectedDrawerData!=null&&selectedDrawerData.Any(cl => cl.AddQuantity != 0 && cl.DrugId != null && cl.ManuNo != null))
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            if (selectedDrawerData.Where(cs => cs.AddQuantity != 0).Sum(cs => cs.AddQuantity) > channelStock.Quantity)
 | 
					            if (selectedDrawerData.Where(cs => cs.AddQuantity != 0).Sum(cs => cs.Quantity) > channelStock.Quantity)
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                _message.Notify(new NotificationMessage { Severity = NotificationSeverity.Warning, Summary = "提示", Detail = $"交换总数量不能大于库存", Duration = 4000 });
 | 
					                _message.Notify(new NotificationMessage { Severity = NotificationSeverity.Warning, Summary = myText.Tips, Detail = $"交换总数量不能大于库存", Duration = 4000 });
 | 
				
			||||||
                return;
 | 
					                return;
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            var b = await channelListDao.BoxReplaceFinish(channelStock,selectedDrawerData.Where(cl => cl.AddQuantity != 0).ToList());
 | 
					            var b = await channelListDao.BoxReplaceFinish(channelStock,selectedDrawerData.Where(cl => cl.AddQuantity != 0).ToList());
 | 
				
			||||||
            if (!b)
 | 
					            if (!b)
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                _message.Notify(new NotificationMessage { Severity = NotificationSeverity.Error, Summary = "提示", Detail = $"数据保存失败", Duration = 4000 });
 | 
					                _message.Notify(new NotificationMessage { Severity = NotificationSeverity.Error, Summary = myText.Tips, Detail = $"数据保存失败", Duration = 4000 });
 | 
				
			||||||
                logger.Error($"药盒药品替换保存数据库失败,数据{JsonConvert.SerializeObject(selectedDrawerData.Where(cl => cl.AddQuantity != 0).ToList())}");
 | 
					                logger.Error($"药箱药品替换保存数据库失败,数据{JsonConvert.SerializeObject(selectedDrawerData.Where(cl => cl.AddQuantity != 0).ToList())}");
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            else
 | 
					            else
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                _message.Notify(new NotificationMessage { Severity = NotificationSeverity.Success, Summary = "提示", Detail = $"交换完成", Duration = 4000 });
 | 
					                _message.Notify(new NotificationMessage { Severity = NotificationSeverity.Success, Summary = myText.Tips, Detail = $"交换完成", Duration = 4000 });
 | 
				
			||||||
                // 关闭弹窗
 | 
					                // 关闭弹窗
 | 
				
			||||||
                dialogService.Close(true);
 | 
					                dialogService.Close(true);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -294,20 +151,14 @@
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        else
 | 
					        else
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            _message.Notify(new NotificationMessage { Severity = NotificationSeverity.Warning, Summary = "提示", Detail = $"无可交换数据或未输入交换数量", Duration = 4000 });
 | 
					            _message.Notify(new NotificationMessage { Severity = NotificationSeverity.Warning, Summary = myText.Tips, Detail = $"无可交换数据或未输入交换数量", Duration = 4000 });
 | 
				
			||||||
            return;
 | 
					            return;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    async Task SelectedDrawerChange(object drawerNo)
 | 
					    async Task SelectedDrawerChange(object drawerNo)
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        if (drawerNo == "无库位")
 | 
					        var result = await channelListDao.GetChannelStockByDrug(channelStock, Convert.ToInt32(drawerNo), 8, 0);
 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
            return;
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
        drawerNo = drawerNo == "急诊药盒" ? "99-1" : drawerNo == "恢复室药盒" ? "111-1" : drawerNo == "胃镜药盒" ? "31-1" : drawerNo == "导管药盒" ? "32-1" : drawerNo == "生殖药盒" ? "33-1" : drawerNo == "妇门药盒" ? "34-1" : drawerNo;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        var result = await channelListDao.GetChannelStockByDrug(channelStock, drawerNo.ToString(), 8, 0);
 | 
					 | 
				
			||||||
        selectedDrawerData = result.Desserts;
 | 
					        selectedDrawerData = result.Desserts;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    int currentCol = 0;
 | 
					    int currentCol = 0;
 | 
				
			||||||
| 
						 | 
					@ -318,15 +169,4 @@
 | 
				
			||||||
        currentCol = args.Data.ColNo;
 | 
					        currentCol = args.Data.ColNo;
 | 
				
			||||||
        grid.EditRow(args.Data);
 | 
					        grid.EditRow(args.Data);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					 | 
				
			||||||
    void RestData()
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
        PortUtil.PowerOff();
 | 
					 | 
				
			||||||
        PortUtil.speechSynthesizer.SpeakAsyncCancelAll();
 | 
					 | 
				
			||||||
        this.status = 0;
 | 
					 | 
				
			||||||
        // this.BeforeQuantity = new int[9];
 | 
					 | 
				
			||||||
        // this.AfterQuantity = new int[9];
 | 
					 | 
				
			||||||
        // currentCol = 0;
 | 
					 | 
				
			||||||
        // ColNos.Clear();
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -2,49 +2,71 @@
 | 
				
			||||||
@using MasaBlazorApp3.Pojo.Config
 | 
					@using MasaBlazorApp3.Pojo.Config
 | 
				
			||||||
 | 
					
 | 
				
			||||||
<RadzenStack Orientation="Orientation.Horizontal" class="col-12 mb-4">
 | 
					<RadzenStack Orientation="Orientation.Horizontal" class="col-12 mb-4">
 | 
				
			||||||
    <div class="col-2 row justify-content-center align-items-center text-center">
 | 
					    <div class="col-12 row justify-content-center align-items-center text-center" style="background: url('/images/box-16.jpg')  no-repeat; background-size: 100% 100%; width: 380px; height:650px">
 | 
				
			||||||
        <div class="row justify-content-around align-items-center" style="height:600px;overflow:auto">
 | 
					        <div class="row justify-content-around align-items-center" style="margin-top: 220px; height: 430px;">
 | 
				
			||||||
            @foreach (var cs in channelStockList)
 | 
					            @foreach (int i in DrawerNos)
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                <RadzenButton class="col-12" Style="margin-bottom:5px" Click="@(() => SelectDrawer((cs.DrawerNo.ToString() + "-" + cs.ColNo.ToString())))" Text="@(cs.DrawerNo==99?"急诊室药盒":cs.DrawerNo==111?"恢复室药盒":cs.DrawerNo==31?"胃镜药盒":cs.DrawerNo==32?"导管药盒":cs.DrawerNo==33?"生殖药盒":cs.DrawerNo==34?"妇门药盒":$"{cs.DrawerNo.ToString() + "-" + (cs.ColNo==1?'白':'绿')}")" Disabled="@(status > 0)" Shade="Shade.Light" Variant="@(drawerNo != (cs.DrawerNo.ToString() + "-" + cs.ColNo.ToString()) ? Variant.Outlined : Variant.Flat)" />
 | 
					                <RadzenButton class="col-5" Click="@(() => SelectDrawer(i))" Text="@i.ToString()" Disabled="@(status > 0)" Shade="Shade.Light" Variant="@(drawerNo != i ? Variant.Outlined : Variant.Flat)" />
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        </div>
 | 
					        </div>
 | 
				
			||||||
    </div>
 | 
					    </div>
 | 
				
			||||||
    <div class="col-10">
 | 
					    <div class="col-9 mb-4">
 | 
				
			||||||
        <RadzenDataList @ref="grid" LoadData="@LoadData" WrapItems="true" Count="@count" IsLoading="@isLoading" style="height:600px;overflow:auto"
 | 
					        @*   <RadzenFieldset Text="">
 | 
				
			||||||
                        Data="@_forecasts" PageSize="6" AllowPaging="false">
 | 
					            <RadzenStack Orientation="Orientation.Horizontal" Gap="1rem">
 | 
				
			||||||
            <Template Context="pd">
 | 
					                <RadzenRow AlignItems="AlignItems.Center">
 | 
				
			||||||
                <RadzenCard Variant="Variant.Outlined" class="rz-p-0" Style="width: 100%;">
 | 
					                    <RadzenColumn Size="12">
 | 
				
			||||||
                    <RadzenRow Gap="0">
 | 
					                        <RadzenButton Size="ButtonSize.Medium" ButtonType="ButtonType.Submit" IsBusy="isLoading" Icon="search" Text="替换药品" />
 | 
				
			||||||
                        <RadzenColumn Size="10">
 | 
					                        <RadzenButton Size="ButtonSize.Medium" Click="reloadGrid" IsBusy="isLoading" Icon="refresh" Text="移出药品" ButtonStyle="ButtonStyle.Warning" />
 | 
				
			||||||
                            <div style="text-align: left;">
 | 
					 | 
				
			||||||
                                <div class="rz-text-h6 rz-mb-0">品名/规格/厂家</div>
 | 
					 | 
				
			||||||
                                @(pd._DrugInfo.DrugNameSpec)
 | 
					 | 
				
			||||||
                            </div>
 | 
					 | 
				
			||||||
                            @* <RadzenText TextStyle="TextStyle.H6" TagName="TagName.H5" class="rz-color-on-secondary-lighter">@(pd._DrugInfo.ToString())</RadzenText> *@
 | 
					 | 
				
			||||||
                    </RadzenColumn>
 | 
					                    </RadzenColumn>
 | 
				
			||||||
                        @*           <RadzenColumn Size="5">
 | 
					 | 
				
			||||||
                            厂家<br />
 | 
					 | 
				
			||||||
                            @(pd._DrugInfo.Manufactory) 
 | 
					 | 
				
			||||||
                        </RadzenColumn> *@
 | 
					 | 
				
			||||||
                        @*<RadzenColumn Size="3">
 | 
					 | 
				
			||||||
                            规格<br />
 | 
					 | 
				
			||||||
                            @(pd._DrugInfo.DrugSpec)
 | 
					 | 
				
			||||||
 <RadzenText TextStyle="TextStyle.H6" TagName="TagName.H5" class="rz-color-on-secondary-lighter">@(pd._DrugInfo.DrugSpec)</RadzenText>
 | 
					 | 
				
			||||||
                        </RadzenColumn> *@
 | 
					 | 
				
			||||||
                        <RadzenColumn Size="1">
 | 
					 | 
				
			||||||
                            <div class="rz-text-h6 rz-mb-0">基数</div>
 | 
					 | 
				
			||||||
                            @(pd.BaseQuantity)
 | 
					 | 
				
			||||||
                            @* <RadzenText TextStyle="TextStyle.H6" TagName="TagName.H5" class="rz-color-on-secondary-lighter">@(pd.BaseQuantity)</RadzenText> *@
 | 
					 | 
				
			||||||
                        </RadzenColumn>
 | 
					 | 
				
			||||||
                        <RadzenColumn Size="1">
 | 
					 | 
				
			||||||
                            <div class="rz-text-h6 rz-mb-0">库存</div>
 | 
					 | 
				
			||||||
                            @(pd.channelStocks.Sum(cs => cs.Quantity))
 | 
					 | 
				
			||||||
                            @* <RadzenText TextStyle="TextStyle.H6" TagName="TagName.H5" class="rz-color-on-secondary-lighter">@(pd.channelStocks.Sum(cs => cs.Quantity))</RadzenText> *@
 | 
					 | 
				
			||||||
                        </RadzenColumn>
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                </RadzenRow>
 | 
					                </RadzenRow>
 | 
				
			||||||
 | 
					            </RadzenStack>
 | 
				
			||||||
 | 
					        </RadzenFieldset> *@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        @* <RadzenDataGrid @ref="grid" AllowRowSelectOnRowClick="@allowRowSelectOnRowClick" AllowFiltering="true" LoadData="@LoadData"
 | 
				
			||||||
 | 
					                        FilterPopupRenderMode="PopupRenderMode.OnDemand" FilterCaseSensitivity="FilterCaseSensitivity.CaseInsensitive"
 | 
				
			||||||
 | 
					                        Data="@orderInfos" ColumnWidth="200px" IsLoading="@isLoading" Count="@count" EmptyText="无数据"
 | 
				
			||||||
 | 
					                        SelectionMode="DataGridSelectionMode.Multiple" @bind-Value=@selectedOrderInfos
 | 
				
			||||||
 | 
					                        AllowPaging="true" PageSize="10" PagerHorizontalAlign="HorizontalAlign.Left" ShowPagingSummary="true" PagingSummaryFormat="{0}/{1} 共{2}条数据">
 | 
				
			||||||
 | 
					            <Columns>
 | 
				
			||||||
 | 
					                <RadzenDataGridColumn Sortable="false" Filterable="false" Width="4rem">
 | 
				
			||||||
 | 
					                    <HeaderTemplate>
 | 
				
			||||||
 | 
					                        <RadzenCheckBox TabIndex="-1" TriState="false" TValue="bool?" InputAttributes="@(new Dictionary<string, object>() { { "aria-label", "Select all items" } })"
 | 
				
			||||||
 | 
					                                        Value="@(selectedOrderInfos == null || selectedOrderInfos?.Any() != true ? false : !orderInfos.All(i => selectedOrderInfos.Contains(i)) ? null : orderInfos.Any(i => selectedOrderInfos.Contains(i)))"
 | 
				
			||||||
 | 
					                                        Change="@(args => selectedOrderInfos = args == true ? orderInfos.ToList() : null)" />
 | 
				
			||||||
 | 
					                    </HeaderTemplate>
 | 
				
			||||||
 | 
					                    <Template Context="data">
 | 
				
			||||||
 | 
					                        <RadzenCheckBox TabIndex="-1" TriState="false" Value="@(selectedOrderInfos != null && selectedOrderInfos.Contains(data))" InputAttributes="@(new Dictionary<string, object>() { { "aria-label", "Select item" } })"
 | 
				
			||||||
 | 
					                                        TValue="bool" Change="@(args => { if (!allowRowSelectOnRowClick) { grid.SelectRow(data); } })" />
 | 
				
			||||||
 | 
					                    </Template>
 | 
				
			||||||
 | 
					                </RadzenDataGridColumn>
 | 
				
			||||||
 | 
					                <RadzenDataGridColumn Property="PatientName" Title="姓名" Sortable="false" Filterable="false" Width="4rem" />
 | 
				
			||||||
 | 
					                <RadzenDataGridColumn Property="Sex" Title="性别" Sortable="false" Filterable="false" Width="2rem" />
 | 
				
			||||||
 | 
					                <RadzenDataGridColumn Property="OrderNo" Title="单号" Sortable="false" Filterable="false" Width="8rem" />
 | 
				
			||||||
 | 
					                <RadzenDataGridColumn Property="Detail.Drug.DrugName" Title="药品名称" FormatString="{0:d}" Sortable="false" Filterable="false" Width="8rem" />
 | 
				
			||||||
 | 
					                <RadzenDataGridColumn Property="Detail.SetManuNo" Title="药品批次" Sortable="false" Filterable="false" Width="8rem" />
 | 
				
			||||||
 | 
					                <RadzenDataGridColumn Property="Detail.Quantity" Title="数量" Sortable="false" Filterable="false" Width="2rem" />
 | 
				
			||||||
 | 
					            </Columns>
 | 
				
			||||||
 | 
					        </RadzenDataGrid> *@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        <RadzenDataList @ref="grid" LoadData="@LoadData" WrapItems="true" Count="@count" IsLoading="@isLoading"
 | 
				
			||||||
 | 
					                        Data="@_forecasts" PageSize="6" AllowPaging="true" PagerHorizontalAlign="HorizontalAlign.Left"
 | 
				
			||||||
 | 
					                        ShowPagingSummary="true" PagingSummaryFormat="{0}/{1} 共{2}条数据">
 | 
				
			||||||
 | 
					            <Template Context="pd">
 | 
				
			||||||
 | 
					                <RadzenCard Variant="Variant.Outlined" class="rz-p-0" Style="width: 100%; overflow: hidden;">
 | 
				
			||||||
 | 
					                    <RadzenRow Gap="0">
 | 
				
			||||||
 | 
					                        <RadzenColumn Size="12" SizeLG="2" class="rz-p-4 product-title">
 | 
				
			||||||
 | 
					                            <RadzenText TextStyle="TextStyle.H6" TagName="TagName.H5" class="rz-color-on-secondary-lighter">@(pd._DrugInfo.DrugName)</RadzenText>
 | 
				
			||||||
 | 
					                        </RadzenColumn>
 | 
				
			||||||
 | 
					                        <RadzenColumn Size="12" SizeLG="3" class="rz-p-4 product-title">
 | 
				
			||||||
 | 
					                            <RadzenText TextStyle="TextStyle.H6" TagName="TagName.H5" class="rz-color-on-secondary-lighter">@(pd._DrugInfo.Manufactory)</RadzenText>
 | 
				
			||||||
 | 
					                        </RadzenColumn>
 | 
				
			||||||
 | 
					                        <RadzenColumn Size="12" SizeLG="2" class="rz-p-4 product-title">
 | 
				
			||||||
 | 
					                            <RadzenText TextStyle="TextStyle.H6" TagName="TagName.H5" class="rz-color-on-secondary-lighter">@(pd._DrugInfo.DrugSpec)</RadzenText>
 | 
				
			||||||
 | 
					                        </RadzenColumn>
 | 
				
			||||||
 | 
					                        <RadzenColumn Size="12" SizeLG="1" class="rz-p-4 product-title">
 | 
				
			||||||
 | 
					                            <RadzenText TextStyle="TextStyle.H6" TagName="TagName.H5" class="rz-color-on-secondary-lighter">@(pd.BaseQuantity)</RadzenText>
 | 
				
			||||||
 | 
					                        </RadzenColumn>
 | 
				
			||||||
                       @*  <RadzenColumn Size="12" SizeLG="2" class="rz-p-4">
 | 
					                       @*  <RadzenColumn Size="12" SizeLG="2" class="rz-p-4">
 | 
				
			||||||
                            <RadzenButton Text="替换药品" Style="width: 100%" Click="@(() => replaceClick(pd))" />
 | 
					                            <RadzenButton Text="替换药品" Style="width: 100%" Click="@(() => replaceClick(pd))" />
 | 
				
			||||||
                        </RadzenColumn>
 | 
					                        </RadzenColumn>
 | 
				
			||||||
| 
						 | 
					@ -61,55 +83,51 @@
 | 
				
			||||||
                                {
 | 
					                                {
 | 
				
			||||||
                                    manuNo = 0;
 | 
					                                    manuNo = 0;
 | 
				
			||||||
                                }
 | 
					                                }
 | 
				
			||||||
                            <RadzenRow Gap="0">
 | 
					                                <RadzenColumn Size="12" SizeLG="7" class="rz-p-4">
 | 
				
			||||||
                                <RadzenColumn Size="12">
 | 
					 | 
				
			||||||
                                    @if (manuInfo != null && manuInfo.ManuNo != null)
 | 
					                                    @if (manuInfo != null && manuInfo.ManuNo != null)
 | 
				
			||||||
                                    {
 | 
					                                    {
 | 
				
			||||||
                                        <RadzenRow Gap="0">
 | 
					                                        <RadzenRow Gap="0">
 | 
				
			||||||
                                            <RadzenColumn Size="3">
 | 
					                                            <RadzenColumn Size="12" SizeMD="6" SizeLG="2">
 | 
				
			||||||
                                                @if (manuNo == 0)
 | 
					                                                @if (manuNo == 0)
 | 
				
			||||||
                                                {
 | 
					                                                {
 | 
				
			||||||
                                                    <RadzenText TextStyle="TextStyle.H6" TagName="TagName.H5" class="rz-mb-0">批次</RadzenText>
 | 
					                                                    <RadzenText TextStyle="TextStyle.H6" TagName="TagName.H5" class="rz-mb-0">@myText.Batch</RadzenText>
 | 
				
			||||||
                                                }
 | 
					                                                }
 | 
				
			||||||
                                                <RadzenText TextStyle="TextStyle.Body2">@(manuInfo.ManuNo)</RadzenText>
 | 
					                                                <RadzenText TextStyle="TextStyle.Body2">@(manuInfo.ManuNo)</RadzenText>
 | 
				
			||||||
                                            </RadzenColumn>
 | 
					                                            </RadzenColumn>
 | 
				
			||||||
                                            <RadzenColumn Size="3">
 | 
					                                            <RadzenColumn Size="12" SizeMD="6" SizeLG="2">
 | 
				
			||||||
                                                @if (manuNo == 0)
 | 
					                                                @if (manuNo == 0)
 | 
				
			||||||
                                                {
 | 
					                                                {
 | 
				
			||||||
                                                    <RadzenText TextStyle="TextStyle.H6" TagName="TagName.H5" class="rz-mb-0">效期</RadzenText>
 | 
					                                                    <RadzenText TextStyle="TextStyle.H6" TagName="TagName.H5" class="rz-mb-0">@myText.Expiration</RadzenText>
 | 
				
			||||||
                                                }
 | 
					                                                }
 | 
				
			||||||
                                                <RadzenText TextStyle="TextStyle.Body2">@(manuInfo.EffDate)</RadzenText>
 | 
					                                                <RadzenText TextStyle="TextStyle.Body2">@(manuInfo.EffDate)</RadzenText>
 | 
				
			||||||
                                            </RadzenColumn>
 | 
					                                            </RadzenColumn>
 | 
				
			||||||
                                            <RadzenColumn Size="1">
 | 
					                                            <RadzenColumn Size="12" SizeMD="6" SizeLG="2">
 | 
				
			||||||
                                                @if (manuNo == 0)
 | 
					                                                @if (manuNo == 0)
 | 
				
			||||||
                                                {
 | 
					                                                {
 | 
				
			||||||
                                                    <RadzenText TextStyle="TextStyle.H6" TagName="TagName.H5" class="rz-mb-0">库存</RadzenText>
 | 
					                                                    <RadzenText TextStyle="TextStyle.H6" TagName="TagName.H5" class="rz-mb-0">@myText.Inventory</RadzenText>
 | 
				
			||||||
                                                }
 | 
					                                                }
 | 
				
			||||||
                                                <RadzenText TextStyle="TextStyle.Body2">@(manuInfo.Quantity)</RadzenText>
 | 
					                                                <RadzenText TextStyle="TextStyle.Body2">@(manuInfo.Quantity)</RadzenText>
 | 
				
			||||||
                                            </RadzenColumn>
 | 
					                                            </RadzenColumn>
 | 
				
			||||||
                                            <RadzenColumn Size="2">
 | 
					                                            <RadzenColumn Size="12" SizeLG="2" class="rz-p-4">
 | 
				
			||||||
                                                <RadzenText style="margin-top:5px;"></RadzenText>
 | 
					                                                <RadzenButton Text="@myText.ReplaceDrug" Style="width: 100%" Click="@(() => replaceClick(manuInfo))" />
 | 
				
			||||||
                                                <RadzenButton Text="替换药品" Style="margin:1px" Click="@(() => replaceClick(manuInfo))" />
 | 
					 | 
				
			||||||
                                            </RadzenColumn>
 | 
					                                            </RadzenColumn>
 | 
				
			||||||
                                            <RadzenColumn Size="2">
 | 
					                                            <RadzenColumn Size="12" SizeLG="2" class="rz-p-4">
 | 
				
			||||||
                                                <RadzenText style="margin-top:5px;"></RadzenText>
 | 
					                                                <RadzenButton Text="@myText.RemoveDrug" Style="width: 100%" Click="@(() => removeClick(manuInfo))" />
 | 
				
			||||||
                                                <RadzenButton Text="移出药品" Click="@(() => removeClick(manuInfo))" />
 | 
					 | 
				
			||||||
                                            </RadzenColumn>
 | 
					                                            </RadzenColumn>
 | 
				
			||||||
 | 
					 | 
				
			||||||
                                        </RadzenRow>
 | 
					                                        </RadzenRow>
 | 
				
			||||||
                                    }
 | 
					                                    }
 | 
				
			||||||
                                    else
 | 
					                                    else
 | 
				
			||||||
                                    {
 | 
					                                    {
 | 
				
			||||||
                                        <RadzenRow Gap="0">
 | 
					                                        <RadzenRow Gap="0">
 | 
				
			||||||
                                            <RadzenColumn Size="5">
 | 
					                                            <RadzenColumn Size="12" SizeMD="6" SizeLG="2">
 | 
				
			||||||
                                                <RadzenText TextStyle="TextStyle.H6" TagName="TagName.H5" class="rz-mb-0">未绑定批次</RadzenText>
 | 
					                                                <RadzenText TextStyle="TextStyle.H6" TagName="TagName.H5" class="rz-mb-0">@myText.NotBind</RadzenText>
 | 
				
			||||||
                                            </RadzenColumn>
 | 
					                                            </RadzenColumn>
 | 
				
			||||||
                                        </RadzenRow>
 | 
					                                        </RadzenRow>
 | 
				
			||||||
                                    }
 | 
					                                    }
 | 
				
			||||||
                                </RadzenColumn>
 | 
					                                </RadzenColumn>
 | 
				
			||||||
 | 
					                            }
 | 
				
			||||||
 | 
					                        }
 | 
				
			||||||
                    </RadzenRow>
 | 
					                    </RadzenRow>
 | 
				
			||||||
                        }
 | 
					 | 
				
			||||||
                    }
 | 
					 | 
				
			||||||
                </RadzenCard>
 | 
					                </RadzenCard>
 | 
				
			||||||
            </Template>
 | 
					            </Template>
 | 
				
			||||||
        </RadzenDataList>
 | 
					        </RadzenDataList>
 | 
				
			||||||
| 
						 | 
					@ -122,6 +140,8 @@
 | 
				
			||||||
    @inject DialogService dialogService;
 | 
					    @inject DialogService dialogService;
 | 
				
			||||||
    @inject Microsoft.Extensions.Options.IOptions<Pojo.Config.SettingConfig> setting;
 | 
					    @inject Microsoft.Extensions.Options.IOptions<Pojo.Config.SettingConfig> setting;
 | 
				
			||||||
    @inject NotificationService _message
 | 
					    @inject NotificationService _message
 | 
				
			||||||
 | 
					    @inject Toolbelt.Blazor.I18nText.I18nText I18nText;
 | 
				
			||||||
 | 
					    private I18nText.local myText = new I18nText.local();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    private IEnumerable<PlanDetails>? _forecasts;
 | 
					    private IEnumerable<PlanDetails>? _forecasts;
 | 
				
			||||||
    bool allowRowSelectOnRowClick = true;
 | 
					    bool allowRowSelectOnRowClick = true;
 | 
				
			||||||
| 
						 | 
					@ -132,16 +152,20 @@
 | 
				
			||||||
    bool isLoading;
 | 
					    bool isLoading;
 | 
				
			||||||
    int count;
 | 
					    int count;
 | 
				
			||||||
    int[] DrawerNos = new int[] { 1, 2, 3, 4, 5, 6, 7, 8 };
 | 
					    int[] DrawerNos = new int[] { 1, 2, 3, 4, 5, 6, 7, 8 };
 | 
				
			||||||
    List<ChannelStock> channelStockList = new();
 | 
					 | 
				
			||||||
    int status = 0;
 | 
					    int status = 0;
 | 
				
			||||||
    string drawerNo = "1-1";
 | 
					    int drawerNo = 1;
 | 
				
			||||||
    string OrderNo;
 | 
					    string OrderNo;
 | 
				
			||||||
    DateTime OrderDate;
 | 
					    DateTime OrderDate;
 | 
				
			||||||
    void SelectDrawer(string strDrawerNoColNo)
 | 
					    void SelectDrawer(int drawerNo)
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        this.drawerNo = strDrawerNoColNo;
 | 
					        this.drawerNo = drawerNo;
 | 
				
			||||||
        grid.Reload();
 | 
					        grid.Reload();
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					    protected override async Task OnInitializedAsync()
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        myText = await I18nText.GetTextTableAsync<I18nText.local>(this);
 | 
				
			||||||
 | 
					        await base.OnInitializedAsync();
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
    // void OnCurrentDateChanged(DateTime args)
 | 
					    // void OnCurrentDateChanged(DateTime args)
 | 
				
			||||||
    // {
 | 
					    // {
 | 
				
			||||||
    //     OrderDate = new DateTime(args.Year, args.Month, args.Day);
 | 
					    //     OrderDate = new DateTime(args.Year, args.Month, args.Day);
 | 
				
			||||||
| 
						 | 
					@ -171,17 +195,15 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        isLoading = false;
 | 
					        isLoading = false;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        channelStockList = await orderInfoDao.GetDrawerNum(setting.Value.boxMachineId);
 | 
					        DrawerNos = await orderInfoDao.GetDrawerNum(setting.Value.boxMachineId);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    //替换按钮
 | 
					    //替换按钮
 | 
				
			||||||
    async Task replaceClick(ChannelStock cs)
 | 
					    async Task replaceClick(ChannelStock cs)
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        if (cs.Quantity > 0)
 | 
					        if (cs.Quantity > 0)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
 | 
					 | 
				
			||||||
            string message = cs.DrawerNo + "-" + (cs.ColNo == 1 ? "白" : "绿") + " 药盒替换药品详情";
 | 
					 | 
				
			||||||
            var b = await dialogService.OpenAsync<BoxReplace>(
 | 
					            var b = await dialogService.OpenAsync<BoxReplace>(
 | 
				
			||||||
                 message,
 | 
					                   $"{cs.DrawerNo}号药箱替换药品详情",
 | 
				
			||||||
                 new Dictionary<string, object>() { { "channelStock", cs } },
 | 
					                 new Dictionary<string, object>() { { "channelStock", cs } },
 | 
				
			||||||
                 new DialogOptions() { Width = "85vw", Resizable = true, Draggable = true, ShowClose = false }
 | 
					                 new DialogOptions() { Width = "85vw", Resizable = true, Draggable = true, ShowClose = false }
 | 
				
			||||||
           );
 | 
					           );
 | 
				
			||||||
| 
						 | 
					@ -194,7 +216,7 @@
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            //库存为0无法操作
 | 
					            //库存为0无法操作
 | 
				
			||||||
            _message.Notify(
 | 
					            _message.Notify(
 | 
				
			||||||
            new NotificationMessage { Severity = NotificationSeverity.Error, Summary = "提示", Detail = $"库存为0无法替换", Duration = 4000 }
 | 
					            new NotificationMessage { Severity = NotificationSeverity.Error, Summary = myText.Tips, Detail = $"库存为0无法替换", Duration = 4000 }
 | 
				
			||||||
        );
 | 
					        );
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
| 
						 | 
					@ -203,9 +225,8 @@
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        if (cs.Quantity > 0)
 | 
					        if (cs.Quantity > 0)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            string message = cs.DrawerNo + "-" + (cs.ColNo == 1 ? "白" : "绿") + " 药盒移动药品详情";
 | 
					 | 
				
			||||||
            var b = await dialogService.OpenAsync<BoxRemoveDialog>(
 | 
					            var b = await dialogService.OpenAsync<BoxRemoveDialog>(
 | 
				
			||||||
                message,
 | 
					                   $"{cs.DrawerNo}号药箱替换药品详情",
 | 
				
			||||||
                 new Dictionary<string, object>() { { "channelStock", cs } },
 | 
					                 new Dictionary<string, object>() { { "channelStock", cs } },
 | 
				
			||||||
                 new DialogOptions() { Width = "85vw", Resizable = true, Draggable = true, ShowClose = false }
 | 
					                 new DialogOptions() { Width = "85vw", Resizable = true, Draggable = true, ShowClose = false }
 | 
				
			||||||
           );
 | 
					           );
 | 
				
			||||||
| 
						 | 
					@ -218,7 +239,7 @@
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            //库存为0无法操作
 | 
					            //库存为0无法操作
 | 
				
			||||||
            _message.Notify(
 | 
					            _message.Notify(
 | 
				
			||||||
            new NotificationMessage { Severity = NotificationSeverity.Error, Summary = "提示", Detail = $"库存为0,没有要移出的药品", Duration = 4000 }
 | 
					            new NotificationMessage { Severity = NotificationSeverity.Error, Summary = myText.Tips, Detail = $"库存为0,没有要移出的药品", Duration = 4000 }
 | 
				
			||||||
        );
 | 
					        );
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,234 +0,0 @@
 | 
				
			||||||
@page "/Box/BoxStockAAA"
 | 
					 | 
				
			||||||
@using MasaBlazorApp3.Pojo.Config
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
<RadzenStack Orientation="Orientation.Horizontal" class="col-12 mb-4">
 | 
					 | 
				
			||||||
    <div class="col-2 row justify-content-center align-items-center text-center">
 | 
					 | 
				
			||||||
        <div class="row justify-content-around align-items-center" style="height:600px;overflow:auto">
 | 
					 | 
				
			||||||
            @foreach (var cs in channelStockList)
 | 
					 | 
				
			||||||
            {
 | 
					 | 
				
			||||||
                <RadzenButton class="col-12" Style="margin-bottom:5px" Click="@(() => SelectDrawer((cs.DrawerNo.ToString() + "-" + cs.ColNo.ToString())))" Text="@(cs.DrawerNo==99?"急诊室药盒":cs.DrawerNo==111?"恢复室药盒":cs.DrawerNo==31?"胃镜药盒":cs.DrawerNo==32?"导管药盒":cs.DrawerNo==33?"生殖药盒":cs.DrawerNo==34?"妇门药盒":$"{cs.DrawerNo.ToString() + "-" + (cs.ColNo==1?'白':'绿')}")" Disabled="@(status > 0)" Shade="Shade.Light" Variant="@(drawerNo != (cs.DrawerNo.ToString() + "-" + cs.ColNo.ToString()) ? Variant.Outlined : Variant.Flat)" />
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
        </div>
 | 
					 | 
				
			||||||
    </div>
 | 
					 | 
				
			||||||
    <div class="col-10">
 | 
					 | 
				
			||||||
        <RadzenDataGrid @ref="grid"
 | 
					 | 
				
			||||||
                        IsLoading="@isLoading"
 | 
					 | 
				
			||||||
                        RowRender="@RowRender"
 | 
					 | 
				
			||||||
                        EmptyText="无数据"
 | 
					 | 
				
			||||||
                        Data="@_forecasts"
 | 
					 | 
				
			||||||
                        AllowColumnResize="true" AllowAlternatingRows="false"
 | 
					 | 
				
			||||||
                        SelectionMode="DataGridSelectionMode.Single"
 | 
					 | 
				
			||||||
                        ExpandMode="DataGridExpandMode.Single">
 | 
					 | 
				
			||||||
            <Template Context="di">
 | 
					 | 
				
			||||||
                <RadzenDataGrid Data="@di.Stocks" EmptyText="无数据">
 | 
					 | 
				
			||||||
                    <Columns>
 | 
					 | 
				
			||||||
                        @* <RadzenDataGridColumn Title="库位" Property="DrawerNo">
 | 
					 | 
				
			||||||
                            <Template Context="s">
 | 
					 | 
				
			||||||
                                @s.DrawerNo - @s.ColNo
 | 
					 | 
				
			||||||
                            </Template>
 | 
					 | 
				
			||||||
                        </RadzenDataGridColumn> *@
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                        <RadzenDataGridColumn Title="批次" Property="ManuNo"></RadzenDataGridColumn>
 | 
					 | 
				
			||||||
                        <RadzenDataGridColumn Title="效期" Property="EffDate">
 | 
					 | 
				
			||||||
                            <Template Context="s">
 | 
					 | 
				
			||||||
                                @{
 | 
					 | 
				
			||||||
                                    DateTime dateTime;
 | 
					 | 
				
			||||||
                                    bool success = DateTime.TryParse(s.EffDate, out dateTime);
 | 
					 | 
				
			||||||
                                    @s.EffDate
 | 
					 | 
				
			||||||
                                }
 | 
					 | 
				
			||||||
                            </Template>
 | 
					 | 
				
			||||||
                        </RadzenDataGridColumn>
 | 
					 | 
				
			||||||
                        <RadzenDataGridColumn Title="数量" Property="Quantity">
 | 
					 | 
				
			||||||
                        </RadzenDataGridColumn>
 | 
					 | 
				
			||||||
                    </Columns>
 | 
					 | 
				
			||||||
                </RadzenDataGrid>
 | 
					 | 
				
			||||||
            </Template>
 | 
					 | 
				
			||||||
            <Columns>
 | 
					 | 
				
			||||||
                <RadzenDataGridColumn Frozen="true" Width="200px" Title="药品名称" Property="DrugName"></RadzenDataGridColumn>
 | 
					 | 
				
			||||||
                <RadzenDataGridColumn Title="规格" Property="DrugSpec"></RadzenDataGridColumn>
 | 
					 | 
				
			||||||
                <RadzenDataGridColumn Title="基数" Property="BoxBaseQuantity">
 | 
					 | 
				
			||||||
                    <Template Context="s">
 | 
					 | 
				
			||||||
                        @s.BoxBaseQuantity
 | 
					 | 
				
			||||||
                    </Template>
 | 
					 | 
				
			||||||
                </RadzenDataGridColumn>
 | 
					 | 
				
			||||||
                <RadzenDataGridColumn Title="总库存" Property="BoxBaseQuantity">
 | 
					 | 
				
			||||||
                    <Template Context="s">
 | 
					 | 
				
			||||||
                        @s.StockQuantity
 | 
					 | 
				
			||||||
                    </Template>
 | 
					 | 
				
			||||||
                </RadzenDataGridColumn>
 | 
					 | 
				
			||||||
            </Columns>
 | 
					 | 
				
			||||||
        </RadzenDataGrid>
 | 
					 | 
				
			||||||
    </div>
 | 
					 | 
				
			||||||
</RadzenStack>
 | 
					 | 
				
			||||||
@code {
 | 
					 | 
				
			||||||
    @inject IOrderInfoDao orderInfoDao;
 | 
					 | 
				
			||||||
    @inject IChannelListDao channelListDao;
 | 
					 | 
				
			||||||
    @inject DialogService dialogService;
 | 
					 | 
				
			||||||
    @inject Microsoft.Extensions.Options.IOptions<Pojo.Config.SettingConfig> setting;
 | 
					 | 
				
			||||||
    @inject NotificationService _message
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    @inject IDrugInfoDao drugInfoDao;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    private IEnumerable<DrugInfo>? _forecasts;
 | 
					 | 
				
			||||||
    bool allowRowSelectOnRowClick = true;
 | 
					 | 
				
			||||||
    // IEnumerable<DrugManuNo> drugManuNos;
 | 
					 | 
				
			||||||
    // IList<DrugManuNo> selectedDrugManuNos;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    RadzenDataGrid<DrugInfo> grid;
 | 
					 | 
				
			||||||
    // RadzenDataGrid<DrugManuNo> gridManuNo;
 | 
					 | 
				
			||||||
    bool isLoading;
 | 
					 | 
				
			||||||
    int count;
 | 
					 | 
				
			||||||
    int[] DrawerNos = new int[] { 1, 2, 3, 4, 5, 6, 7, 8 };
 | 
					 | 
				
			||||||
    List<ChannelStock> channelStockList = new();
 | 
					 | 
				
			||||||
    int status = 0;
 | 
					 | 
				
			||||||
    string drawerNo = "1-1";
 | 
					 | 
				
			||||||
    string OrderNo;
 | 
					 | 
				
			||||||
    DateTime OrderDate;
 | 
					 | 
				
			||||||
    async Task SelectDrawer(string strDrawerNoColNo)
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
        this.drawerNo = strDrawerNoColNo;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        BoxModel boxModel = new BoxModel();
 | 
					 | 
				
			||||||
        boxModel.BoxName = 1;
 | 
					 | 
				
			||||||
        boxModel.BoxNo = 1;
 | 
					 | 
				
			||||||
        // grid.Reload();
 | 
					 | 
				
			||||||
        if (drawerNo != null)
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
            string[] strArr = drawerNo.Split('-');
 | 
					 | 
				
			||||||
            boxModel.BoxName = Convert.ToInt32(strArr[0]);
 | 
					 | 
				
			||||||
            boxModel.BoxNo = Convert.ToInt32(strArr[1]);
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
        var result = await drugInfoDao.GetAllDrugAndStockByBox(boxModel);
 | 
					 | 
				
			||||||
        _forecasts = result;
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    // void OnCurrentDateChanged(DateTime args)
 | 
					 | 
				
			||||||
    // {
 | 
					 | 
				
			||||||
    //     OrderDate = new DateTime(args.Year, args.Month, args.Day);
 | 
					 | 
				
			||||||
    // }
 | 
					 | 
				
			||||||
    //重置
 | 
					 | 
				
			||||||
    async Task reloadGrid()
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
        OrderNo = "";
 | 
					 | 
				
			||||||
        OrderDate = DateTime.MinValue;
 | 
					 | 
				
			||||||
        await grid.Reload();
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    protected override async Task OnInitializedAsync()
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
        await base.OnInitializedAsync();
 | 
					 | 
				
			||||||
        isLoading = true;
 | 
					 | 
				
			||||||
        BoxModel boxModel = new BoxModel();
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        boxModel.BoxName = 1;
 | 
					 | 
				
			||||||
        boxModel.BoxNo = 1;
 | 
					 | 
				
			||||||
        isLoading = true;
 | 
					 | 
				
			||||||
        if (drawerNo != null)
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
            string[] strArr = drawerNo.Split('-');
 | 
					 | 
				
			||||||
            boxModel.BoxName = Convert.ToInt32(strArr[0]);
 | 
					 | 
				
			||||||
            boxModel.BoxNo = Convert.ToInt32(strArr[1]);
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
        var result = await drugInfoDao.GetAllDrugAndStockByBox(boxModel);// await channelListDao.GetBoxDrugInfo(drawerNo, args.Top, args.Skip);
 | 
					 | 
				
			||||||
        // Update the Data property
 | 
					 | 
				
			||||||
        _forecasts = result;
 | 
					 | 
				
			||||||
        // Update the count
 | 
					 | 
				
			||||||
        //count = result.TotalDesserts;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        isLoading = false;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        channelStockList = await orderInfoDao.GetDrawerNum(setting.Value.boxMachineId);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        isLoading = false;
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    protected override async Task OnAfterRenderAsync(bool firstRender)
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
        base.OnAfterRender(firstRender);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        if (firstRender)
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
            await grid.ExpandRows(grid.PagedView.Where(di => di.Stocks.Count > 0));
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    void RowRender(RowRenderEventArgs<DrugInfo> args)
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
        args.Expandable = args.Data.Stocks.Count > 0;
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    //确认
 | 
					 | 
				
			||||||
    async Task Confirm()
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
        // orderInfoDao.CheckOrderInfo(selectedOrderInfos, drawerNo);
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    async Task LoadData(LoadDataArgs args)
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
        BoxModel boxModel = new BoxModel();
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        boxModel.BoxName = 1;
 | 
					 | 
				
			||||||
        boxModel.BoxNo = 1;
 | 
					 | 
				
			||||||
        isLoading = true;
 | 
					 | 
				
			||||||
        if (drawerNo != null)
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
            string[] strArr = drawerNo.Split(',');
 | 
					 | 
				
			||||||
            boxModel.BoxName = Convert.ToInt32(strArr[0]);
 | 
					 | 
				
			||||||
            boxModel.BoxNo = Convert.ToInt32(strArr[1]);
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
        var result = await drugInfoDao.GetAllDrugAndStockByBox(boxModel);// await channelListDao.GetBoxDrugInfo(drawerNo, args.Top, args.Skip);
 | 
					 | 
				
			||||||
        // Update the Data property
 | 
					 | 
				
			||||||
        _forecasts = result;
 | 
					 | 
				
			||||||
        // Update the count
 | 
					 | 
				
			||||||
        //count = result.TotalDesserts;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        isLoading = false;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        channelStockList = await orderInfoDao.GetDrawerNum(setting.Value.boxMachineId);
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    //替换按钮
 | 
					 | 
				
			||||||
    async Task replaceClick(ChannelStock cs)
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
        if (cs.Quantity > 0)
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
            var b = await dialogService.OpenAsync<BoxReplace>(
 | 
					 | 
				
			||||||
                   $"{cs.DrawerNo}号药盒替换药品详情",
 | 
					 | 
				
			||||||
                 new Dictionary<string, object>() { { "channelStock", cs } },
 | 
					 | 
				
			||||||
                 new DialogOptions() { Width = "85vw", Resizable = true, Draggable = true, ShowClose = false }
 | 
					 | 
				
			||||||
           );
 | 
					 | 
				
			||||||
            if (b)
 | 
					 | 
				
			||||||
            {
 | 
					 | 
				
			||||||
                await reloadGrid();
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
        else
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
            //库存为0无法操作
 | 
					 | 
				
			||||||
            _message.Notify(
 | 
					 | 
				
			||||||
            new NotificationMessage { Severity = NotificationSeverity.Error, Summary = "提示", Detail = $"库存为0无法替换", Duration = 4000 }
 | 
					 | 
				
			||||||
        );
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    //移除按钮
 | 
					 | 
				
			||||||
    async Task removeClick(ChannelStock cs)
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
        if (cs.Quantity > 0)
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
            var b = await dialogService.OpenAsync<BoxRemoveDialog>(
 | 
					 | 
				
			||||||
                   $"{cs.DrawerNo}号药盒替换药品详情",
 | 
					 | 
				
			||||||
                 new Dictionary<string, object>() { { "channelStock", cs } },
 | 
					 | 
				
			||||||
                 new DialogOptions() { Width = "85vw", Resizable = true, Draggable = true, ShowClose = false }
 | 
					 | 
				
			||||||
           );
 | 
					 | 
				
			||||||
            if (b)
 | 
					 | 
				
			||||||
            {
 | 
					 | 
				
			||||||
                await reloadGrid();
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
        else
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
            //库存为0无法操作
 | 
					 | 
				
			||||||
            _message.Notify(
 | 
					 | 
				
			||||||
            new NotificationMessage { Severity = NotificationSeverity.Error, Summary = "提示", Detail = $"库存为0,没有要移出的药品", Duration = 4000 }
 | 
					 | 
				
			||||||
        );
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
| 
						 | 
					@ -1,212 +0,0 @@
 | 
				
			||||||
@page "/Box/BoxStockAA"
 | 
					 | 
				
			||||||
@using MasaBlazorApp3.Pojo.Config
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
<RadzenStack Orientation="Orientation.Horizontal" class="col-12 mb-4">
 | 
					 | 
				
			||||||
    <div class="col-2 row justify-content-center align-items-center text-center">
 | 
					 | 
				
			||||||
        <div class="row justify-content-around align-items-center" style="height:600px;overflow:auto">
 | 
					 | 
				
			||||||
            @foreach (var cs in channelStockList)
 | 
					 | 
				
			||||||
            {
 | 
					 | 
				
			||||||
                <RadzenButton class="col-12" Style="margin-bottom:5px" Click="@(() => SelectDrawer((cs.DrawerNo.ToString() + "-" + cs.ColNo.ToString())))" Text="@(cs.DrawerNo==99?"急诊室药盒":cs.DrawerNo==111?"恢复室药盒":cs.DrawerNo==31?"胃镜药盒":cs.DrawerNo==32?"导管药盒":cs.DrawerNo==33?"生殖药盒":cs.DrawerNo==34?"妇门药盒":$"{cs.DrawerNo.ToString() + "-" + (cs.ColNo==1?'白':'绿')}")" Disabled="@(status > 0)" Shade="Shade.Light" Variant="@(drawerNo != (cs.DrawerNo.ToString() + "-" + cs.ColNo.ToString()) ? Variant.Outlined : Variant.Flat)" />
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
        </div>
 | 
					 | 
				
			||||||
    </div>
 | 
					 | 
				
			||||||
    <div class="col-10">
 | 
					 | 
				
			||||||
        <RadzenDataList @ref="grid" LoadData="@LoadData" WrapItems="true" Count="@count" IsLoading="@isLoading" style="height:600px;overflow:auto"
 | 
					 | 
				
			||||||
                        Data="@_forecasts" PageSize="6" AllowPaging="true" PagerHorizontalAlign="HorizontalAlign.Left"
 | 
					 | 
				
			||||||
                        ShowPagingSummary="true" PagingSummaryFormat="{0}/{1} 共{2}条数据">
 | 
					 | 
				
			||||||
            <Template Context="pd">
 | 
					 | 
				
			||||||
                <RadzenCard Variant="Variant.Outlined" class="rz-p-0" Style="width: 100%;">
 | 
					 | 
				
			||||||
                    <RadzenRow Gap="0">
 | 
					 | 
				
			||||||
                        <RadzenColumn Size="2">
 | 
					 | 
				
			||||||
                            <RadzenText TextStyle="TextStyle.H6" TagName="TagName.H5" class="rz-color-on-secondary-lighter">@(pd._DrugInfo.DrugName)</RadzenText>
 | 
					 | 
				
			||||||
                        </RadzenColumn>
 | 
					 | 
				
			||||||
                        <RadzenColumn Size="5">
 | 
					 | 
				
			||||||
                            <RadzenText TextStyle="TextStyle.H6" TagName="TagName.H5" class="rz-color-on-secondary-lighter">@(pd._DrugInfo.Manufactory)</RadzenText>
 | 
					 | 
				
			||||||
                        </RadzenColumn>
 | 
					 | 
				
			||||||
                        <RadzenColumn Size="3">
 | 
					 | 
				
			||||||
                            <RadzenText TextStyle="TextStyle.H6" TagName="TagName.H5" class="rz-color-on-secondary-lighter">@(pd._DrugInfo.DrugSpec)</RadzenText>
 | 
					 | 
				
			||||||
                        </RadzenColumn>
 | 
					 | 
				
			||||||
                        <RadzenColumn Size="1">
 | 
					 | 
				
			||||||
                            <RadzenText TextStyle="TextStyle.H6" TagName="TagName.H5" class="rz-color-on-secondary-lighter">@(pd.BaseQuantity)</RadzenText>
 | 
					 | 
				
			||||||
                        </RadzenColumn>
 | 
					 | 
				
			||||||
                        <RadzenColumn Size="1">
 | 
					 | 
				
			||||||
                            <RadzenText TextStyle="TextStyle.H6" TagName="TagName.H5" class="rz-color-on-secondary-lighter">@(pd.channelStocks.Sum(cs => cs.Quantity))</RadzenText>
 | 
					 | 
				
			||||||
                        </RadzenColumn>
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                    </RadzenRow>
 | 
					 | 
				
			||||||
                    @*  <RadzenColumn Size="12" SizeLG="2" class="rz-p-4">
 | 
					 | 
				
			||||||
                            <RadzenButton Text="替换药品" Style="width: 100%" Click="@(() => replaceClick(pd))" />
 | 
					 | 
				
			||||||
                        </RadzenColumn>
 | 
					 | 
				
			||||||
                        <RadzenColumn Size="12" SizeLG="2" class="rz-p-4">
 | 
					 | 
				
			||||||
                            <RadzenButton Text="移出药品" Style="width: 100%" Click="@(()=>removeClick(pd))" />
 | 
					 | 
				
			||||||
                        </RadzenColumn> *@
 | 
					 | 
				
			||||||
                    @if (pd.channelStocks != null && pd.channelStocks.Count > 0)
 | 
					 | 
				
			||||||
                    {
 | 
					 | 
				
			||||||
                        for (int i = 0; i < pd.channelStocks.Count; i++)
 | 
					 | 
				
			||||||
                        {
 | 
					 | 
				
			||||||
                            var manuInfo = pd.channelStocks[i];
 | 
					 | 
				
			||||||
                            var manuNo = 1;
 | 
					 | 
				
			||||||
                            if (i == 0)
 | 
					 | 
				
			||||||
                            {
 | 
					 | 
				
			||||||
                                manuNo = 0;
 | 
					 | 
				
			||||||
                            }
 | 
					 | 
				
			||||||
                            <RadzenRow Gap="0">
 | 
					 | 
				
			||||||
                                <RadzenColumn Size="12">
 | 
					 | 
				
			||||||
                                    @if (manuInfo != null && manuInfo.ManuNo != null)
 | 
					 | 
				
			||||||
                                    {
 | 
					 | 
				
			||||||
                                        <RadzenRow Gap="0">
 | 
					 | 
				
			||||||
                                            <RadzenColumn Size="3">
 | 
					 | 
				
			||||||
                                                @if (manuNo == 0)
 | 
					 | 
				
			||||||
                                                {
 | 
					 | 
				
			||||||
                                                    <RadzenText TextStyle="TextStyle.H6" TagName="TagName.H5" class="rz-mb-0">批次</RadzenText>
 | 
					 | 
				
			||||||
                                                }
 | 
					 | 
				
			||||||
                                                <RadzenText TextStyle="TextStyle.Body2">@(manuInfo.ManuNo)</RadzenText>
 | 
					 | 
				
			||||||
                                            </RadzenColumn>
 | 
					 | 
				
			||||||
                                            <RadzenColumn Size="3">
 | 
					 | 
				
			||||||
                                                @if (manuNo == 0)
 | 
					 | 
				
			||||||
                                                {
 | 
					 | 
				
			||||||
                                                    <RadzenText TextStyle="TextStyle.H6" TagName="TagName.H5" class="rz-mb-0">效期</RadzenText>
 | 
					 | 
				
			||||||
                                                }
 | 
					 | 
				
			||||||
                                                <RadzenText TextStyle="TextStyle.Body2">@(manuInfo.EffDate)</RadzenText>
 | 
					 | 
				
			||||||
                                            </RadzenColumn>
 | 
					 | 
				
			||||||
                                            <RadzenColumn Size="1">
 | 
					 | 
				
			||||||
                                                @if (manuNo == 0)
 | 
					 | 
				
			||||||
                                                {
 | 
					 | 
				
			||||||
                                                    <RadzenText TextStyle="TextStyle.H6" TagName="TagName.H5" class="rz-mb-0">库存</RadzenText>
 | 
					 | 
				
			||||||
                                                }
 | 
					 | 
				
			||||||
                                                <RadzenText TextStyle="TextStyle.Body2">@(manuInfo.Quantity)</RadzenText>
 | 
					 | 
				
			||||||
                                            </RadzenColumn>
 | 
					 | 
				
			||||||
                                            <RadzenColumn Size="2">
 | 
					 | 
				
			||||||
                                                <RadzenText style="margin-top:5px;"></RadzenText>
 | 
					 | 
				
			||||||
                                                <RadzenButton Text="替换药品" Style="margin:1px" Click="@(() => replaceClick(manuInfo))" />
 | 
					 | 
				
			||||||
                                            </RadzenColumn>
 | 
					 | 
				
			||||||
                                            <RadzenColumn Size="2">
 | 
					 | 
				
			||||||
                                                <RadzenText style="margin-top:5px;"></RadzenText>
 | 
					 | 
				
			||||||
                                                <RadzenButton Text="移出药品" Click="@(() => removeClick(manuInfo))" />
 | 
					 | 
				
			||||||
                                            </RadzenColumn>
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                                        </RadzenRow>
 | 
					 | 
				
			||||||
                                    }
 | 
					 | 
				
			||||||
                                    else
 | 
					 | 
				
			||||||
                                    {
 | 
					 | 
				
			||||||
                                        <RadzenRow Gap="0">
 | 
					 | 
				
			||||||
                                            <RadzenColumn Size="5">
 | 
					 | 
				
			||||||
                                                <RadzenText TextStyle="TextStyle.H6" TagName="TagName.H5" class="rz-mb-0">未绑定批次</RadzenText>
 | 
					 | 
				
			||||||
                                            </RadzenColumn>
 | 
					 | 
				
			||||||
                                        </RadzenRow>
 | 
					 | 
				
			||||||
                                    }
 | 
					 | 
				
			||||||
                                </RadzenColumn>
 | 
					 | 
				
			||||||
                            </RadzenRow>
 | 
					 | 
				
			||||||
                        }
 | 
					 | 
				
			||||||
                    }
 | 
					 | 
				
			||||||
                </RadzenCard>
 | 
					 | 
				
			||||||
            </Template>
 | 
					 | 
				
			||||||
        </RadzenDataList>
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    </div>
 | 
					 | 
				
			||||||
</RadzenStack>
 | 
					 | 
				
			||||||
@code {
 | 
					 | 
				
			||||||
    @inject IOrderInfoDao orderInfoDao;
 | 
					 | 
				
			||||||
    @inject IChannelListDao channelListDao;
 | 
					 | 
				
			||||||
    @inject DialogService dialogService;
 | 
					 | 
				
			||||||
    @inject Microsoft.Extensions.Options.IOptions<Pojo.Config.SettingConfig> setting;
 | 
					 | 
				
			||||||
    @inject NotificationService _message
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    private IEnumerable<PlanDetails>? _forecasts;
 | 
					 | 
				
			||||||
    bool allowRowSelectOnRowClick = true;
 | 
					 | 
				
			||||||
    // IEnumerable<DrugManuNo> drugManuNos;
 | 
					 | 
				
			||||||
    // IList<DrugManuNo> selectedDrugManuNos;
 | 
					 | 
				
			||||||
    RadzenDataList<PlanDetails> grid;
 | 
					 | 
				
			||||||
    // RadzenDataGrid<DrugManuNo> gridManuNo;
 | 
					 | 
				
			||||||
    bool isLoading;
 | 
					 | 
				
			||||||
    int count;
 | 
					 | 
				
			||||||
    int[] DrawerNos = new int[] { 1, 2, 3, 4, 5, 6, 7, 8 };
 | 
					 | 
				
			||||||
    List<ChannelStock> channelStockList = new();
 | 
					 | 
				
			||||||
    int status = 0;
 | 
					 | 
				
			||||||
    string drawerNo = "1-1";
 | 
					 | 
				
			||||||
    string OrderNo;
 | 
					 | 
				
			||||||
    DateTime OrderDate;
 | 
					 | 
				
			||||||
    void SelectDrawer(string strDrawerNoColNo)
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
        this.drawerNo = strDrawerNoColNo;
 | 
					 | 
				
			||||||
        grid.Reload();
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    // void OnCurrentDateChanged(DateTime args)
 | 
					 | 
				
			||||||
    // {
 | 
					 | 
				
			||||||
    //     OrderDate = new DateTime(args.Year, args.Month, args.Day);
 | 
					 | 
				
			||||||
    // }
 | 
					 | 
				
			||||||
    //重置
 | 
					 | 
				
			||||||
    async Task reloadGrid()
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
        OrderNo = "";
 | 
					 | 
				
			||||||
        OrderDate = DateTime.MinValue;
 | 
					 | 
				
			||||||
        await grid.Reload();
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    //确认
 | 
					 | 
				
			||||||
    async Task Confirm()
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
        // orderInfoDao.CheckOrderInfo(selectedOrderInfos, drawerNo);
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    async Task LoadData(LoadDataArgs args)
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
        isLoading = true;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        var result = await channelListDao.GetBoxDrugInfo(drawerNo, args.Top, args.Skip);
 | 
					 | 
				
			||||||
        // Update the Data property
 | 
					 | 
				
			||||||
        _forecasts = result.Desserts;
 | 
					 | 
				
			||||||
        // Update the count
 | 
					 | 
				
			||||||
        count = result.TotalDesserts;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        isLoading = false;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        channelStockList = await orderInfoDao.GetDrawerNum(setting.Value.boxMachineId);
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    //替换按钮
 | 
					 | 
				
			||||||
    async Task replaceClick(ChannelStock cs)
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
        if (cs.Quantity > 0)
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
            var b = await dialogService.OpenAsync<BoxReplace>(
 | 
					 | 
				
			||||||
                   $"{cs.DrawerNo}号药盒替换药品详情",
 | 
					 | 
				
			||||||
                 new Dictionary<string, object>() { { "channelStock", cs } },
 | 
					 | 
				
			||||||
                 new DialogOptions() { Width = "85vw", Resizable = true, Draggable = true, ShowClose = false }
 | 
					 | 
				
			||||||
           );
 | 
					 | 
				
			||||||
            if (b)
 | 
					 | 
				
			||||||
            {
 | 
					 | 
				
			||||||
                await reloadGrid();
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
        else
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
            //库存为0无法操作
 | 
					 | 
				
			||||||
            _message.Notify(
 | 
					 | 
				
			||||||
            new NotificationMessage { Severity = NotificationSeverity.Error, Summary = "提示", Detail = $"库存为0无法替换", Duration = 4000 }
 | 
					 | 
				
			||||||
        );
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    //移除按钮
 | 
					 | 
				
			||||||
    async Task removeClick(ChannelStock cs)
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
        if (cs.Quantity > 0)
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
            var b = await dialogService.OpenAsync<BoxRemoveDialog>(
 | 
					 | 
				
			||||||
                   $"{cs.DrawerNo}号药盒替换药品详情",
 | 
					 | 
				
			||||||
                 new Dictionary<string, object>() { { "channelStock", cs } },
 | 
					 | 
				
			||||||
                 new DialogOptions() { Width = "85vw", Resizable = true, Draggable = true, ShowClose = false }
 | 
					 | 
				
			||||||
           );
 | 
					 | 
				
			||||||
            if (b)
 | 
					 | 
				
			||||||
            {
 | 
					 | 
				
			||||||
                await reloadGrid();
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
        else
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
            //库存为0无法操作
 | 
					 | 
				
			||||||
            _message.Notify(
 | 
					 | 
				
			||||||
            new NotificationMessage { Severity = NotificationSeverity.Error, Summary = "提示", Detail = $"库存为0,没有要移出的药品", Duration = 4000 }
 | 
					 | 
				
			||||||
        );
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
| 
						 | 
					@ -17,30 +17,30 @@
 | 
				
			||||||
            @if (userI == 1)
 | 
					            @if (userI == 1)
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                <RadzenText TextStyle="TextStyle.H5" class="rz-color-white">
 | 
					                <RadzenText TextStyle="TextStyle.H5" class="rz-color-white">
 | 
				
			||||||
                    请交班操作人 @FromOperator?.NickName
 | 
					                    @myText.HandoverOperator1 @FromOperator?.NickName
 | 
				
			||||||
                    <p>登录验证</p>
 | 
					                    <p>@myText.LoginCheck</p>
 | 
				
			||||||
                </RadzenText>
 | 
					                </RadzenText>
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            else if (userI == 2)
 | 
					            else if (userI == 2)
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                <RadzenText TextStyle="TextStyle.H5" class="rz-color-white">
 | 
					                <RadzenText TextStyle="TextStyle.H5" class="rz-color-white">
 | 
				
			||||||
                    请交班复核人 @FromRviewer?.NickName
 | 
					                    @myText.HandoverChecker1  @FromRviewer?.NickName
 | 
				
			||||||
                    <p>登录验证</p>
 | 
					                    <p>@myText.LoginCheck</p>
 | 
				
			||||||
                </RadzenText>
 | 
					                </RadzenText>
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            else
 | 
					            else
 | 
				
			||||||
            @if (userI == 3)
 | 
					            @if (userI == 3)
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                <RadzenText TextStyle="TextStyle.H5" class="rz-color-white">
 | 
					                <RadzenText TextStyle="TextStyle.H5" class="rz-color-white">
 | 
				
			||||||
                    请接班操作人 @ToOperator?.NickName
 | 
					                    @myText.HandoverOperator2 @ToOperator?.NickName
 | 
				
			||||||
                    <p>登录验证</p>
 | 
					                    <p>@myText.LoginCheck</p>
 | 
				
			||||||
                </RadzenText>
 | 
					                </RadzenText>
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            else if (userI == 4)
 | 
					            else if (userI == 4)
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                <RadzenText TextStyle="TextStyle.H5" class="rz-color-white">
 | 
					                <RadzenText TextStyle="TextStyle.H5" class="rz-color-white">
 | 
				
			||||||
                    请接班复核人 @ToReviewer?.NickName
 | 
					                    @myText.HandoverChecker2 @ToReviewer?.NickName
 | 
				
			||||||
                    <p>登录验证</p>
 | 
					                    <p>@myText.LoginCheck</p>
 | 
				
			||||||
                </RadzenText>
 | 
					                </RadzenText>
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        </RadzenCard>
 | 
					        </RadzenCard>
 | 
				
			||||||
| 
						 | 
					@ -48,38 +48,29 @@
 | 
				
			||||||
    <RadzenColumn Size="12" SizeMD="7">
 | 
					    <RadzenColumn Size="12" SizeMD="7">
 | 
				
			||||||
        <RadzenCard Class="rz-shadow-0 rz-border-radius-0 rz-p-12" Style="width:100%;height:100%">
 | 
					        <RadzenCard Class="rz-shadow-0 rz-border-radius-0 rz-p-12" Style="width:100%;height:100%">
 | 
				
			||||||
            <RadzenText TextStyle="TextStyle.H5" TagName="TagName.H2" class="rz-mb-6">
 | 
					            <RadzenText TextStyle="TextStyle.H5" TagName="TagName.H2" class="rz-mb-6">
 | 
				
			||||||
                交接班登录验证
 | 
					                @myText.Login
 | 
				
			||||||
            </RadzenText>
 | 
					            </RadzenText>
 | 
				
			||||||
            <RadzenTemplateForm Data="@loginModel" Submit="@((Pojo.User args) => { Submit(args); })" Style="width:100%;height:100%">
 | 
					            <RadzenTemplateForm Data="@loginModel" Submit="@((Pojo.User args) => { Submit(args); })" Style="width:100%;height:100%">
 | 
				
			||||||
                <div class="rz-form-row">
 | 
					                <div class="rz-form-row">
 | 
				
			||||||
                    <label class="rz-label" for="username">账号</label>
 | 
					                    <label class="rz-label" for="username">@myText.Account</label>
 | 
				
			||||||
                    <div class="rz-form-input-wrapper">
 | 
					                    <div class="rz-form-input-wrapper">
 | 
				
			||||||
                        <!--@onfocusin="@(() => Util.VirtualKeyboardHelper.ShowVirtualKeyboard())"-->
 | 
					                        <!--@onfocusin="@(() => Util.VirtualKeyboardHelper.ShowVirtualKeyboard())"-->
 | 
				
			||||||
                        <RadzenTextBox id="username" Name="Username" @bind-Value="@loginModel.Username" Style="width:100%" />
 | 
					                        <RadzenTextBox id="username" Name="Username" @bind-Value="@loginModel.Username" Style="width:100%" />
 | 
				
			||||||
                        <RadzenRequiredValidator Component="Username" Text="请填写用户名" />
 | 
					                        <RadzenRequiredValidator Component="Username" Text="@myText.loginTips1" />
 | 
				
			||||||
                    </div>
 | 
					                    </div>
 | 
				
			||||||
                </div>
 | 
					                </div>
 | 
				
			||||||
                <div class="rz-form-row">
 | 
					                <div class="rz-form-row">
 | 
				
			||||||
                    <label class="rz-label" for="password">密码</label>
 | 
					                    <label class="rz-label" for="password">密码</label>
 | 
				
			||||||
                    <div class="rz-form-input-wrapper">
 | 
					                    <div class="rz-form-input-wrapper">
 | 
				
			||||||
                        <RadzenPassword id="password" Name="Password" @bind-Value="@loginModel.Password" Style="width:100%" />
 | 
					                        <RadzenPassword id="password" Name="Password" @bind-Value="@loginModel.Password" Style="width:100%" />
 | 
				
			||||||
                        <RadzenRequiredValidator Component="Password" Text="请填写密码" />
 | 
					                        <RadzenRequiredValidator Component="Password" Text="@myText.loginTips2" />
 | 
				
			||||||
                    </div>
 | 
					                    </div>
 | 
				
			||||||
                </div>
 | 
					                </div>
 | 
				
			||||||
                @if (userI > 2)
 | 
					 | 
				
			||||||
                {
 | 
					 | 
				
			||||||
                    <div class="rz-form-row">
 | 
					 | 
				
			||||||
                        <label class="rz-label" for="remark">备注</label>
 | 
					 | 
				
			||||||
                    <div class="rz-form-input-wrapper">
 | 
					 | 
				
			||||||
                            <RadzenTextBox id="remark" @bind-Value="@remarks" Style="width:100%" />
 | 
					 | 
				
			||||||
                    </div>
 | 
					 | 
				
			||||||
                </div>
 | 
					 | 
				
			||||||
                }
 | 
					 | 
				
			||||||
                <div class="rz-form-row">
 | 
					                <div class="rz-form-row">
 | 
				
			||||||
                    <label class="rz-label"></label>
 | 
					                    <label class="rz-label"></label>
 | 
				
			||||||
                    <div class="rz-form-input-wrapper rz-login-buttons">
 | 
					                    <div class="rz-form-input-wrapper rz-login-buttons">
 | 
				
			||||||
                        <RadzenButton Style="background:#255dd4;color:white;width:110px" ButtonType="ButtonType.Submit" Text="登录验证" />
 | 
					                        <RadzenButton Style="background:#255dd4;color:white;width:110px" ButtonType="ButtonType.Submit" Text="@myText.Login" />
 | 
				
			||||||
                        <RadzenButton Style="border-color:#255dd4;width:110px" Variant="Variant.Outlined" Text="取消" Click="@Exit" />
 | 
					                        <RadzenButton Style="border-color:#255dd4;width:110px" Variant="Variant.Outlined" Text="@myText.Cancel" Click="@Exit" />
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                    </div>
 | 
					                    </div>
 | 
				
			||||||
                </div>
 | 
					                </div>
 | 
				
			||||||
| 
						 | 
					@ -99,6 +90,8 @@
 | 
				
			||||||
    @inject GlobalStateService globalStateService;
 | 
					    @inject GlobalStateService globalStateService;
 | 
				
			||||||
    @inject IUserDao userDao;
 | 
					    @inject IUserDao userDao;
 | 
				
			||||||
    @inject Microsoft.Extensions.Options.IOptions<Pojo.Config.SettingConfig> setting;
 | 
					    @inject Microsoft.Extensions.Options.IOptions<Pojo.Config.SettingConfig> setting;
 | 
				
			||||||
 | 
					    @inject Toolbelt.Blazor.I18nText.I18nText I18nText;
 | 
				
			||||||
 | 
					    private I18nText.local myText = new I18nText.local();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -114,13 +107,14 @@
 | 
				
			||||||
    Pojo.User ToReviewer = new Pojo.User();
 | 
					    Pojo.User ToReviewer = new Pojo.User();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    HkcChangeShifts hkcChange = new HkcChangeShifts();
 | 
					    HkcChangeShifts hkcChange = new HkcChangeShifts();
 | 
				
			||||||
    string remarks = string.Empty;
 | 
					
 | 
				
			||||||
    bool isShow;
 | 
					    bool isShow;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    private Pojo.User loginModel = new();
 | 
					    private Pojo.User loginModel = new();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    protected override Task OnInitializedAsync()
 | 
					    protected override async Task OnInitializedAsync()
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
 | 
					        myText = await I18nText.GetTextTableAsync<I18nText.local>(this);
 | 
				
			||||||
        FingerprintUtil.axCZKEM1.OnAttTransactionEx += axCZKEM1_OnAttTransactionEx;
 | 
					        FingerprintUtil.axCZKEM1.OnAttTransactionEx += axCZKEM1_OnAttTransactionEx;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        loginMode = setting.Value.loginMode;
 | 
					        loginMode = setting.Value.loginMode;
 | 
				
			||||||
| 
						 | 
					@ -136,7 +130,7 @@
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            FromRviewer = userDao.GetByUsername(hkcChange.FromRviewer);
 | 
					            FromRviewer = userDao.GetByUsername(hkcChange.FromRviewer);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        return base.OnInitializedAsync();
 | 
					        await base.OnInitializedAsync();
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    private async Task SetUser(Pojo.User user)
 | 
					    private async Task SetUser(Pojo.User user)
 | 
				
			||||||
| 
						 | 
					@ -216,8 +210,7 @@
 | 
				
			||||||
                        optDate = DateTime.Now,
 | 
					                        optDate = DateTime.Now,
 | 
				
			||||||
                        ToDate = DateTime.Now,
 | 
					                        ToDate = DateTime.Now,
 | 
				
			||||||
                        State = "0", //状态为1表示交接班完成
 | 
					                        State = "0", //状态为1表示交接班完成
 | 
				
			||||||
                        MachineId = hkcChange.MachineId,
 | 
					                        MachineId = hkcChange.MachineId
 | 
				
			||||||
                        Remarks = remarks
 | 
					 | 
				
			||||||
                    };
 | 
					                    };
 | 
				
			||||||
                    hkcChange.ToOperator = ToOperator.Username;
 | 
					                    hkcChange.ToOperator = ToOperator.Username;
 | 
				
			||||||
                    bool bResult = await userDao.UpdateChangeShift(hkcChange, hkcChangeNew);
 | 
					                    bool bResult = await userDao.UpdateChangeShift(hkcChange, hkcChangeNew);
 | 
				
			||||||
| 
						 | 
					@ -257,8 +250,7 @@
 | 
				
			||||||
                FromRviewer = ToReviewer?.Username,
 | 
					                FromRviewer = ToReviewer?.Username,
 | 
				
			||||||
                optDate = DateTime.Now,
 | 
					                optDate = DateTime.Now,
 | 
				
			||||||
                State = "0", //状态为1表示交接班完成
 | 
					                State = "0", //状态为1表示交接班完成
 | 
				
			||||||
                MachineId = hkcChange.MachineId,
 | 
					                MachineId = hkcChange.MachineId
 | 
				
			||||||
                Remarks = remarks
 | 
					 | 
				
			||||||
            };
 | 
					            };
 | 
				
			||||||
            bool bResult = await userDao.UpdateChangeShift(hkcChange, hkcChangeNew);
 | 
					            bool bResult = await userDao.UpdateChangeShift(hkcChange, hkcChangeNew);
 | 
				
			||||||
            if (bResult)
 | 
					            if (bResult)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -5,29 +5,29 @@
 | 
				
			||||||
        <div class="col-12 mb-4">
 | 
					        <div class="col-12 mb-4">
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            <form onsubmit="@(() => grid.Reload())">
 | 
					            <form onsubmit="@(() => grid.Reload())">
 | 
				
			||||||
                <RadzenFieldset Text="查询">
 | 
					                <RadzenFieldset Text="@myText.Search">
 | 
				
			||||||
                    <RadzenStack Orientation="Orientation.Horizontal" Gap="1rem">
 | 
					                    <RadzenStack Orientation="Orientation.Horizontal" Gap="1rem">
 | 
				
			||||||
                        <RadzenRow AlignItems="AlignItems.Center">
 | 
					                        <RadzenRow AlignItems="AlignItems.Center">
 | 
				
			||||||
                            <RadzenColumn Size="4">
 | 
					                            <RadzenColumn Size="4">
 | 
				
			||||||
                                <RadzenLabel Text="开始时间" Component="Start" />
 | 
					                                <RadzenLabel Text="@myText.StartDate" Component="Start" />
 | 
				
			||||||
                            </RadzenColumn>
 | 
					                            </RadzenColumn>
 | 
				
			||||||
                            <RadzenColumn Size="8">
 | 
					                            <RadzenColumn Size="8">
 | 
				
			||||||
                                <RadzenDatePicker DateFormat="yyyy-MM-dd" @bind-Value="start" Style="width: 100%;" Name="Start" />
 | 
					                                <RadzenDatePicker DateFormat="yyyy-MM-dd HH:mm:ss" ShowTime="true" @bind-Value="start" Style="width: 100%;" Name="Start" />
 | 
				
			||||||
                            </RadzenColumn>
 | 
					                            </RadzenColumn>
 | 
				
			||||||
                        </RadzenRow>
 | 
					                        </RadzenRow>
 | 
				
			||||||
                        <RadzenRow AlignItems="AlignItems.Center">
 | 
					                        <RadzenRow AlignItems="AlignItems.Center">
 | 
				
			||||||
                            <RadzenColumn Size="4">
 | 
					                            <RadzenColumn Size="4">
 | 
				
			||||||
                                <RadzenLabel Text="结束时间" Component="End" />
 | 
					                                <RadzenLabel Text="@myText.EndDate" Component="End" />
 | 
				
			||||||
                            </RadzenColumn>
 | 
					                            </RadzenColumn>
 | 
				
			||||||
                            <RadzenColumn Size="8">
 | 
					                            <RadzenColumn Size="8">
 | 
				
			||||||
                                <RadzenDatePicker DateFormat="yyyy-MM-dd" @bind-Value="end" Style="width: 100%;" Name="End" />
 | 
					                                <RadzenDatePicker DateFormat="yyyy-MM-dd HH:mm:ss" ShowTime="true" @bind-Value="end" Style="width: 100%;" Name="End" />
 | 
				
			||||||
                            </RadzenColumn>
 | 
					                            </RadzenColumn>
 | 
				
			||||||
                        </RadzenRow>
 | 
					                        </RadzenRow>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                        <RadzenRow AlignItems="AlignItems.Center">
 | 
					                        <RadzenRow AlignItems="AlignItems.Center">
 | 
				
			||||||
                            <RadzenColumn Size="12">
 | 
					                            <RadzenColumn Size="12">
 | 
				
			||||||
                                <RadzenButton Size="ButtonSize.Large" ButtonType="ButtonType.Submit" IsBusy="isLoading" Icon="search" Text="查询" />
 | 
					                                <RadzenButton Size="ButtonSize.Large" ButtonType="ButtonType.Submit" IsBusy="isLoading" Icon="search" Text="@myText.Search" />
 | 
				
			||||||
                                <RadzenButton Size="ButtonSize.Large" Click="reloadGrid" IsBusy="isLoading" Icon="refresh" Text="重置" ButtonStyle="ButtonStyle.Warning" />
 | 
					                                <RadzenButton Size="ButtonSize.Large" Click="reloadGrid" IsBusy="isLoading" Icon="refresh" Text="@myText.Restore" ButtonStyle="ButtonStyle.Warning" />
 | 
				
			||||||
                            </RadzenColumn>
 | 
					                            </RadzenColumn>
 | 
				
			||||||
                        </RadzenRow>
 | 
					                        </RadzenRow>
 | 
				
			||||||
                    </RadzenStack>
 | 
					                    </RadzenStack>
 | 
				
			||||||
| 
						 | 
					@ -40,36 +40,36 @@
 | 
				
			||||||
                            LoadData="@LoadData"
 | 
					                            LoadData="@LoadData"
 | 
				
			||||||
                            IsLoading="@isLoading"
 | 
					                            IsLoading="@isLoading"
 | 
				
			||||||
                            Count="@count"
 | 
					                            Count="@count"
 | 
				
			||||||
                            EmptyText="无数据"
 | 
					                            EmptyText="@myText.NoDate"
 | 
				
			||||||
                            Data="@_forecasts"
 | 
					                            Data="@_forecasts"
 | 
				
			||||||
                            AllowColumnResize="true" AllowAlternatingRows="false"
 | 
					                            AllowColumnResize="true" AllowAlternatingRows="false"
 | 
				
			||||||
                            SelectionMode="DataGridSelectionMode.Single"
 | 
					                            SelectionMode="DataGridSelectionMode.Single"
 | 
				
			||||||
                            AllowPaging="true" PageSize="10" PagerHorizontalAlign="HorizontalAlign.Left" ShowPagingSummary="true" PagingSummaryFormat="{0}/{1} 共{2}条数据">
 | 
					                            AllowPaging="true" PageSize="10" PagerHorizontalAlign="HorizontalAlign.Left" ShowPagingSummary="true" PagingSummaryFormat="{0}/{1} 共{2}条数据">
 | 
				
			||||||
                <Columns>
 | 
					                <Columns>
 | 
				
			||||||
                    <RadzenDataGridColumn Title="日期" Property="optDate">
 | 
					                    <RadzenDataGridColumn Title="@myText.Date" Property="optDate">
 | 
				
			||||||
                        <Template Context="mr">
 | 
					                        <Template Context="mr">
 | 
				
			||||||
                            @mr.optDate.ToString("yyyy-MM-dd")
 | 
					                            @mr.optDate.ToString("yyyy-MM-dd")
 | 
				
			||||||
                        </Template>
 | 
					                        </Template>
 | 
				
			||||||
                    </RadzenDataGridColumn>
 | 
					                    </RadzenDataGridColumn>
 | 
				
			||||||
                    <RadzenDataGridColumn Title="交班发药人" Property="FromOperator"></RadzenDataGridColumn>
 | 
					                    <RadzenDataGridColumn Title="@myText.HandoverOperator1" Property="FromOperator"></RadzenDataGridColumn>
 | 
				
			||||||
                    <RadzenDataGridColumn Title="交班审核人" Property="FromRviewer"></RadzenDataGridColumn>
 | 
					                    <RadzenDataGridColumn Title="@myText.HandoverChecker1" Property="FromRviewer"></RadzenDataGridColumn>
 | 
				
			||||||
                    <RadzenDataGridColumn Title="接班发药人" Property="ToOperator"></RadzenDataGridColumn>
 | 
					                    <RadzenDataGridColumn Title="@myText.HandoverOperator2" Property="ToOperator"></RadzenDataGridColumn>
 | 
				
			||||||
                    <RadzenDataGridColumn Title="接班审核人" Property="ToReviewer"></RadzenDataGridColumn>
 | 
					                    <RadzenDataGridColumn Title="@myText.HandoverChecker2" Property="ToReviewer"></RadzenDataGridColumn>
 | 
				
			||||||
                    <RadzenDataGridColumn Title="接班日期" Property="ToDate">
 | 
					                    <RadzenDataGridColumn Title="@myText.HandoverDate" Property="ToDate">
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                        <Template Context="mr">
 | 
					                        <Template Context="mr">
 | 
				
			||||||
                            @mr.ToDate.ToString("yyyy-MM-dd")
 | 
					                            @mr.ToDate.ToString("yyyy-MM-dd")
 | 
				
			||||||
                        </Template>
 | 
					                        </Template>
 | 
				
			||||||
                    </RadzenDataGridColumn>
 | 
					                    </RadzenDataGridColumn>
 | 
				
			||||||
                    <RadzenDataGridColumn Title="当班状态" Property="State">
 | 
					                    <RadzenDataGridColumn Title="@myText.HandoverState" Property="State">
 | 
				
			||||||
                        <Template Context="state">
 | 
					                        <Template Context="state">
 | 
				
			||||||
                            @if(state.State=="0")
 | 
					                            @if(state.State=="0")
 | 
				
			||||||
                            {
 | 
					                            {
 | 
				
			||||||
                                <RadzenText>值班中</RadzenText>
 | 
					                                <RadzenText>@myText.OnDuty</RadzenText>
 | 
				
			||||||
                            }
 | 
					                            }
 | 
				
			||||||
                            else
 | 
					                            else
 | 
				
			||||||
                            {
 | 
					                            {
 | 
				
			||||||
                                <RadzenText>已交班</RadzenText>
 | 
					                                <RadzenText>@myText.NotDuty</RadzenText>
 | 
				
			||||||
                            }
 | 
					                            }
 | 
				
			||||||
                        </Template>
 | 
					                        </Template>
 | 
				
			||||||
                    </RadzenDataGridColumn>
 | 
					                    </RadzenDataGridColumn>
 | 
				
			||||||
| 
						 | 
					@ -84,6 +84,10 @@
 | 
				
			||||||
    @inject DialogService dialogService;
 | 
					    @inject DialogService dialogService;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    @inject NavigationManager navigate;
 | 
					    @inject NavigationManager navigate;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    @inject Toolbelt.Blazor.I18nText.I18nText I18nText;
 | 
				
			||||||
 | 
					    private I18nText.local myText = new I18nText.local();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    RadzenDataGrid<HkcChangeShifts> grid;
 | 
					    RadzenDataGrid<HkcChangeShifts> grid;
 | 
				
			||||||
    bool isLoading;
 | 
					    bool isLoading;
 | 
				
			||||||
    int count;
 | 
					    int count;
 | 
				
			||||||
| 
						 | 
					@ -120,4 +124,9 @@
 | 
				
			||||||
        end = DateTime.MinValue;
 | 
					        end = DateTime.MinValue;
 | 
				
			||||||
        await grid.Reload();
 | 
					        await grid.Reload();
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					    protected override async Task OnInitializedAsync()
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        myText = await I18nText.GetTextTableAsync<I18nText.local>(this);
 | 
				
			||||||
 | 
					        await base.OnInitializedAsync();
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -1,204 +1,78 @@
 | 
				
			||||||
@page "/Box/CheckAAA"
 | 
					@page "/Box/Check"
 | 
				
			||||||
@using MasaBlazorApp3.Pojo.Config
 | 
					@using MasaBlazorApp3.Pojo.Config
 | 
				
			||||||
@using MasaBlazorApp3.Report
 | 
					 | 
				
			||||||
@using Microsoft.Extensions.Options
 | 
					 | 
				
			||||||
@using Radzen.Blazor.Rendering
 | 
					 | 
				
			||||||
@using log4net;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
<style>
 | 
					<RadzenStack Orientation="Orientation.Horizontal" class="col-12 mb-4">
 | 
				
			||||||
    .my-popup {
 | 
					    <div class="col-12 row justify-content-center align-items-center text-center" style="background: url('/images/box-16.jpg')  no-repeat; background-size: 100% 100%; width: 380px; height:650px">
 | 
				
			||||||
    display: none;
 | 
					        <div class="row justify-content-around align-items-center" style="margin-top: 220px; height: 430px;">
 | 
				
			||||||
    position: absolute;
 | 
					 | 
				
			||||||
    overflow: auto;
 | 
					 | 
				
			||||||
    /* height: 360px; */
 | 
					 | 
				
			||||||
    width: 900px;
 | 
					 | 
				
			||||||
    border: var(--rz-panel-border);
 | 
					 | 
				
			||||||
    background-color: var(--rz-panel-background-color);
 | 
					 | 
				
			||||||
    box-shadow: var(--rz-panel-shadow);
 | 
					 | 
				
			||||||
    border-radius: var(--rz-border-radius);
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    .rz-grid-table {
 | 
					 | 
				
			||||||
    position: relative;
 | 
					 | 
				
			||||||
    border-collapse: separate;
 | 
					 | 
				
			||||||
    border-spacing: 0;
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
</style>
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
<RadzenStack Orientation="Orientation.Horizontal">
 | 
					 | 
				
			||||||
    @*   <div class="col-4 row justify-content-center align-items-center text-center" style="background: url('/images/box-16.jpg')  no-repeat; background-size: 100% 100%; width: 380px; height:650px">
 | 
					 | 
				
			||||||
        <div class="row justify-content-around align-items-center" style="margin-top: 220px; height: 430px;overflow:auto">
 | 
					 | 
				
			||||||
            @foreach (int i in DrawerNos)
 | 
					            @foreach (int i in DrawerNos)
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                <RadzenButton class="col-5" Style="margin-bottom:5px" Click="@(() => SelectDrawer(i))" Text="@i.ToString()" Disabled="@(status > 0)" Shade="Shade.Light" Variant="@(drawerNo != i ? Variant.Outlined : Variant.Flat)" />
 | 
					                <RadzenButton class="col-5" Click="@(() => SelectDrawer(i))" Text="@i.ToString()" Disabled="@(status > 0)" Shade="Shade.Light" Variant="@(drawerNo != i ? Variant.Outlined : Variant.Flat)" />
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        </div>
 | 
					        </div>
 | 
				
			||||||
    </div> *@
 | 
					 | 
				
			||||||
    @*     <div class="col-2 row justify-content-center align-items-center text-center">
 | 
					 | 
				
			||||||
        <div class="row justify-content-around align-items-center" style="height:600px;overflow:auto">
 | 
					 | 
				
			||||||
            @foreach (int i in DrawerNos)
 | 
					 | 
				
			||||||
            {
 | 
					 | 
				
			||||||
                <RadzenButton class="col-12" Style="margin-bottom:5px" Click="@(() => SelectDrawer(i))" Text="@i.ToString()" Disabled="@(status > 0)" Shade="Shade.Light" Variant="@(drawerNo != i ? Variant.Outlined : Variant.Flat)" />
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
    </div>
 | 
					    </div>
 | 
				
			||||||
    </div> *@
 | 
					    <div class="col-9 mb-4">
 | 
				
			||||||
    <div class="col-12">
 | 
					        <form onsubmit="@(() => grid.Reload())">
 | 
				
			||||||
        <form onsubmit="@(() => {firstLod=0;grid.Reload();})">
 | 
					            <RadzenFieldset Text="@myText.Search">
 | 
				
			||||||
            <RadzenFieldset Text="查询">
 | 
					                <RadzenStack Orientation="Orientation.Horizontal" Gap="1rem">
 | 
				
			||||||
                @* <RadzenStack Orientation="Orientation.Horizontal" Gap="1rem"> *@
 | 
					 | 
				
			||||||
                    <RadzenRow AlignItems="AlignItems.Center">
 | 
					                    <RadzenRow AlignItems="AlignItems.Center">
 | 
				
			||||||
                    <RadzenColumn Size="6">
 | 
					                        <RadzenColumn Size="4">
 | 
				
			||||||
                        <RadzenLabel Text="麻醉医师" Component="NamesList" Style="width: 20%;" />
 | 
					                            <RadzenLabel Text="@myText.OrderNo" Component="OrderNo" />
 | 
				
			||||||
                        <RadzenDropDownDataGrid AllowVirtualization="true" Name="NamesList" TValue="Anaesthetist" Data="@NamesList" @bind-Value="NameInfo"
 | 
					 | 
				
			||||||
                        Style="width:100%; display: block;" AllowFilteringByAllStringColumns="true" TextProperty="Name">
 | 
					 | 
				
			||||||
                            <Columns>
 | 
					 | 
				
			||||||
                                <RadzenDropDownDataGridColumn Property="Name" Title="麻醉医师" Sortable="false" />
 | 
					 | 
				
			||||||
                            </Columns>
 | 
					 | 
				
			||||||
                        </RadzenDropDownDataGrid>
 | 
					 | 
				
			||||||
                        </RadzenColumn>
 | 
					                        </RadzenColumn>
 | 
				
			||||||
 | 
					                        <RadzenColumn Size="8">
 | 
				
			||||||
                    <RadzenColumn Size="6">
 | 
					 | 
				
			||||||
                        <RadzenLabel Text="核对药箱" Component="BoxList" />
 | 
					 | 
				
			||||||
                          @*  <RadzenDropDownDataGrid AllowVirtualization="true" Name="BoxColorList" TValue="Anaesthetist" Data="@BoxColorList" @bind-Value="BoxColor" Style="width: 100%;"
 | 
					 | 
				
			||||||
                        AllowFilteringByAllStringColumns="true" TextProperty="Name">
 | 
					 | 
				
			||||||
                            <Columns>
 | 
					 | 
				
			||||||
                                <RadzenDropDownDataGridColumn Property="Name" Title="药盒颜色" Sortable="false" />
 | 
					 | 
				
			||||||
                            </Columns>
 | 
					 | 
				
			||||||
                        </RadzenDropDownDataGrid> *@
 | 
					 | 
				
			||||||
                        <RadzenDropDownDataGrid AllowVirtualization="true" Name="BoxList" TValue="BoxModel" Data="@BoxList" @bind-Value="BoxNum" Style="width: 100%;"
 | 
					 | 
				
			||||||
                        AllowFilteringByAllStringColumns="true" TextProperty="药箱号">
 | 
					 | 
				
			||||||
                            <Template>
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                                @((context as BoxModel).BoxName == 99 ? "急诊药盒" : (context as BoxModel).BoxName == 111 ? "恢复室药盒" : (context as BoxModel).BoxName + "-" + ((context as BoxModel).BoxNo == 1 ? "白" : "绿"))
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                                @* @((context as BoxModel).BoxName + "-" + (context as BoxModel).BoxNo) *@
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                            </Template>
 | 
					 | 
				
			||||||
                            <Columns>
 | 
					 | 
				
			||||||
                                <RadzenDropDownDataGridColumn Property="BoxName" Title="药箱号" Sortable="false" />
 | 
					 | 
				
			||||||
                            </Columns>
 | 
					 | 
				
			||||||
                        </RadzenDropDownDataGrid>
 | 
					 | 
				
			||||||
                    </RadzenColumn>
 | 
					 | 
				
			||||||
                </RadzenRow>
 | 
					 | 
				
			||||||
                <RadzenRow AlignItems="AlignItems.Center">
 | 
					 | 
				
			||||||
                    <RadzenColumn Size="6">
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                        <RadzenLabel Text="处方号" Component="OrderNo" />
 | 
					 | 
				
			||||||
                            <RadzenTextBox @bind-Value="OrderNo" Style="width: 100%;" Name="OrderNo"></RadzenTextBox>
 | 
					                            <RadzenTextBox @bind-Value="OrderNo" Style="width: 100%;" Name="OrderNo"></RadzenTextBox>
 | 
				
			||||||
 | 
					 | 
				
			||||||
                    </RadzenColumn>
 | 
					 | 
				
			||||||
                    <RadzenColumn Size="6" Style="margin-top:0.5rem">
 | 
					 | 
				
			||||||
                        <RadzenLabel Text="处方时间" Component="OrderDate" />
 | 
					 | 
				
			||||||
                        <RadzenDatePicker DateFormat="yyyy-MM-dd" CurrentDateChanged="@OnCurrentDateChanged" AllowClear @bind-Value="OrderDate" Style="width: 100%;" Name="OrderDate" />
 | 
					 | 
				
			||||||
                        </RadzenColumn>
 | 
					                        </RadzenColumn>
 | 
				
			||||||
                    </RadzenRow>
 | 
					                    </RadzenRow>
 | 
				
			||||||
                    <RadzenRow AlignItems="AlignItems.Center">
 | 
					                    <RadzenRow AlignItems="AlignItems.Center">
 | 
				
			||||||
                    <RadzenColumn Size="6">
 | 
					                        <RadzenColumn Size="4">
 | 
				
			||||||
 | 
					                            <RadzenLabel Text="@myText.OrderDate" Component="OrderDate" />
 | 
				
			||||||
                        <RadzenLabel Text="患者姓名" Component="PatientName" />
 | 
					 | 
				
			||||||
                        <RadzenTextBox @bind-Value="PatientName" Style="width: 100%;" Name="PatientName"></RadzenTextBox>
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                        </RadzenColumn>
 | 
					                        </RadzenColumn>
 | 
				
			||||||
                    <RadzenColumn Size="6" Style="margin-top:2px">
 | 
					                        <RadzenColumn Size="8">
 | 
				
			||||||
                        <RadzenButton Size="ButtonSize.Medium" ButtonType="ButtonType.Submit" IsBusy="isLoading" Icon="search" Text="查询" />
 | 
					                            <RadzenDatePicker DateFormat="yyyy-MM-dd" CurrentDateChanged="@OnCurrentDateChanged" @bind-Value="OrderDate" Style="width: 100%;" Name="OrderDate" />
 | 
				
			||||||
                        <RadzenButton Size="ButtonSize.Medium" Click="reloadGrid" IsBusy="isLoading" Icon="refresh" Text="重置" ButtonStyle="ButtonStyle.Warning" />
 | 
					                        </RadzenColumn>
 | 
				
			||||||
                        <RadzenButton Size="ButtonSize.Medium" Click="Confirm" ButtonType="ButtonType.Button" IsBusy="isLoading" Icon="check_circle" Text="确认" />
 | 
					                    </RadzenRow>
 | 
				
			||||||
                        <RadzenButton Style="margin-top:2px" Icon="download" @ref=button Text="麻醉药品使用登记本导出" Variant="Variant.Outlined" Click="@(args => popup.ToggleAsync(button.Element))" />
 | 
					
 | 
				
			||||||
                        <Popup @ref=popup Lazy=true class="my-popup">
 | 
					 | 
				
			||||||
                            <RadzenStack Orientation="Orientation.Vertical" Gap="1rem" class="rz-h-100 rz-p-4">
 | 
					 | 
				
			||||||
                                <RadzenFieldset Text="条件选择">
 | 
					 | 
				
			||||||
                                    <RadzenStack Orientation="Orientation.Horizontal" Gap="1rem">
 | 
					 | 
				
			||||||
                    <RadzenRow AlignItems="AlignItems.Center">
 | 
					                    <RadzenRow AlignItems="AlignItems.Center">
 | 
				
			||||||
                                            <RadzenColumn Size="6">
 | 
					                        <RadzenColumn Size="12">
 | 
				
			||||||
                                                <RadzenLabel Text="处方时间" Component="PortOrderDate" />
 | 
					                            <RadzenButton Size="ButtonSize.Medium" ButtonType="ButtonType.Submit" IsBusy="isLoading" Icon="search" Text="@myText.Search" />
 | 
				
			||||||
                                            </RadzenColumn>
 | 
					                            <RadzenButton Size="ButtonSize.Medium" Click="reloadGrid" IsBusy="isLoading" Icon="refresh" Text="@myText.Restore" ButtonStyle="ButtonStyle.Warning" />
 | 
				
			||||||
                                            <RadzenColumn Size="6">
 | 
					 | 
				
			||||||
                                                <RadzenDatePicker DateFormat="yyyy-MM-dd" CurrentDateChanged="@OnCurrentPortDateChanged" @bind-Value="PortOrderDate" Style="width: 100%;" Name="PortOrderDate" />
 | 
					 | 
				
			||||||
                        </RadzenColumn>
 | 
					                        </RadzenColumn>
 | 
				
			||||||
                    </RadzenRow>
 | 
					                    </RadzenRow>
 | 
				
			||||||
 | 
					                </RadzenStack>
 | 
				
			||||||
 | 
					            </RadzenFieldset>
 | 
				
			||||||
 | 
					            <RadzenButton Size="ButtonSize.Medium" Click="Confirm" ButtonType="ButtonType.Button" IsBusy="isLoading" Icon="check_circle" Text="@myText.Confirm" Style="margin:0.5rem" />
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                                        <RadzenRow JustifyContent="JustifyContent.End" AlignItems="AlignItems.Center">
 | 
					 | 
				
			||||||
                                            <RadzenButton Icon="download" Text="导出" Variant="Variant.Outlined" Click="StockExport" />
 | 
					 | 
				
			||||||
                                        </RadzenRow>
 | 
					 | 
				
			||||||
                                    </RadzenStack>
 | 
					 | 
				
			||||||
                                </RadzenFieldset>
 | 
					 | 
				
			||||||
                            </RadzenStack>
 | 
					 | 
				
			||||||
                        </Popup>
 | 
					 | 
				
			||||||
                    </RadzenColumn>
 | 
					 | 
				
			||||||
                </RadzenRow>
 | 
					 | 
				
			||||||
                @* </RadzenStack> *@
 | 
					 | 
				
			||||||
            </RadzenFieldset>
 | 
					 | 
				
			||||||
            <RadzenStack Orientation="Orientation.Horizontal" Gap="1rem" Style="margin:0.5rem">
 | 
					 | 
				
			||||||
                @*   <RadzenLabel Text="核对药箱" Component="BoxList" Style="margin:0.5rem" />
 | 
					 | 
				
			||||||
                <RadzenDropDownDataGrid AllowVirtualization="true" Name="BoxList" TValue="BoxModel" Data="@BoxList" @bind-Value="BoxNum"
 | 
					 | 
				
			||||||
                                        AllowFilteringByAllStringColumns="true" TextProperty="药箱号">
 | 
					 | 
				
			||||||
                    <Template>
 | 
					 | 
				
			||||||
                        @((context as BoxModel).BoxName + "-" + (context as BoxModel).BoxNo)
 | 
					 | 
				
			||||||
                    </Template>
 | 
					 | 
				
			||||||
                    <Columns>
 | 
					 | 
				
			||||||
                        <RadzenDropDownDataGridColumn Property="BoxName" Title="药箱号" Sortable="false" />
 | 
					 | 
				
			||||||
                    </Columns>
 | 
					 | 
				
			||||||
                </RadzenDropDownDataGrid> *@
 | 
					 | 
				
			||||||
                @*  <RadzenButton Size="ButtonSize.Medium" Click="Confirm" ButtonType="ButtonType.Button" IsBusy="isLoading" Icon="check_circle" Text="确认" />
 | 
					 | 
				
			||||||
                <RadzenButton Icon="download" @ref=button Text="麻醉药品使用登记本导出" Variant="Variant.Outlined" Click="@(args => popup.ToggleAsync(button.Element))" />
 | 
					 | 
				
			||||||
                <Popup @ref=popup Lazy=true class="my-popup">
 | 
					 | 
				
			||||||
                    <RadzenStack Orientation="Orientation.Vertical" Gap="1rem" class="rz-h-100 rz-p-4">
 | 
					 | 
				
			||||||
                        <RadzenFieldset Text="条件选择">
 | 
					 | 
				
			||||||
                            <RadzenStack Orientation="Orientation.Horizontal" Gap="1rem">
 | 
					 | 
				
			||||||
                                <RadzenRow AlignItems="AlignItems.Center">
 | 
					 | 
				
			||||||
                                    <RadzenColumn Size="6">
 | 
					 | 
				
			||||||
                                        <RadzenLabel Text="处方时间" Component="PortOrderDate" />
 | 
					 | 
				
			||||||
                                    </RadzenColumn>
 | 
					 | 
				
			||||||
                                    <RadzenColumn Size="6">
 | 
					 | 
				
			||||||
                                        <RadzenDatePicker DateFormat="yyyy-MM-dd" CurrentDateChanged="@OnCurrentPortDateChanged" @bind-Value="PortOrderDate" Style="width: 100%;" Name="PortOrderDate" />
 | 
					 | 
				
			||||||
                                    </RadzenColumn>
 | 
					 | 
				
			||||||
                                </RadzenRow>
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                                <RadzenRow JustifyContent="JustifyContent.End" AlignItems="AlignItems.Center">
 | 
					 | 
				
			||||||
                                    <RadzenButton Icon="download" Text="导出" Variant="Variant.Outlined" Click="StockExport" />
 | 
					 | 
				
			||||||
                                </RadzenRow>
 | 
					 | 
				
			||||||
                            </RadzenStack>
 | 
					 | 
				
			||||||
                        </RadzenFieldset>
 | 
					 | 
				
			||||||
                    </RadzenStack>
 | 
					 | 
				
			||||||
                </Popup> *@
 | 
					 | 
				
			||||||
            </RadzenStack>
 | 
					 | 
				
			||||||
        </form>
 | 
					        </form>
 | 
				
			||||||
        <div Style="width:936px;height:50vh;overflow:auto">
 | 
					        <RadzenDataGrid @ref="grid" AllowRowSelectOnRowClick="@allowRowSelectOnRowClick" AllowFiltering="true" LoadData="@LoadData"
 | 
				
			||||||
            <RadzenDataGrid @ref="grid" AllowRowSelectOnRowClick="@allowRowSelectOnRowClick" AllowFiltering="true" LoadData="@LoadData" Style="width:955px;overflow:auto" Groupable="true" 
 | 
					 | 
				
			||||||
                        FilterPopupRenderMode="PopupRenderMode.OnDemand" FilterCaseSensitivity="FilterCaseSensitivity.CaseInsensitive"
 | 
					                        FilterPopupRenderMode="PopupRenderMode.OnDemand" FilterCaseSensitivity="FilterCaseSensitivity.CaseInsensitive"
 | 
				
			||||||
            Data="@orderInfos" IsLoading="@isLoading" Count="@count" EmptyText="无数据"
 | 
					                        Data="@orderInfos" ColumnWidth="200px" IsLoading="@isLoading" Count="@count" EmptyText="@myText.NoDate"
 | 
				
			||||||
                        SelectionMode="DataGridSelectionMode.Multiple" @bind-Value=@selectedOrderInfos
 | 
					                        SelectionMode="DataGridSelectionMode.Multiple" @bind-Value=@selectedOrderInfos
 | 
				
			||||||
            CellClick="@((DataGridCellMouseEventArgs<OrderInfo> args) => OnCellClick(args))"
 | 
					                        AllowPaging="true" PageSize="10" PagerHorizontalAlign="HorizontalAlign.Left" ShowPagingSummary="true" PagingSummaryFormat="{0}/{1} 共{2}条数据">
 | 
				
			||||||
            AllowPaging="false">
 | 
					 | 
				
			||||||
            <Columns>
 | 
					            <Columns>
 | 
				
			||||||
                    <RadzenDataGridColumn Sortable="false" Filterable="false" Width="2rem">
 | 
					                <RadzenDataGridColumn Sortable="false" Filterable="false" Width="4rem">
 | 
				
			||||||
                        @*  <HeaderTemplate>
 | 
					                    <HeaderTemplate>
 | 
				
			||||||
                        <RadzenCheckBox TabIndex="-1" TriState="false" TValue="bool?" InputAttributes="@(new Dictionary<string, object>() { { "aria-label", "Select all items" } })"
 | 
					                        <RadzenCheckBox TabIndex="-1" TriState="false" TValue="bool?" InputAttributes="@(new Dictionary<string, object>() { { "aria-label", "Select all items" } })"
 | 
				
			||||||
                                        Value="@(selectedOrderInfos == null || selectedOrderInfos?.Any() != true ? false : !orderInfos.All(i => selectedOrderInfos.Contains(i)) ? null : orderInfos.Any(i => selectedOrderInfos.Contains(i)))"
 | 
					                                        Value="@(selectedOrderInfos == null || selectedOrderInfos?.Any() != true ? false : !orderInfos.All(i => selectedOrderInfos.Contains(i)) ? null : orderInfos.Any(i => selectedOrderInfos.Contains(i)))"
 | 
				
			||||||
                            Change="@(args => OnCheckSeleced(args))" />
 | 
					                                        Change="@(args => selectedOrderInfos = args == true ? orderInfos.ToList() : null)" />
 | 
				
			||||||
                        </HeaderTemplate> *@
 | 
					                    </HeaderTemplate>
 | 
				
			||||||
                    <Template Context="data">
 | 
					                    <Template Context="data">
 | 
				
			||||||
                            <RadzenCheckBox TabIndex="-1" TriState="false" Value="@data.ItemIsChecked" InputAttributes="@(new Dictionary<string, object>() { { "aria-label", "Select item" } })"
 | 
					                        <RadzenCheckBox TabIndex="-1" TriState="false" Value="@(selectedOrderInfos != null && selectedOrderInfos.Contains(data))" InputAttributes="@(new Dictionary<string, object>() { { "aria-label", "Select item" } })"
 | 
				
			||||||
                                        TValue="bool" Change="@(args => { if (!allowRowSelectOnRowClick) { grid.SelectRow(data); } })" />
 | 
					                                        TValue="bool" Change="@(args => { if (!allowRowSelectOnRowClick) { grid.SelectRow(data); } })" />
 | 
				
			||||||
                    </Template>
 | 
					                    </Template>
 | 
				
			||||||
                </RadzenDataGridColumn>
 | 
					                </RadzenDataGridColumn>
 | 
				
			||||||
                    <RadzenDataGridColumn Property="anaesthetistName" Title="麻醉医师" Sortable="false" Filterable="false" Width="50px" />
 | 
					                <RadzenDataGridColumn Property="PatientName" Title="@myText.Name" Sortable="false" Filterable="false" Width="4rem" />
 | 
				
			||||||
                    <RadzenDataGridColumn Property="PatientName" Title="姓名" Sortable="false" Filterable="false" Width="50px" />
 | 
					                <RadzenDataGridColumn Property="Sex" Title="@myText.Sex" Sortable="false" Filterable="false" Width="2rem" />
 | 
				
			||||||
                    <RadzenDataGridColumn Property="Sex" Title="性别" Sortable="false" Filterable="false" Width="30px" />
 | 
					                <RadzenDataGridColumn Property="OrderNo" Title="@myText.OrderNo" Sortable="false" Filterable="false" Width="8rem" />
 | 
				
			||||||
                    <RadzenDataGridColumn Property="OrderNo" Title="单号" Sortable="false" Filterable="false" Width="70px" />
 | 
					                <RadzenDataGridColumn Property="Detail.Drug.DrugName" Title="@myText.DrugName" FormatString="{0:d}" Sortable="false" Filterable="false" Width="8rem">
 | 
				
			||||||
                    <RadzenDataGridColumn Property="ChargeDate" Title="处方时间" Sortable="false" Filterable="false" Width="80px" />
 | 
					                    <Template Context="DetailList">
 | 
				
			||||||
                    <RadzenDataGridColumn Property="DetailInfo.Drug.DrugName" Title="药品名称" FormatString="{0:d}" Sortable="false" Filterable="false" Width="80px" />
 | 
					 | 
				
			||||||
                    @* <Template Context="DetailInfo">
 | 
					 | 
				
			||||||
                        @for (int i = 0; i < DetailList.DetailList.Count; i++)
 | 
					                        @for (int i = 0; i < DetailList.DetailList.Count; i++)
 | 
				
			||||||
                        {
 | 
					                        {
 | 
				
			||||||
                            OrderDetail orderDetail = DetailList.DetailList[i]; *@
 | 
					                            OrderDetail orderDetail = DetailList.DetailList[i];
 | 
				
			||||||
                    @*     <RadzenText TextStyle="TextStyle.Subtitle2" class="rz-mb-0">@DetailInfo.Drug.DrugName</RadzenText>
 | 
					                            <RadzenText TextStyle="TextStyle.Subtitle2" class="rz-mb-0">@orderDetail.Drug.DrugName</RadzenText>
 | 
				
			||||||
                        }
 | 
					                        }
 | 
				
			||||||
                    </Template>
 | 
					                    </Template>
 | 
				
			||||||
                </RadzenDataGridColumn>*@
 | 
					                </RadzenDataGridColumn>
 | 
				
			||||||
                    @*  <RadzenDataGridColumn Property="Detail.SetManuNo" Title="药品批次" Sortable="false" Filterable="false" Width="8rem">
 | 
					                <RadzenDataGridColumn Property="Detail.SetManuNo" Title="@myText.Batch" Sortable="false" Filterable="false" Width="8rem">
 | 
				
			||||||
                    <Template Context="DetailList">
 | 
					                    <Template Context="DetailList">
 | 
				
			||||||
                        @for (int i = 0; i < DetailList.DetailList.Count; i++)
 | 
					                        @for (int i = 0; i < DetailList.DetailList.Count; i++)
 | 
				
			||||||
                        {
 | 
					                        {
 | 
				
			||||||
| 
						 | 
					@ -206,304 +80,78 @@
 | 
				
			||||||
                            <RadzenText TextStyle="TextStyle.Subtitle2" class="rz-mb-0">@orderDetail.SetManuNo</RadzenText>
 | 
					                            <RadzenText TextStyle="TextStyle.Subtitle2" class="rz-mb-0">@orderDetail.SetManuNo</RadzenText>
 | 
				
			||||||
                        }
 | 
					                        }
 | 
				
			||||||
                    </Template>
 | 
					                    </Template>
 | 
				
			||||||
                </RadzenDataGridColumn> *@
 | 
					                </RadzenDataGridColumn>
 | 
				
			||||||
                    <RadzenDataGridColumn Title="批次" Property="DetailInfo.SetManuNo" Filterable="false" Width="100px">
 | 
					                <RadzenDataGridColumn Property="Detail.Quantity" Title="@myText.Quantity" Sortable="false" Filterable="false" Width="2rem">
 | 
				
			||||||
                        @*            <Template Context="DetailInfo">
 | 
					                    <Template Context="DetailList">
 | 
				
			||||||
                        <RadzenText TextStyle="TextStyle.Subtitle2" class="mb-0">@DetailInfo.DetailInfo.SetManuNo</RadzenText>
 | 
					                        @for (int i = 0; i < DetailList.DetailList.Count; i++)
 | 
				
			||||||
 | 
					 | 
				
			||||||
                        @if (DetailInfo.DetailInfo.SetManuNo != null )
 | 
					 | 
				
			||||||
                        {
 | 
					                        {
 | 
				
			||||||
                            <RadzenText TextStyle="TextStyle.Caption">
 | 
					                            OrderDetail orderDetail = DetailList.DetailList[i];
 | 
				
			||||||
                                @DetailInfo.DetailInfo.SetManuNo
 | 
					                            <RadzenText TextStyle="TextStyle.Subtitle2" class="rz-mb-0">@orderDetail.Quantity</RadzenText>
 | 
				
			||||||
                            </RadzenText>
 | 
					 | 
				
			||||||
                        }
 | 
					 | 
				
			||||||
                    </Template> *@
 | 
					 | 
				
			||||||
                        <EditTemplate Context="DetailInfo">
 | 
					 | 
				
			||||||
                            <RadzenDropDown TValue="DrugManuNo" Name="ManuNo" @bind-Value="DetailInfo.DetailInfo.drugManuNo" Data="DetailInfo.DetailInfo.Drug.Manus" Style="width:100%; display: block;">
 | 
					 | 
				
			||||||
                                <Template>
 | 
					 | 
				
			||||||
                                    <RadzenText TextStyle="TextStyle.Subtitle2" class="mb-0">@((context as DrugManuNo)?.ManuNo)</RadzenText>
 | 
					 | 
				
			||||||
                                    @if ((context as DrugManuNo).EffDate != null && (context as DrugManuNo).EffDate.ToString().Length > 10)
 | 
					 | 
				
			||||||
                                    {
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                                        <RadzenText TextStyle="TextStyle.Caption">@((context as DrugManuNo).EffDate.ToString().Substring(0, 10))</RadzenText>
 | 
					 | 
				
			||||||
                                    }
 | 
					 | 
				
			||||||
                                    else
 | 
					 | 
				
			||||||
                                    {
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                                        <RadzenText TextStyle="TextStyle.Caption">@((context as DrugManuNo)?.EffDate)</RadzenText>
 | 
					 | 
				
			||||||
                        }
 | 
					                        }
 | 
				
			||||||
                    </Template>
 | 
					                    </Template>
 | 
				
			||||||
                                <ValueTemplate>
 | 
					 | 
				
			||||||
                                    <RadzenStack Orientation="Orientation.Horizontal">
 | 
					 | 
				
			||||||
                                        <RadzenText TextStyle="TextStyle.Subtitle2" class="mb-0">@((context as DrugManuNo)?.ManuNo)</RadzenText>
 | 
					 | 
				
			||||||
                                        @if ((context as DrugManuNo).EffDate != null && (context as DrugManuNo).EffDate.ToString().Length > 10)
 | 
					 | 
				
			||||||
                                        {
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                                            <RadzenText TextStyle="TextStyle.Caption">@((context as DrugManuNo).EffDate.ToString().Substring(0, 10))</RadzenText>
 | 
					 | 
				
			||||||
                                        }
 | 
					 | 
				
			||||||
                                        else
 | 
					 | 
				
			||||||
                                        {
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                                            <RadzenText TextStyle="TextStyle.Caption">@((context as DrugManuNo)?.EffDate)</RadzenText>
 | 
					 | 
				
			||||||
                                        }
 | 
					 | 
				
			||||||
                                    </RadzenStack>
 | 
					 | 
				
			||||||
                                </ValueTemplate>
 | 
					 | 
				
			||||||
                            </RadzenDropDown>
 | 
					 | 
				
			||||||
                            <RadzenRequiredValidator Text="请选择批次" Component="ManuNo" Popup="true" />
 | 
					 | 
				
			||||||
                        </EditTemplate>
 | 
					 | 
				
			||||||
                </RadzenDataGridColumn>
 | 
					                </RadzenDataGridColumn>
 | 
				
			||||||
                    <RadzenDataGridColumn Property="DetailInfo.Quantity" Title="数量" Filterable="false" Width="50px">
 | 
					 | 
				
			||||||
                        <EditTemplate Context="DetailInfo">
 | 
					 | 
				
			||||||
                            <RadzenNumeric Min="0" Style="display: block" Name="Quantity" @bind-Value=@DetailInfo.DetailInfo.Quantity />
 | 
					 | 
				
			||||||
                            <RadzenNumericRangeValidator Style="position: absolute;z-index: 9999;" Min="0" Text="请填写正确的添加数量" Component="Quantity" Popup="true" />
 | 
					 | 
				
			||||||
                        </EditTemplate>
 | 
					 | 
				
			||||||
                    </RadzenDataGridColumn>
 | 
					 | 
				
			||||||
                    <RadzenDataGridColumn Property="DetailInfo.TotalQuantity" Title="合计" Filterable="false" Width="50px" />
 | 
					 | 
				
			||||||
            </Columns>
 | 
					            </Columns>
 | 
				
			||||||
        </RadzenDataGrid>
 | 
					        </RadzenDataGrid>
 | 
				
			||||||
    </div>
 | 
					    </div>
 | 
				
			||||||
    </div>
 | 
					 | 
				
			||||||
</RadzenStack>
 | 
					</RadzenStack>
 | 
				
			||||||
@code {
 | 
					@code {
 | 
				
			||||||
 | 
					 | 
				
			||||||
    private readonly ILog logger = LogManager.GetLogger(typeof(CheckOrder));
 | 
					 | 
				
			||||||
    @inject IOrderInfoDao orderInfoDao;
 | 
					    @inject IOrderInfoDao orderInfoDao;
 | 
				
			||||||
    @inject DialogService dialogService;
 | 
					    @inject DialogService dialogService;
 | 
				
			||||||
    @inject Microsoft.Extensions.Options.IOptions<Pojo.Config.SettingConfig> setting;
 | 
					    @inject Microsoft.Extensions.Options.IOptions<Pojo.Config.SettingConfig> setting;
 | 
				
			||||||
    @inject NotificationService _message;
 | 
					    @inject Toolbelt.Blazor.I18nText.I18nText I18nText;
 | 
				
			||||||
    @inject IReportDataDao reportDataDao;
 | 
					    private I18nText.local myText = new I18nText.local();
 | 
				
			||||||
    @inject IOptions<SettingConfig> setting;
 | 
					
 | 
				
			||||||
    bool allowRowSelectOnRowClick = true;
 | 
					    bool allowRowSelectOnRowClick = true;
 | 
				
			||||||
    IEnumerable<OrderInfo> orderInfos;
 | 
					    IEnumerable<OrderInfo> orderInfos;
 | 
				
			||||||
    IList<OrderInfo> selectedOrderInfos;
 | 
					    IList<OrderInfo> selectedOrderInfos;
 | 
				
			||||||
    RadzenDataGrid<OrderInfo> grid;
 | 
					    RadzenDataGrid<OrderInfo> grid;
 | 
				
			||||||
    //麻醉师集合
 | 
					 | 
				
			||||||
    List<Anaesthetist> NamesList = new List<Anaesthetist>();
 | 
					 | 
				
			||||||
    Anaesthetist NameInfo;
 | 
					 | 
				
			||||||
    Anaesthetist BoxColor;
 | 
					 | 
				
			||||||
    //药盒集合
 | 
					 | 
				
			||||||
    List<BoxModel> BoxList = new List<BoxModel>();
 | 
					 | 
				
			||||||
    //药盒颜色集合
 | 
					 | 
				
			||||||
    List<Anaesthetist> BoxColorList = new List<Anaesthetist>();
 | 
					 | 
				
			||||||
    BoxModel BoxNum;
 | 
					 | 
				
			||||||
    bool isLoading;
 | 
					    bool isLoading;
 | 
				
			||||||
    int count;
 | 
					    int count;
 | 
				
			||||||
    int[] DrawerNos = new int[] { 1, 2, 3, 4, 5, 6, 7, 8 };
 | 
					    int[] DrawerNos = new int[] { 1, 2, 3, 4, 5, 6, 7, 8 };
 | 
				
			||||||
    int status = 0;
 | 
					    int status = 0;
 | 
				
			||||||
 | 
					    int drawerNo = 1;
 | 
				
			||||||
    string OrderNo;
 | 
					    string OrderNo;
 | 
				
			||||||
    string PatientName;
 | 
					    DateTime OrderDate;
 | 
				
			||||||
    DateTime? OrderDate = null;
 | 
					    void SelectDrawer(int drawerNo)
 | 
				
			||||||
    DateTime PortOrderDate = DateTime.Now;
 | 
					 | 
				
			||||||
    Popup popup;
 | 
					 | 
				
			||||||
    RadzenButton button;
 | 
					 | 
				
			||||||
    //第一次加载不执行LoadData方法
 | 
					 | 
				
			||||||
    int firstLod = 1;
 | 
					 | 
				
			||||||
    void OnCheckSeleced(object dete)
 | 
					 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        if (orderInfos != null)
 | 
					        this.drawerNo = drawerNo;
 | 
				
			||||||
        {
 | 
					        grid.Reload();
 | 
				
			||||||
            orderInfos.ToList().ForEach(it => it.ItemIsChecked = true);
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    void OnCurrentDateChanged(DateTime args)
 | 
					    void OnCurrentDateChanged(DateTime args)
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        OrderDate = new DateTime(args.Year, args.Month, args.Day);
 | 
					        OrderDate = new DateTime(args.Year, args.Month, args.Day);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    void OnCurrentPortDateChanged(DateTime args)
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
        PortOrderDate = new DateTime(args.Year, args.Month, args.Day);
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    // async Task OnColorChange(object value)
 | 
					 | 
				
			||||||
    // {
 | 
					 | 
				
			||||||
    //     Anaesthetist v = value as Anaesthetist;
 | 
					 | 
				
			||||||
    //     if (v.Id != BoxColor.Id)
 | 
					 | 
				
			||||||
    //     {
 | 
					 | 
				
			||||||
    //         BoxList = await orderInfoDao.GetOperationNum(BoxColor.Id);// await orderInfoDao.GetDrawerNumByOperationNum(setting.Value.boxMachineId, roomNameList); //roomNameList.Select(it => new BoxModel { BoxName = it, BoxNo = Convert.ToInt32(it.Substring(it.Length - 2, 2)) }).ToList();
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    //         BoxNum = BoxList.FirstOrDefault();
 | 
					 | 
				
			||||||
    //     }
 | 
					 | 
				
			||||||
    // }
 | 
					 | 
				
			||||||
    //重置
 | 
					    //重置
 | 
				
			||||||
    async Task reloadGrid()
 | 
					    async Task reloadGrid()
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        OrderNo = "";
 | 
					        OrderNo = "";
 | 
				
			||||||
        OrderDate = DateTime.MinValue;
 | 
					        OrderDate = DateTime.MinValue;
 | 
				
			||||||
        firstLod = 1;
 | 
					 | 
				
			||||||
        await grid.Reload();
 | 
					        await grid.Reload();
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    void OnCellClick(DataGridCellMouseEventArgs<OrderInfo> args)
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
        if (args.Data.DetailInfo.SetManuNo != null)
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
            args.Data.DetailInfo.drugManuNo = args.Data.DetailInfo.Drug.Manus.Where(m => m.ManuNo == args.Data.DetailInfo.SetManuNo).FirstOrDefault();
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
        if (args.Data.DetailInfo.drugManuNo == null)
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
            args.Data.DetailInfo.drugManuNo = args.Data.DetailInfo.Drug.Manus.FirstOrDefault();
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
        args.Data.ItemIsChecked = !args.Data.ItemIsChecked;
 | 
					 | 
				
			||||||
        grid.EditRow(args.Data);
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    //确认
 | 
					    //确认
 | 
				
			||||||
    async Task Confirm()
 | 
					    async Task Confirm()
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        if (selectedOrderInfos == null)
 | 
					        orderInfoDao.CheckOrderInfo(selectedOrderInfos, drawerNo);
 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
            _message.Notify(
 | 
					 | 
				
			||||||
                   new NotificationMessage { Severity = NotificationSeverity.Error, Summary = "提示", Detail = $"请选择处方", Duration = 4000 }
 | 
					 | 
				
			||||||
               );
 | 
					 | 
				
			||||||
            return;
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
        if (BoxNum == null)
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
            _message.Notify(
 | 
					 | 
				
			||||||
                  new NotificationMessage { Severity = NotificationSeverity.Error, Summary = "提示", Detail = $"请选择药箱", Duration = 4000 }
 | 
					 | 
				
			||||||
              );
 | 
					 | 
				
			||||||
            return;
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
        if (selectedOrderInfos.Any(it => it.DetailInfo.drugManuNo == null && (string.IsNullOrEmpty(it.DetailInfo.SetManuNo))))
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
            _message.Notify(
 | 
					 | 
				
			||||||
                         new NotificationMessage { Severity = NotificationSeverity.Error, Summary = "提示", Detail = $"请选择批次信息", Duration = 4000 }
 | 
					 | 
				
			||||||
                     );
 | 
					 | 
				
			||||||
            return;
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
        selectedOrderInfos.Where(oi => oi.DetailInfo.drugManuNo != null && !string.IsNullOrEmpty(oi.DetailInfo.drugManuNo.ManuNo)).ToList().ForEach(oi => oi.DetailInfo.SetManuNo = oi.DetailInfo.drugManuNo.ManuNo);
 | 
					 | 
				
			||||||
        selectedOrderInfos.Where(oi => !string.IsNullOrEmpty(oi.DetailInfo.SetManuNo)).ToList().ForEach(oi => oi.DetailInfo.drugManuNo = new() { ManuNo = oi.DetailInfo.SetManuNo });
 | 
					 | 
				
			||||||
        //弹出药品合计信息,确认无误后进行核对,取消则不核对
 | 
					 | 
				
			||||||
        //弹出确认提示框
 | 
					 | 
				
			||||||
        // var b = await dialogService.OpenAsync<CheckOrderConfirmDialog>(
 | 
					 | 
				
			||||||
        //    $"核对确认",
 | 
					 | 
				
			||||||
        //  new Dictionary<string, object>() { { "selectedOrderInfos", selectedOrderInfos } },
 | 
					 | 
				
			||||||
        //  new DialogOptions() { Width = "80vw", Resizable = true, Draggable = true, ShowClose = false });
 | 
					 | 
				
			||||||
        // if (b)
 | 
					 | 
				
			||||||
        // {
 | 
					 | 
				
			||||||
        bool bResult = await orderInfoDao.CheckOrderInfo(selectedOrderInfos, BoxNum);
 | 
					 | 
				
			||||||
        if (bResult)
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
            _message.Notify(
 | 
					 | 
				
			||||||
                            new NotificationMessage { Severity = NotificationSeverity.Success, Summary = "提示", Detail = $"处方已核对完成", Duration = 4000 }
 | 
					 | 
				
			||||||
                        );
 | 
					 | 
				
			||||||
            //await GetInitialDate();
 | 
					 | 
				
			||||||
            await grid.Reload();
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
        else
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
            _message.Notify(
 | 
					 | 
				
			||||||
                          new NotificationMessage { Severity = NotificationSeverity.Error, Summary = "提示", Detail = $"处方已核对失败", Duration = 4000 }
 | 
					 | 
				
			||||||
                   );
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
        // }
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    PageData<OrderInfo> result;
 | 
					 | 
				
			||||||
    protected override async Task OnInitializedAsync()
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
        BoxColorList = setting.Value.boxColor.Split(',').Select(it => new Anaesthetist { Name = it,Id=it=="白"?1:2 }).ToList();
 | 
					 | 
				
			||||||
        BoxColor = BoxColorList.FirstOrDefault();
 | 
					 | 
				
			||||||
        NamesList = setting.Value.anaesthetist_name.Split(',').Select(it => new Anaesthetist { Name = it }).ToList();
 | 
					 | 
				
			||||||
        NameInfo = NamesList.FirstOrDefault();
 | 
					 | 
				
			||||||
        BoxList = await orderInfoDao.GetOperationNum(0);// await orderInfoDao.GetDrawerNumByOperationNum(setting.Value.boxMachineId, roomNameList); //roomNameList.Select(it => new BoxModel { BoxName = it, BoxNo = Convert.ToInt32(it.Substring(it.Length - 2, 2)) }).ToList();
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
        BoxNum = BoxList.FirstOrDefault();
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        //await GetInitialDate();
 | 
					 | 
				
			||||||
        await base.OnInitializedAsync();
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    async Task LoadData(LoadDataArgs args)
 | 
					    async Task LoadData(LoadDataArgs args)
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        if (firstLod == 1)
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            return;
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
        // BoxList=BoxList.Where(bl => bl.BoxNo == BoxColor.Id).ToList();
 | 
					 | 
				
			||||||
        // BoxNum = BoxList.FirstOrDefault();
 | 
					 | 
				
			||||||
        string? anaesthetistName = NameInfo.Name == "未选择" ? null : NameInfo.Name;
 | 
					 | 
				
			||||||
        string? roomName = BoxNum == null ? "" : setting.Value.roomName + BoxNum.BoxName.ToString().PadLeft(2, '0');
 | 
					 | 
				
			||||||
        result = await orderInfoDao.GetAllOrderInfo(anaesthetistName, roomName, PatientName, OrderNo, OrderDate, args.Top, args.Skip);
 | 
					 | 
				
			||||||
        isLoading = true;
 | 
					        isLoading = true;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        var result = await orderInfoDao.GetAllOrderInfoByBox(drawerNo, OrderNo, OrderDate, args.Top, args.Skip);
 | 
				
			||||||
 | 
					        // Update the Data property
 | 
				
			||||||
        orderInfos = result.Desserts;
 | 
					        orderInfos = result.Desserts;
 | 
				
			||||||
 | 
					        // Update the count
 | 
				
			||||||
        count = result.TotalDesserts;
 | 
					        count = result.TotalDesserts;
 | 
				
			||||||
        // if (result != null)
 | 
					 | 
				
			||||||
        // {
 | 
					 | 
				
			||||||
        //     isLoading = true;
 | 
					 | 
				
			||||||
        //     orderInfos = result.Desserts;
 | 
					 | 
				
			||||||
        //     // Update the count
 | 
					 | 
				
			||||||
        //     count = result.TotalDesserts;
 | 
					 | 
				
			||||||
        //     logger.Info($"LoadData:{DateTime.Now},{orderInfos.Count()}");
 | 
					 | 
				
			||||||
        //     // Update the Data property
 | 
					 | 
				
			||||||
        //     if (Name != null)
 | 
					 | 
				
			||||||
        //     {
 | 
					 | 
				
			||||||
        //         orderInfos = orderInfos.Where(it => it.anaesthetistName == Name.Name);
 | 
					 | 
				
			||||||
        //         logger.Info($"LoadData:{DateTime.Now},{orderInfos.Count()},Name{Name.Name}");
 | 
					 | 
				
			||||||
        //         count = orderInfos.Count();
 | 
					 | 
				
			||||||
        //     }
 | 
					 | 
				
			||||||
        //     if (OrderDate != null && OrderDate != DateTime.MinValue)
 | 
					 | 
				
			||||||
        //     {
 | 
					 | 
				
			||||||
        //         orderInfos = orderInfos.Where(it => it.ChargeDate.Date >= OrderDate.Value.Date);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        //         logger.Info($"LoadData:{DateTime.Now},{orderInfos.Count()}");
 | 
					 | 
				
			||||||
        //         // Update the count
 | 
					 | 
				
			||||||
        //         count = orderInfos.Count();
 | 
					 | 
				
			||||||
        //     }
 | 
					 | 
				
			||||||
        //     if (!string.IsNullOrEmpty(OrderNo))
 | 
					 | 
				
			||||||
        //     {
 | 
					 | 
				
			||||||
        //         orderInfos = orderInfos.Where(it => it.OrderNo.Contains(OrderNo));
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        //         logger.Info($"LoadData:{DateTime.Now},{orderInfos.Count()}-OrderNo{OrderNo}");
 | 
					 | 
				
			||||||
        //         // Update the count
 | 
					 | 
				
			||||||
        //         count = orderInfos.Count();
 | 
					 | 
				
			||||||
        //     }
 | 
					 | 
				
			||||||
        //     if (Name != null && OrderDate != null && OrderDate != DateTime.MinValue && !string.IsNullOrEmpty(OrderNo))
 | 
					 | 
				
			||||||
        //     {
 | 
					 | 
				
			||||||
        //         orderInfos = orderInfos.Where(it => it.anaesthetistName == Name.Name && it.ChargeDate.Date == OrderDate.Value.Date && it.OrderNo.Contains(OrderNo));
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        //         logger.Info($"LoadData:{DateTime.Now},{orderInfos.Count()}");
 | 
					 | 
				
			||||||
        //         // Update the count
 | 
					 | 
				
			||||||
        //         count = orderInfos.Count();
 | 
					 | 
				
			||||||
        //     }
 | 
					 | 
				
			||||||
        //     if (BoxNum != null&&BoxNum.BoxName!=99&&BoxNum.BoxName!=111)
 | 
					 | 
				
			||||||
        //     {
 | 
					 | 
				
			||||||
        //         string roomName = setting.Value.roomName + BoxNum.BoxName.ToString().PadLeft(2, '0');
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        //         orderInfos = orderInfos.Where(it => it.RoomName == roomName);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        //         logger.Info($"LoadData:{DateTime.Now},{orderInfos.Count()};roomName{roomName}");
 | 
					 | 
				
			||||||
        //         count = orderInfos.Count();
 | 
					 | 
				
			||||||
        //     }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        //     logger.Info($"LoadData结束:{DateTime.Now},{orderInfos.Count()}");
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        //     orderInfos = orderInfos.Skip(args.Skip.Value).Take(args.Top.Value).ToList();
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        //     logger.Info($"LoadData结束:{DateTime.Now},{orderInfos.Count()} -{args.Skip.Value}-{args.Top.Value}");
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        //     await InvokeAsync(StateHasChanged);
 | 
					 | 
				
			||||||
        //     //查找该麻醉师对应的手术室
 | 
					 | 
				
			||||||
        //     //List<string> roomNameList = orderInfos.Select(it => it.RoomName).Distinct().ToList();
 | 
					 | 
				
			||||||
        //     // List<int> roomNameList = orderInfos.Select(it => Convert.ToInt32(it.RoomName.Substring(6, it.RoomName.Length - 6))).Distinct().ToList();
 | 
					 | 
				
			||||||
        //     // BoxList = await orderInfoDao.GetDrawerNumByOperationNum(setting.Value.boxMachineId, roomNameList); //roomNameList.Select(it => new BoxModel { BoxName = it, BoxNo = Convert.ToInt32(it.Substring(it.Length - 2, 2)) }).ToList();
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        //     // BoxNum = BoxList.FirstOrDefault();
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
        isLoading = false;
 | 
					        isLoading = false;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        // }
 | 
					        DrawerNos = await orderInfoDao.GetDrawerNum(setting.Value.boxMachineId);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    //麻醉药品使用登记本导出
 | 
					    protected override async Task OnInitializedAsync()
 | 
				
			||||||
    async Task StockExport()
 | 
					 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        if (PortOrderDate == DateTime.MinValue)
 | 
					        myText = await I18nText.GetTextTableAsync<I18nText.local>(this);
 | 
				
			||||||
        {
 | 
					        await base.OnInitializedAsync();
 | 
				
			||||||
            _message.Notify(
 | 
					 | 
				
			||||||
                           new NotificationMessage { Severity = NotificationSeverity.Error, Summary = "提示", Detail = $"请选择处方时间再导出", Duration = 4000 }
 | 
					 | 
				
			||||||
                    );
 | 
					 | 
				
			||||||
            return;
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
        List<ReportUsageDateInfo> pageData = await reportDataDao.GetOrderInfoData(PortOrderDate);
 | 
					 | 
				
			||||||
        Dictionary<string, object> parameters = new Dictionary<string, object>();
 | 
					 | 
				
			||||||
        parameters.Add("PortOrderDate", pageData);
 | 
					 | 
				
			||||||
        GridReportUtil.PrintReport("Usage_Temp.grf", parameters);
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    // protected override async Task OnInitializedAsync()
 | 
					    // protected override async Task OnInitializedAsync()
 | 
				
			||||||
    // {
 | 
					    // {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,358 +0,0 @@
 | 
				
			||||||
@using MasaBlazorApp3.Pojo.Config
 | 
					 | 
				
			||||||
@using MasaBlazorApp3.Util
 | 
					 | 
				
			||||||
@using MasaBlazorApp3.Pojo.Vo;
 | 
					 | 
				
			||||||
@using Microsoft.Extensions.Options
 | 
					 | 
				
			||||||
@using log4net;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
<RadzenStack>
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    <div Style="width:100%;height:70vh;overflow:auto">
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        @* <RadzenListBox AllowClear="true" @bind-Value=@listBoxSelectedcsList Style="width:50vw;overflow:auto" AllowFiltering="false" 
 | 
					 | 
				
			||||||
                       Data=@csList>
 | 
					 | 
				
			||||||
            <Template Context="contextDate">
 | 
					 | 
				
			||||||
                <RadzenStack Orientation="Orientation.Horizontal">
 | 
					 | 
				
			||||||
                    <RadzenText Style="width:20vw;text-align:left">@contextDate.Drug.DrugName</RadzenText>
 | 
					 | 
				
			||||||
                    <RadzenText Style="width:10vw">@contextDate.ManuNo</RadzenText>
 | 
					 | 
				
			||||||
                    <RadzenStack Gap="10" Style="text-align:right">
 | 
					 | 
				
			||||||
                        <div style="text-align: center;">
 | 
					 | 
				
			||||||
                            @if (contextDate.ReturnDrawerChanneStock != null && contextDate.ReturnDrawerChanneStock.ReturnQuantity>0)
 | 
					 | 
				
			||||||
                            {
 | 
					 | 
				
			||||||
                                <div style="text-align: center;">
 | 
					 | 
				
			||||||
                                    还药库位【@contextDate.ReturnDrawerChanneStock?.DrawerNo】还药数【contextDate.ReturnDrawerChanneStock?.ReturnQuantity】< br />
 | 
					 | 
				
			||||||
                                </div>
 | 
					 | 
				
			||||||
                            }
 | 
					 | 
				
			||||||
                            @if (contextDate.OrderList.fore > 0)
 | 
					 | 
				
			||||||
                            {
 | 
					 | 
				
			||||||
                                <div style="text-align: center;">
 | 
					 | 
				
			||||||
                                    空瓶库位【@contextDate.EmptyStock】空瓶数【@contextDate.EmptyQuantity】< br />
 | 
					 | 
				
			||||||
                                </div>
 | 
					 | 
				
			||||||
                            }
 | 
					 | 
				
			||||||
                        </div>
 | 
					 | 
				
			||||||
                    </RadzenStack>
 | 
					 | 
				
			||||||
                    <RadzenStack Gap="10" Style="text-align:right">
 | 
					 | 
				
			||||||
                        <div style="text-align: center;">
 | 
					 | 
				
			||||||
                            基数【@contextDate.BaseQuantity】<br />
 | 
					 | 
				
			||||||
                            库存数【@contextDate.Quantity】<br />
 | 
					 | 
				
			||||||
                            用药数【@contextDate.UseQuantity】<br />
 | 
					 | 
				
			||||||
                            处方数【@contextDate.OrderQuantity】<br />
 | 
					 | 
				
			||||||
                            空瓶数【@contextDate.EmptyQuantity】<br />
 | 
					 | 
				
			||||||
                        </div>
 | 
					 | 
				
			||||||
                    </RadzenStack>
 | 
					 | 
				
			||||||
                </RadzenStack>
 | 
					 | 
				
			||||||
            </Template>
 | 
					 | 
				
			||||||
        </RadzenListBox> *@
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        <RadzenListBox AllowClear="true" @bind-Value=@listBoxSelectedcsList Style="width:100%;overflow:auto" AllowFiltering="false" TValue="ChannelStock"
 | 
					 | 
				
			||||||
        Data=@csList>
 | 
					 | 
				
			||||||
            <Template>
 | 
					 | 
				
			||||||
                <RadzenStack Orientation="Orientation.Horizontal">
 | 
					 | 
				
			||||||
                    <RadzenText Style="width:20vw;text-align:left">@((context as ChannelStock).Drug.ToString())</RadzenText>
 | 
					 | 
				
			||||||
                    <RadzenText Style="width:10vw">@((context as ChannelStock).ManuNo)</RadzenText>
 | 
					 | 
				
			||||||
                    <RadzenStack Gap="10" Style="text-align:right">
 | 
					 | 
				
			||||||
                        <div style="text-align: center;">
 | 
					 | 
				
			||||||
                            @if (((context as ChannelStock).DrawerChanneStockList) != null && ((context as ChannelStock).DrawerChanneStockList.Count) > 0)
 | 
					 | 
				
			||||||
                            {
 | 
					 | 
				
			||||||
                                for (int i = 0; i < (context as ChannelStock).DrawerChanneStockList.Count; i++)
 | 
					 | 
				
			||||||
                                {
 | 
					 | 
				
			||||||
                                    <div style="text-align: center;">
 | 
					 | 
				
			||||||
                                        还药品库位【@((context as ChannelStock).DrawerChanneStockList[i].Location)】还药数【@((context as ChannelStock).DrawerChanneStockList[i].ReturnQuantity)】
 | 
					 | 
				
			||||||
                                    </div>
 | 
					 | 
				
			||||||
                                }
 | 
					 | 
				
			||||||
                            }
 | 
					 | 
				
			||||||
                            @if ((context as ChannelStock).EmptyQuantity > 0)
 | 
					 | 
				
			||||||
                            {
 | 
					 | 
				
			||||||
                                <div style="text-align: center;">
 | 
					 | 
				
			||||||
                                    还空瓶库位【@((context as ChannelStock).EmptyStock.Location)】空瓶数【@((context as ChannelStock).EmptyStock.ReturnQuantity)】
 | 
					 | 
				
			||||||
                                </div>
 | 
					 | 
				
			||||||
                            }
 | 
					 | 
				
			||||||
                        </div>
 | 
					 | 
				
			||||||
                    </RadzenStack>
 | 
					 | 
				
			||||||
                    <RadzenStack Gap="10" Style="text-align:right">
 | 
					 | 
				
			||||||
                        <div style="text-align: center;">
 | 
					 | 
				
			||||||
                            基数【@((context as ChannelStock).BaseQuantity)】<br />
 | 
					 | 
				
			||||||
                            @* 总库存【@((context as ChannelStock).TotalQuantity)】<br /> *@
 | 
					 | 
				
			||||||
                            库存数【@((context as ChannelStock).Quantity)】<br />
 | 
					 | 
				
			||||||
                            用药数【@((context as ChannelStock).UseQuantity)】<br />
 | 
					 | 
				
			||||||
                            处方数【@((context as ChannelStock).OrderQuantity)】<br />
 | 
					 | 
				
			||||||
                            空瓶数【@((context as ChannelStock).EmptyQuantity)】<br />
 | 
					 | 
				
			||||||
                        </div>
 | 
					 | 
				
			||||||
                    </RadzenStack>
 | 
					 | 
				
			||||||
                </RadzenStack>
 | 
					 | 
				
			||||||
            </Template>
 | 
					 | 
				
			||||||
        </RadzenListBox>
 | 
					 | 
				
			||||||
    </div>
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    <RadzenStack Orientation="Orientation.Horizontal" JustifyContent="JustifyContent.Center" Gap="0.5rem">
 | 
					 | 
				
			||||||
        @* <RadzenButton Click="@ConfirmOK" ButtonStyle="ButtonStyle.Success" Variant="Variant.Flat" Text="归还" Style="width: 120px" />
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        <RadzenButton Click="@((args) => dialogService.Close(false))" Variant="Variant.Flat" Text="取消" Style="width: 120px" /> *@
 | 
					 | 
				
			||||||
        @if (status < 2)
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
            <RadzenButton Click="@OpenDrawer" IsBusy="status > 0" BusyText="归还中。。。" ButtonStyle="ButtonStyle.Warning" Variant="Variant.Flat" Text="归还" Style="width: 120px" />
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
        @if (status == 2)
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
            <RadzenButton Click="@TakeFinish" ButtonStyle="ButtonStyle.Success" Variant="Variant.Flat" Text="完成" Style="width: 120px" />
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
        @if (status <= 2)
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
            <RadzenButton Click="@Cancel" Variant="Variant.Flat" Text="取消" Style="width: 120px" />
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    </RadzenStack>
 | 
					 | 
				
			||||||
</RadzenStack>
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
@code {
 | 
					 | 
				
			||||||
    @inject Radzen.DialogService dialogService;
 | 
					 | 
				
			||||||
    @inject IOptions<DrawerConfig> setting;
 | 
					 | 
				
			||||||
    @inject PortUtil PortUtil;
 | 
					 | 
				
			||||||
    @inject NotificationService _message;
 | 
					 | 
				
			||||||
    @inject IOrderInfoDao orderInfoDao;
 | 
					 | 
				
			||||||
    [Parameter] public IList<ChannelStock> csList { get; set; }
 | 
					 | 
				
			||||||
    List<OrderDetail> orderDetailList = new();
 | 
					 | 
				
			||||||
    ChannelStock listBoxSelectedcsList = new();
 | 
					 | 
				
			||||||
    private readonly ILog logger = LogManager.GetLogger(typeof(OrderDetailDialog));
 | 
					 | 
				
			||||||
    int status;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    List<OrderTakeVo> data = new();
 | 
					 | 
				
			||||||
    //计数取药数量
 | 
					 | 
				
			||||||
    int[] WeightFinnalQuantity { get; set; } = new int[] { 0, 0, 0, 0, 0, 0, 0, 0, 0 };
 | 
					 | 
				
			||||||
    // //取药数量小于库存
 | 
					 | 
				
			||||||
    // tempData.Add(new OrderTakeVo()
 | 
					 | 
				
			||||||
    // {
 | 
					 | 
				
			||||||
    //     Drug = detail.Drug,
 | 
					 | 
				
			||||||
    //                             OrderDetail = detail,
 | 
					 | 
				
			||||||
    //                             ChannelStock = stock,
 | 
					 | 
				
			||||||
    //                             StockQuantity = total,
 | 
					 | 
				
			||||||
    //                             Quantity = Quantity,
 | 
					 | 
				
			||||||
    //                         });
 | 
					 | 
				
			||||||
    protected override async Task OnInitializedAsync()
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
        for (int i = 0; i < csList.Count; i++)
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
            if (csList[i].EmptyStock != null && csList[i].EmptyStock.ReturnQuantity > 0)
 | 
					 | 
				
			||||||
            {
 | 
					 | 
				
			||||||
                data.Add(new OrderTakeVo()
 | 
					 | 
				
			||||||
                    {
 | 
					 | 
				
			||||||
                        ChannelStock = csList[i].EmptyStock
 | 
					 | 
				
			||||||
                    });
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
            if (csList[i].DrawerChanneStockList != null && csList[i].DrawerChanneStockList.Count > 0)
 | 
					 | 
				
			||||||
            {
 | 
					 | 
				
			||||||
                for (int j = 0; j < csList[i].DrawerChanneStockList.Count; j++)
 | 
					 | 
				
			||||||
                {
 | 
					 | 
				
			||||||
                    data.Add(new OrderTakeVo()
 | 
					 | 
				
			||||||
                        {
 | 
					 | 
				
			||||||
                            ChannelStock = csList[i].DrawerChanneStockList[j]
 | 
					 | 
				
			||||||
                        });
 | 
					 | 
				
			||||||
                }
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
        base.OnInitializedAsync();
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    // async Task ConfirmOK()
 | 
					 | 
				
			||||||
    // {
 | 
					 | 
				
			||||||
    //     // 关闭弹窗
 | 
					 | 
				
			||||||
    //     dialogService.Close(true);
 | 
					 | 
				
			||||||
    // }
 | 
					 | 
				
			||||||
    async Task OpenDrawer()
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
        this.status = 1;
 | 
					 | 
				
			||||||
        PortUtil.PowerOn();
 | 
					 | 
				
			||||||
        await Task.Delay(200);
 | 
					 | 
				
			||||||
        // 解析需要打开的抽屉列表
 | 
					 | 
				
			||||||
        List<OrderTakeVo> drawerNos = this.data.GroupBy(it => it.ChannelStock.DrawerNo).Select(it => it.First()).ToList();
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        // 根据抽屉类型来决定打开前是否需要查询数量
 | 
					 | 
				
			||||||
        var promiseUtil = new PromiseUtil<int>();
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        await promiseUtil.taskAsyncLoop(500, 0, async (options, next, stop) =>
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
            var orderTakeVo = drawerNos[options._data];
 | 
					 | 
				
			||||||
            var drawerNo = orderTakeVo.ChannelStock.DrawerNo;
 | 
					 | 
				
			||||||
            var drawerType = orderTakeVo.ChannelStock.DrawerType;
 | 
					 | 
				
			||||||
            try
 | 
					 | 
				
			||||||
            {
 | 
					 | 
				
			||||||
                if (this.status == 0)
 | 
					 | 
				
			||||||
                {
 | 
					 | 
				
			||||||
                    stop();
 | 
					 | 
				
			||||||
                }
 | 
					 | 
				
			||||||
                // 开启抽屉
 | 
					 | 
				
			||||||
                else if (this.status == 1)
 | 
					 | 
				
			||||||
                {
 | 
					 | 
				
			||||||
                    if (orderTakeVo.Status == 0)
 | 
					 | 
				
			||||||
                    {
 | 
					 | 
				
			||||||
                        // 判断是否为单支抽屉
 | 
					 | 
				
			||||||
                        if (setting.Value.single.Contains(drawerNo))
 | 
					 | 
				
			||||||
                        {
 | 
					 | 
				
			||||||
                            byte[] quantity = await PortUtil.CheckQuantityByDrawer(drawerNo);
 | 
					 | 
				
			||||||
                            orderTakeVo.BeforeQuantity = quantity.Select(it => Convert.ToInt32(it)).ToArray().Skip(3).Take(9).ToArray();
 | 
					 | 
				
			||||||
                            logger.Info($"单支抽屉,开抽屉前检测数量【{string.Join(",", orderTakeVo.BeforeQuantity)}】");
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                            await PortUtil.HasLightOnByCol(drawerNo, data.Where(ot => ot.ChannelStock.DrawerNo == drawerNo).Select(ot => ot.ChannelStock.ColNo).ToArray());
 | 
					 | 
				
			||||||
                        }
 | 
					 | 
				
			||||||
                        var b = await PortUtil.OpenDrawerStatus(drawerNo);
 | 
					 | 
				
			||||||
                        if (b)
 | 
					 | 
				
			||||||
                        {
 | 
					 | 
				
			||||||
                            PortUtil.speechSynthesizer.SpeakAsyncCancelAll();
 | 
					 | 
				
			||||||
                            if (drawerType==1)
 | 
					 | 
				
			||||||
                            {
 | 
					 | 
				
			||||||
                                PortUtil.SpeakAsync($"{drawerNo}号抽屉已经打开,请,环药");
 | 
					 | 
				
			||||||
                            }
 | 
					 | 
				
			||||||
                            else
 | 
					 | 
				
			||||||
                            {
 | 
					 | 
				
			||||||
                                PortUtil.SpeakAsync($"{drawerNo}号抽屉已经打开,请,环空瓶");
 | 
					 | 
				
			||||||
                            }
 | 
					 | 
				
			||||||
                            orderTakeVo.Status = 1;
 | 
					 | 
				
			||||||
                            next();
 | 
					 | 
				
			||||||
                        }
 | 
					 | 
				
			||||||
                        else
 | 
					 | 
				
			||||||
                        {
 | 
					 | 
				
			||||||
                            _message.Notify(
 | 
					 | 
				
			||||||
                            new NotificationMessage { Severity = NotificationSeverity.Error, Summary = "提示", Detail = $"抽屉【{drawerNo}】打开失败,请检测硬件", Duration = 4000 }
 | 
					 | 
				
			||||||
                        );
 | 
					 | 
				
			||||||
                            logger.Info($"抽屉打开失败");
 | 
					 | 
				
			||||||
                            PortUtil.PowerOff();
 | 
					 | 
				
			||||||
                            RestData();
 | 
					 | 
				
			||||||
                            stop();
 | 
					 | 
				
			||||||
                        }
 | 
					 | 
				
			||||||
                    }
 | 
					 | 
				
			||||||
                    // 检测状态
 | 
					 | 
				
			||||||
                    else if (orderTakeVo.Status == 1)
 | 
					 | 
				
			||||||
                    {
 | 
					 | 
				
			||||||
                        // 查询抽屉是否为关闭状态
 | 
					 | 
				
			||||||
                        var b = await PortUtil.CheckDrawerStatus2(drawerNo);
 | 
					 | 
				
			||||||
                        // 关闭则改变状态并终止循环
 | 
					 | 
				
			||||||
                        if (b)
 | 
					 | 
				
			||||||
                        {
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                            data.ForEach(cl =>
 | 
					 | 
				
			||||||
                            {
 | 
					 | 
				
			||||||
                                if (cl.ChannelStock.DrawerNo == drawerNo)
 | 
					 | 
				
			||||||
                                {
 | 
					 | 
				
			||||||
                                    cl.GetQuantity = cl.Quantity;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                                }
 | 
					 | 
				
			||||||
                            });
 | 
					 | 
				
			||||||
                            orderTakeVo.Status = 2;
 | 
					 | 
				
			||||||
                            PortUtil.PowerOff();
 | 
					 | 
				
			||||||
                            if (options._data == drawerNos.Count - 1)
 | 
					 | 
				
			||||||
                            {
 | 
					 | 
				
			||||||
                                PortUtil.speechSynthesizer.SpeakAsyncCancelAll();
 | 
					 | 
				
			||||||
                                PortUtil.SpeakAsync($"抽屉关闭,请,点击完成按钮进行确认");
 | 
					 | 
				
			||||||
                                this.status = 2;
 | 
					 | 
				
			||||||
                                string alertMessage = string.Empty;
 | 
					 | 
				
			||||||
                                //检查是否称重抽屉,核对实际取出数量是否与应取数量一致,不一致则弹出提示
 | 
					 | 
				
			||||||
                                for (int i = 0; i < data.Count; i++)
 | 
					 | 
				
			||||||
                                {
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                                    if (data[i].ChannelStock.BoardType.ToString().Contains("2"))
 | 
					 | 
				
			||||||
                                    {
 | 
					 | 
				
			||||||
                                        byte[] quantity = await PortUtil.CheckQuantityByDrawer(drawerNo);
 | 
					 | 
				
			||||||
                                        orderTakeVo.AfterQuantity = quantity.Select(it => Convert.ToInt32(it)).ToArray().Skip(3).Take(9).ToArray();
 | 
					 | 
				
			||||||
                                        logger.Info($"单支抽屉,关抽屉后检测数量【{string.Join(",", orderTakeVo.AfterQuantity)}】");
 | 
					 | 
				
			||||||
                                        WeightFinnalQuantity[data[i].ChannelStock.ColNo - 1] = orderTakeVo.BeforeQuantity[data[i].ChannelStock.ColNo - 1] - orderTakeVo.AfterQuantity[data[i].ChannelStock.ColNo - 1];
 | 
					 | 
				
			||||||
                                        if (data[i].Quantity != WeightFinnalQuantity[data[i].ChannelStock.ColNo - 1])
 | 
					 | 
				
			||||||
                                        {
 | 
					 | 
				
			||||||
                                            alertMessage += $"{data[i].Drug.DrugName}应取数量【{orderTakeVo.Quantity}】,实际取出数量【{WeightFinnalQuantity[data[i].ChannelStock.ColNo - 1]}】";
 | 
					 | 
				
			||||||
                                        }
 | 
					 | 
				
			||||||
                                    }
 | 
					 | 
				
			||||||
                                }
 | 
					 | 
				
			||||||
                                if (!string.IsNullOrEmpty(alertMessage))
 | 
					 | 
				
			||||||
                                {
 | 
					 | 
				
			||||||
                                    //弹出确认对话框
 | 
					 | 
				
			||||||
                                    alertMessage += "应取数与实际取出数不一致确认要保存吗?";
 | 
					 | 
				
			||||||
                                    //弹出确认提示框
 | 
					 | 
				
			||||||
                                    var confirm = await dialogService.OpenAsync<ConfirmDialog>(
 | 
					 | 
				
			||||||
                                          $"保存确认",
 | 
					 | 
				
			||||||
                                          new Dictionary<string, object>() { { "confirmInfo", alertMessage } },
 | 
					 | 
				
			||||||
                                          new DialogOptions() { Width = "45vw", Resizable = true, Draggable = true, ShowClose = false });
 | 
					 | 
				
			||||||
                                    logger.Info(alertMessage);
 | 
					 | 
				
			||||||
                                    if (!confirm)
 | 
					 | 
				
			||||||
                                    {
 | 
					 | 
				
			||||||
                                        RestData();
 | 
					 | 
				
			||||||
                                        logger.Info("取消保存");
 | 
					 | 
				
			||||||
                                        // 关闭弹窗
 | 
					 | 
				
			||||||
                                        dialogService.Close(false);
 | 
					 | 
				
			||||||
                                    }
 | 
					 | 
				
			||||||
                                }
 | 
					 | 
				
			||||||
                                stop();
 | 
					 | 
				
			||||||
                            }
 | 
					 | 
				
			||||||
                            else
 | 
					 | 
				
			||||||
                            {
 | 
					 | 
				
			||||||
                                options._data += 1;
 | 
					 | 
				
			||||||
                                next();
 | 
					 | 
				
			||||||
                            }
 | 
					 | 
				
			||||||
                        }
 | 
					 | 
				
			||||||
                        else
 | 
					 | 
				
			||||||
                        {
 | 
					 | 
				
			||||||
                            next(); // continue iteration
 | 
					 | 
				
			||||||
                        }
 | 
					 | 
				
			||||||
                    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
            catch (Exception e)
 | 
					 | 
				
			||||||
            {
 | 
					 | 
				
			||||||
                RestData();
 | 
					 | 
				
			||||||
                logger.Info($"处方取药发生错误,{e.Message}");
 | 
					 | 
				
			||||||
                _message.Notify(
 | 
					 | 
				
			||||||
                new NotificationMessage { Severity = NotificationSeverity.Error, Summary = "提示", Detail = $"发生错误,{e.Message}", Duration = 4000 }
 | 
					 | 
				
			||||||
            );
 | 
					 | 
				
			||||||
                if (setting.Value.single.Contains(drawerNo))
 | 
					 | 
				
			||||||
                {
 | 
					 | 
				
			||||||
                    PortUtil.PowerOff();
 | 
					 | 
				
			||||||
                }
 | 
					 | 
				
			||||||
                stop();
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
        });
 | 
					 | 
				
			||||||
        PortUtil.PowerOff();
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    void RestData()
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
        PortUtil.PowerOff();
 | 
					 | 
				
			||||||
        PortUtil.speechSynthesizer.SpeakAsyncCancelAll();
 | 
					 | 
				
			||||||
        this.status = 0;
 | 
					 | 
				
			||||||
        data.ForEach(it =>
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
            it.Status = 0;
 | 
					 | 
				
			||||||
            it.BeforeQuantity = new int[9];
 | 
					 | 
				
			||||||
            it.AfterQuantity = new int[9];
 | 
					 | 
				
			||||||
        });
 | 
					 | 
				
			||||||
        this.WeightFinnalQuantity = new int[9];
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    void Cancel()
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
        RestData();
 | 
					 | 
				
			||||||
        // 关闭弹窗
 | 
					 | 
				
			||||||
        dialogService.Close(false);
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    async Task TakeFinish()
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        // 保存账册、操作记录
 | 
					 | 
				
			||||||
        bool bResult = await orderInfoDao.CheckOrderInfoByChannelStock(csList.ToList(), null);
 | 
					 | 
				
			||||||
        if (bResult)
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
            _message.Notify(
 | 
					 | 
				
			||||||
                            new NotificationMessage { Severity = NotificationSeverity.Success, Summary = "提示", Detail = $"处方已核对完成", Duration = 4000 }
 | 
					 | 
				
			||||||
                        );
 | 
					 | 
				
			||||||
            // 关闭弹窗
 | 
					 | 
				
			||||||
            dialogService.Close(true);
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
        else
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
            _message.Notify(
 | 
					 | 
				
			||||||
                          new NotificationMessage { Severity = NotificationSeverity.Error, Summary = "提示", Detail = $"处方核对失败", Duration = 4000 }
 | 
					 | 
				
			||||||
                   );
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
        //重置状态
 | 
					 | 
				
			||||||
        this.RestData();
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
| 
						 | 
					@ -1,253 +0,0 @@
 | 
				
			||||||
@page "/Box/OrderImport"
 | 
					 | 
				
			||||||
@using MasaBlazorApp3.Pojo.Config
 | 
					 | 
				
			||||||
@using MasaBlazorApp3.Report
 | 
					 | 
				
			||||||
@using Microsoft.Extensions.Options
 | 
					 | 
				
			||||||
@using Radzen.Blazor.Rendering
 | 
					 | 
				
			||||||
@using log4net;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
<style>
 | 
					 | 
				
			||||||
    .rz-grid-table {
 | 
					 | 
				
			||||||
        position: relative;
 | 
					 | 
				
			||||||
        border-collapse: separate;
 | 
					 | 
				
			||||||
        border-spacing: 0;
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
</style>
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
<RadzenStack Orientation="Orientation.Horizontal">
 | 
					 | 
				
			||||||
    <div class="col-12">
 | 
					 | 
				
			||||||
        <form onsubmit="@(() => {grid.Reload();})">
 | 
					 | 
				
			||||||
            <RadzenFieldset Text="查询">
 | 
					 | 
				
			||||||
                <RadzenRow AlignItems="AlignItems.Center">
 | 
					 | 
				
			||||||
                    <RadzenColumn Size="6">
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                        <RadzenLabel Text="处方号" Component="OrderNo" />
 | 
					 | 
				
			||||||
                        <RadzenTextBox @bind-Value="OrderNo" Style="width: 100%;" Name="OrderNo"></RadzenTextBox>
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                    </RadzenColumn>
 | 
					 | 
				
			||||||
                    <RadzenColumn Size="6" Style="margin-top:0.5rem">
 | 
					 | 
				
			||||||
                        <RadzenLabel Text="处方时间" Component="OrderDate" />
 | 
					 | 
				
			||||||
                        <RadzenDatePicker DateFormat="yyyy-MM-dd" CurrentDateChanged="@OnCurrentDateChanged" @bind-Value="OrderDate" Style="width: 100%;" Name="OrderDate" />
 | 
					 | 
				
			||||||
                    </RadzenColumn>
 | 
					 | 
				
			||||||
                </RadzenRow>
 | 
					 | 
				
			||||||
                <RadzenRow AlignItems="AlignItems.Center">
 | 
					 | 
				
			||||||
                    <RadzenColumn Size="6">
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                        <RadzenLabel Text="患者姓名" Component="PatientName" />
 | 
					 | 
				
			||||||
                        <RadzenTextBox @bind-Value="PatientName" Style="width: 100%;" Name="PatientName"></RadzenTextBox>
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                    </RadzenColumn>
 | 
					 | 
				
			||||||
                    <RadzenColumn Size="6" Style="margin-top:4vh">
 | 
					 | 
				
			||||||
                        <RadzenButton Size="ButtonSize.Medium" ButtonType="ButtonType.Submit" IsBusy="isLoading" Icon="search" Text="查询" />
 | 
					 | 
				
			||||||
                        <RadzenButton Size="ButtonSize.Medium" Click="Confirm" ButtonType="ButtonType.Button" ButtonStyle="ButtonStyle.Warning" IsBusy="isLoading" Icon="input" Text="导入" />
 | 
					 | 
				
			||||||
                        <RadzenButton Click="@((args) => dialogService.Close(false))" Variant="Variant.Flat" ButtonStyle="ButtonStyle.Secondary" Text="取消" />
 | 
					 | 
				
			||||||
                    </RadzenColumn>
 | 
					 | 
				
			||||||
                </RadzenRow>
 | 
					 | 
				
			||||||
            </RadzenFieldset>
 | 
					 | 
				
			||||||
        </form>
 | 
					 | 
				
			||||||
        <div Style="width:75vw;height:50vh;overflow:auto">
 | 
					 | 
				
			||||||
            <RadzenDataGrid @ref="grid" AllowRowSelectOnRowClick="@allowRowSelectOnRowClick" AllowFiltering="true" LoadData="@LoadData" Style="width:75vw;overflow:auto" Groupable="true"
 | 
					 | 
				
			||||||
                            FilterPopupRenderMode="PopupRenderMode.OnDemand" FilterCaseSensitivity="FilterCaseSensitivity.CaseInsensitive"
 | 
					 | 
				
			||||||
                            Data="@orderInfos" IsLoading="@isLoading" Count="@count" EmptyText="无数据"
 | 
					 | 
				
			||||||
                            SelectionMode="DataGridSelectionMode.Multiple"
 | 
					 | 
				
			||||||
                            @bind-Value="@(selectedOrderInfos)"
 | 
					 | 
				
			||||||
                            CellClick="@((DataGridCellMouseEventArgs<OrderInfo> args) => OnCellClick(args))"
 | 
					 | 
				
			||||||
                            AllowPaging="false">
 | 
					 | 
				
			||||||
                <Columns>
 | 
					 | 
				
			||||||
                    <RadzenDataGridColumn Sortable="false" Filterable="false" Width="4rem">
 | 
					 | 
				
			||||||
                        @*   <HeaderTemplate>
 | 
					 | 
				
			||||||
                            <RadzenCheckBox TabIndex="-1" TriState="false" TValue="bool?" InputAttributes="@(new Dictionary<string, object>() { { "aria-label", "Select all items" } })"
 | 
					 | 
				
			||||||
                            Value="@(selectedOrderInfos == null || selectedOrderInfos?.Any() != true ? false : !orderInfos.All(i => selectedOrderInfos.Contains(i)) ? null : orderInfos.Any(i => selectedOrderInfos.Contains(i)))"
 | 
					 | 
				
			||||||
                            Change="@(args => OnCheckSeleced(args))" />
 | 
					 | 
				
			||||||
                        </HeaderTemplate>
 | 
					 | 
				
			||||||
                        <Template Context="data">
 | 
					 | 
				
			||||||
                            <RadzenCheckBox TabIndex="-1" TriState="false" Value="@data.ItemIsChecked" InputAttributes="@(new Dictionary<string, object>() { { "aria-label", "Select item" } })"
 | 
					 | 
				
			||||||
                            TValue="bool" Change="@(args => { if (!allowRowSelectOnRowClick) { grid.SelectRow(data); } })" />
 | 
					 | 
				
			||||||
                        </Template> *@
 | 
					 | 
				
			||||||
                        <HeaderTemplate>
 | 
					 | 
				
			||||||
                            <RadzenCheckBox TabIndex="-1" TriState="false" TValue="bool?" InputAttributes="@(new Dictionary<string, object>() { { "aria-label", "Select all items" } })"
 | 
					 | 
				
			||||||
                                            Value="@(selectedOrderInfos == null || selectedOrderInfos?.Any() != true ? false : !orderInfos.All(i => selectedOrderInfos.Contains(i)) ? null : orderInfos.Any(i => selectedOrderInfos.Contains(i)))"
 | 
					 | 
				
			||||||
                                            Change="@(args => selectedOrderInfos = args == true ? orderInfos.ToList() : null)" />
 | 
					 | 
				
			||||||
                        </HeaderTemplate>
 | 
					 | 
				
			||||||
                        <Template Context="data">
 | 
					 | 
				
			||||||
                            <RadzenCheckBox TabIndex="-1" TriState="false"
 | 
					 | 
				
			||||||
                                            Value="@(selectedOrderInfos != null &&selectedOrderInfos.Contains(data))"
 | 
					 | 
				
			||||||
                                            InputAttributes="@(new Dictionary<string, object>() { { "aria-label", "Select item" } })"
 | 
					 | 
				
			||||||
                                            TValue="bool" />
 | 
					 | 
				
			||||||
                        </Template>
 | 
					 | 
				
			||||||
                    </RadzenDataGridColumn>
 | 
					 | 
				
			||||||
                    <RadzenDataGridColumn Property="anaesthetistName" Title="麻醉医师" Sortable="false" Filterable="false" Width="8vw" />
 | 
					 | 
				
			||||||
                    <RadzenDataGridColumn Property="PatientName" Title="姓名" Sortable="false" Filterable="false" Width="8vw" />
 | 
					 | 
				
			||||||
                    <RadzenDataGridColumn Property="Sex" Title="性别" Sortable="false" Filterable="false" Width="6vw" />
 | 
					 | 
				
			||||||
                    <RadzenDataGridColumn Property="OrderNo" Title="单号" Sortable="false" Filterable="false" Width="13vw" />
 | 
					 | 
				
			||||||
                    @* <RadzenDataGridColumn Property="ChargeDate" Title="处方时间" Sortable="false" Filterable="false" Width="10vw" /> *@
 | 
					 | 
				
			||||||
                    <RadzenDataGridColumn Property="DetailInfo.Drug.DrugName" Title="药品名称" FormatString="{0:d}" Sortable="false" Filterable="false" Width="20vw" />
 | 
					 | 
				
			||||||
                    @* <Template Context="DetailInfo">
 | 
					 | 
				
			||||||
                       @for (int i = 0; i < DetailList.DetailList.Count; i++)
 | 
					 | 
				
			||||||
                        {
 | 
					 | 
				
			||||||
                            OrderDetail orderDetail = DetailList.DetailList[i]; *@
 | 
					 | 
				
			||||||
                    @*     <RadzenText TextStyle="TextStyle.Subtitle2" class="rz-mb-0">@DetailInfo.Drug.DrugName</RadzenText>
 | 
					 | 
				
			||||||
                    }
 | 
					 | 
				
			||||||
                    </Template> 
 | 
					 | 
				
			||||||
                </RadzenDataGridColumn>*@
 | 
					 | 
				
			||||||
                    @*  <RadzenDataGridColumn Property="Detail.SetManuNo" Title="药品批次" Sortable="false" Filterable="false" Width="8rem">
 | 
					 | 
				
			||||||
                    <Template Context="DetailList">
 | 
					 | 
				
			||||||
                        @for (int i = 0; i < DetailList.DetailList.Count; i++)
 | 
					 | 
				
			||||||
                        {
 | 
					 | 
				
			||||||
                            OrderDetail orderDetail = DetailList.DetailList[i];
 | 
					 | 
				
			||||||
                            <RadzenText TextStyle="TextStyle.Subtitle2" class="rz-mb-0">@orderDetail.SetManuNo</RadzenText>
 | 
					 | 
				
			||||||
                        }
 | 
					 | 
				
			||||||
                    </Template>
 | 
					 | 
				
			||||||
                </RadzenDataGridColumn> *@
 | 
					 | 
				
			||||||
                    <RadzenDataGridColumn Title="批次" Property="DetailInfo.SetManuNo" Filterable="false" Width="18vw">
 | 
					 | 
				
			||||||
                        <Template Context="DetailInfo">
 | 
					 | 
				
			||||||
                            <RadzenText TextStyle="TextStyle.Subtitle2" class="mb-0">@DetailInfo.DetailInfo.SetManuNo</RadzenText>
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                            @if (DetailInfo.DetailInfo.SetManuNo != null)
 | 
					 | 
				
			||||||
                            {
 | 
					 | 
				
			||||||
                                <RadzenText TextStyle="TextStyle.Caption">
 | 
					 | 
				
			||||||
                                    @DetailInfo.DetailInfo.SetManuNo
 | 
					 | 
				
			||||||
                                </RadzenText>
 | 
					 | 
				
			||||||
                            }
 | 
					 | 
				
			||||||
                        </Template>
 | 
					 | 
				
			||||||
                        @*      <EditTemplate Context="DetailInfo">
 | 
					 | 
				
			||||||
                            <RadzenDropDown TValue="DrugManuNo" Name="ManuNo" @bind-Value="DetailInfo.DetailInfo.drugManuNo" Data="DetailInfo.DetailInfo.Drug.Manus" Style="width:100%; display: block;">
 | 
					 | 
				
			||||||
                                <Template>
 | 
					 | 
				
			||||||
                                    <RadzenText TextStyle="TextStyle.Subtitle2" class="mb-0">@((context as DrugManuNo)?.ManuNo)</RadzenText>
 | 
					 | 
				
			||||||
                                    @if ((context as DrugManuNo).EffDate != null && (context as DrugManuNo).EffDate.ToString().Length > 10)
 | 
					 | 
				
			||||||
                                    {
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                                        <RadzenText TextStyle="TextStyle.Caption">@((context as DrugManuNo).EffDate.ToString().Substring(0, 10))</RadzenText>
 | 
					 | 
				
			||||||
                                    }
 | 
					 | 
				
			||||||
                                    else
 | 
					 | 
				
			||||||
                                    {
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                                        <RadzenText TextStyle="TextStyle.Caption">@((context as DrugManuNo)?.EffDate)</RadzenText>
 | 
					 | 
				
			||||||
                                    }
 | 
					 | 
				
			||||||
                                </Template>
 | 
					 | 
				
			||||||
                                <ValueTemplate>
 | 
					 | 
				
			||||||
                                    <RadzenStack Orientation="Orientation.Horizontal">
 | 
					 | 
				
			||||||
                                        <RadzenText TextStyle="TextStyle.Subtitle2" class="mb-0">@((context as DrugManuNo)?.ManuNo)</RadzenText>
 | 
					 | 
				
			||||||
                                        @if ((context as DrugManuNo).EffDate != null && (context as DrugManuNo).EffDate.ToString().Length > 10)
 | 
					 | 
				
			||||||
                                        {
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                                            <RadzenText TextStyle="TextStyle.Caption">@((context as DrugManuNo).EffDate.ToString().Substring(0, 10))</RadzenText>
 | 
					 | 
				
			||||||
                                        }
 | 
					 | 
				
			||||||
                                        else
 | 
					 | 
				
			||||||
                                        {
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                                            <RadzenText TextStyle="TextStyle.Caption">@((context as DrugManuNo)?.EffDate)</RadzenText>
 | 
					 | 
				
			||||||
                                        }
 | 
					 | 
				
			||||||
                                    </RadzenStack>
 | 
					 | 
				
			||||||
                                </ValueTemplate>
 | 
					 | 
				
			||||||
                            </RadzenDropDown>
 | 
					 | 
				
			||||||
                            <RadzenRequiredValidator Text="请选择批次" Component="ManuNo" Popup="true" />
 | 
					 | 
				
			||||||
                        </EditTemplate> *@
 | 
					 | 
				
			||||||
                    </RadzenDataGridColumn>
 | 
					 | 
				
			||||||
                    <RadzenDataGridColumn Property="DetailInfo.Quantity" Title="数量" Filterable="false" Width="6vw">
 | 
					 | 
				
			||||||
                        @* <EditTemplate Context="DetailInfo">
 | 
					 | 
				
			||||||
                            <RadzenNumeric Min="0" Style="display: block" Name="Quantity" @bind-Value=@DetailInfo.DetailInfo.Quantity />
 | 
					 | 
				
			||||||
                            <RadzenNumericRangeValidator Style="position: absolute;z-index: 9999;" Min="0" Text="请填写正确的添加数量" Component="Quantity" Popup="true" />
 | 
					 | 
				
			||||||
                        </EditTemplate> *@
 | 
					 | 
				
			||||||
                    </RadzenDataGridColumn>
 | 
					 | 
				
			||||||
                </Columns>
 | 
					 | 
				
			||||||
            </RadzenDataGrid>
 | 
					 | 
				
			||||||
        </div>
 | 
					 | 
				
			||||||
    </div>
 | 
					 | 
				
			||||||
</RadzenStack>
 | 
					 | 
				
			||||||
@code {
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    private readonly ILog logger = LogManager.GetLogger(typeof(CheckOrder));
 | 
					 | 
				
			||||||
    @inject IOrderInfoDao orderInfoDao;
 | 
					 | 
				
			||||||
    @inject DialogService dialogService;
 | 
					 | 
				
			||||||
    @inject Microsoft.Extensions.Options.IOptions<Pojo.Config.SettingConfig> setting;
 | 
					 | 
				
			||||||
    @inject NotificationService _message;
 | 
					 | 
				
			||||||
    @inject IReportDataDao reportDataDao;
 | 
					 | 
				
			||||||
    @inject IOptions<SettingConfig> setting;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    [Parameter] public BoxModel boxModel { get; set; }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    bool allowRowSelectOnRowClick = true;
 | 
					 | 
				
			||||||
    IEnumerable<OrderInfo> orderInfos;
 | 
					 | 
				
			||||||
    IList<OrderInfo> selectedOrderInfos = new List<OrderInfo>();
 | 
					 | 
				
			||||||
    RadzenDataGrid<OrderInfo> grid;
 | 
					 | 
				
			||||||
    //麻醉师集合
 | 
					 | 
				
			||||||
    List<Anaesthetist> NamesList = new List<Anaesthetist>();
 | 
					 | 
				
			||||||
    Anaesthetist NameInfo;
 | 
					 | 
				
			||||||
    Anaesthetist BoxColor;
 | 
					 | 
				
			||||||
    //药盒集合
 | 
					 | 
				
			||||||
    List<BoxModel> BoxList = new List<BoxModel>();
 | 
					 | 
				
			||||||
    //药盒颜色集合
 | 
					 | 
				
			||||||
    List<Anaesthetist> BoxColorList = new List<Anaesthetist>();
 | 
					 | 
				
			||||||
    BoxModel BoxNum;
 | 
					 | 
				
			||||||
    bool isLoading;
 | 
					 | 
				
			||||||
    int count;
 | 
					 | 
				
			||||||
    int[] DrawerNos = new int[] { 1, 2, 3, 4, 5, 6, 7, 8 };
 | 
					 | 
				
			||||||
    int status = 0;
 | 
					 | 
				
			||||||
    string OrderNo;
 | 
					 | 
				
			||||||
    string PatientName;
 | 
					 | 
				
			||||||
    DateTime OrderDate = DateTime.Now;
 | 
					 | 
				
			||||||
    DateTime PortOrderDate = DateTime.Now;
 | 
					 | 
				
			||||||
    Popup popup;
 | 
					 | 
				
			||||||
    RadzenButton button;
 | 
					 | 
				
			||||||
    //第一次加载不执行LoadData方法
 | 
					 | 
				
			||||||
    // int firstLod = 1;
 | 
					 | 
				
			||||||
    void OnCheckSeleced(object dete)
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
        if (orderInfos != null)
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
            orderInfos.ToList().ForEach(it => it.ItemIsChecked = true);
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    void OnCurrentDateChanged(DateTime args)
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
        OrderDate = new DateTime(args.Year, args.Month, args.Day);
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    void OnCellClick(DataGridCellMouseEventArgs<OrderInfo> args)
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
        if (args.Data.DetailInfo.SetManuNo != null)
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
            args.Data.DetailInfo.drugManuNo = args.Data.DetailInfo.Drug.Manus.Where(m => m.ManuNo == args.Data.DetailInfo.SetManuNo).FirstOrDefault();
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
        if (args.Data.DetailInfo.drugManuNo == null)
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
            args.Data.DetailInfo.drugManuNo = args.Data.DetailInfo.Drug.Manus.FirstOrDefault();
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
        args.Data.ItemIsChecked = !args.Data.ItemIsChecked;
 | 
					 | 
				
			||||||
        grid.EditRow(args.Data);
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    //确认
 | 
					 | 
				
			||||||
    async Task Confirm()
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
        if (selectedOrderInfos == null || selectedOrderInfos.Count<=0)
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
            _message.Notify(
 | 
					 | 
				
			||||||
                   new NotificationMessage { Severity = NotificationSeverity.Error, Summary = "提示", Detail = $"请选择处方", Duration = 4000 }
 | 
					 | 
				
			||||||
               );
 | 
					 | 
				
			||||||
            return;
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
        // 关闭弹窗selectedOrderInfos
 | 
					 | 
				
			||||||
        dialogService.Close(selectedOrderInfos);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    PageData<OrderInfo> result;
 | 
					 | 
				
			||||||
    protected override async Task OnInitializedAsync()
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
        await base.OnInitializedAsync();
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    async Task LoadData(LoadDataArgs args)
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
        // if (firstLod == 1)
 | 
					 | 
				
			||||||
        if (boxModel != null && boxModel.BoxName > 0)
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
            //查询除本药箱外的处方信息
 | 
					 | 
				
			||||||
            result = await orderInfoDao.GetAllOrderInfoForImport(PatientName, OrderNo, OrderDate, boxModel, args.Top, args.Skip);
 | 
					 | 
				
			||||||
            orderInfos = result.Desserts;
 | 
					 | 
				
			||||||
            selectedOrderInfos = orderInfos.ToList();
 | 
					 | 
				
			||||||
            count = result.TotalDesserts;
 | 
					 | 
				
			||||||
            isLoading = true;
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
        isLoading = false;
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
| 
						 | 
					@ -1,581 +0,0 @@
 | 
				
			||||||
@page "/Box/Check"
 | 
					 | 
				
			||||||
@using MasaBlazorApp3.Pojo.Config
 | 
					 | 
				
			||||||
@using MasaBlazorApp3.Report
 | 
					 | 
				
			||||||
@using Microsoft.Extensions.Options
 | 
					 | 
				
			||||||
@using Radzen.Blazor.Rendering
 | 
					 | 
				
			||||||
@using log4net;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
<style>
 | 
					 | 
				
			||||||
    .my-popup {
 | 
					 | 
				
			||||||
    display: none;
 | 
					 | 
				
			||||||
    position: absolute;
 | 
					 | 
				
			||||||
    overflow: auto;
 | 
					 | 
				
			||||||
    /* height: 360px; */
 | 
					 | 
				
			||||||
    width: 900px;
 | 
					 | 
				
			||||||
    border: var(--rz-panel-border);
 | 
					 | 
				
			||||||
    background-color: var(--rz-panel-background-color);
 | 
					 | 
				
			||||||
    box-shadow: var(--rz-panel-shadow);
 | 
					 | 
				
			||||||
    border-radius: var(--rz-border-radius);
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    .rz-grid-table {
 | 
					 | 
				
			||||||
    position: relative;
 | 
					 | 
				
			||||||
    border-collapse: separate;
 | 
					 | 
				
			||||||
    border-spacing: 0;
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
</style>
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
@* <RadzenStack Orientation="Orientation.Horizontal"> *@
 | 
					 | 
				
			||||||
<div class="col-12" style="margin-bottom:5px;">
 | 
					 | 
				
			||||||
    @* <RadzenStack Orientation="Orientation.Horizontal" Gap="1rem"> *@
 | 
					 | 
				
			||||||
    <RadzenRow AlignItems="AlignItems.Center">
 | 
					 | 
				
			||||||
        <RadzenColumn Size="12">
 | 
					 | 
				
			||||||
            <RadzenLabel Text="核对药箱" Component="BoxList" />
 | 
					 | 
				
			||||||
            <RadzenDropDownDataGrid AllowVirtualization="true" Name="BoxColorList" TValue="BoxModel" Data="@BoxColorList" Value="BoxColor" Style="width: 8vw;"
 | 
					 | 
				
			||||||
            ValueChanged="@((args) => OnColorChanged(args))" AllowFiltering="false"
 | 
					 | 
				
			||||||
            AllowFilteringByAllStringColumns="true" TextProperty="药箱号">
 | 
					 | 
				
			||||||
                <Template>
 | 
					 | 
				
			||||||
                    @((context as BoxModel).BoxNo == 1 ? "白" : (context as BoxModel).BoxNo == 3 ? "非常规" : "绿")
 | 
					 | 
				
			||||||
                </Template>
 | 
					 | 
				
			||||||
                <Columns>
 | 
					 | 
				
			||||||
                    <RadzenDropDownDataGridColumn Property="BoxNo" Title="药箱颜色" Sortable="false" />
 | 
					 | 
				
			||||||
                </Columns>
 | 
					 | 
				
			||||||
            </RadzenDropDownDataGrid>
 | 
					 | 
				
			||||||
            <RadzenDropDownDataGrid AllowVirtualization="true" Name="BoxList" TValue="BoxModel" Data="@BoxList" Value="BoxNum" Style="width: 10vw;"
 | 
					 | 
				
			||||||
            ValueChanged="@((args) => OnBoxChanged(args))" AllowFilteringByAllStringColumns="true" TextProperty="药箱号">
 | 
					 | 
				
			||||||
                <Template>
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                    @((context as BoxModel).BoxName == 99 ? "急诊药盒" : (context as BoxModel).BoxName == 111 ? "恢复室药盒" :
 | 
					 | 
				
			||||||
                                (context as BoxModel).BoxName == 31 ? "胃镜药盒" :
 | 
					 | 
				
			||||||
                                (context as BoxModel).BoxName == 32 ? "导管药盒" :
 | 
					 | 
				
			||||||
                                (context as BoxModel).BoxName == 33 ? "生殖药盒" :
 | 
					 | 
				
			||||||
                                (context as BoxModel).BoxName == 34 ? "妇门药盒" : (context as BoxModel).BoxName + "-" + ((context as BoxModel).BoxNo == 1 ? "白" : "绿"))
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                    @* @((context as BoxModel).BoxName + "-" + (context as BoxModel).BoxNo) *@
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                </Template>
 | 
					 | 
				
			||||||
                <Columns>
 | 
					 | 
				
			||||||
                    <RadzenDropDownDataGridColumn Property="BoxName" Title="药箱号" Sortable="false" />
 | 
					 | 
				
			||||||
                </Columns>
 | 
					 | 
				
			||||||
            </RadzenDropDownDataGrid>
 | 
					 | 
				
			||||||
            <RadzenLabel Text="处方时间" Component="OrderDate" />
 | 
					 | 
				
			||||||
            <RadzenDatePicker DateFormat="yyyy-MM-dd" CurrentDateChanged="@OnCurrentDateChanged" @bind-Value="OrderDate" Style="width: 15vw;" Name="OrderDate" />
 | 
					 | 
				
			||||||
            @*             <RadzenButton Size="ButtonSize.Medium" Click="Search" IsBusy="isLoading" Icon="search" Text="查询" /> *@
 | 
					 | 
				
			||||||
            <RadzenButton Size="ButtonSize.Medium" Click="Confirm" ButtonType="ButtonType.Button" ButtonStyle="ButtonStyle.Success" IsBusy="isLoading" Icon="check_circle" Text="确认" />
 | 
					 | 
				
			||||||
            <RadzenButton Size="ButtonSize.Medium" Click="AddOrderMethod" ButtonType="ButtonType.Button" IsBusy="isLoading" ButtonStyle="ButtonStyle.Warning" Icon="input" Text="导入" />
 | 
					 | 
				
			||||||
            <RadzenButton Style="margin-top:2px" Icon="download" @ref=button Text="麻醉药品使用登记本导出" Variant="Variant.Outlined" Click="@(args => popup.ToggleAsync(button.Element))" />
 | 
					 | 
				
			||||||
            <Popup @ref=popup Lazy=true class="my-popup">
 | 
					 | 
				
			||||||
                <RadzenStack Orientation="Orientation.Vertical" Gap="1rem" class="rz-h-100 rz-p-4">
 | 
					 | 
				
			||||||
                    <RadzenFieldset Text="条件选择">
 | 
					 | 
				
			||||||
                        <RadzenStack Orientation="Orientation.Horizontal" Gap="1rem">
 | 
					 | 
				
			||||||
                            <RadzenRow AlignItems="AlignItems.Center">
 | 
					 | 
				
			||||||
                                <RadzenColumn Size="6">
 | 
					 | 
				
			||||||
                                    <RadzenLabel Text="处方时间" Component="PortOrderDate" />
 | 
					 | 
				
			||||||
                                </RadzenColumn>
 | 
					 | 
				
			||||||
                                <RadzenColumn Size="6">
 | 
					 | 
				
			||||||
                                    <RadzenDatePicker DateFormat="yyyy-MM-dd" CurrentDateChanged="@OnCurrentPortDateChanged" @bind-Value="PortOrderDate" Style="width: 100%;" Name="PortOrderDate" />
 | 
					 | 
				
			||||||
                                </RadzenColumn>
 | 
					 | 
				
			||||||
                            </RadzenRow>
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                            <RadzenRow JustifyContent="JustifyContent.End" AlignItems="AlignItems.Center">
 | 
					 | 
				
			||||||
                                <RadzenButton Icon="download" Text="导出" Variant="Variant.Outlined" Click="StockExport" />
 | 
					 | 
				
			||||||
                            </RadzenRow>
 | 
					 | 
				
			||||||
                        </RadzenStack>
 | 
					 | 
				
			||||||
                    </RadzenFieldset>
 | 
					 | 
				
			||||||
                </RadzenStack>
 | 
					 | 
				
			||||||
            </Popup>
 | 
					 | 
				
			||||||
        </RadzenColumn>
 | 
					 | 
				
			||||||
    </RadzenRow>
 | 
					 | 
				
			||||||
</div>
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
<RadzenStack Orientation="Orientation.Horizontal">
 | 
					 | 
				
			||||||
    <div Style="width:55vw;overflow:auto">
 | 
					 | 
				
			||||||
        @*   <RadzenDataGrid @ref="grid" AllowRowSelectOnRowClick="@allowRowSelectOnRowClick" AllowFiltering="true" LoadData="@LoadData" Style="width:50vw;overflow:auto"
 | 
					 | 
				
			||||||
        FilterPopupRenderMode="PopupRenderMode.OnDemand" FilterCaseSensitivity="FilterCaseSensitivity.CaseInsensitive"
 | 
					 | 
				
			||||||
        Data="@csList" IsLoading="@isLoading" Count="@count" EmptyText="无数据"
 | 
					 | 
				
			||||||
        SelectionMode="DataGridSelectionMode.Multiple" @bind-Value=@selectedcsList
 | 
					 | 
				
			||||||
        CellClick="@((DataGridCellMouseEventArgs<ChannelStock> args) => OnDrugCellClick(args))"
 | 
					 | 
				
			||||||
        AllowPaging="false">
 | 
					 | 
				
			||||||
            <Columns>
 | 
					 | 
				
			||||||
                <RadzenDataGridColumn Property="Drug.DrugName" Title="药品名称" FormatString="{0:d}" Sortable="false" Filterable="false" Width="2vw" />
 | 
					 | 
				
			||||||
                <RadzenDataGridColumn Title="批次" Property="ManuNo" Filterable="false" Width="2vw">
 | 
					 | 
				
			||||||
                </RadzenDataGridColumn>
 | 
					 | 
				
			||||||
                <RadzenDataGridColumn Property="DetailInfo.Quantity" Title="合计" Filterable="false" Width="3vw">
 | 
					 | 
				
			||||||
                    <Template Context="contextDate">
 | 
					 | 
				
			||||||
                        <div style="text-align: center;">
 | 
					 | 
				
			||||||
                            库存量【@contextDate.Quantity】<br />
 | 
					 | 
				
			||||||
                            用药量【@contextDate.UseQuantity】<br />
 | 
					 | 
				
			||||||
                            处方数【@contextDate.OrderQuantity】
 | 
					 | 
				
			||||||
                        </div>
 | 
					 | 
				
			||||||
                    </Template>
 | 
					 | 
				
			||||||
                </RadzenDataGridColumn>
 | 
					 | 
				
			||||||
            </Columns>
 | 
					 | 
				
			||||||
        </RadzenDataGrid> *@
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        <RadzenListBox AllowClear="true" @bind-Value=@listBoxSelectedcsList Style="width:45vw;height:70vh;overflow:auto" AllowFiltering="false" TValue="ChannelStock"
 | 
					 | 
				
			||||||
        LoadData=@LoadData Data=@csList>
 | 
					 | 
				
			||||||
            <Template>
 | 
					 | 
				
			||||||
                <RadzenStack Orientation="Orientation.Horizontal">
 | 
					 | 
				
			||||||
                    <RadzenText Style="width:15vw;text-align:left">@((context as ChannelStock).Drug.DrugName)</RadzenText>
 | 
					 | 
				
			||||||
                    <RadzenText Style="width:10vw">@((context as ChannelStock).ManuNo)</RadzenText>
 | 
					 | 
				
			||||||
                    <RadzenStack Gap="10" Style="text-align:right">
 | 
					 | 
				
			||||||
                        <div style="text-align: center;">
 | 
					 | 
				
			||||||
                            基数【@((context as ChannelStock).BaseQuantity)】<br />
 | 
					 | 
				
			||||||
                            @* 总库存【@((context as ChannelStock).TotalQuantity)】<br /> *@
 | 
					 | 
				
			||||||
                            库存数【@((context as ChannelStock).Quantity)】<br />
 | 
					 | 
				
			||||||
                            用药数【@((context as ChannelStock).SelectedOrderList.Aggregate(0, (a, b) => a + b.DetailInfo.Quantity))】<br />
 | 
					 | 
				
			||||||
                            处方数【@((context as ChannelStock).SelectedOrderList.Count)】
 | 
					 | 
				
			||||||
                        </div>
 | 
					 | 
				
			||||||
                    </RadzenStack>
 | 
					 | 
				
			||||||
                </RadzenStack>
 | 
					 | 
				
			||||||
            </Template>
 | 
					 | 
				
			||||||
        </RadzenListBox>
 | 
					 | 
				
			||||||
    </div>
 | 
					 | 
				
			||||||
    <div Style="width:75vw;overflow:auto;box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.3); ">
 | 
					 | 
				
			||||||
        @if ((listBoxSelectedcsList != null && string.IsNullOrEmpty(listBoxSelectedcsList.ListId) && listBoxSelectedcsList.Quantity > listBoxSelectedcsList.UseQuantity) || (listBoxSelectedcsList.Quantity > listBoxSelectedcsList.BaseQuantity))
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
            //ListId为空则是没有在套餐里的药,库存量大于使用量时需要把药还到抽屉里
 | 
					 | 
				
			||||||
            //列出需要还到抽屉里的药品的抽屉库位
 | 
					 | 
				
			||||||
            @*  <RadzenRow AlignItems="AlignItems.Center" Style="margin:1vw;">
 | 
					 | 
				
			||||||
                <RadzenColumn Size="12">
 | 
					 | 
				
			||||||
                    <RadzenLabel Text="库位" Component="DrawerList" />
 | 
					 | 
				
			||||||
                    <RadzenDropDownDataGrid AllowVirtualization="true" Name="DrawerList" TValue="ChannelStock" @bind-Value="@listBoxSelectedcsList.ReturnDrawerChanneStock" Data="@(listBoxSelectedcsList?.DrawerChanneStockList)"
 | 
					 | 
				
			||||||
                    Style="width:20vw;" AllowFilteringByAllStringColumns="true" TextProperty="Location">
 | 
					 | 
				
			||||||
                        <Columns>
 | 
					 | 
				
			||||||
                            <RadzenDropDownDataGridColumn Property="Location" Title="库位" Sortable="false" />
 | 
					 | 
				
			||||||
                            <RadzenDropDownDataGridColumn Property="Quantity" Title="库存" Sortable="false" />
 | 
					 | 
				
			||||||
                        </Columns>
 | 
					 | 
				
			||||||
                    </RadzenDropDownDataGrid>
 | 
					 | 
				
			||||||
                    <RadzenLabel Text="还药数" Component="ReturnQuantity" />
 | 
					 | 
				
			||||||
                    <RadzenNumeric Min="0" Name="ReturnQuantity" TValue="int" @bind-Value=@listBoxSelectedcsList.ReturnQuantity Style="width:5vw;" />
 | 
					 | 
				
			||||||
                    <RadzenNumericRangeValidator Min="0" Max=@listBoxSelectedcsList.Quantity Text="请填写正确的还药数量" Component="ReturnQuantity" Popup="true" />
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                </RadzenColumn>
 | 
					 | 
				
			||||||
            </RadzenRow> 
 | 
					 | 
				
			||||||
            <RadzenRow AlignItems="AlignItems.Center" Style="margin:1vw;">
 | 
					 | 
				
			||||||
                <RadzenColumn Size="12">*@
 | 
					 | 
				
			||||||
            @if (listBoxSelectedcsList?.DrawerChanneStockList != null)
 | 
					 | 
				
			||||||
            {
 | 
					 | 
				
			||||||
                <RadzenListBox AllowClear="true" @bind-Value=@returnList AllowFiltering="false" TValue="ChannelStock" Style="width:70vw;overflow:auto"
 | 
					 | 
				
			||||||
                Data=@(listBoxSelectedcsList?.DrawerChanneStockList)>
 | 
					 | 
				
			||||||
                    <Template>
 | 
					 | 
				
			||||||
                        <RadzenStack Orientation="Orientation.Horizontal">
 | 
					 | 
				
			||||||
                            <RadzenText Style="width:20vw;text-align:left">还药库位@((context as ChannelStock).Location)</RadzenText>
 | 
					 | 
				
			||||||
                            <RadzenText Style="width:10vw">还药数@((context as ChannelStock).ReturnQuantity)</RadzenText>
 | 
					 | 
				
			||||||
                        </RadzenStack>
 | 
					 | 
				
			||||||
                    </Template>
 | 
					 | 
				
			||||||
                </RadzenListBox>
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
            @*   </RadzenColumn>
 | 
					 | 
				
			||||||
            </RadzenRow> *@
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        <RadzenDataGrid Style="width:55vw;height:70vh;overflow:auto"
 | 
					 | 
				
			||||||
        FilterPopupRenderMode="PopupRenderMode.OnDemand" FilterCaseSensitivity="FilterCaseSensitivity.CaseInsensitive"
 | 
					 | 
				
			||||||
        Data="@(listBoxSelectedcsList?.OrderList)" EmptyText="无处方数据"
 | 
					 | 
				
			||||||
        @bind-Value="@(listBoxSelectedcsList.SelectedOrderList)"
 | 
					 | 
				
			||||||
        SelectionMode="DataGridSelectionMode.Multiple"
 | 
					 | 
				
			||||||
        AllowRowSelectOnRowClick="true"
 | 
					 | 
				
			||||||
        AllowPaging="false">
 | 
					 | 
				
			||||||
            <Columns>
 | 
					 | 
				
			||||||
                <RadzenDataGridColumn Sortable="false" Filterable="false" Width="1rem">
 | 
					 | 
				
			||||||
                    @* <HeaderTemplate>
 | 
					 | 
				
			||||||
                        <RadzenCheckBox TabIndex="-1" TriState="false" TValue="bool?" InputAttributes="@(new Dictionary<string, object>() { { "aria-label", "Select all items" } })"
 | 
					 | 
				
			||||||
                                        Value="@(listBoxSelectedcsList?.OrderList!=null&&(bool)listBoxSelectedcsList?.OrderList.Any(oi=>oi. ItemIsChecked))"
 | 
					 | 
				
			||||||
                        Change="@(args => ChangeHeaderCheckBox(args))" />
 | 
					 | 
				
			||||||
                    </HeaderTemplate>
 | 
					 | 
				
			||||||
                    <Template Context="data">
 | 
					 | 
				
			||||||
                        <RadzenCheckBox TabIndex="-1" TriState="false" Value="@data.ItemIsChecked" InputAttributes="@(new Dictionary<string, object>() { { "aria-label", "Select item" } })"
 | 
					 | 
				
			||||||
                        TValue="bool" Change="@(args => { data.ItemIsChecked=!data.ItemIsChecked;})" />
 | 
					 | 
				
			||||||
                    </Template> *@
 | 
					 | 
				
			||||||
                    <HeaderTemplate>
 | 
					 | 
				
			||||||
                        <RadzenCheckBox TabIndex="-1" TriState="false" TValue="bool?" InputAttributes="@(new Dictionary<string, object>() { { "aria-label", "Select all items" } })"
 | 
					 | 
				
			||||||
                        Value="@(listBoxSelectedcsList?.SelectedOrderList==null || listBoxSelectedcsList?.SelectedOrderList.Any() !=true? false: !(bool)listBoxSelectedcsList?.OrderList.All(i => (bool)(listBoxSelectedcsList?.SelectedOrderList.Contains(i)))?null:listBoxSelectedcsList?.OrderList.Any(i => (bool)listBoxSelectedcsList?.SelectedOrderList.Contains(i)))"
 | 
					 | 
				
			||||||
                        Change="@(args =>listBoxSelectedcsList.SelectedOrderList = args == true ? listBoxSelectedcsList?.OrderList.ToList():new List<OrderInfo>())" />
 | 
					 | 
				
			||||||
                    </HeaderTemplate>
 | 
					 | 
				
			||||||
                    <Template Context="data">
 | 
					 | 
				
			||||||
                        <RadzenCheckBox TabIndex="-1" TriState="false" Value="@(listBoxSelectedcsList.SelectedOrderList.Contains(data))" InputAttributes="@(new Dictionary<string, object>() { { "aria-label", "Select item" } })"
 | 
					 | 
				
			||||||
                        TValue="bool" />
 | 
					 | 
				
			||||||
                    </Template>
 | 
					 | 
				
			||||||
                </RadzenDataGridColumn>
 | 
					 | 
				
			||||||
                <RadzenDataGridColumn Property="OrderNo" Title="处方号" Sortable="false" Filterable="false" Width="5vw" />
 | 
					 | 
				
			||||||
                <RadzenDataGridColumn Property="anaesthetistName" Title="医师" Sortable="false" Filterable="false" Width="3vw" />
 | 
					 | 
				
			||||||
                <RadzenDataGridColumn Property="PatientName" Title="患者" Sortable="false" Filterable="false" Width="3vw" />
 | 
					 | 
				
			||||||
                <RadzenDataGridColumn Property="Sex" Title="性别" Sortable="false" Filterable="false" Width="2vw" />
 | 
					 | 
				
			||||||
                <RadzenDataGridColumn Property="DetailInfo.Quantity" Title="数量" Sortable="false" Filterable="false" Width="2vw" />
 | 
					 | 
				
			||||||
            </Columns>
 | 
					 | 
				
			||||||
        </RadzenDataGrid>
 | 
					 | 
				
			||||||
    </div>
 | 
					 | 
				
			||||||
</RadzenStack>
 | 
					 | 
				
			||||||
@* </RadzenStack> *@
 | 
					 | 
				
			||||||
@code {
 | 
					 | 
				
			||||||
    private readonly ILog logger = LogManager.GetLogger(typeof(CheckOrder));
 | 
					 | 
				
			||||||
    @inject IOrderInfoDao orderInfoDao;
 | 
					 | 
				
			||||||
    @inject DialogService dialogService;
 | 
					 | 
				
			||||||
    @inject Microsoft.Extensions.Options.IOptions<Pojo.Config.SettingConfig> setting;
 | 
					 | 
				
			||||||
    @inject NotificationService _message;
 | 
					 | 
				
			||||||
    @inject IReportDataDao reportDataDao;
 | 
					 | 
				
			||||||
    @inject IOptions<SettingConfig> setting;
 | 
					 | 
				
			||||||
    //bool allowRowSelectOnRowClick = true;
 | 
					 | 
				
			||||||
    IEnumerable<ChannelStock> csList;
 | 
					 | 
				
			||||||
    IList<ChannelStock> selectedcsList;
 | 
					 | 
				
			||||||
    ChannelStock listBoxSelectedcsList = new();
 | 
					 | 
				
			||||||
    ChannelStock returnList = new();
 | 
					 | 
				
			||||||
    IEnumerable<OrderInfo> orderList;
 | 
					 | 
				
			||||||
    IList<OrderInfo> selectedOrderList;
 | 
					 | 
				
			||||||
    RadzenListBox<ChannelStock> listBox;
 | 
					 | 
				
			||||||
    RadzenDataGrid<OrderInfo> gridOrder;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    //麻醉师集合
 | 
					 | 
				
			||||||
    List<Anaesthetist> NamesList = new List<Anaesthetist>();
 | 
					 | 
				
			||||||
    Anaesthetist NameInfo;
 | 
					 | 
				
			||||||
    BoxModel BoxColor;
 | 
					 | 
				
			||||||
    //全部药盒集合
 | 
					 | 
				
			||||||
    List<BoxModel> AllBoxList = new List<BoxModel>();
 | 
					 | 
				
			||||||
    //药盒集合
 | 
					 | 
				
			||||||
    List<BoxModel> BoxList = new List<BoxModel>();
 | 
					 | 
				
			||||||
    //药盒颜色集合
 | 
					 | 
				
			||||||
    List<BoxModel> BoxColorList = new List<BoxModel>()
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
            new  BoxModel{BoxNo=1,BoxName=1 },
 | 
					 | 
				
			||||||
            new  BoxModel{BoxNo=2 ,BoxName=1},
 | 
					 | 
				
			||||||
            new  BoxModel{BoxNo=3 ,BoxName=1}
 | 
					 | 
				
			||||||
        };
 | 
					 | 
				
			||||||
    BoxModel BoxNum;
 | 
					 | 
				
			||||||
    bool isLoading;
 | 
					 | 
				
			||||||
    int count;
 | 
					 | 
				
			||||||
    int[] DrawerNos = new int[] { 1, 2, 3, 4, 5, 6, 7, 8 };
 | 
					 | 
				
			||||||
    int status = 0;
 | 
					 | 
				
			||||||
    string OrderNo;
 | 
					 | 
				
			||||||
    string PatientName;
 | 
					 | 
				
			||||||
    DateTime? OrderDate = DateTime.Now;
 | 
					 | 
				
			||||||
    DateTime PortOrderDate = DateTime.Now;
 | 
					 | 
				
			||||||
    Popup popup;
 | 
					 | 
				
			||||||
    RadzenButton button;
 | 
					 | 
				
			||||||
    private async Task OnColorChanged(object value)
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
        if ((((BoxModel)value).BoxNo) == 3)
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
            BoxList = AllBoxList.Where(bl => bl.BoxName > 30).ToList();
 | 
					 | 
				
			||||||
            BoxNum = BoxList.FirstOrDefault();
 | 
					 | 
				
			||||||
            await InvokeAsync(StateHasChanged);
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
        else
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
            BoxList = AllBoxList.Where(bl => bl.BoxNo == ((BoxModel)value).BoxNo && bl.BoxName <= 30).ToList();
 | 
					 | 
				
			||||||
            BoxNum = BoxList.FirstOrDefault();
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
        await LoadData(null);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    //药箱选中修改
 | 
					 | 
				
			||||||
    private async Task OnBoxChanged(object value)
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
        // BoxList = BoxList.Where(bl => bl.BoxNo == ((BoxModel)value).BoxNo && bl.BoxName == ((BoxModel)value).BoxName).ToList();
 | 
					 | 
				
			||||||
        BoxNum = (BoxModel)value;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        await LoadData(null);
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    bool? boolHeader = true;
 | 
					 | 
				
			||||||
    //全选/反选
 | 
					 | 
				
			||||||
    void ChangeHeaderCheckBox(bool? args)
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
        if (args != null)
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
            boolHeader = args;
 | 
					 | 
				
			||||||
            listBoxSelectedcsList?.OrderList.ToList().ForEach(it => it.ItemIsChecked = (bool)args);
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    void OnCheckSeleced(object dete)
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
        //listBoxSelectedcsList?.OrderList.ToList().Where(it => it.OrderNo == (OrderInfo as (dete).))(oi => oi.ItemIsChecked = true));
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    //日期修改
 | 
					 | 
				
			||||||
    async Task OnCurrentDateChanged(DateTime args)
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
        OrderDate = new DateTime(args.Year, args.Month, args.Day);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        await LoadData(null);
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    void OnCurrentPortDateChanged(DateTime args)
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
        PortOrderDate = new DateTime(args.Year, args.Month, args.Day);
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    void OnDrugCellClick(DataGridCellMouseEventArgs<ChannelStock> args)
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    void OnCellClick(DataGridCellMouseEventArgs<OrderInfo> args)
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
        if (args.Data.DetailInfo.SetManuNo != null)
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
            args.Data.DetailInfo.drugManuNo = args.Data.DetailInfo.Drug.Manus.Where(m => m.ManuNo == args.Data.DetailInfo.SetManuNo).FirstOrDefault();
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
        if (args.Data.DetailInfo.drugManuNo == null)
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
            args.Data.DetailInfo.drugManuNo = args.Data.DetailInfo.Drug.Manus.FirstOrDefault();
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
        args.Data.ItemIsChecked = !args.Data.ItemIsChecked;
 | 
					 | 
				
			||||||
        // gridOrder.EditRow(args.Data);
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    //查询
 | 
					 | 
				
			||||||
    async Task Search()
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
        await LoadData(null);
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    //确认
 | 
					 | 
				
			||||||
    async Task Confirm()
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
        csList = csList.ToList();
 | 
					 | 
				
			||||||
        List<ChannelStock> checkChannelStock = new();
 | 
					 | 
				
			||||||
        string errMessage = string.Empty;
 | 
					 | 
				
			||||||
        foreach (var item in csList)
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
            if (item.SelectedOrderList.Aggregate(0, (a, b) => a + b.DetailInfo.Quantity)>item.Quantity)
 | 
					 | 
				
			||||||
            {
 | 
					 | 
				
			||||||
                _message.Notify(
 | 
					 | 
				
			||||||
                  new NotificationMessage { Severity = NotificationSeverity.Error, Summary = "提示", Detail = $"用药数不可大于库存数,请仔细核对!", Duration = 4000 }
 | 
					 | 
				
			||||||
              );
 | 
					 | 
				
			||||||
                return;
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
            int i = 0;
 | 
					 | 
				
			||||||
            if (item.OrderList != null && item.SelectedOrderList.Count > 0)
 | 
					 | 
				
			||||||
            {
 | 
					 | 
				
			||||||
                item.UseQuantity = item.SelectedOrderList.Sum(oi => oi.DetailInfo.Quantity);
 | 
					 | 
				
			||||||
                item.OrderQuantity = item.SelectedOrderList.Count;
 | 
					 | 
				
			||||||
                // checkChannelStock.Add(item);
 | 
					 | 
				
			||||||
                i = 1;
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
            if (item.DrawerChanneStockList != null && item.DrawerChanneStockList.Any(d => d.ReturnQuantity > 0))
 | 
					 | 
				
			||||||
            {
 | 
					 | 
				
			||||||
                //还药数量:使用量==库存?还0 :库存>基数? (库存数-使用数)>基数?  还 库存数-使用数:0;
 | 
					 | 
				
			||||||
                item.ReturnQuantity =
 | 
					 | 
				
			||||||
                (item.UseQuantity == item.Quantity) ? 0 :
 | 
					 | 
				
			||||||
                (item.Quantity <= item.BaseQuantity) ? 0 :
 | 
					 | 
				
			||||||
                ((item.Quantity - item.UseQuantity) > item.BaseQuantity) ?
 | 
					 | 
				
			||||||
                (item.Quantity - item.UseQuantity - item.BaseQuantity) : 0;
 | 
					 | 
				
			||||||
                //还药库位
 | 
					 | 
				
			||||||
                if (item.ReturnQuantity > 0)
 | 
					 | 
				
			||||||
                {
 | 
					 | 
				
			||||||
                    //药品未在套餐中绑定需要把药还到对应抽屉
 | 
					 | 
				
			||||||
                    List<ChannelStock> allDrugStock = await orderInfoDao.GetStockByDRrug(item.DrugId, item.ManuNo, 1);// await _connection.ChannelStock.Where(cs => cs.MachineId == _setting.machineId && cs.DrawerType == 1 && cs.DrugId == csList[i].DrugId && cs.ManuNo == csList[i].ManuNo).OrderBy(cs => cs.Quantity).ToListAsync();
 | 
					 | 
				
			||||||
                    if (allDrugStock != null && allDrugStock.Count > 0)
 | 
					 | 
				
			||||||
                    {
 | 
					 | 
				
			||||||
                        item.DrawerChanneStockList = new();
 | 
					 | 
				
			||||||
                        int iReturnQuantity = item.Quantity - item.UseQuantity - item.BaseQuantity;
 | 
					 | 
				
			||||||
                        for (int j = 0; j < allDrugStock.Count; j++)
 | 
					 | 
				
			||||||
                        {
 | 
					 | 
				
			||||||
                            if (allDrugStock[j].BoardType.ToString().Contains("2") && allDrugStock[j].Quantity >= 25)
 | 
					 | 
				
			||||||
                                continue;
 | 
					 | 
				
			||||||
                            if (allDrugStock[j].BoardType.ToString().Contains("2") && allDrugStock[j].Quantity + item.Quantity - item.UseQuantity > 25)
 | 
					 | 
				
			||||||
                            {
 | 
					 | 
				
			||||||
                                if (iReturnQuantity <= allDrugStock.Sum(it => it.Quantity))
 | 
					 | 
				
			||||||
                                {
 | 
					 | 
				
			||||||
                                    for (int q = 0; iReturnQuantity > 0; q++)
 | 
					 | 
				
			||||||
                                    {
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                                        allDrugStock[j].ReturnQuantity = 25 - allDrugStock[q].Quantity;
 | 
					 | 
				
			||||||
                                        item.DrawerChanneStockList.Add(allDrugStock[q]);
 | 
					 | 
				
			||||||
                                        iReturnQuantity = iReturnQuantity - allDrugStock[q].ReturnQuantity;
 | 
					 | 
				
			||||||
                                        if (iReturnQuantity <= 0)
 | 
					 | 
				
			||||||
                                            break;
 | 
					 | 
				
			||||||
                                    }
 | 
					 | 
				
			||||||
                                }
 | 
					 | 
				
			||||||
                                else
 | 
					 | 
				
			||||||
                                {
 | 
					 | 
				
			||||||
                                    //库位不足,有药品无库位可放
 | 
					 | 
				
			||||||
                                    allDrugStock[j].ReturnQuantity = iReturnQuantity;
 | 
					 | 
				
			||||||
                                    item.DrawerChanneStockList.Add(allDrugStock[j]);
 | 
					 | 
				
			||||||
                                    logger.Info($"还药品【{item.Drug.DrugName}】库位不足,有药品无库位可放");
 | 
					 | 
				
			||||||
                                    errMessage += $"库位不足,药品【{item.Drug.DrugName}】无库位可放";
 | 
					 | 
				
			||||||
                                    _message.Notify(
 | 
					 | 
				
			||||||
                                          new NotificationMessage { Severity = NotificationSeverity.Error, Summary = "提示", Detail = errMessage, Duration = 4000 }
 | 
					 | 
				
			||||||
                                      );
 | 
					 | 
				
			||||||
                                    break; ;
 | 
					 | 
				
			||||||
                                }
 | 
					 | 
				
			||||||
                            }
 | 
					 | 
				
			||||||
                            else
 | 
					 | 
				
			||||||
                            {
 | 
					 | 
				
			||||||
                                allDrugStock[j].ReturnQuantity = iReturnQuantity;
 | 
					 | 
				
			||||||
                                item.DrawerChanneStockList.Add(allDrugStock[j]);
 | 
					 | 
				
			||||||
                                break;
 | 
					 | 
				
			||||||
                            }
 | 
					 | 
				
			||||||
                        }
 | 
					 | 
				
			||||||
                    }
 | 
					 | 
				
			||||||
                }
 | 
					 | 
				
			||||||
                // checkChannelStock.Add(item);
 | 
					 | 
				
			||||||
                i = 1;
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            //还空瓶数
 | 
					 | 
				
			||||||
            item.EmptyQuantity = item.SelectedOrderList.Sum(oi => oi.DetailInfo.Quantity);
 | 
					 | 
				
			||||||
            if (item.EmptyQuantity > 0)
 | 
					 | 
				
			||||||
            {
 | 
					 | 
				
			||||||
                //还空瓶库位
 | 
					 | 
				
			||||||
                //查询还空瓶库位
 | 
					 | 
				
			||||||
                //checkChannelStock[i].EmptyStock;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                List<ChannelStock> allDrugStock = await orderInfoDao.GetStockByDRrug(item.DrugId, item.ManuNo, 2);// await _connection.ChannelStock.Where(cs => cs.MachineId == _setting.machineId && cs.DrawerType == 1 && cs.DrugId == csList[i].DrugId && cs.ManuNo == csList[i].ManuNo).OrderBy(cs => cs.Quantity).ToListAsync();
 | 
					 | 
				
			||||||
                if (allDrugStock.Count > 0)
 | 
					 | 
				
			||||||
                {
 | 
					 | 
				
			||||||
                    item.EmptyStock = allDrugStock.FirstOrDefault();
 | 
					 | 
				
			||||||
                    item.EmptyStock.ReturnQuantity = item.EmptyQuantity;
 | 
					 | 
				
			||||||
                    i = 1;
 | 
					 | 
				
			||||||
                }
 | 
					 | 
				
			||||||
                // checkChannelStock.Add(item);
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
            if (i == 1)
 | 
					 | 
				
			||||||
            {
 | 
					 | 
				
			||||||
                checkChannelStock.Add(item);
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
        if (errMessage.Length > 0)
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
            return;
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
        if (checkChannelStock == null || checkChannelStock.Count <= 0)
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
            _message.Notify(
 | 
					 | 
				
			||||||
                   new NotificationMessage { Severity = NotificationSeverity.Error, Summary = "提示", Detail = $"无可操作的数据", Duration = 4000 }
 | 
					 | 
				
			||||||
               );
 | 
					 | 
				
			||||||
            return;
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
        // //弹出确认提示框
 | 
					 | 
				
			||||||
        var b = await dialogService.OpenAsync<CheckOrderConfirmDialog>(
 | 
					 | 
				
			||||||
           $"核对确认",
 | 
					 | 
				
			||||||
         new Dictionary<string, object>() { { "csList", checkChannelStock } },
 | 
					 | 
				
			||||||
         new DialogOptions() { Width = "90vw", Resizable = true, Draggable = true, ShowClose = false });
 | 
					 | 
				
			||||||
        // if (b)
 | 
					 | 
				
			||||||
        // {
 | 
					 | 
				
			||||||
        //     bool bResult = await orderInfoDao.CheckOrderInfoByChannelStock(csList.ToList(), BoxNum);
 | 
					 | 
				
			||||||
        //     if (bResult)
 | 
					 | 
				
			||||||
        //     {
 | 
					 | 
				
			||||||
        //         _message.Notify(
 | 
					 | 
				
			||||||
        //                         new NotificationMessage { Severity = NotificationSeverity.Success, Summary = "提示", Detail = $"处方已核对完成", Duration = 4000 }
 | 
					 | 
				
			||||||
        //                     );
 | 
					 | 
				
			||||||
        //         await LoadData(null);
 | 
					 | 
				
			||||||
        //     }
 | 
					 | 
				
			||||||
        //     else
 | 
					 | 
				
			||||||
        //     {
 | 
					 | 
				
			||||||
        //         _message.Notify(
 | 
					 | 
				
			||||||
        //                       new NotificationMessage { Severity = NotificationSeverity.Error, Summary = "提示", Detail = $"处方已核对失败", Duration = 4000 }
 | 
					 | 
				
			||||||
        //                );
 | 
					 | 
				
			||||||
        //     }
 | 
					 | 
				
			||||||
        // }
 | 
					 | 
				
			||||||
        if (b)
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
            LoadData(null);
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    //导处方
 | 
					 | 
				
			||||||
    async Task AddOrderMethod()
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
        var b = await dialogService.OpenAsync<CheckOrderImportDialog>(
 | 
					 | 
				
			||||||
           $"导入处方信息",
 | 
					 | 
				
			||||||
         new Dictionary<string, object>() { { "boxModel", BoxNum } },
 | 
					 | 
				
			||||||
         new DialogOptions() { Width = "80vw", Resizable = true, Draggable = true, ShowClose = false });
 | 
					 | 
				
			||||||
        if (b != null)
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
            try
 | 
					 | 
				
			||||||
            {
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                List<OrderInfo> importOrderInfo = b;
 | 
					 | 
				
			||||||
                if (importOrderInfo.Count > 0)
 | 
					 | 
				
			||||||
                {
 | 
					 | 
				
			||||||
                    string errorMessage = string.Empty;
 | 
					 | 
				
			||||||
                    for (int i = 0; i < importOrderInfo.Count; i++)
 | 
					 | 
				
			||||||
                    {
 | 
					 | 
				
			||||||
                        if (!(bool)listBoxSelectedcsList?.OrderList.Contains(importOrderInfo[i]))
 | 
					 | 
				
			||||||
                        {
 | 
					 | 
				
			||||||
                            if (csList.Where(c => c.DrugId == importOrderInfo[i].DetailInfo.DrugId && c.ManuNo == importOrderInfo[i].DetailInfo.SetManuNo).FirstOrDefault() == null)
 | 
					 | 
				
			||||||
                            {
 | 
					 | 
				
			||||||
                                errorMessage += $"处方{importOrderInfo[i].OrderNo}导入失败,药品{importOrderInfo[i].DetailInfo.Drug.DrugName}不存在或批次{importOrderInfo[i].DetailInfo.SetManuNo}不存在";
 | 
					 | 
				
			||||||
                            }
 | 
					 | 
				
			||||||
                            else
 | 
					 | 
				
			||||||
                            {
 | 
					 | 
				
			||||||
                                csList.Where(c => c.DrugId == importOrderInfo[i].DetailInfo.DrugId && c.ManuNo == importOrderInfo[i].DetailInfo.SetManuNo).FirstOrDefault()?.SelectedOrderList.Add(importOrderInfo[i]);
 | 
					 | 
				
			||||||
                                //csList.Where(c => c.DrugId == importOrderInfo[i].DetailInfo.DrugId && c.ManuNo == importOrderInfo[i].DetailInfo.SetManuNo).FirstOrDefault()?.OrderList.Add(importOrderInfo[i]);
 | 
					 | 
				
			||||||
                            }
 | 
					 | 
				
			||||||
                        }
 | 
					 | 
				
			||||||
                        csList = csList;
 | 
					 | 
				
			||||||
                    }
 | 
					 | 
				
			||||||
                    if (!string.IsNullOrEmpty(errorMessage))
 | 
					 | 
				
			||||||
                    {
 | 
					 | 
				
			||||||
                        _message.Notify(
 | 
					 | 
				
			||||||
                             new NotificationMessage { Severity = NotificationSeverity.Error, Summary = "提示", Detail = errorMessage, Duration = 4000 }
 | 
					 | 
				
			||||||
                      );
 | 
					 | 
				
			||||||
                        return;
 | 
					 | 
				
			||||||
                    }
 | 
					 | 
				
			||||||
                    else
 | 
					 | 
				
			||||||
                    {
 | 
					 | 
				
			||||||
                        StateHasChanged(); // 刷新UI
 | 
					 | 
				
			||||||
                    }
 | 
					 | 
				
			||||||
                }
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
            catch (Exception)
 | 
					 | 
				
			||||||
            {
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    PageData<ChannelStock> result;
 | 
					 | 
				
			||||||
    protected override async Task OnInitializedAsync()
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
        BoxColor = BoxColorList.FirstOrDefault();
 | 
					 | 
				
			||||||
        AllBoxList = await orderInfoDao.GetOperationNum(0);
 | 
					 | 
				
			||||||
        BoxList = AllBoxList.Where(bl => bl.BoxNo == BoxColor.BoxNo && bl.BoxName <= 30).ToList();
 | 
					 | 
				
			||||||
        BoxNum = AllBoxList.FirstOrDefault();
 | 
					 | 
				
			||||||
        await base.OnInitializedAsync();
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    async Task LoadData(LoadDataArgs args)
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
        string? roomName = BoxNum == null ? "" : setting.Value.roomName + BoxNum.BoxName.ToString().PadLeft(2, '0');
 | 
					 | 
				
			||||||
        result = await orderInfoDao.GetAllOrderInfoDrugByBox(BoxNum, roomName, OrderDate);
 | 
					 | 
				
			||||||
        isLoading = true;
 | 
					 | 
				
			||||||
        csList = result.Desserts;
 | 
					 | 
				
			||||||
        if (csList != null && csList.Count() > 0)
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
            listBoxSelectedcsList = csList.ElementAt(0);
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
        count = result.TotalDesserts;
 | 
					 | 
				
			||||||
        isLoading = false;
 | 
					 | 
				
			||||||
        StateHasChanged(); // 刷新UI
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    //麻醉药品使用登记本导出
 | 
					 | 
				
			||||||
    async Task StockExport()
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
        if (PortOrderDate == DateTime.MinValue)
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
            _message.Notify(
 | 
					 | 
				
			||||||
                           new NotificationMessage { Severity = NotificationSeverity.Error, Summary = "提示", Detail = $"请选择处方时间再导出", Duration = 4000 }
 | 
					 | 
				
			||||||
                    );
 | 
					 | 
				
			||||||
            return;
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
        // PageData<ReportUsageDateInfo> pageParentData = await reportDataDao.GetOrderInfoParentData(PortOrderDate);
 | 
					 | 
				
			||||||
        // PageData<ReportUsageDateInfo> pageData = await reportDataDao.GetOrderInfoData(PortOrderDate);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        List<ReportUsageParentDateInfo> pageParentData = await reportDataDao.GetOrderInfoParentData(PortOrderDate);
 | 
					 | 
				
			||||||
        List<ReportUsageDateInfo> pageData = await reportDataDao.GetOrderInfoData(PortOrderDate);
 | 
					 | 
				
			||||||
        Dictionary<string, object> parameters = new Dictionary<string, object>();
 | 
					 | 
				
			||||||
        parameters.Add("parent", pageParentData);
 | 
					 | 
				
			||||||
        parameters.Add("child", pageData);
 | 
					 | 
				
			||||||
        GridReportUtil.PrintReport("use_book.grf", parameters);
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    // protected override async Task OnInitializedAsync()
 | 
					 | 
				
			||||||
    // {
 | 
					 | 
				
			||||||
    //     await base.OnInitializedAsync();
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    //     // orderInfos = dbContext.Employees;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    //     var result = await orderInfoDao.GetAllOrderInfo(OrderNo, OrderDate, args.Top, args.Skip);
 | 
					 | 
				
			||||||
    //     // Update the Data property
 | 
					 | 
				
			||||||
    //     orderInfos = result.Desserts;
 | 
					 | 
				
			||||||
    //     // Update the count
 | 
					 | 
				
			||||||
    //     count = result.TotalDesserts;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    //     isLoading = false;
 | 
					 | 
				
			||||||
    // }
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
| 
						 | 
					@ -1,77 +0,0 @@
 | 
				
			||||||
@page "/Box/CheckDDD"
 | 
					 | 
				
			||||||
@using Radzen.Blazor
 | 
					 | 
				
			||||||
@using System.ComponentModel
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
<style>
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    .total-footer {
 | 
					 | 
				
			||||||
        font-weight: 600;
 | 
					 | 
				
			||||||
        color: var(--rz-secondary);
 | 
					 | 
				
			||||||
        padding: 8px 12px;
 | 
					 | 
				
			||||||
        background-color: var(--rz-base-100);
 | 
					 | 
				
			||||||
        border-top: 2px solid var(--rz-border-default);
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
</style>
 | 
					 | 
				
			||||||
@* <RadzenDataGrid @ref="grid" Data="@summaryData" TItem="dynamic"
 | 
					 | 
				
			||||||
                AllowPaging="true" PageSize="5">
 | 
					 | 
				
			||||||
    <Columns>
 | 
					 | 
				
			||||||
        <RadzenDataGridColumn Title="商品品类" Property="Category" Width="200px" />
 | 
					 | 
				
			||||||
        <RadzenDataGridColumn Title="销售总量" TextAlign="TextAlign.Right">
 | 
					 | 
				
			||||||
            <Template Context="group">
 | 
					 | 
				
			||||||
                <span class="font-bold">@group.TotalQuantity.ToString("N0")</span>
 | 
					 | 
				
			||||||
            </Template>
 | 
					 | 
				
			||||||
            <FooterTemplate>
 | 
					 | 
				
			||||||
                <div class="total-footer">
 | 
					 | 
				
			||||||
                    全品类合计: @orders.Sum(o => o.Quantity).ToString("N0")
 | 
					 | 
				
			||||||
                </div>
 | 
					 | 
				
			||||||
            </FooterTemplate>
 | 
					 | 
				
			||||||
        </RadzenDataGridColumn>
 | 
					 | 
				
			||||||
    </Columns>
 | 
					 | 
				
			||||||
</RadzenDataGrid> *@
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
@code {
 | 
					 | 
				
			||||||
    RadzenDataGrid<dynamic> grid;
 | 
					 | 
				
			||||||
    List<Order> orders = new();
 | 
					 | 
				
			||||||
    IEnumerable<dynamic> summaryData;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    protected override void OnInitialized()
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
        // 模拟数据
 | 
					 | 
				
			||||||
        orders = new List<Order> {
 | 
					 | 
				
			||||||
            new Order { Category = "电子产品", Quantity = 15 },
 | 
					 | 
				
			||||||
            new Order { Category = "电子产品", Quantity = 8 },
 | 
					 | 
				
			||||||
            new Order { Category = "家居用品", Quantity = 23 }
 | 
					 | 
				
			||||||
        };
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        CalculateSummary();
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    void CalculateSummary()
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
        summaryData = orders
 | 
					 | 
				
			||||||
            .GroupBy(o => o.Category)
 | 
					 | 
				
			||||||
            .Select(g => new
 | 
					 | 
				
			||||||
            {
 | 
					 | 
				
			||||||
                Category = g.Key,
 | 
					 | 
				
			||||||
                TotalQuantity = g.Sum(x => x.Quantity)
 | 
					 | 
				
			||||||
            }).ToList();
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    public class Order : INotifyPropertyChanged
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
        public event PropertyChangedEventHandler PropertyChanged;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        public string Category { get; set; }
 | 
					 | 
				
			||||||
        private int _quantity;
 | 
					 | 
				
			||||||
        public int Quantity
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
            get => _quantity;
 | 
					 | 
				
			||||||
            set
 | 
					 | 
				
			||||||
            {
 | 
					 | 
				
			||||||
                _quantity = value;
 | 
					 | 
				
			||||||
                PropertyChanged?.Invoke(this,
 | 
					 | 
				
			||||||
                    new PropertyChangedEventArgs(nameof(Quantity)));
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
| 
						 | 
					@ -16,15 +16,9 @@
 | 
				
			||||||
            <div class="col-12 row justify-content-center align-items-center text-center" style="background: url('/images/box-16.jpg')  no-repeat; background-size: 100% 100%; width: 380px; height:650px">
 | 
					            <div class="col-12 row justify-content-center align-items-center text-center" style="background: url('/images/box-16.jpg')  no-repeat; background-size: 100% 100%; width: 380px; height:650px">
 | 
				
			||||||
                <div class="row justify-content-around align-items-center" style="margin-top: 220px; height: 430px;">
 | 
					                <div class="row justify-content-around align-items-center" style="margin-top: 220px; height: 430px;">
 | 
				
			||||||
                    @foreach (int i in DrawerNos)
 | 
					                    @foreach (int i in DrawerNos)
 | 
				
			||||||
                    {
 | 
					 | 
				
			||||||
                        if (setting.Value.returnDrawer != null && setting.Value.returnDrawer.Contains(i))
 | 
					 | 
				
			||||||
                        {
 | 
					 | 
				
			||||||
                            <RadzenButton class="col-5" Click="@(() => SelectDrawer(i))" Text="@i.ToString()" Disabled="true" Shade="Shade.Light" Variant="@(drawerNo !=i ? Variant.Outlined : Variant.Flat)" Style="background-color: #d3d3d3;" />
 | 
					 | 
				
			||||||
                        }
 | 
					 | 
				
			||||||
                        else
 | 
					 | 
				
			||||||
                    {
 | 
					                    {
 | 
				
			||||||
                        <RadzenButton class="col-5" Click="@(() => SelectDrawer(i))" Text="@i.ToString()" Disabled="@(status > 0)" Shade="Shade.Light" Variant="@(drawerNo !=i ? Variant.Outlined : Variant.Flat)" />
 | 
					                        <RadzenButton class="col-5" Click="@(() => SelectDrawer(i))" Text="@i.ToString()" Disabled="@(status > 0)" Shade="Shade.Light" Variant="@(drawerNo !=i ? Variant.Outlined : Variant.Flat)" />
 | 
				
			||||||
                        }
 | 
					
 | 
				
			||||||
                    }
 | 
					                    }
 | 
				
			||||||
                </div>
 | 
					                </div>
 | 
				
			||||||
            </div>
 | 
					            </div>
 | 
				
			||||||
| 
						 | 
					@ -42,11 +36,11 @@
 | 
				
			||||||
            </div>
 | 
					            </div>
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    </div>
 | 
					    </div>
 | 
				
			||||||
    <RadzenDataGrid @ref="grid" Style="width:66vw; overflow:auto"
 | 
					    <RadzenDataGrid @ref="grid"
 | 
				
			||||||
    LoadData="@LoadData"
 | 
					    LoadData="@LoadData"
 | 
				
			||||||
    IsLoading="@isLoading"
 | 
					    IsLoading="@isLoading"
 | 
				
			||||||
    Count="@count"
 | 
					    Count="@count"
 | 
				
			||||||
    EmptyText="无数据"
 | 
					    EmptyText="@myText.NoDate"
 | 
				
			||||||
    Data="@channels"
 | 
					    Data="@channels"
 | 
				
			||||||
    AllowColumnResize="true" AllowAlternatingRows="false"
 | 
					    AllowColumnResize="true" AllowAlternatingRows="false"
 | 
				
			||||||
    CellClick="@((DataGridCellMouseEventArgs<ChannelStock> args) => OnCellClick(args))"
 | 
					    CellClick="@((DataGridCellMouseEventArgs<ChannelStock> args) => OnCellClick(args))"
 | 
				
			||||||
| 
						 | 
					@ -55,43 +49,42 @@
 | 
				
			||||||
            <RadzenRow JustifyContent="JustifyContent.End">
 | 
					            <RadzenRow JustifyContent="JustifyContent.End">
 | 
				
			||||||
                @if (status < 3)
 | 
					                @if (status < 3)
 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
                    <RadzenButton IsBusy="@(status>0)" BusyText="加药中。。。" ButtonStyle="ButtonStyle.Warning" Variant="Variant.Flat" Shade="Shade.Light" Text="加药" Click="@OpenDrawer" />
 | 
					                    <RadzenButton IsBusy="@(status > 0)" BusyText="@myText.Adding" ButtonStyle="ButtonStyle.Warning" Variant="Variant.Flat" Shade="Shade.Light" Text="@myText.Add" Click="@OpenDrawer" />
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
                @if (status == 3)
 | 
					                @if (status == 3)
 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
                    <RadzenButton Visible="@CompleteIsEnable" ButtonStyle="ButtonStyle.Warning" Variant="Variant.Flat" Shade="Shade.Light" Text="完成" Click="@AddFinish" />
 | 
					                    <RadzenButton Visible="@CompleteIsEnable" ButtonStyle="ButtonStyle.Warning" Variant="Variant.Flat" Shade="Shade.Light" Text="@myText.Complete" Click="@AddFinish" />
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
                @if (status > 0 && status <= 3)
 | 
					                @if (status > 0 && status <= 3)
 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
                    <RadzenButton Visible="@CancleIsEnable" Variant="Variant.Flat" Text="取消" Click="@Cancel" Style="width: 120px" />
 | 
					                    <RadzenButton Visible="@CancleIsEnable" Variant="Variant.Flat" Text="@myText.Cancel" Click="@Cancel" Style="width: 120px" />
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
            </RadzenRow>
 | 
					            </RadzenRow>
 | 
				
			||||||
        </HeaderTemplate>
 | 
					        </HeaderTemplate>
 | 
				
			||||||
        <Columns>
 | 
					        <Columns>
 | 
				
			||||||
            <RadzenDataGridColumn Width="4vw" Title="库位" Property="ColNo"></RadzenDataGridColumn>
 | 
					            <RadzenDataGridColumn Width="70px" Title="@myText.StorageLocation" Property="ColNo"></RadzenDataGridColumn>
 | 
				
			||||||
            <RadzenDataGridColumn Width="15vw" Title="药品名称" Property="Drug.DrugName">
 | 
					            <RadzenDataGridColumn Title="@myText.DrugName" Property="Drug.DrugName">
 | 
				
			||||||
                <Template Context="channel">
 | 
					                <Template Context="channel">
 | 
				
			||||||
                    <RadzenText TextStyle="TextStyle.Subtitle2" class="mb-0">@channel.Drug?.DrugName</RadzenText>
 | 
					                    <RadzenText TextStyle="TextStyle.Subtitle2" class="mb-0">@channel.Drug?.DrugName</RadzenText>
 | 
				
			||||||
                    <RadzenText TextStyle="TextStyle.Caption">@channel.Drug?.DrugSpec</RadzenText>
 | 
					                    <RadzenText TextStyle="TextStyle.Caption">@channel.Drug?.DrugSpec</RadzenText>
 | 
				
			||||||
                </Template>
 | 
					                </Template>
 | 
				
			||||||
            </RadzenDataGridColumn>
 | 
					            </RadzenDataGridColumn>
 | 
				
			||||||
            <RadzenDataGridColumn Width="15vw" Title="批次" Property="ManuNo">
 | 
					            <RadzenDataGridColumn Title="@myText.Batch" Property="ManuNo">
 | 
				
			||||||
                <Template Context="channel">
 | 
					                <Template Context="channel">
 | 
				
			||||||
                    @* <RadzenText TextStyle="TextStyle.Subtitle2" class="mb-0">@channel.drugManuNo?.ManuNo</RadzenText> *@
 | 
					                    <RadzenText TextStyle="TextStyle.Subtitle2" class="mb-0">@channel.drugManuNo?.ManuNo</RadzenText>
 | 
				
			||||||
                    <RadzenText TextStyle="TextStyle.Subtitle2" class="mb-0">@channel.ManuNo</RadzenText>
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
                    @*      @if (channel.drugManuNo != null && channel.drugManuNo.EffDate.ToString().Length > 10)
 | 
					                    @if (channel.drugManuNo != null && channel.drugManuNo.EffDate.ToString().Length > 10)
 | 
				
			||||||
                    {
 | 
					                    {
 | 
				
			||||||
                        <RadzenText TextStyle="TextStyle.Caption">
 | 
					                        <RadzenText TextStyle="TextStyle.Caption">
 | 
				
			||||||
                            @channel.drugManuNo.EffDate.ToString().Substring(0, 10)
 | 
					                            @channel.drugManuNo.EffDate.ToString().Substring(0, 10)
 | 
				
			||||||
                        </RadzenText>
 | 
					                        </RadzenText>
 | 
				
			||||||
                    }
 | 
					                    }
 | 
				
			||||||
                    else
 | 
					                    else
 | 
				
			||||||
                    { *@
 | 
					                    {
 | 
				
			||||||
                        <RadzenText TextStyle="TextStyle.Caption">
 | 
					                        <RadzenText TextStyle="TextStyle.Caption">
 | 
				
			||||||
                        @channel.EffDate
 | 
					                            @channel.drugManuNo?.EffDate
 | 
				
			||||||
                        </RadzenText>
 | 
					                        </RadzenText>
 | 
				
			||||||
                    @* } *@
 | 
					                    }
 | 
				
			||||||
                </Template>
 | 
					                </Template>
 | 
				
			||||||
                <EditTemplate Context="channel">
 | 
					                <EditTemplate Context="channel">
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -127,7 +120,7 @@
 | 
				
			||||||
                                </RadzenStack>
 | 
					                                </RadzenStack>
 | 
				
			||||||
                            </ValueTemplate>
 | 
					                            </ValueTemplate>
 | 
				
			||||||
                        </RadzenDropDown>
 | 
					                        </RadzenDropDown>
 | 
				
			||||||
                        <RadzenRequiredValidator Text="请选择批次" Component="ManuNo" Popup="true" />
 | 
					                        <RadzenRequiredValidator Text="@myText.SelectBatch" Component="ManuNo" Popup="true" />
 | 
				
			||||||
                    }
 | 
					                    }
 | 
				
			||||||
                    else
 | 
					                    else
 | 
				
			||||||
                    {
 | 
					                    {
 | 
				
			||||||
| 
						 | 
					@ -137,17 +130,12 @@
 | 
				
			||||||
                    }
 | 
					                    }
 | 
				
			||||||
                </EditTemplate>
 | 
					                </EditTemplate>
 | 
				
			||||||
            </RadzenDataGridColumn>
 | 
					            </RadzenDataGridColumn>
 | 
				
			||||||
            <RadzenDataGridColumn Title="库存" Width="10vw" Property="Quantity">
 | 
					            <RadzenDataGridColumn Title="@myText.Inventory" Property="Quantity">
 | 
				
			||||||
                <Template Context="cs">
 | 
					                <Template Context="cs">
 | 
				
			||||||
                    <RadzenButton ButtonStyle="ButtonStyle.Info" Variant="Variant.Flat" Shade="Shade.Lighter" class="m-1" Text="@cs.Quantity.ToString()" />
 | 
					                    <RadzenButton ButtonStyle="ButtonStyle.Info" Variant="Variant.Flat" Shade="Shade.Lighter" class="m-1" Text="@cs.Quantity.ToString()" />
 | 
				
			||||||
                </Template>
 | 
					                </Template>
 | 
				
			||||||
            </RadzenDataGridColumn>
 | 
					            </RadzenDataGridColumn>
 | 
				
			||||||
            <RadzenDataGridColumn MinWidth="15vw" Title="加药数量" Property="AddQuantity">
 | 
					            <RadzenDataGridColumn MinWidth="100px" Title="@myText.AddQuantity" Property="AddQuantity">
 | 
				
			||||||
                <HeaderTemplate>
 | 
					 | 
				
			||||||
                    <div style="text-align: center;">
 | 
					 | 
				
			||||||
                        加药<br>数量
 | 
					 | 
				
			||||||
                    </div>
 | 
					 | 
				
			||||||
                </HeaderTemplate>
 | 
					 | 
				
			||||||
                <EditTemplate Context="cs">
 | 
					                <EditTemplate Context="cs">
 | 
				
			||||||
                    @if (cs.BoardType.ToString().Contains("2") || cs.BoardType.ToString().Contains("3"))
 | 
					                    @if (cs.BoardType.ToString().Contains("2") || cs.BoardType.ToString().Contains("3"))
 | 
				
			||||||
                    {
 | 
					                    {
 | 
				
			||||||
| 
						 | 
					@ -156,7 +144,7 @@
 | 
				
			||||||
                    else
 | 
					                    else
 | 
				
			||||||
                    {
 | 
					                    {
 | 
				
			||||||
                        <RadzenNumeric Min="0" Style="display: block" Name="Quantity" @bind-Value=@cs.AddQuantity />
 | 
					                        <RadzenNumeric Min="0" Style="display: block" Name="Quantity" @bind-Value=@cs.AddQuantity />
 | 
				
			||||||
                        <RadzenNumericRangeValidator Style="position: absolute;z-index: 9999;" Min="0" Text="请填写正确的添加数量" Component="Quantity" Popup="true" />
 | 
					                        <RadzenNumericRangeValidator Style="position: absolute;z-index: 9999;" Min="0" Text="@myText.InputCorrectNum" Component="Quantity" Popup="true" />
 | 
				
			||||||
                    }
 | 
					                    }
 | 
				
			||||||
                </EditTemplate>
 | 
					                </EditTemplate>
 | 
				
			||||||
            </RadzenDataGridColumn>
 | 
					            </RadzenDataGridColumn>
 | 
				
			||||||
| 
						 | 
					@ -170,6 +158,8 @@
 | 
				
			||||||
    @inject PortUtil PortUtil;
 | 
					    @inject PortUtil PortUtil;
 | 
				
			||||||
    @inject NotificationService _message
 | 
					    @inject NotificationService _message
 | 
				
			||||||
    @inject IOptions<DrawerConfig> setting;
 | 
					    @inject IOptions<DrawerConfig> setting;
 | 
				
			||||||
 | 
					    @inject Toolbelt.Blazor.I18nText.I18nText I18nText;
 | 
				
			||||||
 | 
					    private I18nText.local myText = new I18nText.local();
 | 
				
			||||||
    int status = 0;
 | 
					    int status = 0;
 | 
				
			||||||
    int drawerNo = 1;
 | 
					    int drawerNo = 1;
 | 
				
			||||||
    RadzenDataGrid<ChannelStock> grid;
 | 
					    RadzenDataGrid<ChannelStock> grid;
 | 
				
			||||||
| 
						 | 
					@ -203,10 +193,8 @@
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    async Task OpenDrawer()
 | 
					    async Task OpenDrawer()
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        this.status = 1;
 | 
					 | 
				
			||||||
        PortUtil.PowerOn();
 | 
					 | 
				
			||||||
        await Task.Delay(200);
 | 
					 | 
				
			||||||
        PortUtil.DrawerNo = this.drawerNo;
 | 
					        PortUtil.DrawerNo = this.drawerNo;
 | 
				
			||||||
 | 
					        this.status = 1;
 | 
				
			||||||
        // 根据抽屉类型来决定打开前是否需要查询数量
 | 
					        // 根据抽屉类型来决定打开前是否需要查询数量
 | 
				
			||||||
        var promiseUtil = new PromiseUtil<object>();
 | 
					        var promiseUtil = new PromiseUtil<object>();
 | 
				
			||||||
        await promiseUtil.taskAsyncLoop(500, null, async (data, next, stop) =>
 | 
					        await promiseUtil.taskAsyncLoop(500, null, async (data, next, stop) =>
 | 
				
			||||||
| 
						 | 
					@ -315,7 +303,6 @@
 | 
				
			||||||
                            {
 | 
					                            {
 | 
				
			||||||
                                cl.AddQuantity = this.AfterQuantity[cl.ColNo - 1] - this.BeforeQuantity[cl.ColNo - 1];
 | 
					                                cl.AddQuantity = this.AfterQuantity[cl.ColNo - 1] - this.BeforeQuantity[cl.ColNo - 1];
 | 
				
			||||||
                            });
 | 
					                            });
 | 
				
			||||||
                            await InvokeAsync(StateHasChanged);
 | 
					 | 
				
			||||||
                        }
 | 
					                        }
 | 
				
			||||||
                        // 判断是否为称重抽屉
 | 
					                        // 判断是否为称重抽屉
 | 
				
			||||||
                        if (setting.Value.weigh != null && setting.Value.weigh.Contains(this.drawerNo))
 | 
					                        if (setting.Value.weigh != null && setting.Value.weigh.Contains(this.drawerNo))
 | 
				
			||||||
| 
						 | 
					@ -346,18 +333,16 @@
 | 
				
			||||||
                );
 | 
					                );
 | 
				
			||||||
                if (setting.Value.single != null && setting.Value.single.Contains(this.drawerNo))
 | 
					                if (setting.Value.single != null && setting.Value.single.Contains(this.drawerNo))
 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
                    PortUtil.PowerOff();
 | 
					                    PortUtil.AllLightOff();
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
                RestData();
 | 
					                RestData();
 | 
				
			||||||
                stop();
 | 
					                stop();
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        });
 | 
					        });
 | 
				
			||||||
        PortUtil.PowerOff();
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    void RestData()
 | 
					    void RestData()
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        PortUtil.PowerOff();
 | 
					 | 
				
			||||||
        PortUtil.speechSynthesizer.SpeakAsyncCancelAll();
 | 
					        PortUtil.speechSynthesizer.SpeakAsyncCancelAll();
 | 
				
			||||||
        this.status = 0;
 | 
					        this.status = 0;
 | 
				
			||||||
        this.BeforeQuantity = new int[9];
 | 
					        this.BeforeQuantity = new int[9];
 | 
				
			||||||
| 
						 | 
					@ -455,7 +440,7 @@
 | 
				
			||||||
        if (channels.Any(cl => cl.AddQuantity != 0 && cl.DrugId != null && cl.drugManuNo != null))
 | 
					        if (channels.Any(cl => cl.AddQuantity != 0 && cl.DrugId != null && cl.drugManuNo != null))
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            // 保存账册、操作记录
 | 
					            // 保存账册、操作记录
 | 
				
			||||||
            var b = await channelListDao.DrawerOperationFinish(channels.Where(cl => cl.AddQuantity != 0).ToList(), 1,null,null);
 | 
					            var b = await channelListDao.DrawerOperationFinish(channels.Where(cl => cl.AddQuantity != 0).ToList(), 1);
 | 
				
			||||||
            if (!b)
 | 
					            if (!b)
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                _message.Notify(new NotificationMessage { Severity = NotificationSeverity.Error, Summary = "提示", Detail = $"数据保存失败", Duration = 4000 });
 | 
					                _message.Notify(new NotificationMessage { Severity = NotificationSeverity.Error, Summary = "提示", Detail = $"数据保存失败", Duration = 4000 });
 | 
				
			||||||
| 
						 | 
					@ -497,7 +482,7 @@
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        // if (args.Data.BoardType.ToString().Contains("3"))
 | 
					        // if (args.Data.BoardType.ToString().Contains("3"))
 | 
				
			||||||
        // {
 | 
					        // {
 | 
				
			||||||
        //     //是药盒抽屉则点击行,打开对应行的药盒
 | 
					        //     //是药盒抽屉则点击行,打开对应行的药箱
 | 
				
			||||||
        //     if (!ColNos.Contains(args.Data.ColNo))
 | 
					        //     if (!ColNos.Contains(args.Data.ColNo))
 | 
				
			||||||
        //     {
 | 
					        //     {
 | 
				
			||||||
        //         ColNos.Add(args.Data.ColNo);
 | 
					        //         ColNos.Add(args.Data.ColNo);
 | 
				
			||||||
| 
						 | 
					@ -534,4 +519,9 @@
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        registration?.Dispose();
 | 
					        registration?.Dispose();
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					    protected override async Task OnInitializedAsync()
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        myText = await I18nText.GetTextTableAsync<I18nText.local>(this);
 | 
				
			||||||
 | 
					        await base.OnInitializedAsync();
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -36,11 +36,11 @@
 | 
				
			||||||
            </div>
 | 
					            </div>
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    </div>
 | 
					    </div>
 | 
				
			||||||
    <RadzenDataGrid @ref="grid" Style="width:66vw; overflow:auto"
 | 
					    <RadzenDataGrid @ref="grid"
 | 
				
			||||||
                    LoadData="@LoadData"
 | 
					                    LoadData="@LoadData"
 | 
				
			||||||
                    IsLoading="@isLoading"
 | 
					                    IsLoading="@isLoading"
 | 
				
			||||||
                    Count="@count"
 | 
					                    Count="@count"
 | 
				
			||||||
    EmptyText="无数据"
 | 
					                    EmptyText="@myText.NoDate"
 | 
				
			||||||
                    Data="@channels"
 | 
					                    Data="@channels"
 | 
				
			||||||
                    AllowColumnResize="true" AllowAlternatingRows="false"
 | 
					                    AllowColumnResize="true" AllowAlternatingRows="false"
 | 
				
			||||||
                    CellClick="@((DataGridCellMouseEventArgs<ChannelStock> args) => OnCellClick(args))"
 | 
					                    CellClick="@((DataGridCellMouseEventArgs<ChannelStock> args) => OnCellClick(args))"
 | 
				
			||||||
| 
						 | 
					@ -49,85 +49,38 @@
 | 
				
			||||||
            <RadzenRow JustifyContent="JustifyContent.End">
 | 
					            <RadzenRow JustifyContent="JustifyContent.End">
 | 
				
			||||||
                @if (status < 3)
 | 
					                @if (status < 3)
 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
                    if (setting.Value.returnDrawer != null && setting.Value.returnDrawer.Contains(drawerNo))
 | 
					                    <RadzenButton IsBusy="@(status > 0)" BusyText="@myText.Taking" ButtonStyle="ButtonStyle.Warning" Variant="Variant.Flat" Shade="Shade.Light" Text="@myText.Take" Click="@OpenDrawer" />
 | 
				
			||||||
                    {
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                        <RadzenButton IsBusy="@(status>0)" BusyText="取空瓶中。。。" ButtonStyle="ButtonStyle.Warning" Variant="Variant.Flat" Shade="Shade.Light" Text="取空瓶" Click="@OpenDrawer" />
 | 
					 | 
				
			||||||
                    }
 | 
					 | 
				
			||||||
                    else
 | 
					 | 
				
			||||||
                    {
 | 
					 | 
				
			||||||
                        <RadzenButton IsBusy="@(status>0)" BusyText="取药中。。。" ButtonStyle="ButtonStyle.Warning" Variant="Variant.Flat" Shade="Shade.Light" Text="取药" Click="@OpenDrawer" />
 | 
					 | 
				
			||||||
                    }
 | 
					 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
                @if (status == 3)
 | 
					                @if (status == 3)
 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
 | 
					                    <RadzenButton Visible="@CompleteIsEnable" ButtonStyle="ButtonStyle.Warning" Variant="Variant.Flat" Shade="Shade.Light" Text="@myText.Complete" Click="@TakeFinish" />
 | 
				
			||||||
                    if (setting.Value.returnDrawer != null && setting.Value.returnDrawer.Contains(drawerNo))
 | 
					 | 
				
			||||||
                    { }
 | 
					 | 
				
			||||||
                    else
 | 
					 | 
				
			||||||
                    {
 | 
					 | 
				
			||||||
                        <RadzenLabel Text="入库药箱" Component="BoxList" />
 | 
					 | 
				
			||||||
                        <RadzenDropDownDataGrid AllowVirtualization="true" Name="BoxColorList" TValue="BoxModel" Data="@BoxColorList" Value="BoxColor" Style="width: 7vw;"
 | 
					 | 
				
			||||||
                        ValueChanged="@((args) => OnColorChanged(args))" AllowFiltering="false"
 | 
					 | 
				
			||||||
                        AllowFilteringByAllStringColumns="true" TextProperty="药箱号">
 | 
					 | 
				
			||||||
                            <Template>
 | 
					 | 
				
			||||||
                                @((context as BoxModel).BoxNo == 1 ? "白" : (context as BoxModel).BoxNo == 3 ? "非常规" : "绿")
 | 
					 | 
				
			||||||
                            </Template>
 | 
					 | 
				
			||||||
                            <Columns>
 | 
					 | 
				
			||||||
                                <RadzenDropDownDataGridColumn Property="BoxNo" Title="药箱颜色" Sortable="false" />
 | 
					 | 
				
			||||||
                            </Columns>
 | 
					 | 
				
			||||||
                        </RadzenDropDownDataGrid>
 | 
					 | 
				
			||||||
                        <RadzenDropDownDataGrid AllowVirtualization="true" Name="BoxList" TValue="BoxModel" Data="@BoxList" Value="BoxNum" Style="width: 15vw;"
 | 
					 | 
				
			||||||
                        ValueChanged="@((args) => OnBoxChanged(args))" AllowFilteringByAllStringColumns="true" TextProperty="药箱号">
 | 
					 | 
				
			||||||
                            <Template>
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                                @(
 | 
					 | 
				
			||||||
                                                            (context as BoxModel).BoxName == 99 ? "急诊药盒" : (context as BoxModel).BoxName == 111 ? "恢复室药盒" :
 | 
					 | 
				
			||||||
                                                                (context as BoxModel).BoxName == 31 ? "胃镜药盒" :
 | 
					 | 
				
			||||||
                                                                (context as BoxModel).BoxName == 32 ? "导管药盒" :
 | 
					 | 
				
			||||||
                                                                (context as BoxModel).BoxName == 33 ? "生殖药盒" :
 | 
					 | 
				
			||||||
                                                                (context as BoxModel).BoxName == 34 ? "妇门药盒" : (context as BoxModel).BoxName + "-" + ((context as BoxModel).BoxNo == 1 ? "白" : "绿")
 | 
					 | 
				
			||||||
                                                            )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                            </Template>
 | 
					 | 
				
			||||||
                            <Columns>
 | 
					 | 
				
			||||||
                                <RadzenDropDownDataGridColumn Property="BoxName" Title="药箱号" Sortable="false" />
 | 
					 | 
				
			||||||
                            </Columns>
 | 
					 | 
				
			||||||
                        </RadzenDropDownDataGrid>
 | 
					 | 
				
			||||||
                    }
 | 
					 | 
				
			||||||
                    <RadzenButton Visible="@CompleteIsEnable" ButtonStyle="ButtonStyle.Warning" Variant="Variant.Flat" Shade="Shade.Light" Text="完成" Click="@TakeFinish" />
 | 
					 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
                @if (status > 0 && status <= 3)
 | 
					                @if (status > 0 && status <= 3)
 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
                    <RadzenButton Visible="@CancleIsEnable" Variant="Variant.Flat" Text="取消" Click="@Cancel" Style="width: 120px" />
 | 
					                    <RadzenButton Visible="@CancleIsEnable" Variant="Variant.Flat" Text="@myText.Cancel" Click="@Cancel" Style="width: 120px" />
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
            </RadzenRow>
 | 
					            </RadzenRow>
 | 
				
			||||||
        </HeaderTemplate>
 | 
					        </HeaderTemplate>
 | 
				
			||||||
        <Columns>
 | 
					        <Columns>
 | 
				
			||||||
            <RadzenDataGridColumn Width="4vw" Title="库位" Property="ColNo"></RadzenDataGridColumn>
 | 
					            <RadzenDataGridColumn Width="70px" Title="@myText.StorageLocation" Property="ColNo"></RadzenDataGridColumn>
 | 
				
			||||||
            <RadzenDataGridColumn Width="15vw" Title="药品名称" Property="Drug.DrugName">
 | 
					            <RadzenDataGridColumn Title="@myText.DrugName" Property="Drug.DrugName">
 | 
				
			||||||
                <Template Context="channel">
 | 
					                <Template Context="channel">
 | 
				
			||||||
                    <RadzenText TextStyle="TextStyle.Subtitle2" class="mb-0">@channel.Drug?.DrugName</RadzenText>
 | 
					                    <RadzenText TextStyle="TextStyle.Subtitle2" class="mb-0">@channel.Drug.DrugName</RadzenText>
 | 
				
			||||||
                    <RadzenText TextStyle="TextStyle.Caption">@channel.Drug?.DrugSpec</RadzenText>
 | 
					                    <RadzenText TextStyle="TextStyle.Caption">@channel.Drug.DrugSpec</RadzenText>
 | 
				
			||||||
                </Template>
 | 
					                </Template>
 | 
				
			||||||
            </RadzenDataGridColumn>
 | 
					            </RadzenDataGridColumn>
 | 
				
			||||||
            <RadzenDataGridColumn Width="15vw" Title="批次" Property="ManuNo">
 | 
					            <RadzenDataGridColumn Title="@myText.Batch" Property="ManuNo">
 | 
				
			||||||
                <Template Context="channel">
 | 
					                <Template Context="channel">
 | 
				
			||||||
                    <RadzenText TextStyle="TextStyle.Subtitle2" class="mb-0">@channel.ManuNo</RadzenText>
 | 
					                    <RadzenText TextStyle="TextStyle.Subtitle2" class="mb-0">@channel.ManuNo</RadzenText>
 | 
				
			||||||
                    <RadzenText TextStyle="TextStyle.Caption">@channel.EffDate</RadzenText>
 | 
					                    <RadzenText TextStyle="TextStyle.Caption">@channel.EffDate</RadzenText>
 | 
				
			||||||
                </Template>
 | 
					                </Template>
 | 
				
			||||||
            </RadzenDataGridColumn>
 | 
					            </RadzenDataGridColumn>
 | 
				
			||||||
            <RadzenDataGridColumn Title="库存" Width="10vw" Property="Quantity">
 | 
					            <RadzenDataGridColumn Title="@myText.Inventory" Property="Quantity">
 | 
				
			||||||
                <Template Context="channel">
 | 
					                <Template Context="channel">
 | 
				
			||||||
                    <RadzenButton ButtonStyle="ButtonStyle.Info" Size="ButtonSize.Medium" Variant="Variant.Flat" Shade="Shade.Lighter" class="m-1" Text="@channel.Quantity.ToString()" />
 | 
					                    <RadzenButton ButtonStyle="ButtonStyle.Info" Size="ButtonSize.Medium" Variant="Variant.Flat" Shade="Shade.Lighter" class="m-1" Text="@channel.Quantity.ToString()" />
 | 
				
			||||||
                </Template>
 | 
					                </Template>
 | 
				
			||||||
            </RadzenDataGridColumn>
 | 
					            </RadzenDataGridColumn>
 | 
				
			||||||
            <RadzenDataGridColumn MinWidth="15vw" Title="取药数量" Property="TakeQuantity">
 | 
					            <RadzenDataGridColumn MinWidth="120px" Title="@myText.TakeQuantity" Property="TakeQuantity">
 | 
				
			||||||
                <HeaderTemplate>
 | 
					 | 
				
			||||||
                    <div style="text-align: center;">
 | 
					 | 
				
			||||||
                        取药<br>数量
 | 
					 | 
				
			||||||
                    </div>
 | 
					 | 
				
			||||||
                </HeaderTemplate>
 | 
					 | 
				
			||||||
                <EditTemplate Context="channel">
 | 
					                <EditTemplate Context="channel">
 | 
				
			||||||
                    @if (channel.BoardType.ToString().Contains("2") || channel.BoardType.ToString().Contains("3"))
 | 
					                    @if (channel.BoardType.ToString().Contains("2") || channel.BoardType.ToString().Contains("3"))
 | 
				
			||||||
                    {
 | 
					                    {
 | 
				
			||||||
| 
						 | 
					@ -150,8 +103,8 @@
 | 
				
			||||||
    @inject PortUtil PortUtil;
 | 
					    @inject PortUtil PortUtil;
 | 
				
			||||||
    @inject NotificationService _message
 | 
					    @inject NotificationService _message
 | 
				
			||||||
    @inject IOptions<DrawerConfig> setting;
 | 
					    @inject IOptions<DrawerConfig> setting;
 | 
				
			||||||
 | 
					    @inject Toolbelt.Blazor.I18nText.I18nText I18nText;
 | 
				
			||||||
    @inject IOrderInfoDao orderInfoDao;
 | 
					    private I18nText.local myText = new I18nText.local();
 | 
				
			||||||
    int status = 0;
 | 
					    int status = 0;
 | 
				
			||||||
    int drawerNo = 1;
 | 
					    int drawerNo = 1;
 | 
				
			||||||
    RadzenDataGrid<ChannelStock> grid;
 | 
					    RadzenDataGrid<ChannelStock> grid;
 | 
				
			||||||
| 
						 | 
					@ -168,33 +121,16 @@
 | 
				
			||||||
    bool CompleteIsEnable = true;
 | 
					    bool CompleteIsEnable = true;
 | 
				
			||||||
    bool CancleIsEnable = true;
 | 
					    bool CancleIsEnable = true;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    BoxModel BoxNum;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    BoxModel BoxColor;
 | 
					 | 
				
			||||||
    //全部药盒集合
 | 
					 | 
				
			||||||
    List<BoxModel> AllBoxList = new List<BoxModel>();
 | 
					 | 
				
			||||||
    //药盒集合
 | 
					 | 
				
			||||||
    List<BoxModel> BoxList = new List<BoxModel>();
 | 
					 | 
				
			||||||
    //药盒颜色集合
 | 
					 | 
				
			||||||
    List<BoxModel> BoxColorList = new List<BoxModel>()
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
            new  BoxModel{BoxNo=1,BoxName=1 },
 | 
					 | 
				
			||||||
            new  BoxModel{BoxNo=2 ,BoxName=1},
 | 
					 | 
				
			||||||
            new  BoxModel{BoxNo=3 ,BoxName=1}
 | 
					 | 
				
			||||||
        };
 | 
					 | 
				
			||||||
    private readonly ILog logger = LogManager.GetLogger(typeof(DrawerTake));
 | 
					    private readonly ILog logger = LogManager.GetLogger(typeof(DrawerTake));
 | 
				
			||||||
    protected override async Task OnInitializedAsync()
 | 
					    protected override async Task OnInitializedAsync()
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        BoxColor = BoxColorList.FirstOrDefault();
 | 
					        myText = await I18nText.GetTextTableAsync<I18nText.local>(this);
 | 
				
			||||||
        AllBoxList = await orderInfoDao.GetOperationNum(0);
 | 
					 | 
				
			||||||
        BoxList = AllBoxList.Where(bl => bl.BoxNo == BoxColor.BoxNo && bl.BoxName <= 30).ToList();
 | 
					 | 
				
			||||||
        BoxNum = AllBoxList.FirstOrDefault();
 | 
					 | 
				
			||||||
        await base.OnInitializedAsync();
 | 
					        await base.OnInitializedAsync();
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    async Task LoadData(LoadDataArgs args)
 | 
					    async Task LoadData(LoadDataArgs args)
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        isLoading = true;
 | 
					        isLoading = true;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        // var result = await channelListDao.GetChannelStockByDrawerNo(drawerNo, 1);
 | 
					        // var result = await channelListDao.GetChannelStockByDrawerNo(drawerNo, 1);
 | 
				
			||||||
        var result = await channelListDao.GetChannelStockByDrawerNoWithDrawers(drawerNo, 1);
 | 
					        var result = await channelListDao.GetChannelStockByDrawerNoWithDrawers(drawerNo, 1);
 | 
				
			||||||
        DrawerNos = result.DrawerArray;
 | 
					        DrawerNos = result.DrawerArray;
 | 
				
			||||||
| 
						 | 
					@ -206,32 +142,10 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        isLoading = false;
 | 
					        isLoading = false;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    private async Task OnColorChanged(object value)
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
        if ((((BoxModel)value).BoxNo) == 3)
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
            BoxList = AllBoxList.Where(bl => bl.BoxName > 30).ToList();
 | 
					 | 
				
			||||||
            BoxNum = BoxList.FirstOrDefault();
 | 
					 | 
				
			||||||
            await InvokeAsync(StateHasChanged);
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
        else
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
            BoxList = AllBoxList.Where(bl => bl.BoxNo == ((BoxModel)value).BoxNo && bl.BoxName <= 30).ToList();
 | 
					 | 
				
			||||||
            BoxNum = BoxList.FirstOrDefault();
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    //药箱选中修改
 | 
					 | 
				
			||||||
    private async Task OnBoxChanged(object value)
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
        // BoxList = BoxList.Where(bl => bl.BoxNo == ((BoxModel)value).BoxNo && bl.BoxName == ((BoxModel)value).BoxName).ToList();
 | 
					 | 
				
			||||||
        BoxNum = (BoxModel)value;
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    async Task OpenDrawer()
 | 
					    async Task OpenDrawer()
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        this.status = 1;
 | 
					 | 
				
			||||||
        PortUtil.PowerOn();
 | 
					 | 
				
			||||||
        await Task.Delay(200);
 | 
					 | 
				
			||||||
        PortUtil.DrawerNo = this.drawerNo;
 | 
					        PortUtil.DrawerNo = this.drawerNo;
 | 
				
			||||||
 | 
					        this.status = 1;
 | 
				
			||||||
        // 根据抽屉类型来决定打开前是否需要查询数量
 | 
					        // 根据抽屉类型来决定打开前是否需要查询数量
 | 
				
			||||||
        var promiseUtil = new PromiseUtil<object>();
 | 
					        var promiseUtil = new PromiseUtil<object>();
 | 
				
			||||||
        await promiseUtil.taskAsyncLoop(500, null, async (data, next, stop) =>
 | 
					        await promiseUtil.taskAsyncLoop(500, null, async (data, next, stop) =>
 | 
				
			||||||
| 
						 | 
					@ -257,15 +171,7 @@
 | 
				
			||||||
                    if (b)
 | 
					                    if (b)
 | 
				
			||||||
                    {
 | 
					                    {
 | 
				
			||||||
                        PortUtil.speechSynthesizer.SpeakAsyncCancelAll();
 | 
					                        PortUtil.speechSynthesizer.SpeakAsyncCancelAll();
 | 
				
			||||||
 | 
					 | 
				
			||||||
                        if (setting.Value.returnDrawer != null && setting.Value.returnDrawer.Contains(drawerNo))
 | 
					 | 
				
			||||||
                        {
 | 
					 | 
				
			||||||
                            PortUtil.SpeakAsync($"{drawerNo}号抽屉已经打开,请,取空瓶");
 | 
					 | 
				
			||||||
                        }
 | 
					 | 
				
			||||||
                        else
 | 
					 | 
				
			||||||
                        {
 | 
					 | 
				
			||||||
                        PortUtil.SpeakAsync($"{drawerNo}号抽屉已经打开,请,取药");
 | 
					                        PortUtil.SpeakAsync($"{drawerNo}号抽屉已经打开,请,取药");
 | 
				
			||||||
                        }
 | 
					 | 
				
			||||||
                        PortUtil.Operate = true;
 | 
					                        PortUtil.Operate = true;
 | 
				
			||||||
                        this.status = 2;
 | 
					                        this.status = 2;
 | 
				
			||||||
                        next();
 | 
					                        next();
 | 
				
			||||||
| 
						 | 
					@ -273,7 +179,7 @@
 | 
				
			||||||
                    else
 | 
					                    else
 | 
				
			||||||
                    {
 | 
					                    {
 | 
				
			||||||
                        _message.Notify(
 | 
					                        _message.Notify(
 | 
				
			||||||
                            new NotificationMessage { Severity = NotificationSeverity.Error, Summary = "提示", Detail = $"抽屉【{drawerNo}】打开失败,请检测硬件", Duration = 4000 }
 | 
					                            new NotificationMessage { Severity = NotificationSeverity.Error, Summary = myText.Tips, Detail = $"抽屉【{drawerNo}】打开失败,请检测硬件", Duration = 4000 }
 | 
				
			||||||
                        );
 | 
					                        );
 | 
				
			||||||
                        logger.Info($"抽屉打开失败");
 | 
					                        logger.Info($"抽屉打开失败");
 | 
				
			||||||
                        RestData();
 | 
					                        RestData();
 | 
				
			||||||
| 
						 | 
					@ -290,15 +196,7 @@
 | 
				
			||||||
                    if (b)
 | 
					                    if (b)
 | 
				
			||||||
                    {
 | 
					                    {
 | 
				
			||||||
                        PortUtil.speechSynthesizer.SpeakAsyncCancelAll();
 | 
					                        PortUtil.speechSynthesizer.SpeakAsyncCancelAll();
 | 
				
			||||||
                        if (setting.Value.returnDrawer != null && setting.Value.returnDrawer.Contains(drawerNo))
 | 
					 | 
				
			||||||
                        {
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                            PortUtil.SpeakAsync($"取空瓶完成,请核对或录入正确的取出数量");
 | 
					 | 
				
			||||||
                        }
 | 
					 | 
				
			||||||
                        else
 | 
					 | 
				
			||||||
                        {
 | 
					 | 
				
			||||||
                        PortUtil.SpeakAsync($"取药完成,请核对或录入正确的取出数量");
 | 
					                        PortUtil.SpeakAsync($"取药完成,请核对或录入正确的取出数量");
 | 
				
			||||||
                        }
 | 
					 | 
				
			||||||
                        // 判断是否为称重抽屉
 | 
					                        // 判断是否为称重抽屉
 | 
				
			||||||
                        if (setting.Value.weigh != null && setting.Value.weigh.Contains(this.drawerNo))
 | 
					                        if (setting.Value.weigh != null && setting.Value.weigh.Contains(this.drawerNo))
 | 
				
			||||||
                        {
 | 
					                        {
 | 
				
			||||||
| 
						 | 
					@ -379,17 +277,16 @@
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                logger.Info($"抽屉取药发生错误,{e.Message}");
 | 
					                logger.Info($"抽屉取药发生错误,{e.Message}");
 | 
				
			||||||
                _message.Notify(
 | 
					                _message.Notify(
 | 
				
			||||||
                    new NotificationMessage { Severity = NotificationSeverity.Error, Summary = "提示", Detail = $"发生错误,{e.Message}", Duration = 4000 }
 | 
					                    new NotificationMessage { Severity = NotificationSeverity.Error, Summary = myText.Tips, Detail = $"发生错误,{e.Message}", Duration = 4000 }
 | 
				
			||||||
                );
 | 
					                );
 | 
				
			||||||
                if (setting.Value.single.Contains(this.drawerNo))
 | 
					                if (setting.Value.single.Contains(this.drawerNo))
 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
                    PortUtil.PowerOff();
 | 
					                    PortUtil.AllLightOff();
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
                RestData();
 | 
					                RestData();
 | 
				
			||||||
                stop();
 | 
					                stop();
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        });
 | 
					        });
 | 
				
			||||||
        PortUtil.PowerOff();
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    //关闭抽屉后获取称重稳定数量
 | 
					    //关闭抽屉后获取称重稳定数量
 | 
				
			||||||
    public async Task GetWeightQuantity()
 | 
					    public async Task GetWeightQuantity()
 | 
				
			||||||
| 
						 | 
					@ -487,7 +384,6 @@
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    void RestData()
 | 
					    void RestData()
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        PortUtil.PowerOff();
 | 
					 | 
				
			||||||
        PortUtil.speechSynthesizer.SpeakAsyncCancelAll();
 | 
					        PortUtil.speechSynthesizer.SpeakAsyncCancelAll();
 | 
				
			||||||
        this.status = 0;
 | 
					        this.status = 0;
 | 
				
			||||||
        this.BeforeQuantity = new int[9];
 | 
					        this.BeforeQuantity = new int[9];
 | 
				
			||||||
| 
						 | 
					@ -502,27 +398,12 @@
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        if (channels.Any(cl => cl.TakeQuantity != 0))
 | 
					        if (channels.Any(cl => cl.TakeQuantity != 0))
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            CheckInfo<ChannelList> checkInfo = null;
 | 
					
 | 
				
			||||||
            // if(BoxNum!=null&&BoxNum.BoxNo!=0)
 | 
					 | 
				
			||||||
            // {
 | 
					 | 
				
			||||||
            //     //查询本次加药的药盒里是否有绑该药,有则正常入库,无则提示无绑定不可添加
 | 
					 | 
				
			||||||
            //     checkInfo = await channelListDao.CheckBoxDrugInfo(BoxNum, channels.Where(cl => cl.TakeQuantity != 0).ToList());
 | 
					 | 
				
			||||||
            //     if (!string.IsNullOrEmpty(checkInfo.StrInfo))
 | 
					 | 
				
			||||||
            //     {
 | 
					 | 
				
			||||||
            //         _message.Notify(new NotificationMessage { Severity = NotificationSeverity.Error, Summary = "提示", Detail = $"该药盒中未绑定该批次药品无法添加", Duration = 4000 });
 | 
					 | 
				
			||||||
            //         logger.Error($"该药盒中未绑定该批次药品无法添加,数据{JsonConvert.SerializeObject(channels)}");
 | 
					 | 
				
			||||||
            //         return;
 | 
					 | 
				
			||||||
            //     }
 | 
					 | 
				
			||||||
            // }
 | 
					 | 
				
			||||||
            if (setting.Value.returnDrawer != null && setting.Value.returnDrawer.Contains(drawerNo))
 | 
					 | 
				
			||||||
            {
 | 
					 | 
				
			||||||
                BoxNum = null;
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
            // 保存账册、操作记录
 | 
					            // 保存账册、操作记录
 | 
				
			||||||
            var b = await channelListDao.DrawerOperationFinish(channels.Where(cl => cl.TakeQuantity != 0).ToList(), 2, BoxNum, null);
 | 
					            var b = await channelListDao.DrawerOperationFinish(channels.Where(cl => cl.TakeQuantity != 0).ToList(), 2);
 | 
				
			||||||
            if (!b)
 | 
					            if (!b)
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                _message.Notify(new NotificationMessage { Severity = NotificationSeverity.Error, Summary = "提示", Detail = $"数据保存失败", Duration = 4000 });
 | 
					                _message.Notify(new NotificationMessage { Severity = NotificationSeverity.Error, Summary = myText.Tips, Detail = $"数据保存失败", Duration = 4000 });
 | 
				
			||||||
                logger.Error($"抽屉取药保存数据库失败,数据{JsonConvert.SerializeObject(channels)}");
 | 
					                logger.Error($"抽屉取药保存数据库失败,数据{JsonConvert.SerializeObject(channels)}");
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            else
 | 
					            else
 | 
				
			||||||
| 
						 | 
					@ -559,7 +440,7 @@
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        // if (args.Data.BoardType.ToString().Contains("3"))
 | 
					        // if (args.Data.BoardType.ToString().Contains("3"))
 | 
				
			||||||
        // {
 | 
					        // {
 | 
				
			||||||
        //     //是药盒抽屉则点击行,打开对应行的药盒
 | 
					        //     //是药盒抽屉则点击行,打开对应行的药箱
 | 
				
			||||||
        //     if (!ColNos.Contains(args.Data.ColNo))
 | 
					        //     if (!ColNos.Contains(args.Data.ColNo))
 | 
				
			||||||
        //     {
 | 
					        //     {
 | 
				
			||||||
        //         ColNos.Add(args.Data.ColNo);
 | 
					        //         ColNos.Add(args.Data.ColNo);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -10,11 +10,11 @@
 | 
				
			||||||
        <div class="col-12  mb-4">
 | 
					        <div class="col-12  mb-4">
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            <form onsubmit="@(() => grid.Reload())">
 | 
					            <form onsubmit="@(() => grid.Reload())">
 | 
				
			||||||
                <RadzenFieldset Text="查询">
 | 
					                <RadzenFieldset Text="@myText.Search">
 | 
				
			||||||
                    <RadzenStack Orientation="Orientation.Horizontal" Gap="1rem">
 | 
					                    <RadzenStack Orientation="Orientation.Horizontal" Gap="1rem">
 | 
				
			||||||
                        <RadzenRow AlignItems="AlignItems.Center">
 | 
					                        <RadzenRow AlignItems="AlignItems.Center">
 | 
				
			||||||
                            <RadzenColumn Size="4">
 | 
					                            <RadzenColumn Size="4">
 | 
				
			||||||
                                <RadzenLabel Text="药品编码" Component="DrugId" />
 | 
					                                <RadzenLabel Text="@myText.DrugCode" Component="DrugId" />
 | 
				
			||||||
                            </RadzenColumn>
 | 
					                            </RadzenColumn>
 | 
				
			||||||
                            <RadzenColumn Size="8">
 | 
					                            <RadzenColumn Size="8">
 | 
				
			||||||
                                <RadzenTextBox @bind-Value="DrugId" Style="width: 100%;" Name="DrugId"></RadzenTextBox>
 | 
					                                <RadzenTextBox @bind-Value="DrugId" Style="width: 100%;" Name="DrugId"></RadzenTextBox>
 | 
				
			||||||
| 
						 | 
					@ -22,7 +22,7 @@
 | 
				
			||||||
                        </RadzenRow>
 | 
					                        </RadzenRow>
 | 
				
			||||||
                        <RadzenRow AlignItems="AlignItems.Center">
 | 
					                        <RadzenRow AlignItems="AlignItems.Center">
 | 
				
			||||||
                            <RadzenColumn Size="4">
 | 
					                            <RadzenColumn Size="4">
 | 
				
			||||||
                                <RadzenLabel Text="药品名称" Component="DrugName" />
 | 
					                                <RadzenLabel Text="@myText.DrugName" Component="DrugName" />
 | 
				
			||||||
                            </RadzenColumn>
 | 
					                            </RadzenColumn>
 | 
				
			||||||
                            <RadzenColumn Size="8">
 | 
					                            <RadzenColumn Size="8">
 | 
				
			||||||
                                <RadzenTextBox @bind-Value="DrugName" Style="width: 100%;" Name="DrugName"></RadzenTextBox>
 | 
					                                <RadzenTextBox @bind-Value="DrugName" Style="width: 100%;" Name="DrugName"></RadzenTextBox>
 | 
				
			||||||
| 
						 | 
					@ -31,58 +31,53 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                        <RadzenRow AlignItems="AlignItems.Center">
 | 
					                        <RadzenRow AlignItems="AlignItems.Center">
 | 
				
			||||||
                            <RadzenColumn Size="12">
 | 
					                            <RadzenColumn Size="12">
 | 
				
			||||||
                                <RadzenButton Size="ButtonSize.Large" ButtonType="ButtonType.Submit" IsBusy="isLoading" Icon="search" Text="查询" />
 | 
					                                <RadzenButton Size="ButtonSize.Large" ButtonType="ButtonType.Submit" IsBusy="isLoading" Icon="search" Text="@myText.Search" />
 | 
				
			||||||
                                <RadzenButton Size="ButtonSize.Large" Click="reloadGrid" IsBusy="isLoading" Icon="refresh" Text="重置" ButtonStyle="ButtonStyle.Warning" />
 | 
					                                <RadzenButton Size="ButtonSize.Large" Click="reloadGrid" IsBusy="isLoading" Icon="refresh" Text="@myText.Restore" ButtonStyle="ButtonStyle.Warning" />
 | 
				
			||||||
                                <RadzenButton Size="ButtonSize.Large" ButtonStyle="ButtonStyle.Success" Icon="add_circle_outline" Click="@InsertDrugRow" Text="新增药品" />
 | 
					                                <RadzenButton Size="ButtonSize.Large" ButtonStyle="ButtonStyle.Success" Icon="add_circle_outline" Click="@InsertDrugRow" Text="@myText.AddDrug" />
 | 
				
			||||||
                            </RadzenColumn>
 | 
					                            </RadzenColumn>
 | 
				
			||||||
                        </RadzenRow>
 | 
					                        </RadzenRow>
 | 
				
			||||||
                    </RadzenStack>
 | 
					                    </RadzenStack>
 | 
				
			||||||
                </RadzenFieldset>
 | 
					                </RadzenFieldset>
 | 
				
			||||||
            </form>
 | 
					            </form>
 | 
				
			||||||
        </div>
 | 
					        </div>
 | 
				
			||||||
        <div class="col-6  mb-4" style="height:55vh;overflow:auto;">
 | 
					        <div class="col-6  mb-4">
 | 
				
			||||||
            <RadzenDataGrid @ref="grid"
 | 
					            <RadzenDataGrid @ref="grid"
 | 
				
			||||||
            LoadData="@LoadData"
 | 
					            LoadData="@LoadData"
 | 
				
			||||||
            @bind-Value="@SelectedDrugs"
 | 
					            @bind-Value="@SelectedDrugs"
 | 
				
			||||||
            IsLoading="@isLoading"
 | 
					            IsLoading="@isLoading"
 | 
				
			||||||
            Count="@count"
 | 
					            Count="@count"
 | 
				
			||||||
                            EmptyText="无数据"
 | 
					            EmptyText="@myText.NoDate"
 | 
				
			||||||
            Data="@_forecasts"
 | 
					            Data="@_forecasts"
 | 
				
			||||||
            AllowColumnResize="true" AllowAlternatingRows="false"
 | 
					            AllowColumnResize="true" AllowAlternatingRows="false"
 | 
				
			||||||
            SelectionMode="DataGridSelectionMode.Single" RowUpdate="@((DrugInfo di)=>{OnDrugUpdateRow(di);})" RowCreate="@((DrugInfo di)=>{OnDrugCreateRow(di);})"
 | 
					            SelectionMode="DataGridSelectionMode.Single" RowUpdate="@((DrugInfo di)=>{OnDrugUpdateRow(di);})" RowCreate="@((DrugInfo di)=>{OnDrugCreateRow(di);})"
 | 
				
			||||||
                            AllowPaging="true" PageSize="5" PagerHorizontalAlign="HorizontalAlign.Left" ColumnWidth="100px" ShowPagingSummary="true" PagingSummaryFormat="{0}/{1} 共{2}条数据">
 | 
					            AllowPaging="true" PageSize="10" PagerHorizontalAlign="HorizontalAlign.Left" ColumnWidth="100px" ShowPagingSummary="true" PagingSummaryFormat="{0}/{1} 共{2}条数据">
 | 
				
			||||||
                <Columns>
 | 
					                <Columns>
 | 
				
			||||||
                    <RadzenDataGridColumn Title="编码" Property="DrugId">
 | 
					                    <RadzenDataGridColumn Frozen="true" Title="@myText.DrugCode" Property="DrugId">
 | 
				
			||||||
                        <EditTemplate Context="drugInfo">
 | 
					                        <EditTemplate Context="drugInfo">
 | 
				
			||||||
                            <RadzenTextBox Name="DrugId" @bind-Value="drugInfo.DrugId" Style="width:100%; display: block;" />
 | 
					                            <RadzenTextBox Name="DrugId" @bind-Value="drugInfo.DrugId" Style="width:100%; display: block;" />
 | 
				
			||||||
                            <RadzenRequiredValidator Text="请填写编码" Component="DrugId" Popup="true" />
 | 
					                            <RadzenRequiredValidator Text="@myText.InputCode" Component="DrugId" Popup="true" />
 | 
				
			||||||
                        </EditTemplate>
 | 
					                        </EditTemplate>
 | 
				
			||||||
                    </RadzenDataGridColumn>
 | 
					                    </RadzenDataGridColumn>
 | 
				
			||||||
                    <RadzenDataGridColumn Width="200px" Title="药品名称" Property="DrugName">
 | 
					                    <RadzenDataGridColumn Width="200px" Title="@myText.DrugName" Property="DrugName">
 | 
				
			||||||
                        <EditTemplate Context="drugInfo">
 | 
					                        <EditTemplate Context="drugInfo">
 | 
				
			||||||
                            <RadzenTextBox Name="DrugName" @bind-Value="drugInfo.DrugName" Style="width:100%;display:block;" />
 | 
					                            <RadzenTextBox Name="DrugName" @bind-Value="drugInfo.DrugName" Style="width:100%;display:block;" />
 | 
				
			||||||
                            <RadzenRequiredValidator Text="请填写药品名称" Component="DrugName" Popup="true" />
 | 
					                            <RadzenRequiredValidator Text="@myText.InputDrugName" Component="DrugName" Popup="true" />
 | 
				
			||||||
                        </EditTemplate>
 | 
					                        </EditTemplate>
 | 
				
			||||||
                    </RadzenDataGridColumn>
 | 
					                    </RadzenDataGridColumn>
 | 
				
			||||||
                    <RadzenDataGridColumn Title="规格" Property="DrugSpec">
 | 
					                    <RadzenDataGridColumn Title="@myText.Spec" Property="DrugSpec">
 | 
				
			||||||
                        <EditTemplate Context="drugInfo">
 | 
					                        <EditTemplate Context="drugInfo">
 | 
				
			||||||
                            <RadzenTextBox Name="DrugSpec" @bind-Value="drugInfo.DrugSpec" Style="width:100%;display:block;" />
 | 
					                            <RadzenTextBox Name="DrugSpec" @bind-Value="drugInfo.DrugSpec" Style="width:100%;display:block;" />
 | 
				
			||||||
                            <RadzenRequiredValidator Text="请填写规格" Component="DrugSpec" Popup="true" />
 | 
					                            <RadzenRequiredValidator Text="@myText.InputDrugSpec" Component="DrugSpec" Popup="true" />
 | 
				
			||||||
                        </EditTemplate>
 | 
					                        </EditTemplate>
 | 
				
			||||||
                    </RadzenDataGridColumn>
 | 
					                    </RadzenDataGridColumn>
 | 
				
			||||||
                    <RadzenDataGridColumn Width="150px" Title="厂家" Property="Manufactory">
 | 
					                    <RadzenDataGridColumn Width="200px" Title="@myText.Factory" Property="Manufactory">
 | 
				
			||||||
                        <EditTemplate Context="drugInfo">
 | 
					                        <EditTemplate Context="drugInfo">
 | 
				
			||||||
                            <RadzenTextBox Name="Manufactory" @bind-Value="drugInfo.Manufactory" Style="width:100%;display:block;" />
 | 
					                            <RadzenTextBox Name="Manufactory" @bind-Value="drugInfo.Manufactory" Style="width:100%;display:block;" />
 | 
				
			||||||
                            <RadzenRequiredValidator Text="请填写厂家" Component="Manufactory" Popup="true" />
 | 
					                            <RadzenRequiredValidator Text="@myText.InputDrugFactory" Component="Manufactory" Popup="true"/>
 | 
				
			||||||
                        </EditTemplate>
 | 
					 | 
				
			||||||
                    </RadzenDataGridColumn>
 | 
					 | 
				
			||||||
                    <RadzenDataGridColumn Title="导出使用报表" Property="PackH">
 | 
					 | 
				
			||||||
                        <EditTemplate Context="drugInfo">
 | 
					 | 
				
			||||||
                            <RadzenTextBox Name="PackH" @bind-Value="drugInfo.PackH" Style="width:100%;display:block;" />
 | 
					 | 
				
			||||||
                        </EditTemplate>
 | 
					                        </EditTemplate>
 | 
				
			||||||
                    </RadzenDataGridColumn>
 | 
					                    </RadzenDataGridColumn>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                    <RadzenDataGridColumn Context="drugInfo" Title="操作" Filterable="false" Sortable="false" TextAlign="TextAlign.Left" Frozen="true" FrozenPosition="FrozenColumnPosition.Right">
 | 
					                    <RadzenDataGridColumn Context="drugInfo" Title="@myText.Operate" Filterable="false" Sortable="false" TextAlign="TextAlign.Left" Frozen="true" FrozenPosition="FrozenColumnPosition.Right">
 | 
				
			||||||
                        <Template Context="drugInfo">
 | 
					                        <Template Context="drugInfo">
 | 
				
			||||||
                            <RadzenButton Icon="edit" ButtonStyle="ButtonStyle.Light" Variant="Variant.Flat" Size="ButtonSize.Medium" Click="@(args => EditDrugRow(drugInfo))" @onclick:stopPropagation="true">
 | 
					                            <RadzenButton Icon="edit" ButtonStyle="ButtonStyle.Light" Variant="Variant.Flat" Size="ButtonSize.Medium" Click="@(args => EditDrugRow(drugInfo))" @onclick:stopPropagation="true">
 | 
				
			||||||
                            </RadzenButton>
 | 
					                            </RadzenButton>
 | 
				
			||||||
| 
						 | 
					@ -107,9 +102,7 @@
 | 
				
			||||||
            </RadzenCard> *@
 | 
					            </RadzenCard> *@
 | 
				
			||||||
            @if (SelectedDrugs.Count > 0)
 | 
					            @if (SelectedDrugs.Count > 0)
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
 | 
					                <RadzenDataGrid @ref="ManusGrid" EmptyText="无数据"
 | 
				
			||||||
                <div class="col-6  mb-4" style="height:55vh;width:550px;overflow:auto;">
 | 
					 | 
				
			||||||
                    <RadzenDataGrid @ref="ManusGrid" EmptyText="无数据"  ColumnWidth="100px" Style="width:445px"
 | 
					 | 
				
			||||||
                Data="@(SelectedDrugs.FirstOrDefault()?.Manus)"
 | 
					                Data="@(SelectedDrugs.FirstOrDefault()?.Manus)"
 | 
				
			||||||
                RowUpdate="@((DrugManuNo dm) => { OnUpdateRow(dm); })" RowCreate="@((DrugManuNo dm) => { OnCreateRow(dm); })"
 | 
					                RowUpdate="@((DrugManuNo dm) => { OnUpdateRow(dm); })" RowCreate="@((DrugManuNo dm) => { OnCreateRow(dm); })"
 | 
				
			||||||
                AllowColumnResize="true" AllowAlternatingRows="false">
 | 
					                AllowColumnResize="true" AllowAlternatingRows="false">
 | 
				
			||||||
| 
						 | 
					@ -119,25 +112,25 @@
 | 
				
			||||||
                        </RadzenRow>
 | 
					                        </RadzenRow>
 | 
				
			||||||
                    </HeaderTemplate> *@
 | 
					                    </HeaderTemplate> *@
 | 
				
			||||||
                    <Columns>
 | 
					                    <Columns>
 | 
				
			||||||
                            <RadzenDataGridColumn Title="序号" Property="index" Width="25px" Visible=false>
 | 
					                        <RadzenDataGridColumn Title="序号" Property="index">
 | 
				
			||||||
                            <Template Context="data">
 | 
					                            <Template Context="data">
 | 
				
			||||||
                                @(SelectedDrugs.FirstOrDefault()?.Manus.IndexOf(data) + 1)
 | 
					                                @(SelectedDrugs.FirstOrDefault()?.Manus.IndexOf(data) + 1)
 | 
				
			||||||
                            </Template>
 | 
					                            </Template>
 | 
				
			||||||
                        </RadzenDataGridColumn>
 | 
					                        </RadzenDataGridColumn>
 | 
				
			||||||
                            <RadzenDataGridColumn Title="批次" Property="ManuNo" Width="150px">
 | 
					                        <RadzenDataGridColumn Title="批次" Property="ManuNo">
 | 
				
			||||||
                            <EditTemplate Context="drugManuNo">
 | 
					                            <EditTemplate Context="drugManuNo">
 | 
				
			||||||
                                <RadzenTextBox Name="ManuNo" @bind-Value="drugManuNo.ManuNo" Style="width:100%; display: block;" />
 | 
					                                <RadzenTextBox Name="ManuNo" @bind-Value="drugManuNo.ManuNo" Style="width:100%; display: block;" />
 | 
				
			||||||
                                <RadzenRequiredValidator Text="请填写批次" Component="ManuNo" Popup="true" />
 | 
					                                <RadzenRequiredValidator Text="请填写批次" Component="ManuNo" Popup="true" />
 | 
				
			||||||
                            </EditTemplate>
 | 
					                            </EditTemplate>
 | 
				
			||||||
                        </RadzenDataGridColumn>
 | 
					                        </RadzenDataGridColumn>
 | 
				
			||||||
                            <RadzenDataGridColumn Title="效期" Property="EffDate" Width="150px">
 | 
					                        <RadzenDataGridColumn Title="效期" Property="EffDate">
 | 
				
			||||||
                            <EditTemplate Context="drugManuNo">
 | 
					                            <EditTemplate Context="drugManuNo">
 | 
				
			||||||
                                <RadzenDatePicker DateFormat="yyyy-MM-dd" @bind-Value="drugManuNo.EffDate" Style="width: 100%;" Name="EffDate" />
 | 
					                                <RadzenDatePicker DateFormat="yyyy-MM-dd" @bind-Value="drugManuNo.EffDate" Style="width: 100%;" Name="EffDate" />
 | 
				
			||||||
                                <RadzenRequiredValidator Text="请填写效期" Component="EffDate" Popup="true" />
 | 
					                                <RadzenRequiredValidator Text="请填写效期" Component="EffDate" Popup="true" />
 | 
				
			||||||
                            </EditTemplate>
 | 
					                            </EditTemplate>
 | 
				
			||||||
                        </RadzenDataGridColumn>
 | 
					                        </RadzenDataGridColumn>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                            <RadzenDataGridColumn Context="drugManuNo" Title="操作" Width="160px" Filterable="false" Sortable="false" TextAlign="TextAlign.Left" Frozen="true" FrozenPosition="FrozenColumnPosition.Right">
 | 
					                        <RadzenDataGridColumn Context="drugManuNo" Title="操作" Filterable="false" Sortable="false" TextAlign="TextAlign.Left" Frozen="true" FrozenPosition="FrozenColumnPosition.Right">
 | 
				
			||||||
                            <Template Context="drugManuNo">
 | 
					                            <Template Context="drugManuNo">
 | 
				
			||||||
                                <RadzenButton Icon="edit" ButtonStyle="ButtonStyle.Light" Variant="Variant.Flat" Size="ButtonSize.Medium" Click="@(args => EditRow(drugManuNo))" @onclick:stopPropagation="true">
 | 
					                                <RadzenButton Icon="edit" ButtonStyle="ButtonStyle.Light" Variant="Variant.Flat" Size="ButtonSize.Medium" Click="@(args => EditRow(drugManuNo))" @onclick:stopPropagation="true">
 | 
				
			||||||
                                </RadzenButton>
 | 
					                                </RadzenButton>
 | 
				
			||||||
| 
						 | 
					@ -155,7 +148,6 @@
 | 
				
			||||||
                        </RadzenDataGridColumn>
 | 
					                        </RadzenDataGridColumn>
 | 
				
			||||||
                    </Columns>
 | 
					                    </Columns>
 | 
				
			||||||
                </RadzenDataGrid>
 | 
					                </RadzenDataGrid>
 | 
				
			||||||
                </div>
 | 
					 | 
				
			||||||
                <div style="margin-top:5px">
 | 
					                <div style="margin-top:5px">
 | 
				
			||||||
                    <RadzenButton Size="ButtonSize.Medium" ButtonStyle="ButtonStyle.Success" Icon="add_circle_outline" Click="@InsertRow" Text="新增批次" />
 | 
					                    <RadzenButton Size="ButtonSize.Medium" ButtonStyle="ButtonStyle.Success" Icon="add_circle_outline" Click="@InsertRow" Text="新增批次" />
 | 
				
			||||||
                </div>
 | 
					                </div>
 | 
				
			||||||
| 
						 | 
					@ -168,6 +160,8 @@
 | 
				
			||||||
    @inject IDrugInfoDao drugInfoDao;
 | 
					    @inject IDrugInfoDao drugInfoDao;
 | 
				
			||||||
    @inject DialogService dialogService;
 | 
					    @inject DialogService dialogService;
 | 
				
			||||||
    @inject IDrugManuNoDao drugManuNoDao;
 | 
					    @inject IDrugManuNoDao drugManuNoDao;
 | 
				
			||||||
 | 
					    @inject Toolbelt.Blazor.I18nText.I18nText I18nText;
 | 
				
			||||||
 | 
					    private I18nText.local myText = new I18nText.local();
 | 
				
			||||||
    RadzenDataGrid<DrugInfo> grid;
 | 
					    RadzenDataGrid<DrugInfo> grid;
 | 
				
			||||||
    RadzenDataGrid<DrugManuNo> ManusGrid;
 | 
					    RadzenDataGrid<DrugManuNo> ManusGrid;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -274,7 +268,7 @@
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        var drugManuNo = new Pojo.DrugManuNo()
 | 
					        var drugManuNo = new Pojo.DrugManuNo()
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                // Id = Guid.NewGuid().ToString(),
 | 
					                Id = Guid.NewGuid().ToString(),
 | 
				
			||||||
                DrugId = SelectedDrugs.FirstOrDefault().DrugId
 | 
					                DrugId = SelectedDrugs.FirstOrDefault().DrugId
 | 
				
			||||||
            };
 | 
					            };
 | 
				
			||||||
        SelectedDrugs.FirstOrDefault().Manus.Add(drugManuNo);
 | 
					        SelectedDrugs.FirstOrDefault().Manus.Add(drugManuNo);
 | 
				
			||||||
| 
						 | 
					@ -291,15 +285,13 @@
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    async Task SaveRow(DrugManuNo drugManuNo)
 | 
					    async Task SaveRow(DrugManuNo drugManuNo)
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        drugManuNo.Id = string.IsNullOrEmpty(drugManuNo.Id) ? Guid.NewGuid().ToString() : drugManuNo.Id;
 | 
					 | 
				
			||||||
        await ManusGrid.UpdateRow(drugManuNo);
 | 
					        await ManusGrid.UpdateRow(drugManuNo);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    void CancelEdit(DrugManuNo drugManuNo)
 | 
					    void CancelEdit(DrugManuNo drugManuNo)
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        Reset(drugManuNo);
 | 
					        Reset(drugManuNo);
 | 
				
			||||||
        // SelectedDrugs.FirstOrDefault().Manus.Remove(drugManuNo);
 | 
					        SelectedDrugs.FirstOrDefault().Manus.Remove(drugManuNo);
 | 
				
			||||||
        SelectedDrugs.FirstOrDefault().Manus.RemoveAll(mn=>string.IsNullOrEmpty(mn.Id));
 | 
					 | 
				
			||||||
        ManusGrid.CancelEditRow(drugManuNo);
 | 
					        ManusGrid.CancelEditRow(drugManuNo);
 | 
				
			||||||
        ManusGrid.Reload();
 | 
					        ManusGrid.Reload();
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
| 
						 | 
					@ -332,7 +324,6 @@
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    void OnUpdateRow(DrugManuNo dm)
 | 
					    void OnUpdateRow(DrugManuNo dm)
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        dm.Id = string.IsNullOrEmpty(dm.Id) ? Guid.NewGuid().ToString() : dm.Id;
 | 
					 | 
				
			||||||
        Reset(dm);
 | 
					        Reset(dm);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        // 数据库更新
 | 
					        // 数据库更新
 | 
				
			||||||
| 
						 | 
					@ -346,5 +337,10 @@
 | 
				
			||||||
        manuNoToInsert.Remove(dm);
 | 
					        manuNoToInsert.Remove(dm);
 | 
				
			||||||
        ManusGrid.Reload();
 | 
					        ManusGrid.Reload();
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					    protected override async Task OnInitializedAsync()
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        myText = await I18nText.GetTextTableAsync<I18nText.local>(this);
 | 
				
			||||||
 | 
					        await base.OnInitializedAsync();
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -7,7 +7,7 @@
 | 
				
			||||||
    <div class="top-row px-4">
 | 
					    <div class="top-row px-4">
 | 
				
			||||||
        <RadzenButton Icon="account_circle" Style="margin-left: auto;" Click="@SaveMethod">
 | 
					        <RadzenButton Icon="account_circle" Style="margin-left: auto;" Click="@SaveMethod">
 | 
				
			||||||
            <ChildContent>
 | 
					            <ChildContent>
 | 
				
			||||||
                保存设置
 | 
					                @myText.SaveSet
 | 
				
			||||||
            </ChildContent>
 | 
					            </ChildContent>
 | 
				
			||||||
        </RadzenButton>
 | 
					        </RadzenButton>
 | 
				
			||||||
    </div>
 | 
					    </div>
 | 
				
			||||||
| 
						 | 
					@ -16,24 +16,24 @@
 | 
				
			||||||
        <RadzenCard class="rz-my-6">
 | 
					        <RadzenCard class="rz-my-6">
 | 
				
			||||||
            <RadzenStack Orientation="Orientation.Horizontal" AlignItems="AlignItems.Start" Wrap="FlexWrap.Wrap">
 | 
					            <RadzenStack Orientation="Orientation.Horizontal" AlignItems="AlignItems.Start" Wrap="FlexWrap.Wrap">
 | 
				
			||||||
                <RadzenStack Orientation="Orientation.Vertical" Gap="4px">
 | 
					                <RadzenStack Orientation="Orientation.Vertical" Gap="4px">
 | 
				
			||||||
                    冰箱温度区间
 | 
					                    @myText.TemperRange
 | 
				
			||||||
                    <RadzenTextBox Placeholder="2-8" Value="@temperatureRange" Change="@(args=>temperatureRange=args)"></RadzenTextBox>
 | 
					                    <RadzenTextBox Placeholder="2-8" Value="@temperatureRange" Change="@(args=>temperatureRange=args)"></RadzenTextBox>
 | 
				
			||||||
                </RadzenStack>
 | 
					                </RadzenStack>
 | 
				
			||||||
                <RadzenStack Orientation="Orientation.Vertical" Gap="4px">
 | 
					                <RadzenStack Orientation="Orientation.Vertical" Gap="4px">
 | 
				
			||||||
                    冰箱状态
 | 
					                    @myText.FridgeState
 | 
				
			||||||
                    <RadzenRadioButtonList Value=@fridgeStateValue TValue="int" Change=@(args => fridgeStateValue = args)>
 | 
					                    <RadzenRadioButtonList Value=@fridgeStateValue TValue="int" Change=@(args => fridgeStateValue = args)>
 | 
				
			||||||
                        <Items>
 | 
					                        <Items>
 | 
				
			||||||
                            <RadzenRadioButtonListItem Text="开" Value="0" />
 | 
					                            <RadzenRadioButtonListItem Text="@myText.Open" Value="0" />
 | 
				
			||||||
                            <RadzenRadioButtonListItem Text="关" Value="1" />
 | 
					                            <RadzenRadioButtonListItem Text="@myText.Close" Value="1" />
 | 
				
			||||||
                        </Items>
 | 
					                        </Items>
 | 
				
			||||||
                    </RadzenRadioButtonList>
 | 
					                    </RadzenRadioButtonList>
 | 
				
			||||||
                </RadzenStack>
 | 
					                </RadzenStack>
 | 
				
			||||||
                <RadzenStack Orientation="Orientation.Vertical" Gap="4px">
 | 
					                <RadzenStack Orientation="Orientation.Vertical" Gap="4px">
 | 
				
			||||||
                    报警状态
 | 
					                    @myText.AlertState
 | 
				
			||||||
                    <RadzenRadioButtonList Value="@alertStateValue" TValue="int" Change="@(args=>alertStateValue=args)">
 | 
					                    <RadzenRadioButtonList Value="@alertStateValue" TValue="int" Change="@(args=>alertStateValue=args)">
 | 
				
			||||||
                        <Items>
 | 
					                        <Items>
 | 
				
			||||||
                            <RadzenRadioButtonListItem Text="开" Value="0"/>
 | 
					                            <RadzenRadioButtonListItem Text="@myText.Open"  Value="0"/>
 | 
				
			||||||
                            <RadzenRadioButtonListItem Text="关" Value="1"/>
 | 
					                            <RadzenRadioButtonListItem Text="@myText.Close" Value="1"/>
 | 
				
			||||||
                        </Items>
 | 
					                        </Items>
 | 
				
			||||||
                    </RadzenRadioButtonList>
 | 
					                    </RadzenRadioButtonList>
 | 
				
			||||||
                </RadzenStack>
 | 
					                </RadzenStack>
 | 
				
			||||||
| 
						 | 
					@ -46,18 +46,22 @@
 | 
				
			||||||
@inject Microsoft.Extensions.Options.IOptions<Pojo.Config.fridgeConfig> setting;
 | 
					@inject Microsoft.Extensions.Options.IOptions<Pojo.Config.fridgeConfig> setting;
 | 
				
			||||||
@inject PortUtil port;
 | 
					@inject PortUtil port;
 | 
				
			||||||
@inject NotificationService _message
 | 
					@inject NotificationService _message
 | 
				
			||||||
 | 
					@inject Toolbelt.Blazor.I18nText.I18nText I18nText;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@code {
 | 
					@code {
 | 
				
			||||||
 | 
					    private I18nText.local myText = new I18nText.local();
 | 
				
			||||||
    private readonly ILog logger = LogManager.GetLogger(typeof(LoginDialog));
 | 
					    private readonly ILog logger = LogManager.GetLogger(typeof(LoginDialog));
 | 
				
			||||||
    int fridgeStateValue = 1;
 | 
					    int fridgeStateValue = 1;
 | 
				
			||||||
    int alertStateValue = 1;
 | 
					    int alertStateValue = 1;
 | 
				
			||||||
    string temperatureRange = "2-8";
 | 
					    string temperatureRange = "2-8";
 | 
				
			||||||
    protected override void OnInitialized()
 | 
					
 | 
				
			||||||
 | 
					    protected override async Task OnInitializedAsync()
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
 | 
					        myText = await I18nText.GetTextTableAsync<I18nText.local>(this);
 | 
				
			||||||
        fridgeStateValue = setting.Value.fridgeState;
 | 
					        fridgeStateValue = setting.Value.fridgeState;
 | 
				
			||||||
        alertStateValue = setting.Value.alertState;
 | 
					        alertStateValue = setting.Value.alertState;
 | 
				
			||||||
        temperatureRange = setting.Value.temperatureRange;
 | 
					        temperatureRange = setting.Value.temperatureRange;
 | 
				
			||||||
        base.OnInitialized();
 | 
					        await base.OnInitializedAsync();
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    //保存
 | 
					    //保存
 | 
				
			||||||
    async Task SaveMethod()
 | 
					    async Task SaveMethod()
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -45,7 +45,13 @@
 | 
				
			||||||
        </RadzenColumn>
 | 
					        </RadzenColumn>
 | 
				
			||||||
        <RadzenColumn Size="8">
 | 
					        <RadzenColumn Size="8">
 | 
				
			||||||
            <RadzenRow Style="height: 100%;width:100%" Orientation="Orientation.Horizontal" JustifyContent="JustifyContent.End" AlignItems="AlignItems.Center">
 | 
					            <RadzenRow Style="height: 100%;width:100%" Orientation="Orientation.Horizontal" JustifyContent="JustifyContent.End" AlignItems="AlignItems.Center">
 | 
				
			||||||
                <RadzenColumn Size="6">
 | 
					                <RadzenColumn Size="3">
 | 
				
			||||||
 | 
					                    <RadzenStack Orientation="Orientation.Horizontal" AlignItems="AlignItems.Center" JustifyContent="JustifyContent.Center" Gap="0.5rem" class="rz-p-sm-12">
 | 
				
			||||||
 | 
					                        <RadzenIcon Icon="language" Style="font-size:3rem;cursor: pointer;margin-left:-60px" class="rz-ripple" IconColor="white" />
 | 
				
			||||||
 | 
					                        <RadzenDropDown TValue="string" Value=@SelectedCulture Data=@languageNames Change="@(args => LanguageClick(args))" Style="width: 100%; max-width: 400px;" Name="DropDownChangeEvent" />
 | 
				
			||||||
 | 
					                    </RadzenStack>
 | 
				
			||||||
 | 
					                </RadzenColumn>
 | 
				
			||||||
 | 
					                <RadzenColumn Size="2">
 | 
				
			||||||
                    @if (globalStateService.Operator != null)
 | 
					                    @if (globalStateService.Operator != null)
 | 
				
			||||||
                    {
 | 
					                    {
 | 
				
			||||||
                        //<RadzenText Style="" class="rz-color-white" TextStyle="TextStyle.H5" TextAlign="TextAlign.Center">操作人:@globalStateService.Operator.NickName</RadzenText>
 | 
					                        //<RadzenText Style="" class="rz-color-white" TextStyle="TextStyle.H5" TextAlign="TextAlign.Center">操作人:@globalStateService.Operator.NickName</RadzenText>
 | 
				
			||||||
| 
						 | 
					@ -53,12 +59,12 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                        <RadzenProfileMenu prefix="" Click="MenuClick" Style="background-color:transparent;z-index:99">
 | 
					                        <RadzenProfileMenu prefix="" Click="MenuClick" Style="background-color:transparent;z-index:99">
 | 
				
			||||||
                            <Template>
 | 
					                            <Template>
 | 
				
			||||||
                                <RadzenText Style="" class="rz-color-white" TextStyle="TextStyle.H5" TextAlign="TextAlign.Center">操作人:@globalStateService.Operator.NickName</RadzenText>
 | 
					                                <RadzenText Style="" class="rz-color-white" TextStyle="TextStyle.H5" TextAlign="TextAlign.Center">@myText.Operator :@globalStateService.Operator.NickName</RadzenText>
 | 
				
			||||||
                            </Template>
 | 
					                            </Template>
 | 
				
			||||||
                            <ChildContent>
 | 
					                            <ChildContent>
 | 
				
			||||||
                                <RadzenProfileMenuItem Text="录入指纹" Value="11" Icon="fingerprint"></RadzenProfileMenuItem>
 | 
					                                <RadzenProfileMenuItem Text="@myText.EnterFingerprint" Value="11" Icon="fingerprint"></RadzenProfileMenuItem>
 | 
				
			||||||
                                <RadzenProfileMenuItem Text="录入签名" Value="21" Icon="line_weight"></RadzenProfileMenuItem>
 | 
					                                <RadzenProfileMenuItem Text="@myText.EnterSign"        Value="21" Icon="line_weight"></RadzenProfileMenuItem>
 | 
				
			||||||
                                <RadzenProfileMenuItem Text="修改密码" Value="31" Icon="password"></RadzenProfileMenuItem>
 | 
					                                <RadzenProfileMenuItem Text="@myText.UpdatePassword"   Value="31" Icon="password"></RadzenProfileMenuItem>
 | 
				
			||||||
                            </ChildContent>
 | 
					                            </ChildContent>
 | 
				
			||||||
                        </RadzenProfileMenu>
 | 
					                        </RadzenProfileMenu>
 | 
				
			||||||
                    }
 | 
					                    }
 | 
				
			||||||
| 
						 | 
					@ -68,12 +74,12 @@
 | 
				
			||||||
                        //<RadzenText onclick="@(() => { EditPassword(2); })" Style="" class="rz-color-white" TextStyle="TextStyle.H5" TextAlign="TextAlign.Center">复核人:@globalStateService.Reviewer.NickName</RadzenText>
 | 
					                        //<RadzenText onclick="@(() => { EditPassword(2); })" Style="" class="rz-color-white" TextStyle="TextStyle.H5" TextAlign="TextAlign.Center">复核人:@globalStateService.Reviewer.NickName</RadzenText>
 | 
				
			||||||
                        <RadzenProfileMenu prefix="" Click="MenuClick" Style="background-color:transparent">
 | 
					                        <RadzenProfileMenu prefix="" Click="MenuClick" Style="background-color:transparent">
 | 
				
			||||||
                            <Template>
 | 
					                            <Template>
 | 
				
			||||||
                                <RadzenText Style="" class="rz-color-white" TextStyle="TextStyle.H5" TextAlign="TextAlign.Center">复核人:@globalStateService.Reviewer.NickName</RadzenText>
 | 
					                                <RadzenText Style="" class="rz-color-white" TextStyle="TextStyle.H5" TextAlign="TextAlign.Center">@myText.Checker:@globalStateService.Reviewer.NickName</RadzenText>
 | 
				
			||||||
                            </Template>
 | 
					                            </Template>
 | 
				
			||||||
                            <ChildContent>
 | 
					                            <ChildContent>
 | 
				
			||||||
                                <RadzenProfileMenuItem Text="录入指纹" Value="12" Icon="fingerprint"></RadzenProfileMenuItem>
 | 
					                                <RadzenProfileMenuItem Text="@myText.EnterFingerprint" Value="12" Icon="fingerprint"></RadzenProfileMenuItem>
 | 
				
			||||||
                                <RadzenProfileMenuItem Text="录入签名" Value="22" Icon="line_weight"></RadzenProfileMenuItem>
 | 
					                                <RadzenProfileMenuItem Text="@myText.EnterSign"        Value="22" Icon="line_weight"></RadzenProfileMenuItem>
 | 
				
			||||||
                                <RadzenProfileMenuItem Text="修改密码" Value="32" Icon="password"></RadzenProfileMenuItem>
 | 
					                                <RadzenProfileMenuItem Text="@myText.UpdatePassword"   Value="32" Icon="password"></RadzenProfileMenuItem>
 | 
				
			||||||
                            </ChildContent>
 | 
					                            </ChildContent>
 | 
				
			||||||
                        </RadzenProfileMenu>
 | 
					                        </RadzenProfileMenu>
 | 
				
			||||||
                    }
 | 
					                    }
 | 
				
			||||||
| 
						 | 
					@ -81,7 +87,7 @@
 | 
				
			||||||
                <RadzenColumn Size="3">
 | 
					                <RadzenColumn Size="3">
 | 
				
			||||||
                    <div @onclick="@(() => { changeShifts(); })">
 | 
					                    <div @onclick="@(() => { changeShifts(); })">
 | 
				
			||||||
                        <RadzenIcon Icon="compare_arrows" Style="font-size:3rem;cursor: pointer;" class="rz-ripple" IconColor="white" />
 | 
					                        <RadzenIcon Icon="compare_arrows" Style="font-size:3rem;cursor: pointer;" class="rz-ripple" IconColor="white" />
 | 
				
			||||||
                        <div>交接班</div>
 | 
					                        <div>@myText.Handover</div>
 | 
				
			||||||
                    </div>
 | 
					                    </div>
 | 
				
			||||||
                    <div style="clear:both"></div>
 | 
					                    <div style="clear:both"></div>
 | 
				
			||||||
                </RadzenColumn>
 | 
					                </RadzenColumn>
 | 
				
			||||||
| 
						 | 
					@ -95,7 +101,7 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        <RadzenStack Style="height: 100%;width:41%" Gap="20">
 | 
					        <RadzenStack Style="height: 100%;width:41%" Gap="20">
 | 
				
			||||||
            <RadzenStack class="home-menu rz-background-color-info-lighter rz-ripple" JustifyContent="JustifyContent.Center" Style="height: 50%" @onclick="@(() => jump2Page(1))">
 | 
					            <RadzenStack class="home-menu rz-background-color-info-lighter rz-ripple" JustifyContent="JustifyContent.Center" Style="height: 50%" @onclick="@(() => jump2Page(1))">
 | 
				
			||||||
                <RadzenText Style="" class="rz-color-white" TextStyle="TextStyle.H2" TextAlign="TextAlign.Center">出库</RadzenText>
 | 
					                <RadzenText Style="" class="rz-color-white" TextStyle="TextStyle.H2" TextAlign="TextAlign.Center">@myText.Outbound</RadzenText>
 | 
				
			||||||
                @if (globalStateService.Operator != null)
 | 
					                @if (globalStateService.Operator != null)
 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
                    @if (!globalStateService.Operator.role.permissionIds.Any(id => id - 10 < 10))
 | 
					                    @if (!globalStateService.Operator.role.permissionIds.Any(id => id - 10 < 10))
 | 
				
			||||||
| 
						 | 
					@ -108,7 +114,7 @@
 | 
				
			||||||
            </RadzenStack>
 | 
					            </RadzenStack>
 | 
				
			||||||
            <RadzenStack Orientation="Orientation.Horizontal" Style="height: 50%;width:100%">
 | 
					            <RadzenStack Orientation="Orientation.Horizontal" Style="height: 50%;width:100%">
 | 
				
			||||||
                <RadzenStack class="home-menu rz-background-color-success-light rz-text-white rz-ripple" JustifyContent="JustifyContent.Center" @onclick="@(() => jump2Page(2))" Style="height: 100%;width:50%">
 | 
					                <RadzenStack class="home-menu rz-background-color-success-light rz-text-white rz-ripple" JustifyContent="JustifyContent.Center" @onclick="@(() => jump2Page(2))" Style="height: 100%;width:50%">
 | 
				
			||||||
                    <RadzenText class="rz-color-white" TextStyle="TextStyle.H2" TextAlign="TextAlign.Center">入库</RadzenText>
 | 
					                    <RadzenText class="rz-color-white" TextStyle="TextStyle.H2" TextAlign="TextAlign.Center">@myText.FillStorage</RadzenText>
 | 
				
			||||||
                    @if (globalStateService.Operator != null)
 | 
					                    @if (globalStateService.Operator != null)
 | 
				
			||||||
                    {
 | 
					                    {
 | 
				
			||||||
                        @if (!globalStateService.Operator.role.permissionIds.Any(id => id - 20 > 0 && id - 20 < 10))
 | 
					                        @if (!globalStateService.Operator.role.permissionIds.Any(id => id - 20 > 0 && id - 20 < 10))
 | 
				
			||||||
| 
						 | 
					@ -120,8 +126,7 @@
 | 
				
			||||||
                    }
 | 
					                    }
 | 
				
			||||||
                </RadzenStack>
 | 
					                </RadzenStack>
 | 
				
			||||||
                <RadzenStack class="home-menu rz-background-color-danger-lighter rz-text-white rz-ripple" JustifyContent="JustifyContent.Center" @onclick="@(() => jump2Page(6))" Style="height: 100%;width:50%">
 | 
					                <RadzenStack class="home-menu rz-background-color-danger-lighter rz-text-white rz-ripple" JustifyContent="JustifyContent.Center" @onclick="@(() => jump2Page(6))" Style="height: 100%;width:50%">
 | 
				
			||||||
                    <RadzenText class="rz-color-white" Style="margin-top:10px;margin-bottom:-10px" TextStyle="TextStyle.H2" TextAlign="TextAlign.Center">药盒</RadzenText>
 | 
					                    <RadzenText class="rz-color-white" TextStyle="TextStyle.H2" TextAlign="TextAlign.Center">@myText.BoxManage</RadzenText>
 | 
				
			||||||
                    <RadzenText class="rz-color-white" Style="margin-top:-10px;margin-bottom:10px" TextStyle="TextStyle.H2" TextAlign="TextAlign.Center">管理</RadzenText>
 | 
					 | 
				
			||||||
                    @if (globalStateService.Operator != null)
 | 
					                    @if (globalStateService.Operator != null)
 | 
				
			||||||
                    {
 | 
					                    {
 | 
				
			||||||
                        @if (!globalStateService.Operator.role.permissionIds.Any(id => id - 60 > 0 && id - 60 < 10))
 | 
					                        @if (!globalStateService.Operator.role.permissionIds.Any(id => id - 60 > 0 && id - 60 < 10))
 | 
				
			||||||
| 
						 | 
					@ -136,7 +141,7 @@
 | 
				
			||||||
        </RadzenStack>
 | 
					        </RadzenStack>
 | 
				
			||||||
        <RadzenStack Style="height: 100%;width:59%" Gap="20">
 | 
					        <RadzenStack Style="height: 100%;width:59%" Gap="20">
 | 
				
			||||||
            <RadzenStack class="home-menu rz-background-color-series-2 rz-text-white rz-ripple" JustifyContent="JustifyContent.Center" @onclick="@(() => jump2Page(3))" Style="height: 43%;width:100%">
 | 
					            <RadzenStack class="home-menu rz-background-color-series-2 rz-text-white rz-ripple" JustifyContent="JustifyContent.Center" @onclick="@(() => jump2Page(3))" Style="height: 43%;width:100%">
 | 
				
			||||||
                <RadzenText class="rz-color-white" TextStyle="TextStyle.H2" TextAlign="TextAlign.Center">归还</RadzenText>
 | 
					                <RadzenText class="rz-color-white" TextStyle="TextStyle.H2" TextAlign="TextAlign.Center">@myText.Return</RadzenText>
 | 
				
			||||||
                @if (globalStateService.Operator != null)
 | 
					                @if (globalStateService.Operator != null)
 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
                    @if (!globalStateService.Operator.role.permissionIds.Any(id => id - 30 > 0 && id - 30 < 10))
 | 
					                    @if (!globalStateService.Operator.role.permissionIds.Any(id => id - 30 > 0 && id - 30 < 10))
 | 
				
			||||||
| 
						 | 
					@ -149,7 +154,7 @@
 | 
				
			||||||
            </RadzenStack>
 | 
					            </RadzenStack>
 | 
				
			||||||
            <RadzenStack Orientation="Orientation.Horizontal" Style="height: 57%;width:100%">
 | 
					            <RadzenStack Orientation="Orientation.Horizontal" Style="height: 57%;width:100%">
 | 
				
			||||||
                <RadzenStack class="home-menu rz-background-color-primary rz-text-white rz-ripple" JustifyContent="JustifyContent.Center" @onclick="@(() => jump2Page(4))" Style="height: 100%;width:50%">
 | 
					                <RadzenStack class="home-menu rz-background-color-primary rz-text-white rz-ripple" JustifyContent="JustifyContent.Center" @onclick="@(() => jump2Page(4))" Style="height: 100%;width:50%">
 | 
				
			||||||
                    <RadzenText class="rz-color-white" TextStyle="TextStyle.H2" TextAlign="TextAlign.Center">库存管理</RadzenText>
 | 
					                    <RadzenText class="rz-color-white" TextStyle="TextStyle.H2" TextAlign="TextAlign.Center">@myText.StockManage</RadzenText>
 | 
				
			||||||
                    @if (globalStateService.Operator != null)
 | 
					                    @if (globalStateService.Operator != null)
 | 
				
			||||||
                    {
 | 
					                    {
 | 
				
			||||||
                        @if (!globalStateService.Operator.role.permissionIds.Any(id => id - 40 > 0 && id - 40 < 10))
 | 
					                        @if (!globalStateService.Operator.role.permissionIds.Any(id => id - 40 > 0 && id - 40 < 10))
 | 
				
			||||||
| 
						 | 
					@ -161,7 +166,7 @@
 | 
				
			||||||
                    }
 | 
					                    }
 | 
				
			||||||
                </RadzenStack>
 | 
					                </RadzenStack>
 | 
				
			||||||
                <RadzenStack class="home-menu rz-background-color-success-lighter rz-text-white rz-ripple" JustifyContent="JustifyContent.Center" @onclick="@(() => jump2Page(5))" Style="height: 100%;width:50%">
 | 
					                <RadzenStack class="home-menu rz-background-color-success-lighter rz-text-white rz-ripple" JustifyContent="JustifyContent.Center" @onclick="@(() => jump2Page(5))" Style="height: 100%;width:50%">
 | 
				
			||||||
                    <RadzenText class="rz-color-white" TextStyle="TextStyle.H2" TextAlign="TextAlign.Center">系统管理</RadzenText>
 | 
					                    <RadzenText class="rz-color-white" TextStyle="TextStyle.H2" TextAlign="TextAlign.Center">@myText.SystemManage</RadzenText>
 | 
				
			||||||
                    @if (globalStateService.Operator != null)
 | 
					                    @if (globalStateService.Operator != null)
 | 
				
			||||||
                    {
 | 
					                    {
 | 
				
			||||||
                        @if (!globalStateService.Operator.role.permissionIds.Any(id => id - 50 > 0 && id - 50 < 10))
 | 
					                        @if (!globalStateService.Operator.role.permissionIds.Any(id => id - 50 > 0 && id - 50 < 10))
 | 
				
			||||||
| 
						 | 
					@ -187,21 +192,25 @@
 | 
				
			||||||
    private List<Premission> userPremissions { get; set; } = new();
 | 
					    private List<Premission> userPremissions { get; set; } = new();
 | 
				
			||||||
    @inject GlobalStateService globalStateService;
 | 
					    @inject GlobalStateService globalStateService;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    @inject Toolbelt.Blazor.I18nText.I18nText I18nText;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    Timer timer;
 | 
					    Timer timer;
 | 
				
			||||||
    @inject PortUtil _portUtil;
 | 
					    @inject PortUtil _portUtil;
 | 
				
			||||||
    private readonly ILog logger = LogManager.GetLogger(typeof(Home));
 | 
					    private readonly ILog logger = LogManager.GetLogger(typeof(Home));
 | 
				
			||||||
    @inject Microsoft.Extensions.Options.IOptions<Pojo.Config.SettingConfig> setting;
 | 
					    @inject Microsoft.Extensions.Options.IOptions<Pojo.Config.SettingConfig> setting;
 | 
				
			||||||
    bool currentPage = true;
 | 
					    bool currentPage = true;
 | 
				
			||||||
 | 
					    public static I18nText.local myText = new I18nText.local();
 | 
				
			||||||
    protected override void OnInitialized()
 | 
					    IEnumerable<string> languageNames;
 | 
				
			||||||
 | 
					    private string culture;
 | 
				
			||||||
 | 
					    private string SelectedCulture
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        // timer = new Timer(state =>
 | 
					        get => culture;
 | 
				
			||||||
        // {
 | 
					        set { }
 | 
				
			||||||
        //     var now = DateTime.Now;
 | 
					    }
 | 
				
			||||||
 | 
					    protected override async Task OnInitializedAsync()
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
        //     InvokeAsync(StateHasChanged);
 | 
					        languageNames = new List<string> { "简体中文", "English" };
 | 
				
			||||||
        // }, null, 0, 1000);
 | 
					        myText = await I18nText.GetTextTableAsync<I18nText.local>(this);
 | 
				
			||||||
        if (setting.Value.autoOutLog > 0)
 | 
					        if (setting.Value.autoOutLog > 0)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            // 是否需要自动退出
 | 
					            // 是否需要自动退出
 | 
				
			||||||
| 
						 | 
					@ -221,22 +230,15 @@
 | 
				
			||||||
                       if (!_portUtil.Operate)
 | 
					                       if (!_portUtil.Operate)
 | 
				
			||||||
                       {
 | 
					                       {
 | 
				
			||||||
                           // 无人操作鼠标键盘
 | 
					                           // 无人操作鼠标键盘
 | 
				
			||||||
                           if ((DateTime.Now - _portUtil.dateTime).TotalSeconds > setting.Value.autoOutLog && (DateTime.Now - _portUtil.mouseClickTime).TotalSeconds > setting.Value.autoOutLog)
 | 
					                           if ((DateTime.Now - _portUtil.dateTime).TotalSeconds > setting.Value.autoOutLog && CheckComputerFreeState.GetLastInputTime() > setting.Value.autoOutLog)
 | 
				
			||||||
                           {
 | 
					                           {
 | 
				
			||||||
                               logger.Info($"设备{setting.Value.autoOutLog}内无人操作,用户【{globalStateService.Operator?.NickName}】自动退出登录,_portUtil.Operate:{_portUtil.Operate},totalSecond:{(DateTime.Now - _portUtil.dateTime).TotalSeconds},lastInputTime:{(DateTime.Now - _portUtil.mouseClickTime).TotalSeconds},autoOutLog:{setting.Value.autoOutLog}");
 | 
					                               logger.Info($"设备{setting.Value.autoOutLog}内无人操作,用户【{globalStateService.Operator?.NickName}】自动退出登录,_portUtil.Operate:{_portUtil.Operate},totalSecond:{(DateTime.Now - _portUtil.dateTime).TotalSeconds},lastInputTime:{CheckComputerFreeState.GetLastInputTime()},autoOutLog:{setting.Value.autoOutLog}");
 | 
				
			||||||
                               globalStateService.Operator.NickName = string.Empty;
 | 
					 | 
				
			||||||
                               globalStateService.Operator = null;
 | 
					                               globalStateService.Operator = null;
 | 
				
			||||||
                               if (globalStateService.Reviewer != null)
 | 
					 | 
				
			||||||
                               {
 | 
					 | 
				
			||||||
                                   globalStateService.Reviewer.NickName = string.Empty;
 | 
					 | 
				
			||||||
                               globalStateService.Reviewer = null;
 | 
					                               globalStateService.Reviewer = null;
 | 
				
			||||||
                               }
 | 
					 | 
				
			||||||
                               await InvokeAsync(StateHasChanged);
 | 
					 | 
				
			||||||
                               stop();
 | 
					                               stop();
 | 
				
			||||||
                           }
 | 
					                           }
 | 
				
			||||||
                           else
 | 
					                           else
 | 
				
			||||||
                           {
 | 
					                           {
 | 
				
			||||||
                               logger.Info($"{setting.Value.autoOutLog}未自动退出{(DateTime.Now - _portUtil.dateTime).TotalSeconds}-{(DateTime.Now - _portUtil.mouseClickTime).TotalSeconds}");
 | 
					 | 
				
			||||||
                               next();
 | 
					                               next();
 | 
				
			||||||
                           }
 | 
					                           }
 | 
				
			||||||
                       }
 | 
					                       }
 | 
				
			||||||
| 
						 | 
					@ -253,9 +255,67 @@
 | 
				
			||||||
               }
 | 
					               }
 | 
				
			||||||
           });
 | 
					           });
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        base.OnInitialized();
 | 
					        culture = I18nText.GetCurrentLanguageAsync().Result == "en-US" ? "English" : "简体中文";
 | 
				
			||||||
 | 
					        
 | 
				
			||||||
 | 
					        base.OnInitializedAsync();
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    // protected override void OnInitialized()
 | 
				
			||||||
 | 
					    // {
 | 
				
			||||||
 | 
					    //     // timer = new Timer(state =>
 | 
				
			||||||
 | 
					    //     // {
 | 
				
			||||||
 | 
					    //     //     var now = DateTime.Now;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    //     //     InvokeAsync(StateHasChanged);
 | 
				
			||||||
 | 
					    //     // }, null, 0, 1000);
 | 
				
			||||||
 | 
					    //     if (setting.Value.autoOutLog > 0)
 | 
				
			||||||
 | 
					    //     {
 | 
				
			||||||
 | 
					    //         // 是否需要自动退出
 | 
				
			||||||
 | 
					    //         var promiseUtil = new PromiseUtil<object>();
 | 
				
			||||||
 | 
					    //         promiseUtil.taskAsyncLoop(500, null, async (data, next, stop) =>
 | 
				
			||||||
 | 
					    //        {
 | 
				
			||||||
 | 
					    //            if (globalStateService.Operator == null || !currentPage)
 | 
				
			||||||
 | 
					    //            {
 | 
				
			||||||
 | 
					    //                logger.Info($"Home页自动退出循环停止{globalStateService.Operator == null},{!currentPage}");
 | 
				
			||||||
 | 
					    //                stop();
 | 
				
			||||||
 | 
					    //            }
 | 
				
			||||||
 | 
					    //            else
 | 
				
			||||||
 | 
					    //            {
 | 
				
			||||||
 | 
					    //                try
 | 
				
			||||||
 | 
					    //                {
 | 
				
			||||||
 | 
					    //                    //没有在操作抽屉
 | 
				
			||||||
 | 
					    //                    if (!_portUtil.Operate)
 | 
				
			||||||
 | 
					    //                    {
 | 
				
			||||||
 | 
					    //                        // 无人操作鼠标键盘
 | 
				
			||||||
 | 
					    //                        if ((DateTime.Now - _portUtil.dateTime).TotalSeconds > setting.Value.autoOutLog && CheckComputerFreeState.GetLastInputTime() > setting.Value.autoOutLog)
 | 
				
			||||||
 | 
					    //                        {
 | 
				
			||||||
 | 
					    //                            logger.Info($"设备{setting.Value.autoOutLog}内无人操作,用户【{globalStateService.Operator?.NickName}】自动退出登录,_portUtil.Operate:{_portUtil.Operate},totalSecond:{(DateTime.Now - _portUtil.dateTime).TotalSeconds},lastInputTime:{CheckComputerFreeState.GetLastInputTime()},autoOutLog:{setting.Value.autoOutLog}");
 | 
				
			||||||
 | 
					    //                            globalStateService.Operator = null;
 | 
				
			||||||
 | 
					    //                            globalStateService.Reviewer = null;
 | 
				
			||||||
 | 
					    //                            stop();
 | 
				
			||||||
 | 
					    //                        }
 | 
				
			||||||
 | 
					    //                        else
 | 
				
			||||||
 | 
					    //                        {
 | 
				
			||||||
 | 
					    //                            next();
 | 
				
			||||||
 | 
					    //                        }
 | 
				
			||||||
 | 
					    //                    }
 | 
				
			||||||
 | 
					    //                    else
 | 
				
			||||||
 | 
					    //                    {
 | 
				
			||||||
 | 
					    //                        next();
 | 
				
			||||||
 | 
					    //                    }
 | 
				
			||||||
 | 
					    //                }
 | 
				
			||||||
 | 
					    //                catch (Exception ex)
 | 
				
			||||||
 | 
					    //                {
 | 
				
			||||||
 | 
					    //                    logger.Info($"检查是否自动退出循环异常:{ex.Message}");
 | 
				
			||||||
 | 
					    //                    next();
 | 
				
			||||||
 | 
					    //                }
 | 
				
			||||||
 | 
					    //            }
 | 
				
			||||||
 | 
					    //        });
 | 
				
			||||||
 | 
					    //     }
 | 
				
			||||||
 | 
					    //     base.OnInitialized();
 | 
				
			||||||
 | 
					    // }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    public void Dispose()
 | 
					    public void Dispose()
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        timer?.Dispose();
 | 
					        timer?.Dispose();
 | 
				
			||||||
| 
						 | 
					@ -411,4 +471,20 @@
 | 
				
			||||||
        new DialogOptions() { Width = "55vw", Resizable = false, Draggable = false, ShowClose = false, ShowTitle = false });
 | 
					        new DialogOptions() { Width = "55vw", Resizable = false, Draggable = false, ShowClose = false, ShowTitle = false });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    async void LanguageClick(object item)
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        string culture = string.Empty;// new System.Globalization.CultureInfo(item.Value);
 | 
				
			||||||
 | 
					        switch (item.ToString())
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            case "简体中文":
 | 
				
			||||||
 | 
					                culture = "zh-CN";
 | 
				
			||||||
 | 
					                break;
 | 
				
			||||||
 | 
					            case "English":
 | 
				
			||||||
 | 
					                culture = "en-US";
 | 
				
			||||||
 | 
					                break;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        await I18nText.SetCurrentLanguageAsync(culture);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -8,7 +8,7 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
<RadzenStack AlignItems="AlignItems.Center" Gap="2rem" class="rz-p-12">
 | 
					<RadzenStack AlignItems="AlignItems.Center" Gap="2rem" class="rz-p-12">
 | 
				
			||||||
    <RadzenImage Path="images/community.svg" Style="width: 200px;" AlternateText="community" />
 | 
					    <RadzenImage Path="images/community.svg" Style="width: 200px;" AlternateText="community" />
 | 
				
			||||||
    <RadzenText TextStyle="TextStyle.H6">加载程序必要连接中,请稍等。。。</RadzenText>
 | 
					    <RadzenText TextStyle="TextStyle.H6">@myText.Loading</RadzenText>
 | 
				
			||||||
    <RadzenText TextStyle="TextStyle.H6">@msg</RadzenText>
 | 
					    <RadzenText TextStyle="TextStyle.H6">@msg</RadzenText>
 | 
				
			||||||
    <RadzenText TextStyle="TextStyle.H6">@errMsg</RadzenText>
 | 
					    <RadzenText TextStyle="TextStyle.H6">@errMsg</RadzenText>
 | 
				
			||||||
</RadzenStack>
 | 
					</RadzenStack>
 | 
				
			||||||
| 
						 | 
					@ -22,6 +22,8 @@
 | 
				
			||||||
    @inject GlobalStateService globalStateService;
 | 
					    @inject GlobalStateService globalStateService;
 | 
				
			||||||
    @inject IOptions<PortConfig> portSetting;
 | 
					    @inject IOptions<PortConfig> portSetting;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    @inject Toolbelt.Blazor.I18nText.I18nText I18nText;
 | 
				
			||||||
 | 
					    private I18nText.local myText = new I18nText.local();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    string msg;
 | 
					    string msg;
 | 
				
			||||||
    string errMsg;
 | 
					    string errMsg;
 | 
				
			||||||
| 
						 | 
					@ -31,7 +33,7 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    protected override async Task OnInitializedAsync()
 | 
					    protected override async Task OnInitializedAsync()
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
 | 
					        myText = await I18nText.GetTextTableAsync<I18nText.local>(this);
 | 
				
			||||||
        base.OnInitializedAsync();
 | 
					        base.OnInitializedAsync();
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -42,94 +44,69 @@
 | 
				
			||||||
        if (firstRender)
 | 
					        if (firstRender)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            await Task.Delay(15);
 | 
					            await Task.Delay(15);
 | 
				
			||||||
            msg = "开始连接指纹模块";
 | 
					            msg = myText.ConnectFinger;
 | 
				
			||||||
            InvokeAsync(StateHasChanged);
 | 
					            InvokeAsync(StateHasChanged);
 | 
				
			||||||
            try
 | 
					            try
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                bool flag=await FingerprintUtil.ConnectionMain();
 | 
					                bool flag=await FingerprintUtil.ConnectionMain();
 | 
				
			||||||
                if (flag)
 | 
					                if (flag)
 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
                    msg = "指纹模块连接成功";
 | 
					                    msg = myText.FingerConnected;
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
                else
 | 
					                else
 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
                    msg = "指纹模块连接失败";
 | 
					                    msg = myText.FingerFailed;
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
                InvokeAsync(StateHasChanged);
 | 
					                InvokeAsync(StateHasChanged);
 | 
				
			||||||
            }
 | 
					            } catch (Exception e)
 | 
				
			||||||
            catch (Exception e)
 | 
					 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                msg = "指纹模块连接失败";
 | 
					                msg = myText.FingerFailed;
 | 
				
			||||||
                errMsg += "【指纹模块连接失败】";
 | 
					                errMsg += "【" + myText .FingerFailed+ "】";
 | 
				
			||||||
                logger.Info($"指纹模块连接失败【{e.Message}】");
 | 
					 | 
				
			||||||
                InvokeAsync(StateHasChanged);
 | 
					                InvokeAsync(StateHasChanged);
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            await Task.Delay(500);
 | 
					            await Task.Delay(500);
 | 
				
			||||||
            msg = "开始连接抽屉串口";
 | 
					            msg = myText.ConnectDrawer;
 | 
				
			||||||
            InvokeAsync(StateHasChanged);
 | 
					            InvokeAsync(StateHasChanged);
 | 
				
			||||||
            try
 | 
					            try
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                PortUtil.drawerSerial.Open();
 | 
					                PortUtil.drawerSerial.Open();
 | 
				
			||||||
                logger.Info($"抽屉串口打开结果【{PortUtil.drawerSerial.IsOpen}】");
 | 
					                logger.Info($"抽屉串口打开结果【{PortUtil.drawerSerial.IsOpen}】");
 | 
				
			||||||
                msg = "抽屉串口连接成功";
 | 
					                msg = myText.DrawerConnected;
 | 
				
			||||||
                InvokeAsync(StateHasChanged);
 | 
					                InvokeAsync(StateHasChanged);
 | 
				
			||||||
            }
 | 
					            } catch (Exception e)
 | 
				
			||||||
            catch (Exception e)
 | 
					 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                msg = "抽屉串口连接失败";
 | 
					                msg = myText.DrawerFailed;
 | 
				
			||||||
                errMsg += "【抽屉串口连接失败】";
 | 
					                errMsg += "【"+myText.DrawerFailed+"】";
 | 
				
			||||||
                logger.Info($"抽屉串口连接失败【{e.Message}】");
 | 
					 | 
				
			||||||
                InvokeAsync(StateHasChanged);
 | 
					                InvokeAsync(StateHasChanged);
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            await Task.Delay(500);
 | 
					            await Task.Delay(500);
 | 
				
			||||||
            msg = "开始连接CanBus模块";
 | 
					            msg = myText.ConnectCan;
 | 
				
			||||||
            InvokeAsync(StateHasChanged);
 | 
					            InvokeAsync(StateHasChanged);
 | 
				
			||||||
            try
 | 
					            try
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                PortUtil.canBusSerial.Open();
 | 
					                PortUtil.canBusSerial.Open();
 | 
				
			||||||
                logger.Info($"CanBus模块打开结果【{PortUtil.canBusSerial.IsOpen}】");
 | 
					                logger.Info($"CanBus模块打开结果【{PortUtil.canBusSerial.IsOpen}】");
 | 
				
			||||||
                msg = "CanBus模块连接成功";
 | 
					                msg = myText.CanConnected;
 | 
				
			||||||
                InvokeAsync(StateHasChanged);
 | 
					                InvokeAsync(StateHasChanged);
 | 
				
			||||||
            }
 | 
					            } catch (Exception e)
 | 
				
			||||||
            catch (Exception e)
 | 
					 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                msg = "CanBus模块连接失败";
 | 
					                msg = myText.CanFailed;
 | 
				
			||||||
                errMsg += "【CanBus模块连接失败】";
 | 
					                errMsg += "【"+myText.CanFailed+"】";
 | 
				
			||||||
                logger.Info($"模块连接失败【{e.Message}】"); 
 | 
					 | 
				
			||||||
                InvokeAsync(StateHasChanged);
 | 
					                InvokeAsync(StateHasChanged);
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            await Task.Delay(500);
 | 
					            await Task.Delay(500);
 | 
				
			||||||
            msg = "开始连接第二个CanBus模块";
 | 
					            msg = myText.ConnectScanCode;
 | 
				
			||||||
            InvokeAsync(StateHasChanged);
 | 
					 | 
				
			||||||
            try
 | 
					 | 
				
			||||||
            {
 | 
					 | 
				
			||||||
                PortUtil.canBusSerialTwo.Open();
 | 
					 | 
				
			||||||
                logger.Info($"第二个CanBus模块打开结果【{PortUtil.canBusSerialTwo.IsOpen}】");
 | 
					 | 
				
			||||||
                msg = "CanBus模块连接成功";
 | 
					 | 
				
			||||||
                InvokeAsync(StateHasChanged);
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
            catch (Exception e)
 | 
					 | 
				
			||||||
            {
 | 
					 | 
				
			||||||
                msg = "第二个CanBus模块连接失败";
 | 
					 | 
				
			||||||
                logger.Info($"模块连接失败【{e.Message}】"); 
 | 
					 | 
				
			||||||
                errMsg += "【第二个CanBus模块连接失败】";
 | 
					 | 
				
			||||||
                InvokeAsync(StateHasChanged);
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
            await Task.Delay(500);
 | 
					 | 
				
			||||||
            msg = "开始连接条码扫描模块";
 | 
					 | 
				
			||||||
            InvokeAsync(StateHasChanged);
 | 
					            InvokeAsync(StateHasChanged);
 | 
				
			||||||
            try
 | 
					            try
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                PortUtil.scanCodeSerial.Open();
 | 
					                PortUtil.scanCodeSerial.Open();
 | 
				
			||||||
                logger.Info($"条码扫描模块打开结果【{PortUtil.scanCodeSerial.IsOpen}】");
 | 
					                logger.Info($"条码扫描模块打开结果【{PortUtil.scanCodeSerial.IsOpen}】");
 | 
				
			||||||
                msg = "条码扫描模块连接成功";
 | 
					                msg = myText.ScanCodeConnected;
 | 
				
			||||||
                InvokeAsync(StateHasChanged);
 | 
					                InvokeAsync(StateHasChanged);
 | 
				
			||||||
            }
 | 
					            } catch (Exception e)
 | 
				
			||||||
            catch (Exception e)
 | 
					 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                msg = "条码扫描模块连接失败";
 | 
					                msg = myText.ScanCodeFailed;
 | 
				
			||||||
                errMsg += "【条码扫描模块连接失败】"; 
 | 
					                errMsg += "【" + myText.ScanCodeFailed + "】";
 | 
				
			||||||
                logger.Info($"条码扫描模块打开结果【{e.Message}】"); 
 | 
					 | 
				
			||||||
                InvokeAsync(StateHasChanged);
 | 
					                InvokeAsync(StateHasChanged);
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            if (portSetting.Value.fridgePortExist)
 | 
					            if (portSetting.Value.fridgePortExist)
 | 
				
			||||||
| 
						 | 
					@ -138,14 +115,13 @@
 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
                    PortUtil.fridgeSerial.Open();
 | 
					                    PortUtil.fridgeSerial.Open();
 | 
				
			||||||
                    logger.Info($"冰箱串口打开结果【{PortUtil.fridgeSerial.IsOpen}】");
 | 
					                    logger.Info($"冰箱串口打开结果【{PortUtil.fridgeSerial.IsOpen}】");
 | 
				
			||||||
                    msg = "冰箱串口连接成功";
 | 
					                    msg = myText.FridgeConnected;
 | 
				
			||||||
                    InvokeAsync(StateHasChanged);
 | 
					                    InvokeAsync(StateHasChanged);
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
                catch (Exception e)
 | 
					                catch (Exception)
 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
                    msg = "冰箱串口打开失败";
 | 
					                    msg = myText.FridgeFailed;
 | 
				
			||||||
                    errMsg += "【冰箱串口打开失败】";
 | 
					                    errMsg += "【"+ myText.FridgeFailed+"】";
 | 
				
			||||||
                    logger.Info($"冰箱串口打开失败【{e.Message}】");
 | 
					 | 
				
			||||||
                    InvokeAsync(StateHasChanged);
 | 
					                    InvokeAsync(StateHasChanged);
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -6,11 +6,11 @@
 | 
				
			||||||
        <div class="col-12 mb-4">
 | 
					        <div class="col-12 mb-4">
 | 
				
			||||||
            
 | 
					            
 | 
				
			||||||
            <form onsubmit="@(() => grid.Reload())">
 | 
					            <form onsubmit="@(() => grid.Reload())">
 | 
				
			||||||
                <RadzenFieldset Text="查询">
 | 
					                <RadzenFieldset Text="@myText.Search">
 | 
				
			||||||
                    <RadzenStack Orientation="Orientation.Horizontal" Gap="1rem">
 | 
					                    <RadzenStack Orientation="Orientation.Horizontal" Gap="1rem">
 | 
				
			||||||
                        <RadzenRow AlignItems="AlignItems.Center">
 | 
					                        <RadzenRow AlignItems="AlignItems.Center">
 | 
				
			||||||
                            <RadzenColumn Size="4">
 | 
					                            <RadzenColumn Size="4">
 | 
				
			||||||
                                <RadzenLabel Text="单据号" Component="InvoiceNo" />
 | 
					                                <RadzenLabel Text="@myText.InvoiceNo" Component="InvoiceNo" />
 | 
				
			||||||
                            </RadzenColumn>
 | 
					                            </RadzenColumn>
 | 
				
			||||||
                            <RadzenColumn Size="8">
 | 
					                            <RadzenColumn Size="8">
 | 
				
			||||||
                                <RadzenTextBox @bind-Value="InvoiceNo" Style="width: 100%;" Name="InvoiceNo"></RadzenTextBox>
 | 
					                                <RadzenTextBox @bind-Value="InvoiceNo" Style="width: 100%;" Name="InvoiceNo"></RadzenTextBox>
 | 
				
			||||||
| 
						 | 
					@ -18,7 +18,7 @@
 | 
				
			||||||
                        </RadzenRow>
 | 
					                        </RadzenRow>
 | 
				
			||||||
                        <RadzenRow AlignItems="AlignItems.Center">
 | 
					                        <RadzenRow AlignItems="AlignItems.Center">
 | 
				
			||||||
                            <RadzenColumn Size="4">
 | 
					                            <RadzenColumn Size="4">
 | 
				
			||||||
                                <RadzenLabel Text="请领日期" Component="InvoiceDate" />
 | 
					                                <RadzenLabel Text="@myText.ApplyDate" Component="InvoiceDate" />
 | 
				
			||||||
                            </RadzenColumn>
 | 
					                            </RadzenColumn>
 | 
				
			||||||
                            <RadzenColumn Size="8">
 | 
					                            <RadzenColumn Size="8">
 | 
				
			||||||
                                <RadzenDatePicker DateFormat="yyyy-MM-dd" CurrentDateChanged="@OnCurrentDateChanged" @bind-Value="InvoiceDate" Style="width: 100%;" Name="InvoiceDate" />
 | 
					                                <RadzenDatePicker DateFormat="yyyy-MM-dd" CurrentDateChanged="@OnCurrentDateChanged" @bind-Value="InvoiceDate" Style="width: 100%;" Name="InvoiceDate" />
 | 
				
			||||||
| 
						 | 
					@ -27,8 +27,8 @@
 | 
				
			||||||
                    
 | 
					                    
 | 
				
			||||||
                        <RadzenRow AlignItems="AlignItems.Center">
 | 
					                        <RadzenRow AlignItems="AlignItems.Center">
 | 
				
			||||||
                            <RadzenColumn Size="12">
 | 
					                            <RadzenColumn Size="12">
 | 
				
			||||||
                                <RadzenButton Size="ButtonSize.Large" ButtonType="ButtonType.Submit" IsBusy="isLoading" Icon="search" Text="查询" />
 | 
					                                <RadzenButton Size="ButtonSize.Large" ButtonType="ButtonType.Submit" IsBusy="isLoading" Icon="search"  Text="@myText.Search" />
 | 
				
			||||||
                                <RadzenButton Size="ButtonSize.Large" Click="reloadGrid" IsBusy="isLoading" Icon="refresh" Text="重置" ButtonStyle="ButtonStyle.Warning" />
 | 
					                                <RadzenButton Size="ButtonSize.Large" Click="reloadGrid" IsBusy="isLoading" Icon="refresh" Text="@myText.Restore" ButtonStyle="ButtonStyle.Warning" />
 | 
				
			||||||
                            </RadzenColumn>
 | 
					                            </RadzenColumn>
 | 
				
			||||||
                        </RadzenRow>
 | 
					                        </RadzenRow>
 | 
				
			||||||
                    </RadzenStack>
 | 
					                    </RadzenStack>
 | 
				
			||||||
| 
						 | 
					@ -42,24 +42,16 @@
 | 
				
			||||||
                    RowSelect="@((InOutInvoice oi) => { InvoiceSelected(oi); })"
 | 
					                    RowSelect="@((InOutInvoice oi) => { InvoiceSelected(oi); })"
 | 
				
			||||||
                    IsLoading="@isLoading"
 | 
					                    IsLoading="@isLoading"
 | 
				
			||||||
                    Count="@count"
 | 
					                    Count="@count"
 | 
				
			||||||
                            EmptyText="无数据"
 | 
					                    EmptyText="@myText.NoDate"
 | 
				
			||||||
                    Data="@_forecasts"
 | 
					                    Data="@_forecasts"
 | 
				
			||||||
                    AllowColumnResize="true" AllowAlternatingRows="false"
 | 
					                    AllowColumnResize="true" AllowAlternatingRows="false"
 | 
				
			||||||
                    SelectionMode="DataGridSelectionMode.Single"
 | 
					                    SelectionMode="DataGridSelectionMode.Single"
 | 
				
			||||||
                    AllowPaging="true" PageSize="10" PagerHorizontalAlign="HorizontalAlign.Left" ShowPagingSummary="true" PagingSummaryFormat="{0}/{1} ¹²{2}ÌõÊý¾Ý">
 | 
					                    AllowPaging="true" PageSize="10" PagerHorizontalAlign="HorizontalAlign.Left" ShowPagingSummary="true" PagingSummaryFormat="{0}/{1} ¹²{2}ÌõÊý¾Ý">
 | 
				
			||||||
                    <Columns>
 | 
					                    <Columns>
 | 
				
			||||||
                    <RadzenDataGridColumn Frozen="true" Title="单据号" Property="InvoiceNo"></RadzenDataGridColumn>
 | 
					                    <RadzenDataGridColumn Frozen="true" Title="@myText.InvoiceNo" Property="InvoiceNo"></RadzenDataGridColumn>
 | 
				
			||||||
                    <RadzenDataGridColumn Width="170px" Title="时间" Property="InvoiceDate"></RadzenDataGridColumn>
 | 
					                    <RadzenDataGridColumn Width="170px" Title="@myText.Date" Property="InvoiceDate"></RadzenDataGridColumn>
 | 
				
			||||||
                    <RadzenDataGridColumn Title="请领药房" Property="InPharmacyId">
 | 
					                    <RadzenDataGridColumn Title="@myText.ApplyPharmacy" Property="InPharmacyId"></RadzenDataGridColumn>
 | 
				
			||||||
                        <Template Context="InPharmacyId">
 | 
					                    <RadzenDataGridColumn Title="@myText.SendPharamacy" Property="OutPharmacyId"></RadzenDataGridColumn>
 | 
				
			||||||
                            @(InPharmacyId.InPharmacyId == "0623" ? "麻醉科" : InPharmacyId.InPharmacyId)
 | 
					 | 
				
			||||||
                        </Template>
 | 
					 | 
				
			||||||
                    </RadzenDataGridColumn>
 | 
					 | 
				
			||||||
                    <RadzenDataGridColumn Title="出库药房" Property="OutPharmacyId">
 | 
					 | 
				
			||||||
                        <Template Context="OutPharmacyId">
 | 
					 | 
				
			||||||
                            @(OutPharmacyId.OutPharmacyId == "070103" ? "药剂科" : OutPharmacyId.OutPharmacyId)
 | 
					 | 
				
			||||||
                        </Template>
 | 
					 | 
				
			||||||
                    </RadzenDataGridColumn>
 | 
					 | 
				
			||||||
                    </Columns>
 | 
					                    </Columns>
 | 
				
			||||||
                </RadzenDataGrid>
 | 
					                </RadzenDataGrid>
 | 
				
			||||||
        </div>
 | 
					        </div>
 | 
				
			||||||
| 
						 | 
					@ -69,13 +61,19 @@
 | 
				
			||||||
@code {
 | 
					@code {
 | 
				
			||||||
    @inject IInOutInvoiceDao inOutInvoiceDao;
 | 
					    @inject IInOutInvoiceDao inOutInvoiceDao;
 | 
				
			||||||
    @inject DialogService dialogService;
 | 
					    @inject DialogService dialogService;
 | 
				
			||||||
 | 
					    @inject Toolbelt.Blazor.I18nText.I18nText I18nText;
 | 
				
			||||||
 | 
					    private I18nText.local myText = new I18nText.local();
 | 
				
			||||||
    RadzenDataGrid<InOutInvoice> grid;
 | 
					    RadzenDataGrid<InOutInvoice> grid;
 | 
				
			||||||
    bool isLoading;
 | 
					    bool isLoading;
 | 
				
			||||||
    int count;
 | 
					    int count;
 | 
				
			||||||
    private IEnumerable<InOutInvoice>? _forecasts;
 | 
					    private IEnumerable<InOutInvoice>? _forecasts;
 | 
				
			||||||
    string InvoiceNo;
 | 
					    string InvoiceNo;
 | 
				
			||||||
    DateTime InvoiceDate = DateTime.Now;
 | 
					    DateTime InvoiceDate = DateTime.MinValue;
 | 
				
			||||||
 | 
					    protected override async Task OnInitializedAsync()
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        myText = await I18nText.GetTextTableAsync<I18nText.local>(this);
 | 
				
			||||||
 | 
					        base.OnInitializedAsync();
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
    void OnCurrentDateChanged(DateTime args)
 | 
					    void OnCurrentDateChanged(DateTime args)
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        InvoiceDate = new DateTime(args.Year, args.Month, args.Day);
 | 
					        InvoiceDate = new DateTime(args.Year, args.Month, args.Day);
 | 
				
			||||||
| 
						 | 
					@ -105,7 +103,7 @@
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        var b = await dialogService.OpenAsync<InvoiceAddDialog>(
 | 
					        var b = await dialogService.OpenAsync<InvoiceAddDialog>(
 | 
				
			||||||
                $"调拨入库详情",
 | 
					                myText.InvoiceInDetail,
 | 
				
			||||||
              new Dictionary<string, object>() { { "invoice", oi } },
 | 
					              new Dictionary<string, object>() { { "invoice", oi } },
 | 
				
			||||||
              new DialogOptions() { Width = "85vw", Resizable = true, Draggable = true, ShowClose = false }
 | 
					              new DialogOptions() { Width = "85vw", Resizable = true, Draggable = true, ShowClose = false }
 | 
				
			||||||
        );
 | 
					        );
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -24,69 +24,15 @@
 | 
				
			||||||
                <RadzenDataGrid Data="@di.ChannelStocks" EmptyText="无数据" @ref="di.Grid"
 | 
					                <RadzenDataGrid Data="@di.ChannelStocks" EmptyText="无数据" @ref="di.Grid"
 | 
				
			||||||
                                CellClick="@((DataGridCellMouseEventArgs<ChannelStock> args) => OnCellClick(args, di.Grid))">
 | 
					                                CellClick="@((DataGridCellMouseEventArgs<ChannelStock> args) => OnCellClick(args, di.Grid))">
 | 
				
			||||||
                    <Columns>
 | 
					                    <Columns>
 | 
				
			||||||
                        <RadzenDataGridColumn Title="库位" Property="DrawerNo" Width="6vw">
 | 
					                        <RadzenDataGridColumn Title="库位" Property="DrawerNo">
 | 
				
			||||||
                            <Template Context="s">
 | 
					                            <Template Context="s">
 | 
				
			||||||
                                @s.DrawerNo - @s.ColNo
 | 
					                                @s.DrawerNo - @s.ColNo
 | 
				
			||||||
                            </Template>
 | 
					                            </Template>
 | 
				
			||||||
                        </RadzenDataGridColumn>
 | 
					                        </RadzenDataGridColumn>
 | 
				
			||||||
                        <RadzenDataGridColumn Title="库存" Property="Quantity" Width="6vw"></RadzenDataGridColumn>
 | 
					                        <RadzenDataGridColumn Title="库存" Property="Quantity"></RadzenDataGridColumn>
 | 
				
			||||||
                        @* <RadzenDataGridColumn Title="批次" Property="ManuNo"></RadzenDataGridColumn>
 | 
					                        @* <RadzenDataGridColumn Title="批次" Property="ManuNo"></RadzenDataGridColumn>
 | 
				
			||||||
                            <RadzenDataGridColumn Title="效期" Property="EffDate"></RadzenDataGridColumn> *@
 | 
					                            <RadzenDataGridColumn Title="效期" Property="EffDate"></RadzenDataGridColumn> *@
 | 
				
			||||||
                        <RadzenDataGridColumn Title="批次" Property="ManuNo" Filterable="false" Width="25vw">
 | 
					                        <RadzenDataGridColumn Title="入库数量" Property="AddQuantity">
 | 
				
			||||||
                            <Template Context="ManuNo">
 | 
					 | 
				
			||||||
                                <RadzenText TextStyle="TextStyle.Subtitle2" class="mb-0">@ManuNo.ManuNo</RadzenText>
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                                @if (ManuNo.Quantity > 0)
 | 
					 | 
				
			||||||
                                {
 | 
					 | 
				
			||||||
                                            <RadzenText TextStyle="TextStyle.Caption">
 | 
					 | 
				
			||||||
                                        @ManuNo.ManuNo
 | 
					 | 
				
			||||||
                                            </RadzenText>
 | 
					 | 
				
			||||||
                                }
 | 
					 | 
				
			||||||
                            </Template>
 | 
					 | 
				
			||||||
                            <EditTemplate Context="channel">
 | 
					 | 
				
			||||||
                                @if (channel.Quantity == 0 && !String.IsNullOrEmpty(channel.DrugId))
 | 
					 | 
				
			||||||
                                {
 | 
					 | 
				
			||||||
                                <RadzenDropDown TValue="DrugManuNo" Name="ManuNo" @bind-Value="channel.drugManuNo" Data="@channel.Drug?.Manus" Style="width:100%; display: block;">
 | 
					 | 
				
			||||||
                                    <Template>
 | 
					 | 
				
			||||||
                                        <RadzenText TextStyle="TextStyle.Subtitle2" class="mb-0">@((context as DrugManuNo)?.ManuNo)</RadzenText>
 | 
					 | 
				
			||||||
                                            @if ((context as DrugManuNo).EffDate != null && (context as DrugManuNo).EffDate.ToString().Length > 10)
 | 
					 | 
				
			||||||
                                            {
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                                                    <RadzenText TextStyle="TextStyle.Caption">@((context as DrugManuNo).EffDate.ToString().Substring(0, 10))</RadzenText>
 | 
					 | 
				
			||||||
                                            }
 | 
					 | 
				
			||||||
                                            else
 | 
					 | 
				
			||||||
                                            {
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                                                    <RadzenText TextStyle="TextStyle.Caption">@((context as DrugManuNo)?.EffDate)</RadzenText>
 | 
					 | 
				
			||||||
                                            }
 | 
					 | 
				
			||||||
                                    </Template>
 | 
					 | 
				
			||||||
                                    <ValueTemplate>
 | 
					 | 
				
			||||||
                                        <RadzenStack Orientation="Orientation.Horizontal">
 | 
					 | 
				
			||||||
                                            <RadzenText TextStyle="TextStyle.Subtitle2" class="mb-0">@((context as DrugManuNo)?.ManuNo)</RadzenText>
 | 
					 | 
				
			||||||
                                                @if ((context as DrugManuNo).EffDate != null && (context as DrugManuNo).EffDate.ToString().Length > 10)
 | 
					 | 
				
			||||||
                                                {
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                                                        <RadzenText TextStyle="TextStyle.Caption">@((context as DrugManuNo).EffDate.ToString().Substring(0, 10))</RadzenText>
 | 
					 | 
				
			||||||
                                                }
 | 
					 | 
				
			||||||
                                                else
 | 
					 | 
				
			||||||
                                                {
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                                                        <RadzenText TextStyle="TextStyle.Caption">@((context as DrugManuNo)?.EffDate)</RadzenText>
 | 
					 | 
				
			||||||
                                                }
 | 
					 | 
				
			||||||
                                        </RadzenStack>
 | 
					 | 
				
			||||||
                                    </ValueTemplate>
 | 
					 | 
				
			||||||
                                </RadzenDropDown>
 | 
					 | 
				
			||||||
                                <RadzenRequiredValidator Text="请选择批次" Component="ManuNo" Popup="true" />
 | 
					 | 
				
			||||||
                                }
 | 
					 | 
				
			||||||
                                else
 | 
					 | 
				
			||||||
                                {
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                                <RadzenText TextStyle="TextStyle.Subtitle2" class="mb-0">@channel.drugManuNo?.ManuNo</RadzenText>
 | 
					 | 
				
			||||||
                                <RadzenText TextStyle="TextStyle.Caption">@channel.drugManuNo?.EffDate</RadzenText>
 | 
					 | 
				
			||||||
                                }
 | 
					 | 
				
			||||||
                            </EditTemplate>
 | 
					 | 
				
			||||||
                        </RadzenDataGridColumn>
 | 
					 | 
				
			||||||
                        <RadzenDataGridColumn Title="入库数" Property="AddQuantity" Width="6vw">
 | 
					 | 
				
			||||||
                            <EditTemplate Context="cs">
 | 
					                            <EditTemplate Context="cs">
 | 
				
			||||||
                                <RadzenNumeric Disabled="status > 0" Style="display: block" Min="0" Max="@di.Quantity" Name="Quantity" @bind-Value=@cs.AddQuantity />
 | 
					                                <RadzenNumeric Disabled="status > 0" Style="display: block" Min="0" Max="@di.Quantity" Name="Quantity" @bind-Value=@cs.AddQuantity />
 | 
				
			||||||
                                <RadzenNumericRangeValidator Style="position: absolute;z-index: 9999;" Min="0" Max="@di.Quantity" Text="请填写正确的添加数量" Component="Quantity" />
 | 
					                                <RadzenNumericRangeValidator Style="position: absolute;z-index: 9999;" Min="0" Max="@di.Quantity" Text="请填写正确的添加数量" Component="Quantity" />
 | 
				
			||||||
| 
						 | 
					@ -97,16 +43,12 @@
 | 
				
			||||||
                </RadzenDataGrid>
 | 
					                </RadzenDataGrid>
 | 
				
			||||||
            </Template>
 | 
					            </Template>
 | 
				
			||||||
            <Columns>
 | 
					            <Columns>
 | 
				
			||||||
                <RadzenDataGridColumn Property="Drug.DrugName" Title="药品" Width="25vw" />
 | 
					                <RadzenDataGridColumn Property="Drug.DrugName" Title="药品" />
 | 
				
			||||||
                <RadzenDataGridColumn Property="Drug.DrugSpec" Title="规格" Width="6vw" />
 | 
					                <RadzenDataGridColumn Property="Drug.DrugSpec" Title="规格" />
 | 
				
			||||||
                <RadzenDataGridColumn Property="Invoice.DrugManuNo" Title="批次" Width="10vw">
 | 
					                <RadzenDataGridColumn Property="Invoice.DrugManuNo" Title="批次" />
 | 
				
			||||||
                    <Template Context="ManuNo">
 | 
					                <RadzenDataGridColumn Property="Invoice.EffDate" Title="效期" />
 | 
				
			||||||
                        @(ManuNo.Invoice.DrugManuNo == "X" ? "无" : ManuNo.Invoice.DrugManuNo)
 | 
					                <RadzenDataGridColumn Property="Quantity" Title="请领数量" />
 | 
				
			||||||
                    </Template>
 | 
					                <RadzenDataGridColumn Property="StockQuantity" Title="总库存" />
 | 
				
			||||||
                </RadzenDataGridColumn>
 | 
					 | 
				
			||||||
                <RadzenDataGridColumn Property="Invoice.EffDate" Title="效期" Width="6vw" />
 | 
					 | 
				
			||||||
                <RadzenDataGridColumn Property="Quantity" Title="请领数量" Width="6vw" />
 | 
					 | 
				
			||||||
                <RadzenDataGridColumn Property="StockQuantity" Title="总库存" Width="6vw" />
 | 
					 | 
				
			||||||
            </Columns>
 | 
					            </Columns>
 | 
				
			||||||
        </RadzenDataGrid>
 | 
					        </RadzenDataGrid>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -116,7 +58,7 @@
 | 
				
			||||||
    <RadzenStack Orientation="Orientation.Horizontal" JustifyContent="JustifyContent.Center" Gap="0.5rem">
 | 
					    <RadzenStack Orientation="Orientation.Horizontal" JustifyContent="JustifyContent.Center" Gap="0.5rem">
 | 
				
			||||||
        @if (status < 2)
 | 
					        @if (status < 2)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
                    <RadzenButton Click="@StartAdd" Disabled="!CanTakeDrug" IsBusy="@(status>0)" BusyText="加药中。。。" ButtonStyle="ButtonStyle.Warning" Variant="Variant.Flat" Text="加药" Style="width: 120px" />
 | 
					            <RadzenButton Click="@StartAdd" Disabled="!CanTakeDrug" IsBusy="status > 0" BusyText="加药中。。。" ButtonStyle="ButtonStyle.Warning" Variant="Variant.Flat" Text="加药" Style="width: 120px" />
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        @if (status == 2)
 | 
					        @if (status == 2)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
| 
						 | 
					@ -172,7 +114,6 @@
 | 
				
			||||||
    async Task CancelOpera()
 | 
					    async Task CancelOpera()
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        PortUtil.speechSynthesizer.SpeakAsyncCancelAll();
 | 
					        PortUtil.speechSynthesizer.SpeakAsyncCancelAll();
 | 
				
			||||||
        PortUtil.Operate = false;
 | 
					 | 
				
			||||||
        status = 0;
 | 
					        status = 0;
 | 
				
			||||||
        dialogService.Close(false);
 | 
					        dialogService.Close(false);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
| 
						 | 
					@ -181,8 +122,6 @@
 | 
				
			||||||
    async Task OpenDrawer()
 | 
					    async Task OpenDrawer()
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        this.status = 1;
 | 
					        this.status = 1;
 | 
				
			||||||
        PortUtil.PowerOn();
 | 
					 | 
				
			||||||
        await Task.Delay(200);
 | 
					 | 
				
			||||||
        // 解析需要打开的抽屉列表
 | 
					        // 解析需要打开的抽屉列表
 | 
				
			||||||
        List<ChannelStock> channels = new();
 | 
					        List<ChannelStock> channels = new();
 | 
				
			||||||
        for (int i = 0; i < data.Count; i++)
 | 
					        for (int i = 0; i < data.Count; i++)
 | 
				
			||||||
| 
						 | 
					@ -248,7 +187,6 @@
 | 
				
			||||||
                            PortUtil.speechSynthesizer.SpeakAsyncCancelAll();
 | 
					                            PortUtil.speechSynthesizer.SpeakAsyncCancelAll();
 | 
				
			||||||
                            PortUtil.SpeakAsync($"{drawerNo}号抽屉已经打开,请,加药");
 | 
					                            PortUtil.SpeakAsync($"{drawerNo}号抽屉已经打开,请,加药");
 | 
				
			||||||
                            options._data = 1;
 | 
					                            options._data = 1;
 | 
				
			||||||
                            PortUtil.Operate = true;
 | 
					 | 
				
			||||||
                            next();
 | 
					                            next();
 | 
				
			||||||
                        }
 | 
					                        }
 | 
				
			||||||
                        else
 | 
					                        else
 | 
				
			||||||
| 
						 | 
					@ -257,7 +195,7 @@
 | 
				
			||||||
                                new NotificationMessage { Severity = NotificationSeverity.Error, Summary = "提示", Detail = $"抽屉【{drawerNo}】打开失败,请检测硬件", Duration = 4000 }
 | 
					                                new NotificationMessage { Severity = NotificationSeverity.Error, Summary = "提示", Detail = $"抽屉【{drawerNo}】打开失败,请检测硬件", Duration = 4000 }
 | 
				
			||||||
                            );
 | 
					                            );
 | 
				
			||||||
                            logger.Info($"抽屉打开失败");
 | 
					                            logger.Info($"抽屉打开失败");
 | 
				
			||||||
                            PortUtil.PowerOff();
 | 
					                            PortUtil.AllLightOff();
 | 
				
			||||||
                            RestData();
 | 
					                            RestData();
 | 
				
			||||||
                            stop();
 | 
					                            stop();
 | 
				
			||||||
                        }
 | 
					                        }
 | 
				
			||||||
| 
						 | 
					@ -273,7 +211,7 @@
 | 
				
			||||||
                            options._data = 0;
 | 
					                            options._data = 0;
 | 
				
			||||||
                            if (setting.Value.single.Contains(drawerNo))
 | 
					                            if (setting.Value.single.Contains(drawerNo))
 | 
				
			||||||
                            {
 | 
					                            {
 | 
				
			||||||
                                PortUtil.PowerOff();
 | 
					                                PortUtil.AllLightOff();
 | 
				
			||||||
                            }
 | 
					                            }
 | 
				
			||||||
                            if (index == drawerNos.Count - 1)
 | 
					                            if (index == drawerNos.Count - 1)
 | 
				
			||||||
                            {
 | 
					                            {
 | 
				
			||||||
| 
						 | 
					@ -397,17 +335,14 @@
 | 
				
			||||||
            );
 | 
					            );
 | 
				
			||||||
                if (setting.Value.single.Contains(drawerNo))
 | 
					                if (setting.Value.single.Contains(drawerNo))
 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
                    PortUtil.PowerOff();
 | 
					                    PortUtil.AllLightOff();
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        });
 | 
					        });
 | 
				
			||||||
        PortUtil.PowerOff();
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    void RestData()
 | 
					    void RestData()
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        PortUtil.PowerOff();
 | 
					 | 
				
			||||||
        PortUtil.Operate = false;
 | 
					 | 
				
			||||||
        this.status = 0;
 | 
					        this.status = 0;
 | 
				
			||||||
        _flagList.Clear();
 | 
					        _flagList.Clear();
 | 
				
			||||||
        this.ColNos.Clear();
 | 
					        this.ColNos.Clear();
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -6,11 +6,11 @@
 | 
				
			||||||
        <div class="col-12 mb-4">
 | 
					        <div class="col-12 mb-4">
 | 
				
			||||||
            
 | 
					            
 | 
				
			||||||
            <form onsubmit="@(() => grid.Reload())">
 | 
					            <form onsubmit="@(() => grid.Reload())">
 | 
				
			||||||
                <RadzenFieldset Text="查询">
 | 
					                <RadzenFieldset Text="@myText.Search">
 | 
				
			||||||
                    <RadzenStack Orientation="Orientation.Horizontal" Gap="1rem">
 | 
					                    <RadzenStack Orientation="Orientation.Horizontal" Gap="1rem">
 | 
				
			||||||
                        <RadzenRow AlignItems="AlignItems.Center">
 | 
					                        <RadzenRow AlignItems="AlignItems.Center">
 | 
				
			||||||
                            <RadzenColumn Size="4">
 | 
					                            <RadzenColumn Size="4">
 | 
				
			||||||
                                <RadzenLabel Text="单据号" Component="InvoiceNo" />
 | 
					                                <RadzenLabel Text="@myText.InvoiceNo" Component="InvoiceNo" />
 | 
				
			||||||
                            </RadzenColumn>
 | 
					                            </RadzenColumn>
 | 
				
			||||||
                            <RadzenColumn Size="8">
 | 
					                            <RadzenColumn Size="8">
 | 
				
			||||||
                                <RadzenTextBox @bind-Value="InvoiceNo" Style="width: 100%;" Name="InvoiceNo"></RadzenTextBox>
 | 
					                                <RadzenTextBox @bind-Value="InvoiceNo" Style="width: 100%;" Name="InvoiceNo"></RadzenTextBox>
 | 
				
			||||||
| 
						 | 
					@ -18,7 +18,7 @@
 | 
				
			||||||
                        </RadzenRow>
 | 
					                        </RadzenRow>
 | 
				
			||||||
                        <RadzenRow AlignItems="AlignItems.Center">
 | 
					                        <RadzenRow AlignItems="AlignItems.Center">
 | 
				
			||||||
                            <RadzenColumn Size="4">
 | 
					                            <RadzenColumn Size="4">
 | 
				
			||||||
                                <RadzenLabel Text="请领日期" Component="InvoiceDate" />
 | 
					                                <RadzenLabel Text="@myText.ApplyDate" Component="InvoiceDate" />
 | 
				
			||||||
                            </RadzenColumn>
 | 
					                            </RadzenColumn>
 | 
				
			||||||
                            <RadzenColumn Size="8">
 | 
					                            <RadzenColumn Size="8">
 | 
				
			||||||
                                <RadzenDatePicker DateFormat="yyyy-MM-dd" CurrentDateChanged="@OnCurrentDateChanged" @bind-Value="InvoiceDate" Style="width: 100%;" Name="InvoiceDate" />
 | 
					                                <RadzenDatePicker DateFormat="yyyy-MM-dd" CurrentDateChanged="@OnCurrentDateChanged" @bind-Value="InvoiceDate" Style="width: 100%;" Name="InvoiceDate" />
 | 
				
			||||||
| 
						 | 
					@ -27,8 +27,8 @@
 | 
				
			||||||
                    
 | 
					                    
 | 
				
			||||||
                        <RadzenRow AlignItems="AlignItems.Center">
 | 
					                        <RadzenRow AlignItems="AlignItems.Center">
 | 
				
			||||||
                            <RadzenColumn Size="12">
 | 
					                            <RadzenColumn Size="12">
 | 
				
			||||||
                                <RadzenButton Size="ButtonSize.Medium" ButtonType="ButtonType.Submit" IsBusy="isLoading" Icon="search"  Text="查询" />
 | 
					                                <RadzenButton Size="ButtonSize.Medium" ButtonType="ButtonType.Submit" IsBusy="isLoading" Icon="search"  Text="@myText.Search" />
 | 
				
			||||||
                                <RadzenButton Size="ButtonSize.Medium" Click="reloadGrid" IsBusy="isLoading" Icon="refresh" Text="重置" ButtonStyle="ButtonStyle.Warning" />
 | 
					                                <RadzenButton Size="ButtonSize.Medium" Click="reloadGrid" IsBusy="isLoading" Icon="refresh" Text="@myText.Restore" ButtonStyle="ButtonStyle.Warning" />
 | 
				
			||||||
                            </RadzenColumn>
 | 
					                            </RadzenColumn>
 | 
				
			||||||
                        </RadzenRow>
 | 
					                        </RadzenRow>
 | 
				
			||||||
                    </RadzenStack>
 | 
					                    </RadzenStack>
 | 
				
			||||||
| 
						 | 
					@ -42,16 +42,16 @@
 | 
				
			||||||
                    RowSelect="@((InOutInvoice oi) => { InvoiceSelected(oi); })"
 | 
					                    RowSelect="@((InOutInvoice oi) => { InvoiceSelected(oi); })"
 | 
				
			||||||
                    IsLoading="@isLoading"
 | 
					                    IsLoading="@isLoading"
 | 
				
			||||||
                    Count="@count"
 | 
					                    Count="@count"
 | 
				
			||||||
                    EmptyText="无数据"
 | 
					                            EmptyText="@myText.NoDate"
 | 
				
			||||||
                    Data="@_forecasts"
 | 
					                    Data="@_forecasts"
 | 
				
			||||||
                    AllowColumnResize="true" AllowAlternatingRows="false"
 | 
					                    AllowColumnResize="true" AllowAlternatingRows="false"
 | 
				
			||||||
                    SelectionMode="DataGridSelectionMode.Single"
 | 
					                    SelectionMode="DataGridSelectionMode.Single"
 | 
				
			||||||
                    AllowPaging="true" PageSize="10" PagerHorizontalAlign="HorizontalAlign.Left" ShowPagingSummary="true" PagingSummaryFormat="{0}/{1} ¹²{2}ÌõÊý¾Ý">
 | 
					                    AllowPaging="true" PageSize="10" PagerHorizontalAlign="HorizontalAlign.Left" ShowPagingSummary="true" PagingSummaryFormat="{0}/{1} ¹²{2}ÌõÊý¾Ý">
 | 
				
			||||||
                    <Columns>
 | 
					                    <Columns>
 | 
				
			||||||
                        <RadzenDataGridColumn Frozen="true" Title="单据号" Property="InvoiceNo"></RadzenDataGridColumn>
 | 
					                    <RadzenDataGridColumn Frozen="true" Title="@myText.InvoiceNo" Property="InvoiceNo"></RadzenDataGridColumn>
 | 
				
			||||||
                        <RadzenDataGridColumn Width="170px" Title="时间" Property="InvoiceDate"></RadzenDataGridColumn>
 | 
					                    <RadzenDataGridColumn Width="170px" Title="@myText.Date" Property="InvoiceDate"></RadzenDataGridColumn>
 | 
				
			||||||
                        <RadzenDataGridColumn Title="请领药房" Property="InPharmacyId"></RadzenDataGridColumn>
 | 
					                    <RadzenDataGridColumn Title="@myText.ApplyPharmacy" Property="InPharmacyId"></RadzenDataGridColumn>
 | 
				
			||||||
                        <RadzenDataGridColumn Title="出库药房" Property="OutPharmacyId"></RadzenDataGridColumn>
 | 
					                    <RadzenDataGridColumn Title="@myText.SendPharamacy" Property="OutPharmacyId"></RadzenDataGridColumn>
 | 
				
			||||||
                    </Columns>
 | 
					                    </Columns>
 | 
				
			||||||
                </RadzenDataGrid>
 | 
					                </RadzenDataGrid>
 | 
				
			||||||
        </div>
 | 
					        </div>
 | 
				
			||||||
| 
						 | 
					@ -61,6 +61,8 @@
 | 
				
			||||||
@code {
 | 
					@code {
 | 
				
			||||||
    @inject IInOutInvoiceDao inOutInvoiceDao;
 | 
					    @inject IInOutInvoiceDao inOutInvoiceDao;
 | 
				
			||||||
    @inject DialogService dialogService;
 | 
					    @inject DialogService dialogService;
 | 
				
			||||||
 | 
					    @inject Toolbelt.Blazor.I18nText.I18nText I18nText;
 | 
				
			||||||
 | 
					    private I18nText.local myText = new I18nText.local();
 | 
				
			||||||
    RadzenDataGrid<InOutInvoice> grid;
 | 
					    RadzenDataGrid<InOutInvoice> grid;
 | 
				
			||||||
    bool isLoading;
 | 
					    bool isLoading;
 | 
				
			||||||
    int count;
 | 
					    int count;
 | 
				
			||||||
| 
						 | 
					@ -68,6 +70,11 @@
 | 
				
			||||||
    string InvoiceNo;
 | 
					    string InvoiceNo;
 | 
				
			||||||
    DateTime InvoiceDate = DateTime.MinValue;
 | 
					    DateTime InvoiceDate = DateTime.MinValue;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					     protected override async Task OnInitializedAsync()
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        myText = await I18nText.GetTextTableAsync<I18nText.local>(this); 
 | 
				
			||||||
 | 
					        base.OnInitializedAsync();
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
    void OnCurrentDateChanged(DateTime args)
 | 
					    void OnCurrentDateChanged(DateTime args)
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        InvoiceDate = new DateTime(args.Year, args.Month, args.Day);
 | 
					        InvoiceDate = new DateTime(args.Year, args.Month, args.Day);
 | 
				
			||||||
| 
						 | 
					@ -97,7 +104,7 @@
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        var b = await dialogService.OpenAsync<InvoiceOutDialog>(
 | 
					        var b = await dialogService.OpenAsync<InvoiceOutDialog>(
 | 
				
			||||||
                $"调拨出库详情",
 | 
					               myText.InvoiceDetail,
 | 
				
			||||||
              new Dictionary<string, object>() { { "invoice", oi } },
 | 
					              new Dictionary<string, object>() { { "invoice", oi } },
 | 
				
			||||||
              new DialogOptions() { Width = "85vw", Resizable = true, Draggable = true, ShowClose = false }
 | 
					              new DialogOptions() { Width = "85vw", Resizable = true, Draggable = true, ShowClose = false }
 | 
				
			||||||
        );
 | 
					        );
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -220,7 +220,7 @@
 | 
				
			||||||
                                new NotificationMessage { Severity = NotificationSeverity.Error, Summary = "提示", Detail = $"抽屉【{drawerNo}】打开失败,请检测硬件", Duration = 4000 }
 | 
					                                new NotificationMessage { Severity = NotificationSeverity.Error, Summary = "提示", Detail = $"抽屉【{drawerNo}】打开失败,请检测硬件", Duration = 4000 }
 | 
				
			||||||
                            );
 | 
					                            );
 | 
				
			||||||
                            logger.Info($"抽屉打开失败");
 | 
					                            logger.Info($"抽屉打开失败");
 | 
				
			||||||
                            PortUtil.PowerOff();
 | 
					                            PortUtil.AllLightOff();
 | 
				
			||||||
                            RestData();
 | 
					                            RestData();
 | 
				
			||||||
                            stop();
 | 
					                            stop();
 | 
				
			||||||
                        }
 | 
					                        }
 | 
				
			||||||
| 
						 | 
					@ -236,7 +236,7 @@
 | 
				
			||||||
                            options._data = 0;
 | 
					                            options._data = 0;
 | 
				
			||||||
                            if (setting.Value.single.Contains(drawerNo))
 | 
					                            if (setting.Value.single.Contains(drawerNo))
 | 
				
			||||||
                            {
 | 
					                            {
 | 
				
			||||||
                                PortUtil.PowerOff();
 | 
					                                PortUtil.AllLightOff();
 | 
				
			||||||
                            }
 | 
					                            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                            if (index == drawerNos.Count - 1)
 | 
					                            if (index == drawerNos.Count - 1)
 | 
				
			||||||
| 
						 | 
					@ -365,7 +365,7 @@
 | 
				
			||||||
                );
 | 
					                );
 | 
				
			||||||
                if (setting.Value.single.Contains(drawerNo))
 | 
					                if (setting.Value.single.Contains(drawerNo))
 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
                    PortUtil.PowerOff();
 | 
					                    PortUtil.AllLightOff();
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
                stop();
 | 
					                stop();
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
| 
						 | 
					@ -374,7 +374,6 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    void RestData()
 | 
					    void RestData()
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        PortUtil.PowerOff();
 | 
					 | 
				
			||||||
        PortUtil.speechSynthesizer.SpeakAsyncCancelAll();
 | 
					        PortUtil.speechSynthesizer.SpeakAsyncCancelAll();
 | 
				
			||||||
        this.status = 0;
 | 
					        this.status = 0;
 | 
				
			||||||
        this.BeforeQuantity = new int[9];
 | 
					        this.BeforeQuantity = new int[9];
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -17,37 +17,37 @@
 | 
				
			||||||
        <RadzenCard class="rz-shadow-0 rz-border-radius-0 rz-text-align-center rz-p-12 align-items-center justify-content-center" Style="height: 100%; background: var(--rz-primary-light) no-repeat 100% 70% fixed url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIwNCIgaGVpZ2h0PSIxNDU4IiB2aWV3Qm94PSIwIDAgMTIwNCAxNDU4IiBmaWxsPSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgo8ZyBvcGFjaXR5PSIwLjUiIGZpbHRlcj0idXJsKCNmaWx0ZXIwX2ZfNDkzXzEwMTM0KSI+CjxjaXJjbGUgY3g9IjcyMi4xMjgiIGN5PSI4MzkuMDIiIHI9IjQ4MS40MTkiIGZpbGw9InVybCgjcGFpbnQwX3JhZGlhbF80OTNfMTAxMzQpIi8+CjwvZz4KPGcgb3BhY2l0eT0iMC41IiBmaWx0ZXI9InVybCgjZmlsdGVyMV9mXzQ5M18xMDEzNCkiPgo8Y2lyY2xlIGN4PSI0NzAuMzMzIiBjeT0iNTcwLjMzMyIgcj0iNDcwLjMzMyIgZmlsbD0idXJsKCNwYWludDFfcmFkaWFsXzQ5M18xMDEzNCkiLz4KPC9nPgo8ZyBvcGFjaXR5PSIwLjUiIGZpbHRlcj0idXJsKCNmaWx0ZXIyX2ZfNDkzXzEwMTM0KSI+CjxjaXJjbGUgY3g9IjY5MS41MTEiIGN5PSI1MjIuMjk3IiByPSIzMzEuNTAzIiBmaWxsPSJ1cmwoI3BhaW50Ml9yYWRpYWxfNDkzXzEwMTM0KSIvPgo8L2c+CjxnIG9wYWNpdHk9IjAuNSIgZmlsdGVyPSJ1cmwoI2ZpbHRlcjNfZl80OTNfMTAxMzQpIj4KPGNpcmNsZSBjeD0iNjA4LjI0NCIgY3k9IjEwNzkuOTciIHI9IjMzMS41MDMiIHRyYW5zZm9ybT0icm90YXRlKC04MS4yMjQ0IDYwOC4yNDQgMTA3OS45NykiIGZpbGw9InVybCgjcGFpbnQzX3JhZGlhbF80OTNfMTAxMzQpIi8+CjwvZz4KPGRlZnM+CjxmaWx0ZXIgaWQ9ImZpbHRlcjBfZl80OTNfMTAxMzQiIHg9IjE0MC43MDkiIHk9IjI1Ny42MDEiIHdpZHRoPSIxMTYyLjg0IiBoZWlnaHQ9IjExNjIuODQiIGZpbHRlclVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgY29sb3ItaW50ZXJwb2xhdGlvbi1maWx0ZXJzPSJzUkdCIj4KPGZlRmxvb2QgZmxvb2Qtb3BhY2l0eT0iMCIgcmVzdWx0PSJCYWNrZ3JvdW5kSW1hZ2VGaXgiLz4KPGZlQmxlbmQgbW9kZT0ibm9ybWFsIiBpbj0iU291cmNlR3JhcGhpYyIgaW4yPSJCYWNrZ3JvdW5kSW1hZ2VGaXgiIHJlc3VsdD0ic2hhcGUiLz4KPGZlR2F1c3NpYW5CbHVyIHN0ZERldmlhdGlvbj0iNTAiIHJlc3VsdD0iZWZmZWN0MV9mb3JlZ3JvdW5kQmx1cl80OTNfMTAxMzQiLz4KPC9maWx0ZXI+CjxmaWx0ZXIgaWQ9ImZpbHRlcjFfZl80OTNfMTAxMzQiIHg9Ii0xMDAiIHk9IjAiIHdpZHRoPSIxMTQwLjY3IiBoZWlnaHQ9IjExNDAuNjciIGZpbHRlclVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgY29sb3ItaW50ZXJwb2xhdGlvbi1maWx0ZXJzPSJzUkdCIj4KPGZlRmxvb2QgZmxvb2Qtb3BhY2l0eT0iMCIgcmVzdWx0PSJCYWNrZ3JvdW5kSW1hZ2VGaXgiLz4KPGZlQmxlbmQgbW9kZT0ibm9ybWFsIiBpbj0iU291cmNlR3JhcGhpYyIgaW4yPSJCYWNrZ3JvdW5kSW1hZ2VGaXgiIHJlc3VsdD0ic2hhcGUiLz4KPGZlR2F1c3NpYW5CbHVyIHN0ZERldmlhdGlvbj0iNTAiIHJlc3VsdD0iZWZmZWN0MV9mb3JlZ3JvdW5kQmx1cl80OTNfMTAxMzQiLz4KPC9maWx0ZXI+CjxmaWx0ZXIgaWQ9ImZpbHRlcjJfZl80OTNfMTAxMzQiIHg9IjI2MC4wMDgiIHk9IjkwLjc5MzkiIHdpZHRoPSI4NjMuMDA2IiBoZWlnaHQ9Ijg2My4wMDYiIGZpbHRlclVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgY29sb3ItaW50ZXJwb2xhdGlvbi1maWx0ZXJzPSJzUkdCIj4KPGZlRmxvb2QgZmxvb2Qtb3BhY2l0eT0iMCIgcmVzdWx0PSJCYWNrZ3JvdW5kSW1hZ2VGaXgiLz4KPGZlQmxlbmQgbW9kZT0ibm9ybWFsIiBpbj0iU291cmNlR3JhcGhpYyIgaW4yPSJCYWNrZ3JvdW5kSW1hZ2VGaXgiIHJlc3VsdD0ic2hhcGUiLz4KPGZlR2F1c3NpYW5CbHVyIHN0ZERldmlhdGlvbj0iNTAiIHJlc3VsdD0iZWZmZWN0MV9mb3JlZ3JvdW5kQmx1cl80OTNfMTAxMzQiLz4KPC9maWx0ZXI+CjxmaWx0ZXIgaWQ9ImZpbHRlcjNfZl80OTNfMTAxMzQiIHg9IjE3Ni42OTQiIHk9IjY0OC40MjMiIHdpZHRoPSI4NjMuMSIgaGVpZ2h0PSI4NjMuMSIgZmlsdGVyVW5pdHM9InVzZXJTcGFjZU9uVXNlIiBjb2xvci1pbnRlcnBvbGF0aW9uLWZpbHRlcnM9InNSR0IiPgo8ZmVGbG9vZCBmbG9vZC1vcGFjaXR5PSIwIiByZXN1bHQ9IkJhY2tncm91bmRJbWFnZUZpeCIvPgo8ZmVCbGVuZCBtb2RlPSJub3JtYWwiIGluPSJTb3VyY2VHcmFwaGljIiBpbjI9IkJhY2tncm91bmRJbWFnZUZpeCIgcmVzdWx0PSJzaGFwZSIvPgo8ZmVHYXVzc2lhbkJsdXIgc3RkRGV2aWF0aW9uPSI1MCIgcmVzdWx0PSJlZmZlY3QxX2ZvcmVncm91bmRCbHVyXzQ5M18xMDEzNCIvPgo8L2ZpbHRlcj4KPHJhZGlhbEdyYWRpZW50IGlkPSJwYWludDBfcmFkaWFsXzQ5M18xMDEzNCIgY3g9IjAiIGN5PSIwIiByPSIxIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgZ3JhZGllbnRUcmFuc2Zvcm09InRyYW5zbGF0ZSg3MjIuMTI4IDgzOS4wMikgcm90YXRlKDkwKSBzY2FsZSg0ODEuNDE5KSI+CjxzdG9wIHN0b3AtY29sb3I9IiNGRjFBNkMiLz4KPHN0b3Agb2Zmc2V0PSIxIiBzdG9wLWNvbG9yPSIjRkYxQTZDIiBzdG9wLW9wYWNpdHk9IjAiLz4KPC9yYWRpYWxHcmFkaWVudD4KPHJhZGlhbEdyYWRpZW50IGlkPSJwYWludDFfcmFkaWFsXzQ5M18xMDEzNCIgY3g9IjAiIGN5PSIwIiByPSIxIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgZ3JhZGllbnRUcmFuc2Zvcm09InRyYW5zbGF0ZSg0NzAuMzMzIDU3MC4zMzMpIHJvdGF0ZSg5MCkgc2NhbGUoNDcwLjMzMykiPgo8c3RvcCBzdG9wLWNvbG9yPSIjM0FBQ0ZGIi8+CjxzdG9wIG9mZnNldD0iMSIgc3RvcC1jb2xvcj0iIzNBOTVGRiIgc3RvcC1vcGFjaXR5PSIwIi8+CjwvcmFkaWFsR3JhZGllbnQ+CjxyYWRpYWxHcmFkaWVudCBpZD0icGFpbnQyX3JhZGlhbF80OTNfMTAxMzQiIGN4PSIwIiBjeT0iMCIgcj0iMSIgZ3JhZGllbnRVbml0cz0idXNlclNwYWNlT25Vc2UiIGdyYWRpZW50VHJhbnNmb3JtPSJ0cmFuc2xhdGUoNjkxLjUxMSA1MjIuMjk3KSByb3RhdGUoOTApIHNjYWxlKDMzMS41MDMpIj4KPHN0b3Agc3RvcC1jb2xvcj0iIzQ4M0FGRiIvPgo8c3RvcCBvZmZzZXQ9IjEiIHN0b3AtY29sb3I9IiM0ODNBRkYiIHN0b3Atb3BhY2l0eT0iMCIvPgo8L3JhZGlhbEdyYWRpZW50Pgo8cmFkaWFsR3JhZGllbnQgaWQ9InBhaW50M19yYWRpYWxfNDkzXzEwMTM0IiBjeD0iMCIgY3k9IjAiIHI9IjEiIGdyYWRpZW50VW5pdHM9InVzZXJTcGFjZU9uVXNlIiBncmFkaWVudFRyYW5zZm9ybT0idHJhbnNsYXRlKDYwOC4yNDQgMTA3OS45Nykgcm90YXRlKDkwKSBzY2FsZSgzMzEuNTAzKSI+CjxzdG9wIHN0b3AtY29sb3I9IiNGRkM4M0EiLz4KPHN0b3Agb2Zmc2V0PSIxIiBzdG9wLWNvbG9yPSIjRkZDODNBIiBzdG9wLW9wYWNpdHk9IjAiLz4KPC9yYWRpYWxHcmFkaWVudD4KPC9kZWZzPgo8L3N2Zz4K')">
 | 
					        <RadzenCard class="rz-shadow-0 rz-border-radius-0 rz-text-align-center rz-p-12 align-items-center justify-content-center" Style="height: 100%; background: var(--rz-primary-light) no-repeat 100% 70% fixed url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIwNCIgaGVpZ2h0PSIxNDU4IiB2aWV3Qm94PSIwIDAgMTIwNCAxNDU4IiBmaWxsPSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgo8ZyBvcGFjaXR5PSIwLjUiIGZpbHRlcj0idXJsKCNmaWx0ZXIwX2ZfNDkzXzEwMTM0KSI+CjxjaXJjbGUgY3g9IjcyMi4xMjgiIGN5PSI4MzkuMDIiIHI9IjQ4MS40MTkiIGZpbGw9InVybCgjcGFpbnQwX3JhZGlhbF80OTNfMTAxMzQpIi8+CjwvZz4KPGcgb3BhY2l0eT0iMC41IiBmaWx0ZXI9InVybCgjZmlsdGVyMV9mXzQ5M18xMDEzNCkiPgo8Y2lyY2xlIGN4PSI0NzAuMzMzIiBjeT0iNTcwLjMzMyIgcj0iNDcwLjMzMyIgZmlsbD0idXJsKCNwYWludDFfcmFkaWFsXzQ5M18xMDEzNCkiLz4KPC9nPgo8ZyBvcGFjaXR5PSIwLjUiIGZpbHRlcj0idXJsKCNmaWx0ZXIyX2ZfNDkzXzEwMTM0KSI+CjxjaXJjbGUgY3g9IjY5MS41MTEiIGN5PSI1MjIuMjk3IiByPSIzMzEuNTAzIiBmaWxsPSJ1cmwoI3BhaW50Ml9yYWRpYWxfNDkzXzEwMTM0KSIvPgo8L2c+CjxnIG9wYWNpdHk9IjAuNSIgZmlsdGVyPSJ1cmwoI2ZpbHRlcjNfZl80OTNfMTAxMzQpIj4KPGNpcmNsZSBjeD0iNjA4LjI0NCIgY3k9IjEwNzkuOTciIHI9IjMzMS41MDMiIHRyYW5zZm9ybT0icm90YXRlKC04MS4yMjQ0IDYwOC4yNDQgMTA3OS45NykiIGZpbGw9InVybCgjcGFpbnQzX3JhZGlhbF80OTNfMTAxMzQpIi8+CjwvZz4KPGRlZnM+CjxmaWx0ZXIgaWQ9ImZpbHRlcjBfZl80OTNfMTAxMzQiIHg9IjE0MC43MDkiIHk9IjI1Ny42MDEiIHdpZHRoPSIxMTYyLjg0IiBoZWlnaHQ9IjExNjIuODQiIGZpbHRlclVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgY29sb3ItaW50ZXJwb2xhdGlvbi1maWx0ZXJzPSJzUkdCIj4KPGZlRmxvb2QgZmxvb2Qtb3BhY2l0eT0iMCIgcmVzdWx0PSJCYWNrZ3JvdW5kSW1hZ2VGaXgiLz4KPGZlQmxlbmQgbW9kZT0ibm9ybWFsIiBpbj0iU291cmNlR3JhcGhpYyIgaW4yPSJCYWNrZ3JvdW5kSW1hZ2VGaXgiIHJlc3VsdD0ic2hhcGUiLz4KPGZlR2F1c3NpYW5CbHVyIHN0ZERldmlhdGlvbj0iNTAiIHJlc3VsdD0iZWZmZWN0MV9mb3JlZ3JvdW5kQmx1cl80OTNfMTAxMzQiLz4KPC9maWx0ZXI+CjxmaWx0ZXIgaWQ9ImZpbHRlcjFfZl80OTNfMTAxMzQiIHg9Ii0xMDAiIHk9IjAiIHdpZHRoPSIxMTQwLjY3IiBoZWlnaHQ9IjExNDAuNjciIGZpbHRlclVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgY29sb3ItaW50ZXJwb2xhdGlvbi1maWx0ZXJzPSJzUkdCIj4KPGZlRmxvb2QgZmxvb2Qtb3BhY2l0eT0iMCIgcmVzdWx0PSJCYWNrZ3JvdW5kSW1hZ2VGaXgiLz4KPGZlQmxlbmQgbW9kZT0ibm9ybWFsIiBpbj0iU291cmNlR3JhcGhpYyIgaW4yPSJCYWNrZ3JvdW5kSW1hZ2VGaXgiIHJlc3VsdD0ic2hhcGUiLz4KPGZlR2F1c3NpYW5CbHVyIHN0ZERldmlhdGlvbj0iNTAiIHJlc3VsdD0iZWZmZWN0MV9mb3JlZ3JvdW5kQmx1cl80OTNfMTAxMzQiLz4KPC9maWx0ZXI+CjxmaWx0ZXIgaWQ9ImZpbHRlcjJfZl80OTNfMTAxMzQiIHg9IjI2MC4wMDgiIHk9IjkwLjc5MzkiIHdpZHRoPSI4NjMuMDA2IiBoZWlnaHQ9Ijg2My4wMDYiIGZpbHRlclVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgY29sb3ItaW50ZXJwb2xhdGlvbi1maWx0ZXJzPSJzUkdCIj4KPGZlRmxvb2QgZmxvb2Qtb3BhY2l0eT0iMCIgcmVzdWx0PSJCYWNrZ3JvdW5kSW1hZ2VGaXgiLz4KPGZlQmxlbmQgbW9kZT0ibm9ybWFsIiBpbj0iU291cmNlR3JhcGhpYyIgaW4yPSJCYWNrZ3JvdW5kSW1hZ2VGaXgiIHJlc3VsdD0ic2hhcGUiLz4KPGZlR2F1c3NpYW5CbHVyIHN0ZERldmlhdGlvbj0iNTAiIHJlc3VsdD0iZWZmZWN0MV9mb3JlZ3JvdW5kQmx1cl80OTNfMTAxMzQiLz4KPC9maWx0ZXI+CjxmaWx0ZXIgaWQ9ImZpbHRlcjNfZl80OTNfMTAxMzQiIHg9IjE3Ni42OTQiIHk9IjY0OC40MjMiIHdpZHRoPSI4NjMuMSIgaGVpZ2h0PSI4NjMuMSIgZmlsdGVyVW5pdHM9InVzZXJTcGFjZU9uVXNlIiBjb2xvci1pbnRlcnBvbGF0aW9uLWZpbHRlcnM9InNSR0IiPgo8ZmVGbG9vZCBmbG9vZC1vcGFjaXR5PSIwIiByZXN1bHQ9IkJhY2tncm91bmRJbWFnZUZpeCIvPgo8ZmVCbGVuZCBtb2RlPSJub3JtYWwiIGluPSJTb3VyY2VHcmFwaGljIiBpbjI9IkJhY2tncm91bmRJbWFnZUZpeCIgcmVzdWx0PSJzaGFwZSIvPgo8ZmVHYXVzc2lhbkJsdXIgc3RkRGV2aWF0aW9uPSI1MCIgcmVzdWx0PSJlZmZlY3QxX2ZvcmVncm91bmRCbHVyXzQ5M18xMDEzNCIvPgo8L2ZpbHRlcj4KPHJhZGlhbEdyYWRpZW50IGlkPSJwYWludDBfcmFkaWFsXzQ5M18xMDEzNCIgY3g9IjAiIGN5PSIwIiByPSIxIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgZ3JhZGllbnRUcmFuc2Zvcm09InRyYW5zbGF0ZSg3MjIuMTI4IDgzOS4wMikgcm90YXRlKDkwKSBzY2FsZSg0ODEuNDE5KSI+CjxzdG9wIHN0b3AtY29sb3I9IiNGRjFBNkMiLz4KPHN0b3Agb2Zmc2V0PSIxIiBzdG9wLWNvbG9yPSIjRkYxQTZDIiBzdG9wLW9wYWNpdHk9IjAiLz4KPC9yYWRpYWxHcmFkaWVudD4KPHJhZGlhbEdyYWRpZW50IGlkPSJwYWludDFfcmFkaWFsXzQ5M18xMDEzNCIgY3g9IjAiIGN5PSIwIiByPSIxIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgZ3JhZGllbnRUcmFuc2Zvcm09InRyYW5zbGF0ZSg0NzAuMzMzIDU3MC4zMzMpIHJvdGF0ZSg5MCkgc2NhbGUoNDcwLjMzMykiPgo8c3RvcCBzdG9wLWNvbG9yPSIjM0FBQ0ZGIi8+CjxzdG9wIG9mZnNldD0iMSIgc3RvcC1jb2xvcj0iIzNBOTVGRiIgc3RvcC1vcGFjaXR5PSIwIi8+CjwvcmFkaWFsR3JhZGllbnQ+CjxyYWRpYWxHcmFkaWVudCBpZD0icGFpbnQyX3JhZGlhbF80OTNfMTAxMzQiIGN4PSIwIiBjeT0iMCIgcj0iMSIgZ3JhZGllbnRVbml0cz0idXNlclNwYWNlT25Vc2UiIGdyYWRpZW50VHJhbnNmb3JtPSJ0cmFuc2xhdGUoNjkxLjUxMSA1MjIuMjk3KSByb3RhdGUoOTApIHNjYWxlKDMzMS41MDMpIj4KPHN0b3Agc3RvcC1jb2xvcj0iIzQ4M0FGRiIvPgo8c3RvcCBvZmZzZXQ9IjEiIHN0b3AtY29sb3I9IiM0ODNBRkYiIHN0b3Atb3BhY2l0eT0iMCIvPgo8L3JhZGlhbEdyYWRpZW50Pgo8cmFkaWFsR3JhZGllbnQgaWQ9InBhaW50M19yYWRpYWxfNDkzXzEwMTM0IiBjeD0iMCIgY3k9IjAiIHI9IjEiIGdyYWRpZW50VW5pdHM9InVzZXJTcGFjZU9uVXNlIiBncmFkaWVudFRyYW5zZm9ybT0idHJhbnNsYXRlKDYwOC4yNDQgMTA3OS45Nykgcm90YXRlKDkwKSBzY2FsZSgzMzEuNTAzKSI+CjxzdG9wIHN0b3AtY29sb3I9IiNGRkM4M0EiLz4KPHN0b3Agb2Zmc2V0PSIxIiBzdG9wLWNvbG9yPSIjRkZDODNBIiBzdG9wLW9wYWNpdHk9IjAiLz4KPC9yYWRpYWxHcmFkaWVudD4KPC9kZWZzPgo8L3N2Zz4K')">
 | 
				
			||||||
            @if (loginMode == 2)
 | 
					            @if (loginMode == 2)
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                <RadzenText TextStyle="TextStyle.H6" class="rz-color-white">操作人:@globalStateService.Operator?.NickName</RadzenText>
 | 
					                <RadzenText TextStyle="TextStyle.H6" class="rz-color-white">@myText.Operator:@globalStateService.Operator?.NickName</RadzenText>
 | 
				
			||||||
                <RadzenText TextStyle="TextStyle.H6" class="rz-color-white">复核人:@globalStateService.Reviewer?.NickName</RadzenText>
 | 
					                <RadzenText TextStyle="TextStyle.H6" class="rz-color-white">@myText.Checker:@globalStateService.Reviewer?.NickName</RadzenText>
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        </RadzenCard>
 | 
					        </RadzenCard>
 | 
				
			||||||
    </RadzenColumn>
 | 
					    </RadzenColumn>
 | 
				
			||||||
    <RadzenColumn Size="12" SizeMD="7">
 | 
					    <RadzenColumn Size="12" SizeMD="7">
 | 
				
			||||||
        <RadzenCard Class="rz-shadow-0 rz-border-radius-0 rz-p-12" Style="width:100%;height:100%">
 | 
					        <RadzenCard Class="rz-shadow-0 rz-border-radius-0 rz-p-12" Style="width:100%;height:100%">
 | 
				
			||||||
            <RadzenText TextStyle="TextStyle.H5" TagName="TagName.H2" class="rz-mb-6">
 | 
					            <RadzenText TextStyle="TextStyle.H5" TagName="TagName.H2" class="rz-mb-6">
 | 
				
			||||||
                登录
 | 
					                @myText.Login
 | 
				
			||||||
            </RadzenText>
 | 
					            </RadzenText>
 | 
				
			||||||
            <RadzenTemplateForm Data="@loginModel" Submit="@((Pojo.User args) => { Submit(args); })" Style="width:100%;height:100%">
 | 
					            <RadzenTemplateForm Data="@loginModel" Submit="@((Pojo.User args) => { Submit(args); })" Style="width:100%;height:100%">
 | 
				
			||||||
                <div class="rz-form-row">
 | 
					                <div class="rz-form-row">
 | 
				
			||||||
                    <label class="rz-label" for="username">账号</label>
 | 
					                    <label class="rz-label" for="username">@myText.Account</label>
 | 
				
			||||||
                    <div class="rz-form-input-wrapper">
 | 
					                    <div class="rz-form-input-wrapper">
 | 
				
			||||||
                        <!--@onfocusin="@(() => Util.VirtualKeyboardHelper.ShowVirtualKeyboard())"-->
 | 
					                        <!--@onfocusin="@(() => Util.VirtualKeyboardHelper.ShowVirtualKeyboard())"-->
 | 
				
			||||||
                        <RadzenTextBox id="username" Name="Username" @bind-Value="@loginModel.Username"  Style="width:100%" />
 | 
					                        <RadzenTextBox id="username" Name="Username" @bind-Value="@loginModel.Username"  Style="width:100%" />
 | 
				
			||||||
                        <RadzenRequiredValidator Component="Username" Text="请填写用户名" />
 | 
					                        <RadzenRequiredValidator Component="Username" Text=@myText.loginTips1 />
 | 
				
			||||||
                    </div>
 | 
					                    </div>
 | 
				
			||||||
                </div>
 | 
					                </div>
 | 
				
			||||||
                <div class="rz-form-row">
 | 
					                <div class="rz-form-row">
 | 
				
			||||||
                    <label class="rz-label" for="password">密码</label>
 | 
					                    <label class="rz-label" for="password">@myText.Password</label>
 | 
				
			||||||
                    <div class="rz-form-input-wrapper">
 | 
					                    <div class="rz-form-input-wrapper">
 | 
				
			||||||
                        <RadzenPassword id="password" Name="Password" @bind-Value="@loginModel.Password" Style="width:100%" />
 | 
					                        <RadzenPassword id="password" Name="Password" @bind-Value="@loginModel.Password" Style="width:100%" />
 | 
				
			||||||
                        <RadzenRequiredValidator Component="Password" Text="请填写密码" />
 | 
					                        <RadzenRequiredValidator Component="Password" Text=@myText.loginTips2 />
 | 
				
			||||||
                    </div>
 | 
					                    </div>
 | 
				
			||||||
                </div>
 | 
					                </div>
 | 
				
			||||||
                <div class="rz-form-row">
 | 
					                <div class="rz-form-row">
 | 
				
			||||||
                    <label class="rz-label"></label>
 | 
					                    <label class="rz-label"></label>
 | 
				
			||||||
                    <div class="rz-form-input-wrapper rz-login-buttons">
 | 
					                    <div class="rz-form-input-wrapper rz-login-buttons">
 | 
				
			||||||
                        <RadzenButton Style="background:#255dd4;color:white;width:110px" ButtonType="ButtonType.Submit" Text="登录" />
 | 
					                        <RadzenButton Style="background:#255dd4;color:white;width:110px" ButtonType="ButtonType.Submit" Text=@myText.Login />
 | 
				
			||||||
                        <RadzenButton Style="border-color:#255dd4;width:110px" Variant="Variant.Outlined" Text="取消" Click="@Exit" />
 | 
					                        <RadzenButton Style="border-color:#255dd4;width:110px" Variant="Variant.Outlined" Text=@myText.Cancel Click="@Exit" />
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                    </div>
 | 
					                    </div>
 | 
				
			||||||
                </div>
 | 
					                </div>
 | 
				
			||||||
| 
						 | 
					@ -69,6 +69,8 @@
 | 
				
			||||||
    @inject Microsoft.Extensions.Options.IOptions<Pojo.Config.SettingConfig> setting;
 | 
					    @inject Microsoft.Extensions.Options.IOptions<Pojo.Config.SettingConfig> setting;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    @inject Toolbelt.Blazor.I18nText.I18nText I18nText;
 | 
				
			||||||
 | 
					    private I18nText.local myText = new I18nText.local();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    private readonly ILog logger = LogManager.GetLogger(typeof(LoginDialog));
 | 
					    private readonly ILog logger = LogManager.GetLogger(typeof(LoginDialog));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -81,14 +83,15 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    private Pojo.User loginModel = new();
 | 
					    private Pojo.User loginModel = new();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    protected override Task OnInitializedAsync()
 | 
					    protected override async Task OnInitializedAsync()
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
 | 
					        myText = await I18nText.GetTextTableAsync<I18nText.local>(this);
 | 
				
			||||||
        FingerprintUtil.axCZKEM1.OnAttTransactionEx += axCZKEM1_OnAttTransactionEx;
 | 
					        FingerprintUtil.axCZKEM1.OnAttTransactionEx += axCZKEM1_OnAttTransactionEx;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        loginMode = setting.Value.loginMode;
 | 
					        loginMode = setting.Value.loginMode;
 | 
				
			||||||
        opFirst = setting.Value.opFirst;
 | 
					        opFirst = setting.Value.opFirst;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        return base.OnInitializedAsync();
 | 
					        base.OnInitializedAsync();
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    private void SetUser(Pojo.User user)
 | 
					    private void SetUser(Pojo.User user)
 | 
				
			||||||
| 
						 | 
					@ -109,7 +112,6 @@
 | 
				
			||||||
                        FingerprintUtil.axCZKEM1.OnAttTransactionEx -= axCZKEM1_OnAttTransactionEx;
 | 
					                        FingerprintUtil.axCZKEM1.OnAttTransactionEx -= axCZKEM1_OnAttTransactionEx;
 | 
				
			||||||
                        globalStateService.Reviewer = user;
 | 
					                        globalStateService.Reviewer = user;
 | 
				
			||||||
                        logger.Info($"双人登录模式:操作人【{globalStateService.Operator.NickName}】复核人【{user.NickName}】登录");
 | 
					                        logger.Info($"双人登录模式:操作人【{globalStateService.Operator.NickName}】复核人【{user.NickName}】登录");
 | 
				
			||||||
                        PortUtil.mouseClickTime = DateTime.Now;
 | 
					 | 
				
			||||||
                        dialogService.Close(true);
 | 
					                        dialogService.Close(true);
 | 
				
			||||||
                    }
 | 
					                    }
 | 
				
			||||||
                    else
 | 
					                    else
 | 
				
			||||||
| 
						 | 
					@ -138,7 +140,6 @@
 | 
				
			||||||
                        FingerprintUtil.axCZKEM1.OnAttTransactionEx -= axCZKEM1_OnAttTransactionEx;
 | 
					                        FingerprintUtil.axCZKEM1.OnAttTransactionEx -= axCZKEM1_OnAttTransactionEx;
 | 
				
			||||||
                        globalStateService.Operator = user;
 | 
					                        globalStateService.Operator = user;
 | 
				
			||||||
                        logger.Info($"双人登录模式:操作人【{user.NickName}】复核人【{globalStateService.Reviewer.NickName}】登录");
 | 
					                        logger.Info($"双人登录模式:操作人【{user.NickName}】复核人【{globalStateService.Reviewer.NickName}】登录");
 | 
				
			||||||
                        PortUtil.mouseClickTime = DateTime.Now;
 | 
					 | 
				
			||||||
                        dialogService.Close(true);
 | 
					                        dialogService.Close(true);
 | 
				
			||||||
                    }
 | 
					                    }
 | 
				
			||||||
                    else
 | 
					                    else
 | 
				
			||||||
| 
						 | 
					@ -163,7 +164,6 @@
 | 
				
			||||||
            FingerprintUtil.axCZKEM1.OnAttTransactionEx -= axCZKEM1_OnAttTransactionEx;
 | 
					            FingerprintUtil.axCZKEM1.OnAttTransactionEx -= axCZKEM1_OnAttTransactionEx;
 | 
				
			||||||
            globalStateService.Operator = user;
 | 
					            globalStateService.Operator = user;
 | 
				
			||||||
            logger.Info($"单人登录模式:用户【{user.NickName}】登录");
 | 
					            logger.Info($"单人登录模式:用户【{user.NickName}】登录");
 | 
				
			||||||
            PortUtil.mouseClickTime = DateTime.Now;
 | 
					 | 
				
			||||||
            dialogService.Close(true);
 | 
					            dialogService.Close(true);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -7,7 +7,7 @@
 | 
				
			||||||
    <div class="top-row px-4">
 | 
					    <div class="top-row px-4">
 | 
				
			||||||
        <RadzenButton Icon="account_circle" Style="margin-left: auto;" Click="@SaveMethod">
 | 
					        <RadzenButton Icon="account_circle" Style="margin-left: auto;" Click="@SaveMethod">
 | 
				
			||||||
            <ChildContent>
 | 
					            <ChildContent>
 | 
				
			||||||
                保存设置
 | 
					                @myText.SaveSet
 | 
				
			||||||
            </ChildContent>
 | 
					            </ChildContent>
 | 
				
			||||||
        </RadzenButton>
 | 
					        </RadzenButton>
 | 
				
			||||||
    </div>
 | 
					    </div>
 | 
				
			||||||
| 
						 | 
					@ -15,11 +15,11 @@
 | 
				
			||||||
        <RadzenCard class="rz-my-6">
 | 
					        <RadzenCard class="rz-my-6">
 | 
				
			||||||
            <RadzenStack Orientation="Orientation.Horizontal" AlignItems="AlignItems.Start" Wrap="FlexWrap.Wrap">
 | 
					            <RadzenStack Orientation="Orientation.Horizontal" AlignItems="AlignItems.Start" Wrap="FlexWrap.Wrap">
 | 
				
			||||||
                <RadzenStack Orientation="Orientation.Vertical" Gap="4px">
 | 
					                <RadzenStack Orientation="Orientation.Vertical" Gap="4px">
 | 
				
			||||||
                    登录模式
 | 
					                    @myText.LoginMode
 | 
				
			||||||
                    <RadzenRadioButtonList Value=@loginValue TValue="int" Change=@(args => loginValue = args)>
 | 
					                    <RadzenRadioButtonList Value=@loginValue TValue="int" Change=@(args => loginValue = args)>
 | 
				
			||||||
                        <Items>
 | 
					                        <Items>
 | 
				
			||||||
                            <RadzenRadioButtonListItem Text="单人登录" Value="1" />
 | 
					                            <RadzenRadioButtonListItem Text="@myText.SingleLogin" Value="1" />
 | 
				
			||||||
                            <RadzenRadioButtonListItem Text="双人登录" Value="2" />
 | 
					                            <RadzenRadioButtonListItem Text="@myText.MultiLogin" Value="2" />
 | 
				
			||||||
                        </Items>
 | 
					                        </Items>
 | 
				
			||||||
                    </RadzenRadioButtonList>
 | 
					                    </RadzenRadioButtonList>
 | 
				
			||||||
                </RadzenStack>
 | 
					                </RadzenStack>
 | 
				
			||||||
| 
						 | 
					@ -33,17 +33,6 @@
 | 
				
			||||||
                    </RadzenRadioButtonList>
 | 
					                    </RadzenRadioButtonList>
 | 
				
			||||||
                </RadzenStack> *@
 | 
					                </RadzenStack> *@
 | 
				
			||||||
            </RadzenStack>
 | 
					            </RadzenStack>
 | 
				
			||||||
            <RadzenStack Orientation="Orientation.Horizontal" AlignItems="AlignItems.Start" Wrap="FlexWrap.Wrap">
 | 
					 | 
				
			||||||
                <RadzenStack Orientation="Orientation.Vertical" Gap="4px">
 | 
					 | 
				
			||||||
                    抽屉报警
 | 
					 | 
				
			||||||
                    <RadzenRadioButtonList Value=@alert TValue="int" Change=@(args => alert = args)>
 | 
					 | 
				
			||||||
                        <Items>
 | 
					 | 
				
			||||||
                            <RadzenRadioButtonListItem Text="开启" Value="1" />
 | 
					 | 
				
			||||||
                            <RadzenRadioButtonListItem Text="关闭" Value="0" />
 | 
					 | 
				
			||||||
                        </Items>
 | 
					 | 
				
			||||||
                    </RadzenRadioButtonList>
 | 
					 | 
				
			||||||
                </RadzenStack>
 | 
					 | 
				
			||||||
            </RadzenStack>
 | 
					 | 
				
			||||||
        </RadzenCard>
 | 
					        </RadzenCard>
 | 
				
			||||||
    </div>
 | 
					    </div>
 | 
				
			||||||
</div>
 | 
					</div>
 | 
				
			||||||
| 
						 | 
					@ -51,33 +40,24 @@
 | 
				
			||||||
@inject Microsoft.Extensions.Options.IOptions<Pojo.Config.setting> setting;
 | 
					@inject Microsoft.Extensions.Options.IOptions<Pojo.Config.setting> setting;
 | 
				
			||||||
@inject Microsoft.Extensions.Options.IOptions<Pojo.Config.SettingConfig> setting;
 | 
					@inject Microsoft.Extensions.Options.IOptions<Pojo.Config.SettingConfig> setting;
 | 
				
			||||||
@inject NotificationService _message
 | 
					@inject NotificationService _message
 | 
				
			||||||
@inject PortUtil PortUtil;
 | 
					@inject Toolbelt.Blazor.I18nText.I18nText I18nText;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@code {
 | 
					@code {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    private I18nText.local myText = new I18nText.local();
 | 
				
			||||||
    private readonly ILog logger = LogManager.GetLogger(typeof(LoginDialog));
 | 
					    private readonly ILog logger = LogManager.GetLogger(typeof(LoginDialog));
 | 
				
			||||||
    int loginValue = 1;
 | 
					    int loginValue = 1;
 | 
				
			||||||
    //报警
 | 
					 | 
				
			||||||
    int alert = 0;
 | 
					 | 
				
			||||||
    // int preValue = 1;
 | 
					    // int preValue = 1;
 | 
				
			||||||
    protected override void OnInitialized()
 | 
					    protected override async Task OnInitializedAsync()
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        loginValue = setting.Value.loginMode;
 | 
					        loginValue = setting.Value.loginMode;
 | 
				
			||||||
        base.OnInitialized();
 | 
					        myText = await I18nText.GetTextTableAsync<I18nText.local>(this);
 | 
				
			||||||
 | 
					        base.OnInitializedAsync();
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    //保存
 | 
					    //保存
 | 
				
			||||||
    async Task SaveMethod()
 | 
					    async Task SaveMethod()
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        //开抽屉时报警状态,发送指令
 | 
					 | 
				
			||||||
        if(alert==0)
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
            await PortUtil.AlertClose();
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
        else
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
            await PortUtil.AlertOpen();
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
        // 获取当前工作目录
 | 
					        // 获取当前工作目录
 | 
				
			||||||
        string currentDirectory = Directory.GetCurrentDirectory();
 | 
					        string currentDirectory = Directory.GetCurrentDirectory();
 | 
				
			||||||
        // setting.Value.fridgeState = fridgeStateValue;
 | 
					        // setting.Value.fridgeState = fridgeStateValue;
 | 
				
			||||||
| 
						 | 
					@ -87,11 +67,10 @@
 | 
				
			||||||
        string jsonString = File.ReadAllText(filePath);
 | 
					        string jsonString = File.ReadAllText(filePath);
 | 
				
			||||||
        var jsonNode = JObject.Parse(jsonString);
 | 
					        var jsonNode = JObject.Parse(jsonString);
 | 
				
			||||||
        jsonNode["setting"]["loginMode"] = loginValue;
 | 
					        jsonNode["setting"]["loginMode"] = loginValue;
 | 
				
			||||||
        jsonNode["setting"]["alert"] = alert;
 | 
					 | 
				
			||||||
        var options = new JsonSerializerOptions { WriteIndented = true };
 | 
					        var options = new JsonSerializerOptions { WriteIndented = true };
 | 
				
			||||||
        File.WriteAllText(filePath, jsonNode.ToString(Newtonsoft.Json.Formatting.Indented));
 | 
					        File.WriteAllText(filePath, jsonNode.ToString(Newtonsoft.Json.Formatting.Indented));
 | 
				
			||||||
        _message.Notify(
 | 
					        _message.Notify(
 | 
				
			||||||
              new NotificationMessage { Severity = NotificationSeverity.Success, Summary = "提示", Detail = $"保存成功", Duration = 4000 }
 | 
					              new NotificationMessage { Severity = NotificationSeverity.Success, Summary = myText.Tips, Detail = myText.LoginMode, Duration = 4000 }
 | 
				
			||||||
          );
 | 
					          );
 | 
				
			||||||
        logger.Info($"修改用户登录设置");
 | 
					        logger.Info($"修改用户登录设置");
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -15,31 +15,31 @@
 | 
				
			||||||
                    <RadzenStack Orientation="Orientation.Horizontal" Gap="1rem">
 | 
					                    <RadzenStack Orientation="Orientation.Horizontal" Gap="1rem">
 | 
				
			||||||
                        <RadzenRow AlignItems="AlignItems.Center">
 | 
					                        <RadzenRow AlignItems="AlignItems.Center">
 | 
				
			||||||
                            <RadzenColumn Size="4">
 | 
					                            <RadzenColumn Size="4">
 | 
				
			||||||
                                <RadzenLabel Text="开始时间" Component="Start" />
 | 
					                                <RadzenLabel Text="@myText.StartDate" Component="Start" />
 | 
				
			||||||
                            </RadzenColumn>
 | 
					                            </RadzenColumn>
 | 
				
			||||||
                            <RadzenColumn Size="8">
 | 
					                            <RadzenColumn Size="8">
 | 
				
			||||||
                                <RadzenDatePicker DateFormat="yyyy-MM-dd" @bind-Value="start" Style="width: 100%;" Name="Start" />
 | 
					                                <RadzenDatePicker DateFormat="yyyy-MM-dd HH:mm:ss" ShowTime="true" @bind-Value="start" Style="width: 100%;" Name="Start" />
 | 
				
			||||||
                            </RadzenColumn>
 | 
					                            </RadzenColumn>
 | 
				
			||||||
                        </RadzenRow>
 | 
					                        </RadzenRow>
 | 
				
			||||||
                        <RadzenRow AlignItems="AlignItems.Center">
 | 
					                        <RadzenRow AlignItems="AlignItems.Center">
 | 
				
			||||||
                            <RadzenColumn Size="4">
 | 
					                            <RadzenColumn Size="4">
 | 
				
			||||||
                                <RadzenLabel Text="结束时间" Component="End" />
 | 
					                                <RadzenLabel Text="@myText.EndDate" Component="End" />
 | 
				
			||||||
                            </RadzenColumn>
 | 
					                            </RadzenColumn>
 | 
				
			||||||
                            <RadzenColumn Size="8">
 | 
					                            <RadzenColumn Size="8">
 | 
				
			||||||
                                <RadzenDatePicker DateFormat="yyyy-MM-dd" @bind-Value="end" Style="width: 100%;" Name="End" />
 | 
					                                <RadzenDatePicker DateFormat="yyyy-MM-dd HH:mm:ss" ShowTime="true" @bind-Value="end" Style="width: 100%;" Name="End" />
 | 
				
			||||||
                            </RadzenColumn>
 | 
					                            </RadzenColumn>
 | 
				
			||||||
                        </RadzenRow>
 | 
					                        </RadzenRow>
 | 
				
			||||||
                    
 | 
					                    
 | 
				
			||||||
                        <RadzenRow AlignItems="AlignItems.Center">
 | 
					                        <RadzenRow AlignItems="AlignItems.Center">
 | 
				
			||||||
                            <RadzenColumn Size="12">
 | 
					                            <RadzenColumn Size="12">
 | 
				
			||||||
                                <RadzenButton Size="ButtonSize.Large" ButtonType="ButtonType.Submit" IsBusy="isLoading" Icon="search" Text="查询" />
 | 
					                                <RadzenButton Size="ButtonSize.Large" ButtonType="ButtonType.Submit" IsBusy="isLoading" Icon="search" Text="@myText.Search" />
 | 
				
			||||||
                                <RadzenButton Size="ButtonSize.Large" Click="reloadGrid" IsBusy="isLoading" Icon="refresh" Text="重置" ButtonStyle="ButtonStyle.Warning" />
 | 
					                                <RadzenButton Size="ButtonSize.Large" Click="reloadGrid" IsBusy="isLoading" Icon="refresh" Text="@myText.Restore" ButtonStyle="ButtonStyle.Warning" />
 | 
				
			||||||
                            </RadzenColumn>
 | 
					                            </RadzenColumn>
 | 
				
			||||||
                        </RadzenRow>
 | 
					                        </RadzenRow>
 | 
				
			||||||
                        @* <RadzenRow AlignItems="AlignItems.Center">
 | 
					                        <RadzenRow AlignItems="AlignItems.Center">
 | 
				
			||||||
                            <RadzenButton Icon="download" Text="库存导出" Variant="Variant.Outlined" Click="StockExport" />
 | 
					                            <RadzenButton Icon="download" Text="@myText.StoreExport" Variant="Variant.Outlined" Click="StockExport" />
 | 
				
			||||||
                            <RadzenButton Icon="download" Text="专用账册导出" Variant="Variant.Outlined" Click="AccountBookExport" />
 | 
					                            <RadzenButton Icon="download" Text="@myText.AccountExport" Variant="Variant.Outlined" Click="AccountBookExport" />
 | 
				
			||||||
                        </RadzenRow> *@
 | 
					                        </RadzenRow>
 | 
				
			||||||
                    </RadzenStack>
 | 
					                    </RadzenStack>
 | 
				
			||||||
                </RadzenFieldset>
 | 
					                </RadzenFieldset>
 | 
				
			||||||
            </form>
 | 
					            </form>
 | 
				
			||||||
| 
						 | 
					@ -50,24 +50,24 @@
 | 
				
			||||||
                    LoadData="@LoadData"
 | 
					                    LoadData="@LoadData"
 | 
				
			||||||
                    IsLoading="@isLoading"
 | 
					                    IsLoading="@isLoading"
 | 
				
			||||||
                    Count="@count"
 | 
					                    Count="@count"
 | 
				
			||||||
                    EmptyText="无数据"
 | 
					                    EmptyText="@myText.NoDate"
 | 
				
			||||||
                    Data="@_forecasts"
 | 
					                    Data="@_forecasts"
 | 
				
			||||||
                    AllowColumnResize="true" AllowAlternatingRows="false"
 | 
					                    AllowColumnResize="true" AllowAlternatingRows="false"
 | 
				
			||||||
                    SelectionMode="DataGridSelectionMode.Single"
 | 
					                    SelectionMode="DataGridSelectionMode.Single"
 | 
				
			||||||
                    AllowPaging="true" PageSize="10" PagerHorizontalAlign="HorizontalAlign.Left" ShowPagingSummary="true" PagingSummaryFormat="{0}/{1} ¹²{2}ÌõÊý¾Ý">
 | 
					                    AllowPaging="true" PageSize="10" PagerHorizontalAlign="HorizontalAlign.Left" ShowPagingSummary="true" PagingSummaryFormat="{0}/{1} ¹²{2}ÌõÊý¾Ý">
 | 
				
			||||||
                    <Columns>
 | 
					                    <Columns>
 | 
				
			||||||
                        <RadzenDataGridColumn Frozen="true" Title="操作人" Property="OperatorUser.NickName"></RadzenDataGridColumn>
 | 
					                    <RadzenDataGridColumn Frozen="true" Title="@myText.Operator" Property="OperatorUser.NickName"></RadzenDataGridColumn>
 | 
				
			||||||
                        <RadzenDataGridColumn Width="170px" Title="操作时间" Property="OperationTime"></RadzenDataGridColumn>
 | 
					                    <RadzenDataGridColumn Width="170px" Title="@myText.OperateDate" Property="OperationTime"></RadzenDataGridColumn>
 | 
				
			||||||
                        <RadzenDataGridColumn Width="200px" Title="药品名称" Property="Drug.DrugName"></RadzenDataGridColumn>
 | 
					                        <RadzenDataGridColumn Width="200px" Title="@myText.DrugName" Property="Drug.DrugName"></RadzenDataGridColumn>
 | 
				
			||||||
                        <RadzenDataGridColumn Title="规格" Property="Drug.DrugSpec"></RadzenDataGridColumn>
 | 
					                        <RadzenDataGridColumn Title="@myText.Spec" Property="Drug.DrugSpec"></RadzenDataGridColumn>
 | 
				
			||||||
                        <RadzenDataGridColumn Title="数量" Property="Quantity"></RadzenDataGridColumn>
 | 
					                        <RadzenDataGridColumn Title="@myText.Quantity" Property="Quantity"></RadzenDataGridColumn>
 | 
				
			||||||
                        <RadzenDataGridColumn Title="批次" Property="ManuNo"></RadzenDataGridColumn>
 | 
					                        <RadzenDataGridColumn Title="@myText.Batch" Property="ManuNo"></RadzenDataGridColumn>
 | 
				
			||||||
                        <RadzenDataGridColumn Title="效期" Property="EffDate">
 | 
					                        <RadzenDataGridColumn Title="@myText.Expiration" Property="EffDate">
 | 
				
			||||||
                            <Template Context="mr">
 | 
					                            <Template Context="mr">
 | 
				
			||||||
                                @mr.EffDate?.ToString("yyyy-MM-dd")
 | 
					                                @mr.EffDate?.ToString("yyyy-MM-dd")
 | 
				
			||||||
                            </Template>
 | 
					                            </Template>
 | 
				
			||||||
                        </RadzenDataGridColumn>
 | 
					                        </RadzenDataGridColumn>
 | 
				
			||||||
                        <RadzenDataGridColumn title="库位" Property="Location"></RadzenDataGridColumn>
 | 
					                    <RadzenDataGridColumn title="@myText.StorageLocation" Property="Location"></RadzenDataGridColumn>
 | 
				
			||||||
                    </Columns>
 | 
					                    </Columns>
 | 
				
			||||||
                </RadzenDataGrid>
 | 
					                </RadzenDataGrid>
 | 
				
			||||||
        </div>
 | 
					        </div>
 | 
				
			||||||
| 
						 | 
					@ -79,6 +79,8 @@
 | 
				
			||||||
    @inject DialogService dialogService;
 | 
					    @inject DialogService dialogService;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    @inject NavigationManager navigate;
 | 
					    @inject NavigationManager navigate;
 | 
				
			||||||
 | 
					    @inject Toolbelt.Blazor.I18nText.I18nText I18nText;
 | 
				
			||||||
 | 
					    private I18nText.local myText = new I18nText.local();
 | 
				
			||||||
    RadzenDataGrid<MachineRecord> grid;
 | 
					    RadzenDataGrid<MachineRecord> grid;
 | 
				
			||||||
    bool isLoading;
 | 
					    bool isLoading;
 | 
				
			||||||
    int count;
 | 
					    int count;
 | 
				
			||||||
| 
						 | 
					@ -96,6 +98,11 @@
 | 
				
			||||||
            reloadGrid();
 | 
					            reloadGrid();
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					    protected override async Task OnInitializedAsync()
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        myText = await I18nText.GetTextTableAsync<I18nText.local>(this);
 | 
				
			||||||
 | 
					        base.OnInitializedAsync();
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
    async Task LoadData(LoadDataArgs args)
 | 
					    async Task LoadData(LoadDataArgs args)
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        isLoading = true;
 | 
					        isLoading = true;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -102,8 +102,6 @@
 | 
				
			||||||
    async Task OpenDrawer()
 | 
					    async Task OpenDrawer()
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        this.status = 1;
 | 
					        this.status = 1;
 | 
				
			||||||
        PortUtil.PowerOn();
 | 
					 | 
				
			||||||
        await Task.Delay(200);
 | 
					 | 
				
			||||||
        // 解析需要打开的抽屉列表
 | 
					        // 解析需要打开的抽屉列表
 | 
				
			||||||
        List<OrderTakeVo> drawerNos = this.data.GroupBy(it => it.ChannelStock.DrawerNo).Select(it => it.First()).ToList();
 | 
					        List<OrderTakeVo> drawerNos = this.data.GroupBy(it => it.ChannelStock.DrawerNo).Select(it => it.First()).ToList();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -172,7 +170,7 @@
 | 
				
			||||||
                            new NotificationMessage { Severity = NotificationSeverity.Error, Summary = "提示", Detail = $"抽屉【{drawerNo}】打开失败,请检测硬件", Duration = 4000 }
 | 
					                            new NotificationMessage { Severity = NotificationSeverity.Error, Summary = "提示", Detail = $"抽屉【{drawerNo}】打开失败,请检测硬件", Duration = 4000 }
 | 
				
			||||||
                        );
 | 
					                        );
 | 
				
			||||||
                            logger.Info($"抽屉打开失败");
 | 
					                            logger.Info($"抽屉打开失败");
 | 
				
			||||||
                            PortUtil.PowerOff();
 | 
					                            PortUtil.AllLightOff();
 | 
				
			||||||
                            RestData();
 | 
					                            RestData();
 | 
				
			||||||
                            stop();
 | 
					                            stop();
 | 
				
			||||||
                        }
 | 
					                        }
 | 
				
			||||||
| 
						 | 
					@ -195,7 +193,7 @@
 | 
				
			||||||
                                }
 | 
					                                }
 | 
				
			||||||
                            });
 | 
					                            });
 | 
				
			||||||
                            orderTakeVo.Status = 2;
 | 
					                            orderTakeVo.Status = 2;
 | 
				
			||||||
                            PortUtil.PowerOff();
 | 
					                            PortUtil.AllLightOff();
 | 
				
			||||||
                            if (options._data == drawerNos.Count - 1)
 | 
					                            if (options._data == drawerNos.Count - 1)
 | 
				
			||||||
                            {
 | 
					                            {
 | 
				
			||||||
                                PortUtil.speechSynthesizer.SpeakAsyncCancelAll();
 | 
					                                PortUtil.speechSynthesizer.SpeakAsyncCancelAll();
 | 
				
			||||||
| 
						 | 
					@ -279,18 +277,15 @@
 | 
				
			||||||
            );
 | 
					            );
 | 
				
			||||||
                if (setting.Value.single.Contains(drawerNo))
 | 
					                if (setting.Value.single.Contains(drawerNo))
 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
                    PortUtil.PowerOff();
 | 
					                    PortUtil.AllLightOff();
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
                stop();
 | 
					                stop();
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        });
 | 
					        });
 | 
				
			||||||
 | 
					 | 
				
			||||||
        PortUtil.PowerOff();
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    void RestData()
 | 
					    void RestData()
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        PortUtil.PowerOff();
 | 
					 | 
				
			||||||
        PortUtil.speechSynthesizer.SpeakAsyncCancelAll();
 | 
					        PortUtil.speechSynthesizer.SpeakAsyncCancelAll();
 | 
				
			||||||
        this.status = 0;
 | 
					        this.status = 0;
 | 
				
			||||||
        data.ForEach(it =>
 | 
					        data.ForEach(it =>
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -168,7 +168,7 @@
 | 
				
			||||||
                        new NotificationMessage { Severity = NotificationSeverity.Error, Summary = "提示", Detail = $"抽屉【{drawerNo}】打开失败,请检测硬件", Duration = 4000 }
 | 
					                        new NotificationMessage { Severity = NotificationSeverity.Error, Summary = "提示", Detail = $"抽屉【{drawerNo}】打开失败,请检测硬件", Duration = 4000 }
 | 
				
			||||||
                    );
 | 
					                    );
 | 
				
			||||||
                        logger.Info($"处方退药抽屉【{drawerNo}】打开失败");
 | 
					                        logger.Info($"处方退药抽屉【{drawerNo}】打开失败");
 | 
				
			||||||
                        PortUtil.PowerOff();
 | 
					                        PortUtil.AllLightOff();
 | 
				
			||||||
                        RestData();
 | 
					                        RestData();
 | 
				
			||||||
                        stop();
 | 
					                        stop();
 | 
				
			||||||
                    }
 | 
					                    }
 | 
				
			||||||
| 
						 | 
					@ -184,7 +184,7 @@
 | 
				
			||||||
                        options._data = 0;
 | 
					                        options._data = 0;
 | 
				
			||||||
                        if (setting.Value.single.Contains(drawerNo))
 | 
					                        if (setting.Value.single.Contains(drawerNo))
 | 
				
			||||||
                        {
 | 
					                        {
 | 
				
			||||||
                            PortUtil.PowerOff();
 | 
					                            PortUtil.AllLightOff();
 | 
				
			||||||
                        }
 | 
					                        }
 | 
				
			||||||
                        if (index == drawerNos.Count - 1)
 | 
					                        if (index == drawerNos.Count - 1)
 | 
				
			||||||
                        {
 | 
					                        {
 | 
				
			||||||
| 
						 | 
					@ -232,7 +232,7 @@
 | 
				
			||||||
        );
 | 
					        );
 | 
				
			||||||
            if (setting.Value.single.Contains(drawerNo))
 | 
					            if (setting.Value.single.Contains(drawerNo))
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                PortUtil.PowerOff();
 | 
					                PortUtil.AllLightOff();
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            stop();
 | 
					            stop();
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
| 
						 | 
					@ -241,7 +241,6 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    void RestData()
 | 
					    void RestData()
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        PortUtil.PowerOff();
 | 
					 | 
				
			||||||
        PortUtil.speechSynthesizer.SpeakAsyncCancelAll();
 | 
					        PortUtil.speechSynthesizer.SpeakAsyncCancelAll();
 | 
				
			||||||
        this.status = 0;
 | 
					        this.status = 0;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -6,11 +6,11 @@
 | 
				
			||||||
        <div class="col-12 mb-4">
 | 
					        <div class="col-12 mb-4">
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            <form onsubmit="@(() => grid.Reload())">
 | 
					            <form onsubmit="@(() => grid.Reload())">
 | 
				
			||||||
                <RadzenFieldset Text="查询">
 | 
					                <RadzenFieldset Text="@myText.Search">
 | 
				
			||||||
                    <RadzenStack Orientation="Orientation.Horizontal" Gap="1rem">
 | 
					                    <RadzenStack Orientation="Orientation.Horizontal" Gap="1rem">
 | 
				
			||||||
                        <RadzenRow AlignItems="AlignItems.Center">
 | 
					                        <RadzenRow AlignItems="AlignItems.Center">
 | 
				
			||||||
                            <RadzenColumn Size="4">
 | 
					                            <RadzenColumn Size="4">
 | 
				
			||||||
                                <RadzenLabel Text="处方号" Component="OrderNo" />
 | 
					                                <RadzenLabel Text="@myText.OrderNo" Component="OrderNo" />
 | 
				
			||||||
                            </RadzenColumn>
 | 
					                            </RadzenColumn>
 | 
				
			||||||
                            <RadzenColumn Size="8">
 | 
					                            <RadzenColumn Size="8">
 | 
				
			||||||
                                <RadzenTextBox @bind-Value="OrderNo" Style="width: 100%;" Name="OrderNo"></RadzenTextBox>
 | 
					                                <RadzenTextBox @bind-Value="OrderNo" Style="width: 100%;" Name="OrderNo"></RadzenTextBox>
 | 
				
			||||||
| 
						 | 
					@ -18,7 +18,7 @@
 | 
				
			||||||
                        </RadzenRow>
 | 
					                        </RadzenRow>
 | 
				
			||||||
                        <RadzenRow AlignItems="AlignItems.Center">
 | 
					                        <RadzenRow AlignItems="AlignItems.Center">
 | 
				
			||||||
                            <RadzenColumn Size="4">
 | 
					                            <RadzenColumn Size="4">
 | 
				
			||||||
                                <RadzenLabel Text="处方时间" Component="OrderDate" />
 | 
					                                <RadzenLabel Text="@myText.OrderDate" Component="OrderDate" />
 | 
				
			||||||
                            </RadzenColumn>
 | 
					                            </RadzenColumn>
 | 
				
			||||||
                            <RadzenColumn Size="8">
 | 
					                            <RadzenColumn Size="8">
 | 
				
			||||||
                                <RadzenDatePicker DateFormat="yyyy-MM-dd" CurrentDateChanged="@OnCurrentDateChanged" @bind-Value="OrderDate" Style="width: 100%;" Name="OrderDate" />
 | 
					                                <RadzenDatePicker DateFormat="yyyy-MM-dd" CurrentDateChanged="@OnCurrentDateChanged" @bind-Value="OrderDate" Style="width: 100%;" Name="OrderDate" />
 | 
				
			||||||
| 
						 | 
					@ -27,8 +27,8 @@
 | 
				
			||||||
                    
 | 
					                    
 | 
				
			||||||
                        <RadzenRow AlignItems="AlignItems.Center">
 | 
					                        <RadzenRow AlignItems="AlignItems.Center">
 | 
				
			||||||
                            <RadzenColumn Size="12">
 | 
					                            <RadzenColumn Size="12">
 | 
				
			||||||
                                <RadzenButton Size="ButtonSize.Medium" ButtonType="ButtonType.Submit" IsBusy="isLoading" Icon="search"  Text="查询" />
 | 
					                                <RadzenButton Size="ButtonSize.Medium" ButtonType="ButtonType.Submit" IsBusy="isLoading" Icon="search"  Text="@myText.Search" />
 | 
				
			||||||
                                <RadzenButton Size="ButtonSize.Medium" Click="reloadGrid" IsBusy="isLoading" Icon="refresh" Text="重置" ButtonStyle="ButtonStyle.Warning" />
 | 
					                                <RadzenButton Size="ButtonSize.Medium" Click="reloadGrid" IsBusy="isLoading" Icon="refresh" Text="@myText.Restore" ButtonStyle="ButtonStyle.Warning" />
 | 
				
			||||||
                            </RadzenColumn>
 | 
					                            </RadzenColumn>
 | 
				
			||||||
                        </RadzenRow>
 | 
					                        </RadzenRow>
 | 
				
			||||||
                    </RadzenStack>
 | 
					                    </RadzenStack>
 | 
				
			||||||
| 
						 | 
					@ -42,20 +42,20 @@
 | 
				
			||||||
                    RowSelect="@((OrderInfo oi) => { OrderSelected(oi); })"
 | 
					                    RowSelect="@((OrderInfo oi) => { OrderSelected(oi); })"
 | 
				
			||||||
                    IsLoading="@isLoading"
 | 
					                    IsLoading="@isLoading"
 | 
				
			||||||
                    Count="@count"
 | 
					                    Count="@count"
 | 
				
			||||||
                    EmptyText="无数据"
 | 
					                    EmptyText="@myText.NoDate"
 | 
				
			||||||
                    Data="@_forecasts"
 | 
					                    Data="@_forecasts"
 | 
				
			||||||
                    AllowColumnResize="true" AllowAlternatingRows="false"
 | 
					                    AllowColumnResize="true" AllowAlternatingRows="false"
 | 
				
			||||||
                    SelectionMode="DataGridSelectionMode.Single"
 | 
					                    SelectionMode="DataGridSelectionMode.Single"
 | 
				
			||||||
                    AllowPaging="true" PageSize="10" PagerHorizontalAlign="HorizontalAlign.Left" ShowPagingSummary="true" PagingSummaryFormat="{0}/{1} ¹²{2}ÌõÊý¾Ý">
 | 
					                    AllowPaging="true" PageSize="10" PagerHorizontalAlign="HorizontalAlign.Left" ShowPagingSummary="true" PagingSummaryFormat="{0}/{1} ¹²{2}ÌõÊý¾Ý">
 | 
				
			||||||
                    <Columns>
 | 
					                    <Columns>
 | 
				
			||||||
                        <RadzenDataGridColumn Frozen="true" Title="处方号" Property="OrderNo"></RadzenDataGridColumn>
 | 
					                        <RadzenDataGridColumn Frozen="true" Title="@myText.OrderNo" Property="OrderNo"></RadzenDataGridColumn>
 | 
				
			||||||
                        <RadzenDataGridColumn Width="170px" Title="开方时间" Property="OrderDate"></RadzenDataGridColumn>
 | 
					                    <RadzenDataGridColumn Width="170px" Title="@myText.OrderDate" Property="OrderDate"></RadzenDataGridColumn>
 | 
				
			||||||
                        <RadzenDataGridColumn Title="医生" Property="DoctorName"></RadzenDataGridColumn>
 | 
					                        <RadzenDataGridColumn Title="@myText.Doctor" Property="DoctorName"></RadzenDataGridColumn>
 | 
				
			||||||
                        <RadzenDataGridColumn Title="姓名" Property="PatientName"></RadzenDataGridColumn>
 | 
					                        <RadzenDataGridColumn Title="@myText.Name" Property="PatientName"></RadzenDataGridColumn>
 | 
				
			||||||
                        <RadzenDataGridColumn Title="性别" Property="Sex"></RadzenDataGridColumn>
 | 
					                        <RadzenDataGridColumn Title="@myText.Sex" Property="Sex"></RadzenDataGridColumn>
 | 
				
			||||||
                        <RadzenDataGridColumn Title="年龄" Property="Age"></RadzenDataGridColumn>
 | 
					                        <RadzenDataGridColumn Title="@myText.Age" Property="Age"></RadzenDataGridColumn>
 | 
				
			||||||
                        <RadzenDataGridColumn Title="科室" Property="DeptName"></RadzenDataGridColumn>
 | 
					                        <RadzenDataGridColumn Title="@myText.DeptName" Property="DeptName"></RadzenDataGridColumn>
 | 
				
			||||||
                        <RadzenDataGridColumn Title="诊断" Property="Disease"></RadzenDataGridColumn>
 | 
					                        <RadzenDataGridColumn Title="@myText.Diagnose" Property="Disease"></RadzenDataGridColumn>
 | 
				
			||||||
                    </Columns>
 | 
					                    </Columns>
 | 
				
			||||||
                </RadzenDataGrid>
 | 
					                </RadzenDataGrid>
 | 
				
			||||||
        </div>
 | 
					        </div>
 | 
				
			||||||
| 
						 | 
					@ -65,6 +65,8 @@
 | 
				
			||||||
@code {
 | 
					@code {
 | 
				
			||||||
    @inject IOrderInfoDao orderInfoDao;
 | 
					    @inject IOrderInfoDao orderInfoDao;
 | 
				
			||||||
    @inject DialogService dialogService;
 | 
					    @inject DialogService dialogService;
 | 
				
			||||||
 | 
					    @inject Toolbelt.Blazor.I18nText.I18nText I18nText;
 | 
				
			||||||
 | 
					    private I18nText.local myText = new I18nText.local();
 | 
				
			||||||
    RadzenDataGrid<OrderInfo> grid;
 | 
					    RadzenDataGrid<OrderInfo> grid;
 | 
				
			||||||
    bool isLoading;
 | 
					    bool isLoading;
 | 
				
			||||||
    int count;
 | 
					    int count;
 | 
				
			||||||
| 
						 | 
					@ -111,6 +113,11 @@
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    protected override async Task OnInitializedAsync()
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        myText = await I18nText.GetTextTableAsync<I18nText.local>(this);
 | 
				
			||||||
 | 
					        base.OnInitializedAsync();
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,15 +1,16 @@
 | 
				
			||||||
@page "/take/order"
 | 
					@page "/take/order"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
<div class="container-fluid">
 | 
					<div class="container-fluid">
 | 
				
			||||||
    <div class="row">
 | 
					    <div class="row">
 | 
				
			||||||
        <div class="col-12 mb-4">
 | 
					        <div class="col-12 mb-4">
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            <form onsubmit="@(() => grid.Reload())">
 | 
					            <form onsubmit="@(() => grid.Reload())">
 | 
				
			||||||
                <RadzenFieldset Text="查询">
 | 
					                <RadzenFieldset Text=@myText.Search>
 | 
				
			||||||
                    <RadzenStack Orientation="Orientation.Horizontal" Gap="1rem">
 | 
					                    <RadzenStack Orientation="Orientation.Horizontal" Gap="1rem">
 | 
				
			||||||
                        <RadzenRow AlignItems="AlignItems.Center">
 | 
					                        <RadzenRow AlignItems="AlignItems.Center">
 | 
				
			||||||
                            <RadzenColumn Size="4">
 | 
					                            <RadzenColumn Size="4">
 | 
				
			||||||
                                <RadzenLabel Text="处方号" Component="OrderNo" />
 | 
					                                <RadzenLabel Text=@myText.OrderNo Component="OrderNo" />
 | 
				
			||||||
                            </RadzenColumn>
 | 
					                            </RadzenColumn>
 | 
				
			||||||
                            <RadzenColumn Size="8">
 | 
					                            <RadzenColumn Size="8">
 | 
				
			||||||
                                <RadzenTextBox @bind-Value="OrderNo" Style="width: 100%;" Name="OrderNo"></RadzenTextBox>
 | 
					                                <RadzenTextBox @bind-Value="OrderNo" Style="width: 100%;" Name="OrderNo"></RadzenTextBox>
 | 
				
			||||||
| 
						 | 
					@ -17,7 +18,7 @@
 | 
				
			||||||
                        </RadzenRow>
 | 
					                        </RadzenRow>
 | 
				
			||||||
                        <RadzenRow AlignItems="AlignItems.Center">
 | 
					                        <RadzenRow AlignItems="AlignItems.Center">
 | 
				
			||||||
                            <RadzenColumn Size="4">
 | 
					                            <RadzenColumn Size="4">
 | 
				
			||||||
                                <RadzenLabel Text="处方时间" Component="OrderDate" />
 | 
					                                <RadzenLabel Text=@myText.OrderDate Component="OrderDate" />
 | 
				
			||||||
                            </RadzenColumn>
 | 
					                            </RadzenColumn>
 | 
				
			||||||
                            <RadzenColumn Size="8">
 | 
					                            <RadzenColumn Size="8">
 | 
				
			||||||
                                <RadzenDatePicker DateFormat="yyyy-MM-dd" CurrentDateChanged="@OnCurrentDateChanged" @bind-Value="OrderDate" Style="width: 100%;" Name="OrderDate" />
 | 
					                                <RadzenDatePicker DateFormat="yyyy-MM-dd" CurrentDateChanged="@OnCurrentDateChanged" @bind-Value="OrderDate" Style="width: 100%;" Name="OrderDate" />
 | 
				
			||||||
| 
						 | 
					@ -26,8 +27,8 @@
 | 
				
			||||||
                    
 | 
					                    
 | 
				
			||||||
                        <RadzenRow AlignItems="AlignItems.Center">
 | 
					                        <RadzenRow AlignItems="AlignItems.Center">
 | 
				
			||||||
                            <RadzenColumn Size="12">
 | 
					                            <RadzenColumn Size="12">
 | 
				
			||||||
                                <RadzenButton Size="ButtonSize.Medium" ButtonType="ButtonType.Submit" IsBusy="isLoading" Icon="search"  Text="查询" />
 | 
					                                <RadzenButton Size="ButtonSize.Medium" ButtonType="ButtonType.Submit" IsBusy="isLoading" Icon="search" Text="@myText.Search" />
 | 
				
			||||||
                                <RadzenButton Size="ButtonSize.Medium" Click="reloadGrid" IsBusy="isLoading" Icon="refresh" Text="重置" ButtonStyle="ButtonStyle.Warning" />
 | 
					                                <RadzenButton Size="ButtonSize.Medium" Click="reloadGrid" IsBusy="isLoading" Icon="refresh" Text="@myText.Restore" ButtonStyle="ButtonStyle.Warning" />
 | 
				
			||||||
                            </RadzenColumn>
 | 
					                            </RadzenColumn>
 | 
				
			||||||
                        </RadzenRow>
 | 
					                        </RadzenRow>
 | 
				
			||||||
                    </RadzenStack>
 | 
					                    </RadzenStack>
 | 
				
			||||||
| 
						 | 
					@ -41,20 +42,20 @@
 | 
				
			||||||
                    RowSelect="@((OrderInfo oi) => { OrderSelected(oi); })"
 | 
					                    RowSelect="@((OrderInfo oi) => { OrderSelected(oi); })"
 | 
				
			||||||
                    IsLoading="@isLoading"
 | 
					                    IsLoading="@isLoading"
 | 
				
			||||||
                    Count="@count"
 | 
					                    Count="@count"
 | 
				
			||||||
                    EmptyText="无数据"
 | 
					                            EmptyText="@myText.NoDate"
 | 
				
			||||||
                    Data="@_forecasts"
 | 
					                    Data="@_forecasts"
 | 
				
			||||||
                    AllowColumnResize="true" AllowAlternatingRows="false"
 | 
					                    AllowColumnResize="true" AllowAlternatingRows="false"
 | 
				
			||||||
                    SelectionMode="DataGridSelectionMode.Single"
 | 
					                    SelectionMode="DataGridSelectionMode.Single"
 | 
				
			||||||
                    AllowPaging="true" PageSize="10" PagerHorizontalAlign="HorizontalAlign.Left" ShowPagingSummary="true" PagingSummaryFormat="{0}/{1} ¹²{2}ÌõÊý¾Ý">
 | 
					                    AllowPaging="true" PageSize="10" PagerHorizontalAlign="HorizontalAlign.Left" ShowPagingSummary="true" PagingSummaryFormat="{0}/{1} ¹²{2}ÌõÊý¾Ý">
 | 
				
			||||||
                    <Columns>
 | 
					                    <Columns>
 | 
				
			||||||
                        <RadzenDataGridColumn Frozen="true" Title="处方号" Property="OrderNo"></RadzenDataGridColumn>
 | 
					                    <RadzenDataGridColumn Frozen="true" Title="@myText.OrderNo" Property="OrderNo"></RadzenDataGridColumn>
 | 
				
			||||||
                        <RadzenDataGridColumn Width="170px" Title="开方时间" Property="OrderDate"></RadzenDataGridColumn>
 | 
					                    <RadzenDataGridColumn Width="170px" Title="@myText.OrderDate" Property="OrderDate"></RadzenDataGridColumn>
 | 
				
			||||||
                        <RadzenDataGridColumn Title="医生" Property="DoctorName"></RadzenDataGridColumn>
 | 
					                    <RadzenDataGridColumn Title="@myText.Doctor" Property="DoctorName"></RadzenDataGridColumn>
 | 
				
			||||||
                        <RadzenDataGridColumn Title="姓名" Property="PatientName"></RadzenDataGridColumn>
 | 
					                    <RadzenDataGridColumn Title="@myText.Name" Property="PatientName"></RadzenDataGridColumn>
 | 
				
			||||||
                        <RadzenDataGridColumn Title="性别" Property="Sex"></RadzenDataGridColumn>
 | 
					                    <RadzenDataGridColumn Title="@myText.Sex" Property="Sex"></RadzenDataGridColumn>
 | 
				
			||||||
                        <RadzenDataGridColumn Title="年龄" Property="Age"></RadzenDataGridColumn>
 | 
					                    <RadzenDataGridColumn Title="@myText.Age" Property="Age"></RadzenDataGridColumn>
 | 
				
			||||||
                        <RadzenDataGridColumn Title="科室" Property="DeptName"></RadzenDataGridColumn>
 | 
					                    <RadzenDataGridColumn Title="@myText.DeptName" Property="DeptName"></RadzenDataGridColumn>
 | 
				
			||||||
                        <RadzenDataGridColumn Title="诊断" Property="Disease"></RadzenDataGridColumn>
 | 
					                    <RadzenDataGridColumn Title="@myText.Diagnose" Property="Disease"></RadzenDataGridColumn>
 | 
				
			||||||
                    </Columns>
 | 
					                    </Columns>
 | 
				
			||||||
                </RadzenDataGrid>
 | 
					                </RadzenDataGrid>
 | 
				
			||||||
        </div>
 | 
					        </div>
 | 
				
			||||||
| 
						 | 
					@ -64,7 +65,7 @@
 | 
				
			||||||
@code {
 | 
					@code {
 | 
				
			||||||
    @inject IOrderInfoDao orderInfoDao;
 | 
					    @inject IOrderInfoDao orderInfoDao;
 | 
				
			||||||
    @inject DialogService dialogService;
 | 
					    @inject DialogService dialogService;
 | 
				
			||||||
    
 | 
					    @inject Toolbelt.Blazor.I18nText.I18nText I18nText;
 | 
				
			||||||
    RadzenDataGrid<OrderInfo> grid;
 | 
					    RadzenDataGrid<OrderInfo> grid;
 | 
				
			||||||
    bool isLoading;
 | 
					    bool isLoading;
 | 
				
			||||||
    int count;
 | 
					    int count;
 | 
				
			||||||
| 
						 | 
					@ -72,6 +73,13 @@
 | 
				
			||||||
    string OrderNo;
 | 
					    string OrderNo;
 | 
				
			||||||
    DateTime OrderDate;
 | 
					    DateTime OrderDate;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    private I18nText.local myText = new I18nText.local();
 | 
				
			||||||
 | 
					    protected override async Task OnInitializedAsync()
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        myText = await I18nText.GetTextTableAsync<I18nText.local>(this);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    void OnCurrentDateChanged(DateTime args)
 | 
					    void OnCurrentDateChanged(DateTime args)
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        OrderDate = new DateTime(args.Year, args.Month, args.Day);
 | 
					        OrderDate = new DateTime(args.Year, args.Month, args.Day);
 | 
				
			||||||
| 
						 | 
					@ -101,7 +109,7 @@
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        
 | 
					        
 | 
				
			||||||
        var b = await dialogService.OpenAsync<OrderDetailDialog>(
 | 
					        var b = await dialogService.OpenAsync<OrderDetailDialog>(
 | 
				
			||||||
                $"处方详情",
 | 
					                myText.OrderDetail,
 | 
				
			||||||
              new Dictionary<string, object>() { { "order", oi } },
 | 
					              new Dictionary<string, object>() { { "order", oi } },
 | 
				
			||||||
              new DialogOptions() { Width = "85vw", Resizable = true, Draggable = true, ShowClose = false }
 | 
					              new DialogOptions() { Width = "85vw", Resizable = true, Draggable = true, ShowClose = false }
 | 
				
			||||||
        );
 | 
					        );
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -12,39 +12,39 @@
 | 
				
			||||||
                <RadzenStack Orientation="Orientation.Horizontal" Gap="1rem">
 | 
					                <RadzenStack Orientation="Orientation.Horizontal" Gap="1rem">
 | 
				
			||||||
                    <RadzenRow AlignItems="AlignItems.Center">
 | 
					                    <RadzenRow AlignItems="AlignItems.Center">
 | 
				
			||||||
                        <RadzenColumn Size="12" Style="margin-top:12px">
 | 
					                        <RadzenColumn Size="12" Style="margin-top:12px">
 | 
				
			||||||
                            <RadzenButton Size="ButtonSize.Large" Click="reloadGrid" IsBusy="isLoading" Icon="refresh" Text="刷新" ButtonStyle="ButtonStyle.Warning" />
 | 
					                            <RadzenButton Size="ButtonSize.Large" Click="reloadGrid" IsBusy="isLoading" Icon="refresh" Text="@myText.Refresh" ButtonStyle="ButtonStyle.Warning" />
 | 
				
			||||||
                            <RadzenButton Size="ButtonSize.Large" ButtonStyle="ButtonStyle.Success" Icon="add_circle_outline" Click="@InsertPlanRow" Text="新增套餐" />
 | 
					                            <RadzenButton Size="ButtonSize.Large" ButtonStyle="ButtonStyle.Success" Icon="add_circle_outline" Click="@InsertPlanRow" Text="@myText.AddMenu" />
 | 
				
			||||||
                        </RadzenColumn>
 | 
					                        </RadzenColumn>
 | 
				
			||||||
                    </RadzenRow>
 | 
					                    </RadzenRow>
 | 
				
			||||||
                </RadzenStack>
 | 
					                </RadzenStack>
 | 
				
			||||||
            </RadzenFieldset>
 | 
					            </RadzenFieldset>
 | 
				
			||||||
        </div>
 | 
					        </div>
 | 
				
			||||||
        <div class="col-4  mb-4">
 | 
					        <div class="col-6  mb-4">
 | 
				
			||||||
            <RadzenDataGrid @ref="grid"
 | 
					            <RadzenDataGrid @ref="grid"
 | 
				
			||||||
                            LoadData="@LoadData"
 | 
					                            LoadData="@LoadData"
 | 
				
			||||||
                            @bind-Value="@SelectedPlan"
 | 
					                            @bind-Value="@SelectedPlan"
 | 
				
			||||||
                            IsLoading="@isLoading"
 | 
					                            IsLoading="@isLoading"
 | 
				
			||||||
                            Count="@count"
 | 
					                            Count="@count"
 | 
				
			||||||
                            EmptyText="无数据"
 | 
					                            EmptyText="@myText.NoDate"
 | 
				
			||||||
                            Data="@_forecasts"
 | 
					                            Data="@_forecasts"
 | 
				
			||||||
                            AllowColumnResize="true" AllowAlternatingRows="false"
 | 
					                            AllowColumnResize="true" AllowAlternatingRows="false"
 | 
				
			||||||
                            SelectionMode="DataGridSelectionMode.Single" RowUpdate="@((Plan di) => { OnUpdatePlanRow(di); })" RowCreate="@((Plan di) => { OnCreatePlanRow(di); })"
 | 
					                            SelectionMode="DataGridSelectionMode.Single" RowUpdate="@((Plan di) => { OnUpdatePlanRow(di); })" RowCreate="@((Plan di) => { OnCreatePlanRow(di); })"
 | 
				
			||||||
                            AllowPaging="true" PageSize="10" PagerHorizontalAlign="HorizontalAlign.Left" ColumnWidth="100px" ShowPagingSummary="true" PagingSummaryFormat="{0}/{1} 共{2}条数据">
 | 
					                            AllowPaging="true" PageSize="10" PagerHorizontalAlign="HorizontalAlign.Left" ColumnWidth="100px" ShowPagingSummary="true" PagingSummaryFormat="{0}/{1} 共{2}条数据">
 | 
				
			||||||
                <Columns>
 | 
					                <Columns>
 | 
				
			||||||
                    <RadzenDataGridColumn Frozen="true" Title="套餐名称" Property="Name">
 | 
					                    <RadzenDataGridColumn Frozen="true" Title="@myText.MenuName" Property="Name">
 | 
				
			||||||
                        <EditTemplate Context="planInfo">
 | 
					                        <EditTemplate Context="planInfo">
 | 
				
			||||||
                            <RadzenTextBox Name="Name" @bind-Value="planInfo.Name" Style="width:100%; display: block;" />
 | 
					                            <RadzenTextBox Name="Name" @bind-Value="planInfo.Name" Style="width:100%; display: block;" />
 | 
				
			||||||
                            <RadzenRequiredValidator Text="请填写套餐名称" Component="Name" Popup="true" />
 | 
					                            <RadzenRequiredValidator Text="@myText.InputMenuName" Component="Name" Popup="true" />
 | 
				
			||||||
                        </EditTemplate>
 | 
					                        </EditTemplate>
 | 
				
			||||||
                    </RadzenDataGridColumn>
 | 
					                    </RadzenDataGridColumn>
 | 
				
			||||||
                    @*   <RadzenDataGridColumn Width="200px" Title="套餐描述" Property="Description">
 | 
					                    <RadzenDataGridColumn Width="200px" Title="@myText.MenuDescrip" Property="Description">
 | 
				
			||||||
                        <EditTemplate Context="planInfo">
 | 
					                        <EditTemplate Context="planInfo">
 | 
				
			||||||
                            <RadzenTextBox Name="Description" @bind-Value="planInfo.Description" Style="width:100%;display:block;" />
 | 
					                            <RadzenTextBox Name="Description" @bind-Value="planInfo.Description" Style="width:100%;display:block;" />
 | 
				
			||||||
                            <RadzenRequiredValidator Text="请填写套餐描述" Component="Description" Popup="true" />
 | 
					                            <RadzenRequiredValidator Text="@myText.InputMenuDesc" Component="Description" Popup="true" />
 | 
				
			||||||
                        </EditTemplate>
 | 
					                        </EditTemplate>
 | 
				
			||||||
                    </RadzenDataGridColumn> *@
 | 
					                    </RadzenDataGridColumn>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                    <RadzenDataGridColumn Context="planInfo" Title="操作" Filterable="false" Sortable="false" TextAlign="TextAlign.Left" Frozen="true" FrozenPosition="FrozenColumnPosition.Right" Width="5rem">
 | 
					                    <RadzenDataGridColumn Context="planInfo" Title="@myText.Operate" Filterable="false" Sortable="false" TextAlign="TextAlign.Left" Frozen="true" FrozenPosition="FrozenColumnPosition.Right" Width="8rem">
 | 
				
			||||||
                        <Template Context="planInfo">
 | 
					                        <Template Context="planInfo">
 | 
				
			||||||
                            <RadzenButton Icon="edit" ButtonStyle="ButtonStyle.Light" Variant="Variant.Flat" Size="ButtonSize.Medium" Click="@(args => EditPlanRow(planInfo))" @onclick:stopPropagation="true">
 | 
					                            <RadzenButton Icon="edit" ButtonStyle="ButtonStyle.Light" Variant="Variant.Flat" Size="ButtonSize.Medium" Click="@(args => EditPlanRow(planInfo))" @onclick:stopPropagation="true">
 | 
				
			||||||
                            </RadzenButton>
 | 
					                            </RadzenButton>
 | 
				
			||||||
| 
						 | 
					@ -63,8 +63,8 @@
 | 
				
			||||||
                </Columns>
 | 
					                </Columns>
 | 
				
			||||||
            </RadzenDataGrid>
 | 
					            </RadzenDataGrid>
 | 
				
			||||||
        </div>
 | 
					        </div>
 | 
				
			||||||
        <div class="col-8  mb-4">
 | 
					        <div class="col-6  mb-4">
 | 
				
			||||||
            <RadzenDataGrid @ref="PlanDetailsGrid" EmptyText="无数据"
 | 
					            <RadzenDataGrid @ref="PlanDetailsGrid" EmptyText="@myText.NoDate"
 | 
				
			||||||
                            Data="@(SelectedPlan?.FirstOrDefault()?._PlanDetails)"
 | 
					                            Data="@(SelectedPlan?.FirstOrDefault()?._PlanDetails)"
 | 
				
			||||||
                            RowUpdate="@((PlanDetails pd) => { OnUpdateRow(pd); })"
 | 
					                            RowUpdate="@((PlanDetails pd) => { OnUpdateRow(pd); })"
 | 
				
			||||||
                            RowCreate="@((PlanDetails pd) => { OnCreateRow(pd); })"
 | 
					                            RowCreate="@((PlanDetails pd) => { OnCreateRow(pd); })"
 | 
				
			||||||
| 
						 | 
					@ -76,12 +76,12 @@
 | 
				
			||||||
                        </RadzenRow>
 | 
					                        </RadzenRow>
 | 
				
			||||||
                    </HeaderTemplate> *@
 | 
					                    </HeaderTemplate> *@
 | 
				
			||||||
                <Columns>
 | 
					                <Columns>
 | 
				
			||||||
                    <RadzenDataGridColumn Title="序号" Property="index" Width="3rem">
 | 
					                    <RadzenDataGridColumn Title="@myText.Number" Property="index" Width="5rem">
 | 
				
			||||||
                        <Template Context="data">
 | 
					                        <Template Context="data">
 | 
				
			||||||
                            @(SelectedPlan.FirstOrDefault()?._PlanDetails.IndexOf(data) + 1)
 | 
					                            @(SelectedPlan.FirstOrDefault()?._PlanDetails.IndexOf(data) + 1)
 | 
				
			||||||
                        </Template>
 | 
					                        </Template>
 | 
				
			||||||
                    </RadzenDataGridColumn>
 | 
					                    </RadzenDataGridColumn>
 | 
				
			||||||
                    <RadzenDataGridColumn Title="药品" Property="_DrugInfo.DrugName" Width="15rem">
 | 
					                    <RadzenDataGridColumn Title="@myText.DrugName" Property="_DrugInfo.DrugName" Width="25rem">
 | 
				
			||||||
                        <Template Context="data">
 | 
					                        <Template Context="data">
 | 
				
			||||||
                            <RadzenText TextStyle="TextStyle.Body1"><b>@(data._DrugInfo?.DrugName)</b></RadzenText>
 | 
					                            <RadzenText TextStyle="TextStyle.Body1"><b>@(data._DrugInfo?.DrugName)</b></RadzenText>
 | 
				
			||||||
                            <RadzenText TextStyle="TextStyle.Body1"><b>@(data._DrugInfo?.DrugSpec)</b></RadzenText>
 | 
					                            <RadzenText TextStyle="TextStyle.Body1"><b>@(data._DrugInfo?.DrugSpec)</b></RadzenText>
 | 
				
			||||||
| 
						 | 
					@ -91,23 +91,23 @@
 | 
				
			||||||
                            <RadzenDropDownDataGrid AllowVirtualization="true" Name="drugName" TValue="DrugInfo" @bind-Value="planDetails._DrugInfo" Data="@drugInfos"
 | 
					                            <RadzenDropDownDataGrid AllowVirtualization="true" Name="drugName" TValue="DrugInfo" @bind-Value="planDetails._DrugInfo" Data="@drugInfos"
 | 
				
			||||||
                                                    Style="width:100%; display: block;" AllowFilteringByAllStringColumns="true" TextProperty="DrugName">
 | 
					                                                    Style="width:100%; display: block;" AllowFilteringByAllStringColumns="true" TextProperty="DrugName">
 | 
				
			||||||
                                <Columns>
 | 
					                                <Columns>
 | 
				
			||||||
                                    <RadzenDropDownDataGridColumn Property="DrugId" Title="药品编码" />
 | 
					                                    <RadzenDropDownDataGridColumn Property="DrugId" Title="@myText.DrugCode" />
 | 
				
			||||||
                                    <RadzenDropDownDataGridColumn Property="DrugName" Title="名称" />
 | 
					                                    <RadzenDropDownDataGridColumn Property="DrugName" Width="120px" Title="@myText.DrugName" />
 | 
				
			||||||
                                    <RadzenDropDownDataGridColumn Property="DrugSpec" Title="规格" />
 | 
					                                    <RadzenDropDownDataGridColumn Property="DrugSpec" Title="@myText.Spec" />
 | 
				
			||||||
                                </Columns>
 | 
					                                </Columns>
 | 
				
			||||||
                            </RadzenDropDownDataGrid>
 | 
					                            </RadzenDropDownDataGrid>
 | 
				
			||||||
                            <RadzenCustomValidator Component="drugName" Validator="@(() => (planDetails._DrugInfo.DrugId != null))" Text="请选择药品" Popup=true />
 | 
					                            <RadzenCustomValidator Component="drugName" Validator="@(() => (planDetails._DrugInfo.DrugId != null))" Text="@myText.SelectDrug" Popup=true />
 | 
				
			||||||
                            <RadzenCustomValidator Component="drugName" Validator="@(() => ValidatroDrug(planDetails))" Text="套餐中已包含该药品" Popup=true />
 | 
					                            <RadzenCustomValidator Component="drugName" Validator="@(() => ValidatroDrug(planDetails))" Text="@myText.MenuHasDrug" Popup=true />
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                        </EditTemplate>
 | 
					                        </EditTemplate>
 | 
				
			||||||
                    </RadzenDataGridColumn>
 | 
					                    </RadzenDataGridColumn>
 | 
				
			||||||
                    <RadzenDataGridColumn Title="基数" Property="BaseQuantity" Width="7rem">
 | 
					                    <RadzenDataGridColumn Title="@myText.BaseQuantity" Property="BaseQuantity" Width="5rem">
 | 
				
			||||||
                        <EditTemplate Context="planDetails">
 | 
					                        <EditTemplate Context="planDetails">
 | 
				
			||||||
                            <RadzenNumeric Name="BaseQuantity" @bind-Value="planDetails.BaseQuantity" Style="width:100%; display: block;" />
 | 
					                            <RadzenNumeric Name="BaseQuantity" @bind-Value="planDetails.BaseQuantity" Style="width:100%; display: block;" />
 | 
				
			||||||
                            <RadzenNumericRangeValidator Style="position: absolute;z-index: 9999;" Min="0" Text="请填写正确的添加数量" Component="BaseQuantity" Popup="true" />
 | 
					                            <RadzenNumericRangeValidator Style="position: absolute;z-index: 9999;" Min="0" Text="请填写正确的添加数量" Component="BaseQuantity" Popup="true" />
 | 
				
			||||||
                        </EditTemplate>
 | 
					                        </EditTemplate>
 | 
				
			||||||
                    </RadzenDataGridColumn>
 | 
					                    </RadzenDataGridColumn>
 | 
				
			||||||
                    <RadzenDataGridColumn Title="操作" Filterable="false" Sortable="false" TextAlign="TextAlign.Left" Frozen="true" FrozenPosition="FrozenColumnPosition.Right" Width="9rem">
 | 
					                    <RadzenDataGridColumn Title="@myText.Operate" Filterable="false" Sortable="false" TextAlign="TextAlign.Left" Frozen="true" FrozenPosition="FrozenColumnPosition.Right" Width="8rem">
 | 
				
			||||||
                        <Template Context="planDetails">
 | 
					                        <Template Context="planDetails">
 | 
				
			||||||
                            <RadzenButton Icon="edit" ButtonStyle="ButtonStyle.Light" Variant="Variant.Flat" Size="ButtonSize.Medium" Click="@(args => EditRow(planDetails))" @onclick:stopPropagation="true">
 | 
					                            <RadzenButton Icon="edit" ButtonStyle="ButtonStyle.Light" Variant="Variant.Flat" Size="ButtonSize.Medium" Click="@(args => EditRow(planDetails))" @onclick:stopPropagation="true">
 | 
				
			||||||
                            </RadzenButton>
 | 
					                            </RadzenButton>
 | 
				
			||||||
| 
						 | 
					@ -126,7 +126,7 @@
 | 
				
			||||||
                </Columns>
 | 
					                </Columns>
 | 
				
			||||||
            </RadzenDataGrid>
 | 
					            </RadzenDataGrid>
 | 
				
			||||||
            <div style="margin-top:5px">
 | 
					            <div style="margin-top:5px">
 | 
				
			||||||
                <RadzenButton Size="ButtonSize.Medium" ButtonStyle="ButtonStyle.Success" Icon="add_circle_outline"  Click="@InsertRow" Text="新增药品" />
 | 
					                <RadzenButton Size="ButtonSize.Medium" ButtonStyle="ButtonStyle.Success" Icon="add_circle_outline" Click="@InsertRow" Text="@myText.AddDrug" />
 | 
				
			||||||
            </div>
 | 
					            </div>
 | 
				
			||||||
        </div>
 | 
					        </div>
 | 
				
			||||||
    </div>
 | 
					    </div>
 | 
				
			||||||
| 
						 | 
					@ -137,7 +137,9 @@
 | 
				
			||||||
    @inject DialogService dialogService;
 | 
					    @inject DialogService dialogService;
 | 
				
			||||||
    @inject NotificationService _message
 | 
					    @inject NotificationService _message
 | 
				
			||||||
    @inject GlobalStateService globalStateService;
 | 
					    @inject GlobalStateService globalStateService;
 | 
				
			||||||
 | 
					    @inject Toolbelt.Blazor.I18nText.I18nText I18nText;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    private I18nText.local myText = new I18nText.local();
 | 
				
			||||||
    RadzenDataGrid<Plan> grid;
 | 
					    RadzenDataGrid<Plan> grid;
 | 
				
			||||||
    RadzenDataGrid<PlanDetails> PlanDetailsGrid;
 | 
					    RadzenDataGrid<PlanDetails> PlanDetailsGrid;
 | 
				
			||||||
    bool isLoading;
 | 
					    bool isLoading;
 | 
				
			||||||
| 
						 | 
					@ -148,6 +150,13 @@
 | 
				
			||||||
    List<DrugInfo> drugInfos;
 | 
					    List<DrugInfo> drugInfos;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    // int preValue = 1;
 | 
				
			||||||
 | 
					    protected override async Task OnInitializedAsync()
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        myText = await I18nText.GetTextTableAsync<I18nText.local>(this);
 | 
				
			||||||
 | 
					        base.OnInitializedAsync();
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    async Task LoadData(LoadDataArgs args)
 | 
					    async Task LoadData(LoadDataArgs args)
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        isLoading = true;
 | 
					        isLoading = true;
 | 
				
			||||||
| 
						 | 
					@ -177,14 +186,11 @@
 | 
				
			||||||
        planDao.UpdatePlanInfo(dl);
 | 
					        planDao.UpdatePlanInfo(dl);
 | 
				
			||||||
        grid.Reload();
 | 
					        grid.Reload();
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    async Task OnCreatePlanRow(Plan dl)
 | 
					    void OnCreatePlanRow(Plan dl)
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        // 数据库添加套餐
 | 
					        // 数据库添加套餐
 | 
				
			||||||
        bool bFlag = await planDao.InsertPlanInfo(dl);
 | 
					        planDao.InsertPlanInfo(dl);
 | 
				
			||||||
        if (!bFlag)
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
        SelectedPlan.Remove(dl);
 | 
					        SelectedPlan.Remove(dl);
 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
        grid.Reload();
 | 
					        grid.Reload();
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    //新增套餐
 | 
					    //新增套餐
 | 
				
			||||||
| 
						 | 
					@ -296,18 +302,7 @@
 | 
				
			||||||
    async Task EditRow(PlanDetails planDetail)
 | 
					    async Task EditRow(PlanDetails planDetail)
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        // planDetail.DrugId = null;
 | 
					        // planDetail.DrugId = null;
 | 
				
			||||||
        //查询要删除的药品是否有绑定且库存大于0
 | 
					
 | 
				
			||||||
        if (!(await planDao.CheckPlanDetailBind(planDetail)))
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
            _message.Notify(new NotificationMessage
 | 
					 | 
				
			||||||
            {
 | 
					 | 
				
			||||||
                Severity = NotificationSeverity.Error,
 | 
					 | 
				
			||||||
                Summary = "提示",
 | 
					 | 
				
			||||||
                Detail = "该药品有绑定且库存不为0,请先清库存",
 | 
					 | 
				
			||||||
                Duration = 4000
 | 
					 | 
				
			||||||
            });
 | 
					 | 
				
			||||||
            return;
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
        await PlanDetailsGrid.EditRow(planDetail);
 | 
					        await PlanDetailsGrid.EditRow(planDetail);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    //保存修改药品
 | 
					    //保存修改药品
 | 
				
			||||||
| 
						 | 
					@ -419,7 +414,6 @@
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        if (SelectedPlan.FirstOrDefault() != null)
 | 
					        if (SelectedPlan.FirstOrDefault() != null)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
 | 
					 | 
				
			||||||
            planDetail.PlanId = SelectedPlan.FirstOrDefault().Id;
 | 
					            planDetail.PlanId = SelectedPlan.FirstOrDefault().Id;
 | 
				
			||||||
            planDetail.DrugId = planDetail.DrugId == null ? planDetail._DrugInfo.DrugId : planDetail.DrugId;
 | 
					            planDetail.DrugId = planDetail.DrugId == null ? planDetail._DrugInfo.DrugId : planDetail.DrugId;
 | 
				
			||||||
            planDetail.UseState = 1;
 | 
					            planDetail.UseState = 1;
 | 
				
			||||||
| 
						 | 
					@ -458,21 +452,6 @@
 | 
				
			||||||
    //新增药品
 | 
					    //新增药品
 | 
				
			||||||
    async Task InsertRow()
 | 
					    async Task InsertRow()
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        //查询要删除的套餐下是否有绑定,且绑定有库存
 | 
					 | 
				
			||||||
        if (SelectedPlan.FirstOrDefault()!=null)
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
            if (!(await planDao.CheckPlanBind((int)SelectedPlan.FirstOrDefault().Id)))
 | 
					 | 
				
			||||||
            {
 | 
					 | 
				
			||||||
                _message.Notify(new NotificationMessage
 | 
					 | 
				
			||||||
                    {
 | 
					 | 
				
			||||||
                        Severity = NotificationSeverity.Error,
 | 
					 | 
				
			||||||
                        Summary = "提示",
 | 
					 | 
				
			||||||
                        Detail = "该药品有绑定且库存不为0,请先清库存",
 | 
					 | 
				
			||||||
                        Duration = 4000
 | 
					 | 
				
			||||||
                    });
 | 
					 | 
				
			||||||
                return;
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
        var detail = new Pojo.PlanDetails()
 | 
					        var detail = new Pojo.PlanDetails()
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            PlanId = SelectedPlan.FirstOrDefault().Id
 | 
					            PlanId = SelectedPlan.FirstOrDefault().Id
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -11,42 +11,42 @@
 | 
				
			||||||
        <div class="col-12 mb-4">
 | 
					        <div class="col-12 mb-4">
 | 
				
			||||||
            
 | 
					            
 | 
				
			||||||
            <form onsubmit="@(() => grid.Reload())">
 | 
					            <form onsubmit="@(() => grid.Reload())">
 | 
				
			||||||
                <RadzenFieldset Text="查询">
 | 
					                <RadzenFieldset Text="@myText.Search">
 | 
				
			||||||
                    <RadzenStack Orientation="Orientation.Horizontal" Gap="1rem">
 | 
					                    <RadzenStack Orientation="Orientation.Horizontal" Gap="1rem">
 | 
				
			||||||
                        <RadzenRow AlignItems="AlignItems.Center">
 | 
					                        <RadzenRow AlignItems="AlignItems.Center">
 | 
				
			||||||
                            <RadzenColumn Size="4">
 | 
					                            <RadzenColumn Size="4">
 | 
				
			||||||
                                <RadzenLabel Text="开始时间" Component="Start" />
 | 
					                                <RadzenLabel Text="@myText.StartDate" Component="Start" />
 | 
				
			||||||
                            </RadzenColumn>
 | 
					                            </RadzenColumn>
 | 
				
			||||||
                            <RadzenColumn Size="8">
 | 
					                            <RadzenColumn Size="8">
 | 
				
			||||||
                                <RadzenDatePicker DateFormat="yyyy-MM-dd" @bind-Value="start" Style="width: 100%;" Name="Start" />
 | 
					                                <RadzenDatePicker DateFormat="yyyy-MM-dd HH:mm:ss" ShowTime="true" @bind-Value="start" Style="width: 100%;" Name="Start" />
 | 
				
			||||||
                            </RadzenColumn>
 | 
					                            </RadzenColumn>
 | 
				
			||||||
                        </RadzenRow>
 | 
					                        </RadzenRow>
 | 
				
			||||||
                        <RadzenRow AlignItems="AlignItems.Center">
 | 
					                        <RadzenRow AlignItems="AlignItems.Center">
 | 
				
			||||||
                            <RadzenColumn Size="4">
 | 
					                            <RadzenColumn Size="4">
 | 
				
			||||||
                                <RadzenLabel Text="结束时间" Component="End" />
 | 
					                                <RadzenLabel Text="@myText.EndDate" Component="End" />
 | 
				
			||||||
                            </RadzenColumn>
 | 
					                            </RadzenColumn>
 | 
				
			||||||
                            <RadzenColumn Size="8">
 | 
					                            <RadzenColumn Size="8">
 | 
				
			||||||
                                <RadzenDatePicker DateFormat="yyyy-MM-dd" @bind-Value="end" Style="width: 100%;" Name="End" />
 | 
					                                <RadzenDatePicker DateFormat="yyyy-MM-dd HH:mm:ss" ShowTime="true" @bind-Value="end" Style="width: 100%;" Name="End" />
 | 
				
			||||||
                            </RadzenColumn>
 | 
					                            </RadzenColumn>
 | 
				
			||||||
                        </RadzenRow>
 | 
					                        </RadzenRow>
 | 
				
			||||||
                    
 | 
					                    
 | 
				
			||||||
                        <RadzenRow AlignItems="AlignItems.Center">
 | 
					                        <RadzenRow AlignItems="AlignItems.Center">
 | 
				
			||||||
                            <RadzenColumn Size="12">
 | 
					                            <RadzenColumn Size="12">
 | 
				
			||||||
                                <RadzenButton Size="ButtonSize.Large" ButtonType="ButtonType.Submit" IsBusy="isLoading" Icon="search" Text="查询" />
 | 
					                                <RadzenButton Size="ButtonSize.Large" ButtonType="ButtonType.Submit" IsBusy="isLoading" Icon="search" Text="@myText.Search" />
 | 
				
			||||||
                                <RadzenButton Size="ButtonSize.Large" Click="reloadGrid" IsBusy="isLoading" Icon="refresh" Text="重置" ButtonStyle="ButtonStyle.Warning" />
 | 
					                                <RadzenButton Size="ButtonSize.Large" Click="reloadGrid" IsBusy="isLoading" Icon="refresh" Text="@myText.Restore" ButtonStyle="ButtonStyle.Warning" />
 | 
				
			||||||
                            </RadzenColumn>
 | 
					                            </RadzenColumn>
 | 
				
			||||||
                        </RadzenRow>
 | 
					                        </RadzenRow>
 | 
				
			||||||
                    </RadzenStack>
 | 
					                    </RadzenStack>
 | 
				
			||||||
                </RadzenFieldset>
 | 
					                </RadzenFieldset>
 | 
				
			||||||
            </form>
 | 
					            </form>
 | 
				
			||||||
        </div>
 | 
					        </div>
 | 
				
			||||||
        <div class="col-12 mb-4" style="height:50vh;overflow:auto">
 | 
					        <div class="col-12 mb-4">
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            <RadzenDataGrid @ref="grid" Style="height:48vh;"
 | 
					                <RadzenDataGrid @ref="grid"
 | 
				
			||||||
                    LoadData="@LoadData"
 | 
					                    LoadData="@LoadData"
 | 
				
			||||||
                    IsLoading="@isLoading"
 | 
					                    IsLoading="@isLoading"
 | 
				
			||||||
                    Count="@count"
 | 
					                    Count="@count"
 | 
				
			||||||
                            EmptyText="无数据"
 | 
					                    EmptyText="@myText.NoDate"
 | 
				
			||||||
                    Data="@_forecasts"
 | 
					                    Data="@_forecasts"
 | 
				
			||||||
                    AllowColumnResize="true" AllowAlternatingRows="false"
 | 
					                    AllowColumnResize="true" AllowAlternatingRows="false"
 | 
				
			||||||
                    AllowRowSelectOnRowClick="true"
 | 
					                    AllowRowSelectOnRowClick="true"
 | 
				
			||||||
| 
						 | 
					@ -58,71 +58,24 @@
 | 
				
			||||||
                        </RadzenRow>
 | 
					                        </RadzenRow>
 | 
				
			||||||
                    </HeaderTemplate>
 | 
					                    </HeaderTemplate>
 | 
				
			||||||
                    <Columns>
 | 
					                    <Columns>
 | 
				
			||||||
                    <RadzenDataGridColumn Frozen="true" Title="操作人" Property="OperatorUser.NickName"></RadzenDataGridColumn>
 | 
					                        <RadzenDataGridColumn Frozen="true" Title="@myText.Operator" Property="OperatorUser.NickName"></RadzenDataGridColumn>
 | 
				
			||||||
                    <RadzenDataGridColumn Width="170px" Title="操作时间" Property="OperationTime"></RadzenDataGridColumn>
 | 
					                        <RadzenDataGridColumn Width="170px" Title="@myText.OperateDate" Property="OperationTime"></RadzenDataGridColumn>
 | 
				
			||||||
                    <RadzenDataGridColumn Width="200px" Title="药品名称" Property="Drug.DrugName">
 | 
					                        <RadzenDataGridColumn Width="200px" Title="@myText.DrugName" Property="Drug.DrugName">
 | 
				
			||||||
                            <Template Context="mr">
 | 
					                            <Template Context="mr">
 | 
				
			||||||
                                <RadzenText TextStyle="TextStyle.Subtitle2" class="mb-0">@mr.Drug?.DrugName</RadzenText>
 | 
					                                <RadzenText TextStyle="TextStyle.Subtitle2" class="mb-0">@mr.Drug?.DrugName</RadzenText>
 | 
				
			||||||
                                <RadzenText TextStyle="TextStyle.Caption">@mr.Drug?.DrugSpec</RadzenText>
 | 
					                                <RadzenText TextStyle="TextStyle.Caption">@mr.Drug?.DrugSpec</RadzenText>
 | 
				
			||||||
                            </Template>
 | 
					                            </Template>
 | 
				
			||||||
                        </RadzenDataGridColumn>
 | 
					                        </RadzenDataGridColumn>
 | 
				
			||||||
                    <RadzenDataGridColumn Width="60px" Title="药盒" Property="OperationTime">
 | 
					                        <RadzenDataGridColumn Title="Åú´Î" Property="ManuNo">
 | 
				
			||||||
                        <Template Context="mr">
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                            @if (mr.BoxDrawer > 0)
 | 
					 | 
				
			||||||
                            {
 | 
					 | 
				
			||||||
                                if (mr.DrawerNo == 99)
 | 
					 | 
				
			||||||
                                {
 | 
					 | 
				
			||||||
                                    <b class="rz-pr-3">@($"急诊药盒")</b>
 | 
					 | 
				
			||||||
                                }
 | 
					 | 
				
			||||||
                                else if (mr.DrawerNo == 111)
 | 
					 | 
				
			||||||
                                {
 | 
					 | 
				
			||||||
                                    <b class="rz-pr-3">@($"恢复室药盒")</b>
 | 
					 | 
				
			||||||
                                }
 | 
					 | 
				
			||||||
                                else
 | 
					 | 
				
			||||||
                                {
 | 
					 | 
				
			||||||
                                    <b class="rz-pr-3">@($"{mr.DrawerNo}-{(mr.ColNo == 1 ? '白' : '绿')}")</b>
 | 
					 | 
				
			||||||
                                }
 | 
					 | 
				
			||||||
                            }
 | 
					 | 
				
			||||||
                            else
 | 
					 | 
				
			||||||
                            {
 | 
					 | 
				
			||||||
                                <b class="rz-pr-3">无</b>
 | 
					 | 
				
			||||||
                            }
 | 
					 | 
				
			||||||
                        </Template>
 | 
					 | 
				
			||||||
                    </RadzenDataGridColumn>
 | 
					 | 
				
			||||||
                    <RadzenDataGridColumn Title="批次" Property="ManuNo" Width="123px">
 | 
					 | 
				
			||||||
                            <Template Context="mr">
 | 
					                            <Template Context="mr">
 | 
				
			||||||
                                <RadzenText TextStyle="TextStyle.Subtitle2" class="mb-0">@mr.ManuNo</RadzenText>
 | 
					                                <RadzenText TextStyle="TextStyle.Subtitle2" class="mb-0">@mr.ManuNo</RadzenText>
 | 
				
			||||||
                                <RadzenText TextStyle="TextStyle.Caption"> @mr.EffDate?.ToString("yyyy-MM-dd")</RadzenText>
 | 
					                                <RadzenText TextStyle="TextStyle.Caption"> @mr.EffDate?.ToString("yyyy-MM-dd")</RadzenText>
 | 
				
			||||||
                            </Template>
 | 
					                            </Template>
 | 
				
			||||||
                        </RadzenDataGridColumn>
 | 
					                        </RadzenDataGridColumn>
 | 
				
			||||||
                    <RadzenDataGridColumn Title="借出数量" Property="Quantity">
 | 
					                    <RadzenDataGridColumn Title="@myText.Borrow" Property="Quantity"></RadzenDataGridColumn>
 | 
				
			||||||
                        <HeaderTemplate>
 | 
					                    <RadzenDataGridColumn Title="@myText.ReturnQuantity" Property="ReturnQuantity1"></RadzenDataGridColumn>
 | 
				
			||||||
                            <div style="text-align: center;">
 | 
					                    <RadzenDataGridColumn Title="@myText.ReturnEmpty" Property="ReturnQuantity2"></RadzenDataGridColumn>
 | 
				
			||||||
                                借出<br>数量
 | 
					                    <RadzenDataGridColumn Title="@myText.CurrentReturn" Property="CurrentReturnQuantity">
 | 
				
			||||||
                            </div>
 | 
					 | 
				
			||||||
                        </HeaderTemplate>
 | 
					 | 
				
			||||||
                    </RadzenDataGridColumn>
 | 
					 | 
				
			||||||
                    <RadzenDataGridColumn Title="已还药品" Property="ReturnQuantity1">
 | 
					 | 
				
			||||||
                        <HeaderTemplate>
 | 
					 | 
				
			||||||
                            <div style="text-align: center;">
 | 
					 | 
				
			||||||
                                已还<br>药品
 | 
					 | 
				
			||||||
                            </div>
 | 
					 | 
				
			||||||
                        </HeaderTemplate>
 | 
					 | 
				
			||||||
                    </RadzenDataGridColumn>
 | 
					 | 
				
			||||||
                    <RadzenDataGridColumn Title="已还空瓶" Property="ReturnQuantity2">
 | 
					 | 
				
			||||||
                        <HeaderTemplate>
 | 
					 | 
				
			||||||
                            <div style="text-align: center;">
 | 
					 | 
				
			||||||
                                已还<br>空瓶
 | 
					 | 
				
			||||||
                            </div>
 | 
					 | 
				
			||||||
                        </HeaderTemplate>
 | 
					 | 
				
			||||||
                    </RadzenDataGridColumn>
 | 
					 | 
				
			||||||
                    <RadzenDataGridColumn Title="本次归还" Property="CurrentReturnQuantity" Width="90px">
 | 
					 | 
				
			||||||
                        <HeaderTemplate>
 | 
					 | 
				
			||||||
                            <div style="text-align: center;">
 | 
					 | 
				
			||||||
                                本次<br>归还
 | 
					 | 
				
			||||||
                            </div>
 | 
					 | 
				
			||||||
                        </HeaderTemplate>
 | 
					 | 
				
			||||||
                            <EditTemplate Context="mr">
 | 
					                            <EditTemplate Context="mr">
 | 
				
			||||||
                                <RadzenNumeric Min="0" Style="display: block" Max="@(mr.Quantity - mr.ReturnQuantity1 - mr.ReturnQuantity2)" Name="Quantity" @bind-Value=@mr.CurrentReturnQuantity />
 | 
					                                <RadzenNumeric Min="0" Style="display: block" Max="@(mr.Quantity - mr.ReturnQuantity1 - mr.ReturnQuantity2)" Name="Quantity" @bind-Value=@mr.CurrentReturnQuantity />
 | 
				
			||||||
                            </EditTemplate>
 | 
					                            </EditTemplate>
 | 
				
			||||||
| 
						 | 
					@ -136,6 +89,8 @@
 | 
				
			||||||
@code {
 | 
					@code {
 | 
				
			||||||
    @inject IMachineRecordDao machineRecordDao;
 | 
					    @inject IMachineRecordDao machineRecordDao;
 | 
				
			||||||
    @inject DialogService dialogService;
 | 
					    @inject DialogService dialogService;
 | 
				
			||||||
 | 
					    @inject Toolbelt.Blazor.I18nText.I18nText I18nText;
 | 
				
			||||||
 | 
					    private I18nText.local myText = new I18nText.local();
 | 
				
			||||||
    RadzenDataGrid<MachineRecord> grid;
 | 
					    RadzenDataGrid<MachineRecord> grid;
 | 
				
			||||||
    bool isLoading;
 | 
					    bool isLoading;
 | 
				
			||||||
    int count;
 | 
					    int count;
 | 
				
			||||||
| 
						 | 
					@ -144,7 +99,11 @@
 | 
				
			||||||
    DateTime start;
 | 
					    DateTime start;
 | 
				
			||||||
    DateTime end;
 | 
					    DateTime end;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    protected override async Task OnInitializedAsync()
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        myText = await I18nText.GetTextTableAsync<I18nText.local>(this);
 | 
				
			||||||
 | 
					        base.OnInitializedAsync();
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
    async Task LoadData(LoadDataArgs args)
 | 
					    async Task LoadData(LoadDataArgs args)
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        isLoading = true;
 | 
					        isLoading = true;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -12,51 +12,45 @@
 | 
				
			||||||
        
 | 
					        
 | 
				
			||||||
            <RadzenDataGrid @ref="grid" Data="@data" ExpandMode="DataGridExpandMode.Multiple"
 | 
					            <RadzenDataGrid @ref="grid" Data="@data" ExpandMode="DataGridExpandMode.Multiple"
 | 
				
			||||||
                            RowRender="@RowRender"
 | 
					                            RowRender="@RowRender"
 | 
				
			||||||
        EmptyText="无数据" AllowAlternatingRows="false">
 | 
					                            EmptyText="@myText.NoDate" AllowAlternatingRows="false">
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                <Template Context="di">
 | 
					                <Template Context="di">
 | 
				
			||||||
                <RadzenDataGrid Data="@di.ChannelStocks" EmptyText="无数据" @ref="di.Grid"
 | 
					                <RadzenDataGrid Data="@di.ChannelStocks" EmptyText="@myText.NoDate" @ref="di.Grid"
 | 
				
			||||||
                                CellClick="@((DataGridCellMouseEventArgs<ChannelStock> args) => OnCellClick(args, di.Grid))">
 | 
					                                CellClick="@((DataGridCellMouseEventArgs<ChannelStock> args) => OnCellClick(args, di.Grid))">
 | 
				
			||||||
                        <Columns>
 | 
					                        <Columns>
 | 
				
			||||||
                        <RadzenDataGridColumn Title="库位" Property="DrawerNo">
 | 
					                        <RadzenDataGridColumn Title="@myText.StorageLocation" Property="DrawerNo">
 | 
				
			||||||
                                <Template Context="s">
 | 
					                                <Template Context="s">
 | 
				
			||||||
                                    @s.DrawerNo - @s.ColNo
 | 
					                                    @s.DrawerNo - @s.ColNo
 | 
				
			||||||
                                </Template>
 | 
					                                </Template>
 | 
				
			||||||
                            </RadzenDataGridColumn>
 | 
					                            </RadzenDataGridColumn>
 | 
				
			||||||
                        <RadzenDataGridColumn Title="库存" Property="Quantity"></RadzenDataGridColumn>
 | 
					                        <RadzenDataGridColumn Title="@myText.Inventory" Property="Quantity"></RadzenDataGridColumn>
 | 
				
			||||||
                            @* <RadzenDataGridColumn Title="批次" Property="ManuNo"></RadzenDataGridColumn>
 | 
					                            @* <RadzenDataGridColumn Title="批次" Property="ManuNo"></RadzenDataGridColumn>
 | 
				
			||||||
                            <RadzenDataGridColumn Title="效期" Property="EffDate"></RadzenDataGridColumn> *@
 | 
					                            <RadzenDataGridColumn Title="效期" Property="EffDate"></RadzenDataGridColumn> *@
 | 
				
			||||||
                        <RadzenDataGridColumn Title="入库数量" Property="ReturnQuantity">
 | 
					                        <RadzenDataGridColumn Title="@myText.Quantity" Property="ReturnQuantity">
 | 
				
			||||||
                                <EditTemplate Context="cs">
 | 
					                                <EditTemplate Context="cs">
 | 
				
			||||||
                                    <RadzenNumeric Disabled="status > 0" Style="display: block" Min="0" Max="@di.Quantity" Name="Quantity" @bind-Value=@cs.ReturnQuantity />
 | 
					                                    <RadzenNumeric Disabled="status > 0" Style="display: block" Min="0" Max="@di.Quantity" Name="Quantity" @bind-Value=@cs.ReturnQuantity />
 | 
				
			||||||
                                <RadzenNumericRangeValidator Style="position: absolute;z-index: 9999;" Min="0" Max="@di.Quantity" Text="请填写正确的添加数量" Component="Quantity" />
 | 
					                                <RadzenNumericRangeValidator Style="position: absolute;z-index: 9999;" Min="0" Max="@di.Quantity" Text="@myText.InputNum" Component="Quantity" />
 | 
				
			||||||
                                <RadzenCustomValidator Validator="@(() => di.ChannelStocks.Sum(cs2 => cs2.ReturnQuantity) == di.Quantity)" Component="Quantity" Text="入库总量应等于还药总数" Style="position: absolute;z-index: 9999;" />
 | 
					                                <RadzenCustomValidator Validator="@(() => di.ChannelStocks.Sum(cs2 => cs2.ReturnQuantity) == di.Quantity)" Component="Quantity" Text="@myText.InputNumError" Style="position: absolute;z-index: 9999;" />
 | 
				
			||||||
                                </EditTemplate>
 | 
					                                </EditTemplate>
 | 
				
			||||||
                            </RadzenDataGridColumn>
 | 
					                            </RadzenDataGridColumn>
 | 
				
			||||||
                        </Columns>
 | 
					                        </Columns>
 | 
				
			||||||
                    </RadzenDataGrid>
 | 
					                    </RadzenDataGrid>
 | 
				
			||||||
                </Template>
 | 
					                </Template>
 | 
				
			||||||
                <Columns>
 | 
					                <Columns>
 | 
				
			||||||
                <RadzenDataGridColumn Property="Drug.DrugName" Title="药品" />
 | 
					                    <RadzenDataGridColumn Property="Drug.DrugName" Title="@myText.DrugName" />
 | 
				
			||||||
                <RadzenDataGridColumn Property="Drug.DrugSpec" Title="规格" />
 | 
					                    <RadzenDataGridColumn Property="Drug.DrugSpec" Title="@myText.Spec" />
 | 
				
			||||||
                <RadzenDataGridColumn Property="ManuNo" Title="批次">
 | 
					                    <RadzenDataGridColumn Property="ManuNo" Title="@myText.Batch">
 | 
				
			||||||
                        <Template Context="ov">
 | 
					                        <Template Context="ov">
 | 
				
			||||||
                            @ov.data.First().ManuNo
 | 
					                            @ov.data.First().ManuNo
 | 
				
			||||||
                        </Template>
 | 
					                        </Template>
 | 
				
			||||||
                    </RadzenDataGridColumn>
 | 
					                    </RadzenDataGridColumn>
 | 
				
			||||||
                <RadzenDataGridColumn Property="EffDate" Title="效期">
 | 
					                    <RadzenDataGridColumn Property="EffDate" Title="@myText.Expiration">
 | 
				
			||||||
                        <Template Context="ov">
 | 
					                        <Template Context="ov">
 | 
				
			||||||
                            @ov.data.First().EffDate
 | 
					                            @ov.data.First().EffDate
 | 
				
			||||||
                        </Template>
 | 
					                        </Template>
 | 
				
			||||||
                    </RadzenDataGridColumn>
 | 
					                    </RadzenDataGridColumn>
 | 
				
			||||||
                <RadzenDataGridColumn Property="Quantity" Title="还药总数">
 | 
					                    <RadzenDataGridColumn Property="Quantity" Title="@myText.Quantity" />
 | 
				
			||||||
                    <HeaderTemplate>
 | 
					                <RadzenDataGridColumn Property="StockQuantity" Title="@myText.TotalStock" />
 | 
				
			||||||
                        <div style="text-align: center;">
 | 
					 | 
				
			||||||
                            还药<br>总数
 | 
					 | 
				
			||||||
                        </div>
 | 
					 | 
				
			||||||
                    </HeaderTemplate>
 | 
					 | 
				
			||||||
                </RadzenDataGridColumn>
 | 
					 | 
				
			||||||
                <RadzenDataGridColumn Property="StockQuantity" Title="总库存" />
 | 
					 | 
				
			||||||
                </Columns>
 | 
					                </Columns>
 | 
				
			||||||
            </RadzenDataGrid>
 | 
					            </RadzenDataGrid>
 | 
				
			||||||
        
 | 
					        
 | 
				
			||||||
| 
						 | 
					@ -66,15 +60,15 @@
 | 
				
			||||||
    <RadzenStack Orientation="Orientation.Horizontal" JustifyContent="JustifyContent.Center" Gap="0.5rem">
 | 
					    <RadzenStack Orientation="Orientation.Horizontal" JustifyContent="JustifyContent.Center" Gap="0.5rem">
 | 
				
			||||||
        @if (status < 2)
 | 
					        @if (status < 2)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            <RadzenButton Click="@StartAdd" Disabled="!CanTakeDrug" IsBusy="status > 0" BusyText="加药中。。。" ButtonStyle="ButtonStyle.Warning" Variant="Variant.Flat" Text="加药" Style="width: 120px" />
 | 
					            <RadzenButton Click="@StartAdd" Disabled="!CanTakeDrug" IsBusy="status > 0" BusyText="@myText.Adding" ButtonStyle="ButtonStyle.Warning" Variant="Variant.Flat" Text="@myText.Add" Style="width: 120px" />
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        @if (status == 2)
 | 
					        @if (status == 2)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            <RadzenButton Click="@AddFinish" ButtonStyle="ButtonStyle.Success" Variant="Variant.Flat" Text="完成" Style="width: 120px" />
 | 
					            <RadzenButton Click="@AddFinish" ButtonStyle="ButtonStyle.Success" Variant="Variant.Flat" Text="@myText.Complete" Style="width: 120px" />
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        @if (status < 2)
 | 
					        @if (status < 2)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            <RadzenButton Click="@((args) => CancelOpera())" Variant="Variant.Flat" Text="取消" Style="width: 120px" />
 | 
					            <RadzenButton Click="@((args) => CancelOpera())" Variant="Variant.Flat" Text="@myText.Cancel" Style="width: 120px" />
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    </RadzenStack>
 | 
					    </RadzenStack>
 | 
				
			||||||
</RadzenStack>
 | 
					</RadzenStack>
 | 
				
			||||||
| 
						 | 
					@ -85,6 +79,9 @@
 | 
				
			||||||
    @inject IOptions<DrawerConfig> setting;
 | 
					    @inject IOptions<DrawerConfig> setting;
 | 
				
			||||||
    @inject NotificationService _message
 | 
					    @inject NotificationService _message
 | 
				
			||||||
    @inject PortUtil PortUtil;
 | 
					    @inject PortUtil PortUtil;
 | 
				
			||||||
 | 
					    @inject Toolbelt.Blazor.I18nText.I18nText I18nText;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    private I18nText.local myText = new I18nText.local();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    RadzenDataGrid<OperationVo<List<MachineRecord>>> grid;
 | 
					    RadzenDataGrid<OperationVo<List<MachineRecord>>> grid;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -102,11 +99,10 @@
 | 
				
			||||||
        if(data.Any(it => it.Quantity != it.ChannelStocks.Sum(cs => cs.ReturnQuantity)))
 | 
					        if(data.Any(it => it.Quantity != it.ChannelStocks.Sum(cs => cs.ReturnQuantity)))
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            _message.Notify(
 | 
					            _message.Notify(
 | 
				
			||||||
                new NotificationMessage { Severity = NotificationSeverity.Error, Summary = "提示", Detail = $"请填写正确的入库数量!", Duration = 4000 }
 | 
					                new NotificationMessage { Severity = NotificationSeverity.Error, Summary = myText.Tips, Detail = myText.InputCorrectInNum, Duration = 4000 }
 | 
				
			||||||
            );
 | 
					            );
 | 
				
			||||||
            
 | 
					            
 | 
				
			||||||
        }
 | 
					        } else
 | 
				
			||||||
        else
 | 
					 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            await OpenDrawer();
 | 
					            await OpenDrawer();
 | 
				
			||||||
        } 
 | 
					        } 
 | 
				
			||||||
| 
						 | 
					@ -123,8 +119,6 @@
 | 
				
			||||||
    async Task OpenDrawer()
 | 
					    async Task OpenDrawer()
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        this.status = 1;
 | 
					        this.status = 1;
 | 
				
			||||||
        PortUtil.PowerOn();
 | 
					 | 
				
			||||||
        await Task.Delay(200);
 | 
					 | 
				
			||||||
        // 解析需要打开的抽屉列表
 | 
					        // 解析需要打开的抽屉列表
 | 
				
			||||||
        List<ChannelStock> channels = new();
 | 
					        List<ChannelStock> channels = new();
 | 
				
			||||||
        for (int i = 0; i < data.Count; i++)
 | 
					        for (int i = 0; i < data.Count; i++)
 | 
				
			||||||
| 
						 | 
					@ -134,7 +128,7 @@
 | 
				
			||||||
        if (channels.Count == 0)
 | 
					        if (channels.Count == 0)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            _message.Notify(
 | 
					            _message.Notify(
 | 
				
			||||||
                new NotificationMessage { Severity = NotificationSeverity.Error, Summary = "提示", Detail = $"请填写正确的入库数量!", Duration = 4000 }
 | 
					                new NotificationMessage { Severity = NotificationSeverity.Error, Summary = myText.Tips, Detail = myText.InputCorrectInNum, Duration = 4000 }
 | 
				
			||||||
            );
 | 
					            );
 | 
				
			||||||
            return;
 | 
					            return;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
| 
						 | 
					@ -167,24 +161,24 @@
 | 
				
			||||||
                            byte[] quantity = await PortUtil.CheckQuantityByDrawer(drawerNo);
 | 
					                            byte[] quantity = await PortUtil.CheckQuantityByDrawer(drawerNo);
 | 
				
			||||||
                            BeforeQuantity = quantity.Select(it => Convert.ToInt32(it)).ToArray().Skip(3).Take(9).ToArray();
 | 
					                            BeforeQuantity = quantity.Select(it => Convert.ToInt32(it)).ToArray().Skip(3).Take(9).ToArray();
 | 
				
			||||||
                            logger.Info($"单支抽屉【{drawerNo}】,开抽屉前检测数量【{string.Join(",", BeforeQuantity)}】");
 | 
					                            logger.Info($"单支抽屉【{drawerNo}】,开抽屉前检测数量【{string.Join(",", BeforeQuantity)}】");
 | 
				
			||||||
                            var colNo = data.Select(ot => ot.ChannelStocks.Where(cs => cs.DrawerNo == drawerNo).Select(cs => cs.ColNo));
 | 
					
 | 
				
			||||||
                            await PortUtil.NoLightOnByCol(drawerNo, colNo.SelectMany(x => x).ToArray());
 | 
					                            await PortUtil.NoLightOnByCol(drawerNo, data.Select(ot => ot.ChannelStocks.Where(cs => cs.DrawerNo == drawerNo).Select(cs => cs.ColNo)).Cast<int>().ToArray());
 | 
				
			||||||
                        }
 | 
					                        }
 | 
				
			||||||
                        var b = await PortUtil.OpenDrawerStatus(drawerNo);
 | 
					                        var b = await PortUtil.OpenDrawerStatus(drawerNo);
 | 
				
			||||||
                        if (b)
 | 
					                        if (b)
 | 
				
			||||||
                        {
 | 
					                        {
 | 
				
			||||||
                            PortUtil.speechSynthesizer.SpeakAsyncCancelAll();
 | 
					                            PortUtil.speechSynthesizer.SpeakAsyncCancelAll();
 | 
				
			||||||
                            PortUtil.SpeakAsync($"{drawerNo}号抽屉已经打开,请,加药");
 | 
					                            PortUtil.SpeakAsync($"{drawerNo}{myText.PleaseAdd}");
 | 
				
			||||||
                            options._data = 1;
 | 
					                            options._data = 1;
 | 
				
			||||||
                            next();
 | 
					                            next();
 | 
				
			||||||
                        }
 | 
					                        }
 | 
				
			||||||
                        else
 | 
					                        else
 | 
				
			||||||
                        {
 | 
					                        {
 | 
				
			||||||
                            _message.Notify(
 | 
					                            _message.Notify(
 | 
				
			||||||
                                new NotificationMessage { Severity = NotificationSeverity.Error, Summary = "提示", Detail = $"抽屉【{drawerNo}】打开失败,请检测硬件", Duration = 4000 }
 | 
					                                new NotificationMessage { Severity = NotificationSeverity.Error, Summary = myText.Tips, Detail = $"【{drawerNo}】{myText.DrawerOpenFailed}", Duration = 4000 }
 | 
				
			||||||
                            );
 | 
					                            );
 | 
				
			||||||
                            logger.Info($"抽屉打开失败");
 | 
					                            logger.Info(myText.DrawerOpenFailed);
 | 
				
			||||||
                            PortUtil.PowerOff();
 | 
					                            PortUtil.AllLightOff();
 | 
				
			||||||
                            RestData();
 | 
					                            RestData();
 | 
				
			||||||
                            stop();
 | 
					                            stop();
 | 
				
			||||||
                        }
 | 
					                        }
 | 
				
			||||||
| 
						 | 
					@ -200,12 +194,12 @@
 | 
				
			||||||
                            options._data = 0;
 | 
					                            options._data = 0;
 | 
				
			||||||
                            if (setting.Value.single.Contains(drawerNo))
 | 
					                            if (setting.Value.single.Contains(drawerNo))
 | 
				
			||||||
                            {
 | 
					                            {
 | 
				
			||||||
                                PortUtil.PowerOff();
 | 
					                                PortUtil.AllLightOff();
 | 
				
			||||||
                            }
 | 
					                            }
 | 
				
			||||||
                            if (index == drawerNos.Count - 1)
 | 
					                            if (index == drawerNos.Count - 1)
 | 
				
			||||||
                            {
 | 
					                            {
 | 
				
			||||||
                                PortUtil.speechSynthesizer.SpeakAsyncCancelAll();
 | 
					                                PortUtil.speechSynthesizer.SpeakAsyncCancelAll();
 | 
				
			||||||
                                PortUtil.SpeakAsync($"加药完成,请,点击完成按钮进行确认");
 | 
					                                PortUtil.SpeakAsync(myText.AddSuccessful);
 | 
				
			||||||
                                this.status = 2;
 | 
					                                this.status = 2;
 | 
				
			||||||
                                stop();
 | 
					                                stop();
 | 
				
			||||||
                            }
 | 
					                            }
 | 
				
			||||||
| 
						 | 
					@ -225,14 +219,11 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                                data.ForEach(cl =>
 | 
					                                data.ForEach(cl =>
 | 
				
			||||||
                                {
 | 
					                                {
 | 
				
			||||||
                                    // cl.ChannelStocks.Where(cs => cs.DrawerNo == drawerNo).ToList().ForEach(cs =>
 | 
					 | 
				
			||||||
                                    // {
 | 
					 | 
				
			||||||
                                    //     logger.Info($"单支抽屉【{drawerNo}】,应加药品数量【{cs.AddQuantity}】,现实加药数量【{AfterQuantity[cs.ColNo - 1] - BeforeQuantity[cs.ColNo - 1]}】");
 | 
					 | 
				
			||||||
                                    // });
 | 
					 | 
				
			||||||
                                    cl.ChannelStocks.Where(cs => cs.DrawerNo == drawerNo).ToList().ForEach(cs =>
 | 
					                                    cl.ChannelStocks.Where(cs => cs.DrawerNo == drawerNo).ToList().ForEach(cs =>
 | 
				
			||||||
                                    {
 | 
					                                    {
 | 
				
			||||||
                                        cl.ReturnQuantity = AfterQuantity[cs.ColNo - 1] - BeforeQuantity[cs.ColNo - 1];
 | 
					                                        logger.Info($"单支抽屉【{drawerNo}】,应加药品数量【{cs.AddQuantity}】,现实取数量【{AfterQuantity[cs.ColNo - 1] - BeforeQuantity[cs.ColNo - 1]}】");
 | 
				
			||||||
                                    });
 | 
					                                    });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                                });
 | 
					                                });
 | 
				
			||||||
                            }
 | 
					                            }
 | 
				
			||||||
                            next(); // continue iteration
 | 
					                            next(); // continue iteration
 | 
				
			||||||
| 
						 | 
					@ -245,23 +236,21 @@
 | 
				
			||||||
            catch (Exception e)
 | 
					            catch (Exception e)
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                RestData();
 | 
					                RestData();
 | 
				
			||||||
                logger.Info($"还药发生错误,{e.Message}");
 | 
					                logger.Info($"调拨加药发生错误,{e.Message}");
 | 
				
			||||||
                _message.Notify(
 | 
					                _message.Notify(
 | 
				
			||||||
                    new NotificationMessage { Severity = NotificationSeverity.Error, Summary = "提示", Detail = $"发生错误,{e.Message}", Duration = 4000 }
 | 
					                    new NotificationMessage { Severity = NotificationSeverity.Error, Summary = myText.Tips, Detail = $"发生错误,{e.Message}", Duration = 4000 }
 | 
				
			||||||
                );
 | 
					                );
 | 
				
			||||||
                if (setting.Value.single.Contains(drawerNo))
 | 
					                if (setting.Value.single.Contains(drawerNo))
 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
                    PortUtil.PowerOff();
 | 
					                    PortUtil.AllLightOff();
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
                stop();
 | 
					                stop();
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        });
 | 
					        });
 | 
				
			||||||
        PortUtil.PowerOff();
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    void RestData()
 | 
					    void RestData()
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        PortUtil.PowerOff();
 | 
					 | 
				
			||||||
        this.status = 0;
 | 
					        this.status = 0;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -272,7 +261,7 @@
 | 
				
			||||||
        var b = await machineRecordDao.ReturnDrugFinish(data);
 | 
					        var b = await machineRecordDao.ReturnDrugFinish(data);
 | 
				
			||||||
        if (!b)
 | 
					        if (!b)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            _message.Notify(new NotificationMessage { Severity = NotificationSeverity.Error, Summary = "提示", Detail = $"数据保存失败", Duration = 4000 });
 | 
					            _message.Notify(new NotificationMessage { Severity = NotificationSeverity.Error, Summary = myText.Tips, Detail = myText.DataSaveFailed, Duration = 4000 });
 | 
				
			||||||
            logger.Error($"抽屉加药保存数据库失败,数据{JsonConvert.SerializeObject(data)}");
 | 
					            logger.Error($"抽屉加药保存数据库失败,数据{JsonConvert.SerializeObject(data)}");
 | 
				
			||||||
            // 关闭弹窗
 | 
					            // 关闭弹窗
 | 
				
			||||||
            dialogService.Close(false);
 | 
					            dialogService.Close(false);
 | 
				
			||||||
| 
						 | 
					@ -290,6 +279,7 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    protected override async Task OnInitializedAsync()
 | 
					    protected override async Task OnInitializedAsync()
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
 | 
					        myText = await I18nText.GetTextTableAsync<I18nText.local>(this);
 | 
				
			||||||
        data = await machineRecordDao.getReturnDrugInfoByRecords(records);
 | 
					        data = await machineRecordDao.getReturnDrugInfoByRecords(records);
 | 
				
			||||||
        // 如果有库位列表未空则说明不能取药,需要增加库位
 | 
					        // 如果有库位列表未空则说明不能取药,需要增加库位
 | 
				
			||||||
        if (data.Any(it => it.ChannelStocks.Count == 0))
 | 
					        if (data.Any(it => it.ChannelStocks.Count == 0))
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -45,7 +45,7 @@
 | 
				
			||||||
            <RadzenDataGrid @ref="grid"
 | 
					            <RadzenDataGrid @ref="grid"
 | 
				
			||||||
            LoadData="@LoadData"
 | 
					            LoadData="@LoadData"
 | 
				
			||||||
            IsLoading="@isLoading"
 | 
					            IsLoading="@isLoading"
 | 
				
			||||||
            EmptyText="无数据"
 | 
					            EmptyText="@myText.NoDate"
 | 
				
			||||||
            Data="@_forecasts"
 | 
					            Data="@_forecasts"
 | 
				
			||||||
            AllowColumnResize="true" AllowAlternatingRows="false"
 | 
					            AllowColumnResize="true" AllowAlternatingRows="false"
 | 
				
			||||||
            AllowRowSelectOnRowClick="true"
 | 
					            AllowRowSelectOnRowClick="true"
 | 
				
			||||||
| 
						 | 
					@ -56,16 +56,16 @@
 | 
				
			||||||
                    </RadzenRow>
 | 
					                    </RadzenRow>
 | 
				
			||||||
                </HeaderTemplate> *@
 | 
					                </HeaderTemplate> *@
 | 
				
			||||||
                <Columns>
 | 
					                <Columns>
 | 
				
			||||||
                    <RadzenDataGridColumn Frozen="true" Title="库位" Property="Location"></RadzenDataGridColumn>
 | 
					                    <RadzenDataGridColumn Frozen="true" Title="@myText.StorageLocation" Property="Location"></RadzenDataGridColumn>
 | 
				
			||||||
                    <RadzenDataGridColumn Width="200px" Title="药品名称" Property="Drug.DrugName">
 | 
					                    <RadzenDataGridColumn Width="200px" Title="@myText.DrugName" Property="Drug.DrugName">
 | 
				
			||||||
                        @* <Template Context="mr">
 | 
					                        @* <Template Context="mr">
 | 
				
			||||||
                            <RadzenText TextStyle="TextStyle.Subtitle2" class="mb-0">@mr.Drug?.DrugName</RadzenText>
 | 
					                            <RadzenText TextStyle="TextStyle.Subtitle2" class="mb-0">@mr.Drug?.DrugName</RadzenText>
 | 
				
			||||||
                            <RadzenText TextStyle="TextStyle.Caption">@mr.Drug?.DrugSpec</RadzenText>
 | 
					                            <RadzenText TextStyle="TextStyle.Caption">@mr.Drug?.DrugSpec</RadzenText>
 | 
				
			||||||
                        </Template> *@
 | 
					                        </Template> *@
 | 
				
			||||||
                    </RadzenDataGridColumn>
 | 
					                    </RadzenDataGridColumn>
 | 
				
			||||||
                    <RadzenDataGridColumn Title="厂家" Property="Drug.Manufactory"></RadzenDataGridColumn>
 | 
					                    <RadzenDataGridColumn Title="@myText.Factory" Property="Drug.Manufactory"></RadzenDataGridColumn>
 | 
				
			||||||
                    <RadzenDataGridColumn Title="库存" Property="Quantity"></RadzenDataGridColumn>
 | 
					                    <RadzenDataGridColumn Title="@myText.Inventory" Property="Quantity"></RadzenDataGridColumn>
 | 
				
			||||||
                    <RadzenDataGridColumn Title="可归还数量" Property="CanReturnQuantity"></RadzenDataGridColumn>
 | 
					                    <RadzenDataGridColumn Title="@myText.CanReturnQuantity" Property="CanReturnQuantity"></RadzenDataGridColumn>
 | 
				
			||||||
                    @*<RadzenDataGridColumn Title="本次归还" Property="CurrentReturnQuantity">
 | 
					                    @*<RadzenDataGridColumn Title="本次归还" Property="CurrentReturnQuantity">
 | 
				
			||||||
                        <EditTemplate Context="mr">
 | 
					                        <EditTemplate Context="mr">
 | 
				
			||||||
                             <RadzenNumeric Min="0" Style="display: block" Max="@(mr.Quantity - mr.ReturnQuantity1 - mr.ReturnQuantity2)" Name="Quantity" @bind-Value=@mr.CurrentReturnQuantity /> 
 | 
					                             <RadzenNumeric Min="0" Style="display: block" Max="@(mr.Quantity - mr.ReturnQuantity1 - mr.ReturnQuantity2)" Name="Quantity" @bind-Value=@mr.CurrentReturnQuantity /> 
 | 
				
			||||||
| 
						 | 
					@ -81,6 +81,8 @@
 | 
				
			||||||
    @inject IMachineRecordDao machineRecordDao;
 | 
					    @inject IMachineRecordDao machineRecordDao;
 | 
				
			||||||
    @inject DialogService dialogService;
 | 
					    @inject DialogService dialogService;
 | 
				
			||||||
    @inject NotificationService _message
 | 
					    @inject NotificationService _message
 | 
				
			||||||
 | 
					    @inject Toolbelt.Blazor.I18nText.I18nText I18nText;
 | 
				
			||||||
 | 
					    private I18nText.local myText = new I18nText.local();
 | 
				
			||||||
    RadzenDataGrid<ChannelStock> grid;
 | 
					    RadzenDataGrid<ChannelStock> grid;
 | 
				
			||||||
    bool isLoading;
 | 
					    bool isLoading;
 | 
				
			||||||
    int count;
 | 
					    int count;
 | 
				
			||||||
| 
						 | 
					@ -109,7 +111,7 @@
 | 
				
			||||||
        if (string.IsNullOrEmpty(args.Data.DrugId))
 | 
					        if (string.IsNullOrEmpty(args.Data.DrugId))
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            _message.Notify(
 | 
					            _message.Notify(
 | 
				
			||||||
                new NotificationMessage { Style = "position: absolute; inset-inline-start: -1000px;", Severity = NotificationSeverity.Error, Summary = "提示", Detail = $"该库位无药品,请先绑药!", Duration = 4000 }
 | 
					                new NotificationMessage { Style = "position: absolute; inset-inline-start: -1000px;", Severity = NotificationSeverity.Error, Summary = myText.Tips, Detail = $"该库位无药品,请先绑药!", Duration = 4000 }
 | 
				
			||||||
            );
 | 
					            );
 | 
				
			||||||
            return;
 | 
					            return;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
| 
						 | 
					@ -117,7 +119,7 @@
 | 
				
			||||||
        var list = args.Data;// _forecasts.Where(mr => mr.DrawerNo > 0).ToList();
 | 
					        var list = args.Data;// _forecasts.Where(mr => mr.DrawerNo > 0).ToList();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        var b = await dialogService.OpenAsync<RecordReturnEmptyDialog>(
 | 
					        var b = await dialogService.OpenAsync<RecordReturnEmptyDialog>(
 | 
				
			||||||
                $"归还空瓶",
 | 
					                myText.ReturnEmpty,
 | 
				
			||||||
              new Dictionary<string, object>() { { "records", list } },
 | 
					              new Dictionary<string, object>() { { "records", list } },
 | 
				
			||||||
              new DialogOptions() { Width = "85vw", Resizable = true, Draggable = true, ShowClose = false }
 | 
					              new DialogOptions() { Width = "85vw", Resizable = true, Draggable = true, ShowClose = false }
 | 
				
			||||||
        );
 | 
					        );
 | 
				
			||||||
| 
						 | 
					@ -126,4 +128,9 @@
 | 
				
			||||||
            await reloadGrid();
 | 
					            await reloadGrid();
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					    protected override async Task OnInitializedAsync()
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        myText = await I18nText.GetTextTableAsync<I18nText.local>(this);
 | 
				
			||||||
 | 
					        base.OnInitializedAsync();
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -6,74 +6,74 @@
 | 
				
			||||||
@using Newtonsoft.Json;
 | 
					@using Newtonsoft.Json;
 | 
				
			||||||
@using log4net;
 | 
					@using log4net;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
<RadzenFieldset Text="药品信息">
 | 
					<RadzenFieldset Text="@myText.DrugInfo">
 | 
				
			||||||
    <RadzenStack Orientation="Orientation.Horizontal" Gap="10px" JustifyContent="JustifyContent.Center" AlignItems="AlignItems.Center" Wrap="FlexWrap.NoWrap" Style="height: 80px;padding:20px;">
 | 
					    <RadzenStack Orientation="Orientation.Horizontal" Gap="10px" JustifyContent="JustifyContent.Center" AlignItems="AlignItems.Center" Wrap="FlexWrap.NoWrap" Style="height: 80px;padding:20px;">
 | 
				
			||||||
        <RadzenStack class="rz-p-1  rz-text-align-center" Style="width:500px">
 | 
					        <RadzenStack class="rz-p-1  rz-text-align-center" Style="width:500px">
 | 
				
			||||||
            药品:@drugName
 | 
					            @myText.DrugName:@drugName
 | 
				
			||||||
        </RadzenStack>
 | 
					        </RadzenStack>
 | 
				
			||||||
        <RadzenStack class="rz-p-1 rz-text-align-center" Style="width:500px">
 | 
					        <RadzenStack class="rz-p-1 rz-text-align-center" Style="width:500px">
 | 
				
			||||||
            规格:@drugSpec
 | 
					            @myText.Spec:@drugSpec
 | 
				
			||||||
        </RadzenStack>
 | 
					        </RadzenStack>
 | 
				
			||||||
        <RadzenStack class="rz-p-1 rz-text-align-center" Style="width:500px">
 | 
					        <RadzenStack class="rz-p-1 rz-text-align-center" Style="width:500px">
 | 
				
			||||||
            厂家:@drugManufactory
 | 
					            @myText.Factory:@drugManufactory
 | 
				
			||||||
        </RadzenStack>
 | 
					        </RadzenStack>
 | 
				
			||||||
        <RadzenStack class="rz-p-1   rz-text-align-center" Style="width:500px">
 | 
					        <RadzenStack class="rz-p-1   rz-text-align-center" Style="width:500px">
 | 
				
			||||||
            可还空瓶数:@emptyQuantity
 | 
					            @myText.CanReturnQuantity:@emptyQuantity
 | 
				
			||||||
        </RadzenStack>
 | 
					        </RadzenStack>
 | 
				
			||||||
    </RadzenStack>
 | 
					    </RadzenStack>
 | 
				
			||||||
</RadzenFieldset>
 | 
					</RadzenFieldset>
 | 
				
			||||||
<div  Style="height:50vh;overflow:auto;">
 | 
					
 | 
				
			||||||
<RadzenDataGrid @ref="grid"
 | 
					<RadzenDataGrid @ref="grid"
 | 
				
			||||||
                LoadData="@LoadData"
 | 
					                LoadData="@LoadData"
 | 
				
			||||||
                IsLoading="@isLoading"
 | 
					                IsLoading="@isLoading"
 | 
				
			||||||
                Count="@count"
 | 
					                Count="@count"
 | 
				
			||||||
    EmptyText="无数据"
 | 
					                EmptyText="@myText.NoDate"
 | 
				
			||||||
                Data="@_returnEmptys"
 | 
					                Data="@_returnEmptys"
 | 
				
			||||||
                AllowColumnResize="true" AllowAlternatingRows="false"
 | 
					                AllowColumnResize="true" AllowAlternatingRows="false"
 | 
				
			||||||
                AllowRowSelectOnRowClick="true"
 | 
					                AllowRowSelectOnRowClick="true"
 | 
				
			||||||
                CellClick="@((DataGridCellMouseEventArgs<MachineRecord> args) => OnCellClick(args))"
 | 
					                CellClick="@((DataGridCellMouseEventArgs<MachineRecord> args) => OnCellClick(args))"
 | 
				
			||||||
    AllowPaging="false" PagerHorizontalAlign="HorizontalAlign.Left" ShowPagingSummary="true" PagingSummaryFormat="{0}/{1} 共{2}条数据">
 | 
					                AllowPaging="true" PageSize="8" PagerHorizontalAlign="HorizontalAlign.Left" ShowPagingSummary="true" PagingSummaryFormat="{0}/{1} 共{2}条数据">
 | 
				
			||||||
    <Columns>
 | 
					    <Columns>
 | 
				
			||||||
        <RadzenDataGridColumn Width="60px" Sortable="false" Filterable="false">
 | 
					        <RadzenDataGridColumn Width="60px" Sortable="false" Filterable="false">
 | 
				
			||||||
            <HeaderTemplate>
 | 
					            <HeaderTemplate>
 | 
				
			||||||
                    选择
 | 
					                @myText.Select
 | 
				
			||||||
            </HeaderTemplate>
 | 
					            </HeaderTemplate>
 | 
				
			||||||
            <Template Context="LoadData">
 | 
					            <Template Context="LoadData">
 | 
				
			||||||
                <RadzenCheckBox TriState="false" Value="@LoadData.IsSelected" InputAttributes="@(new Dictionary<string,object>(){ { "aria-label", "Select item" }})"
 | 
					                <RadzenCheckBox TriState="false" Value="@LoadData.IsSelected" InputAttributes="@(new Dictionary<string,object>(){ { "aria-label", "Select item" }})"
 | 
				
			||||||
                                TValue="bool" />
 | 
					                                TValue="bool" />
 | 
				
			||||||
            </Template>
 | 
					            </Template>
 | 
				
			||||||
        </RadzenDataGridColumn>
 | 
					        </RadzenDataGridColumn>
 | 
				
			||||||
            <RadzenDataGridColumn Frozen="true" Title="操作人" Property="OperatorUser.NickName"></RadzenDataGridColumn>
 | 
					        <RadzenDataGridColumn Frozen="true" Title="@myText.Operator" Property="OperatorUser.NickName"></RadzenDataGridColumn>
 | 
				
			||||||
            <RadzenDataGridColumn Width="170px" Title="操作时间" Property="OperationTime"></RadzenDataGridColumn>
 | 
					        <RadzenDataGridColumn Width="170px" Title="@myText.OperateDate" Property="OperationTime"></RadzenDataGridColumn>
 | 
				
			||||||
            <RadzenDataGridColumn Title="批次" Property="ManuNo">
 | 
					        <RadzenDataGridColumn Title="@myText.Batch" Property="ManuNo">
 | 
				
			||||||
            <Template Context="mr">
 | 
					            <Template Context="mr">
 | 
				
			||||||
                <RadzenText TextStyle="TextStyle.Subtitle2" class="mb-0">@mr.ManuNo</RadzenText>
 | 
					                <RadzenText TextStyle="TextStyle.Subtitle2" class="mb-0">@mr.ManuNo</RadzenText>
 | 
				
			||||||
                <RadzenText TextStyle="TextStyle.Caption"> @mr.EffDate?.ToString("yyyy-MM-dd")</RadzenText>
 | 
					                <RadzenText TextStyle="TextStyle.Caption"> @mr.EffDate?.ToString("yyyy-MM-dd")</RadzenText>
 | 
				
			||||||
            </Template>
 | 
					            </Template>
 | 
				
			||||||
        </RadzenDataGridColumn>
 | 
					        </RadzenDataGridColumn>
 | 
				
			||||||
            <RadzenDataGridColumn Title="数量" Property="Quantity"></RadzenDataGridColumn>
 | 
					        <RadzenDataGridColumn Title="@myText.Quantity" Property="Quantity"></RadzenDataGridColumn>
 | 
				
			||||||
            <RadzenDataGridColumn Title="已还药品" Property="ReturnQuantity1"></RadzenDataGridColumn>
 | 
					        <RadzenDataGridColumn Title="@myText.ReturnQuantity" Property="ReturnQuantity1"></RadzenDataGridColumn>
 | 
				
			||||||
            <RadzenDataGridColumn Title="已还空瓶" Property="ReturnQuantity2"></RadzenDataGridColumn>
 | 
					        <RadzenDataGridColumn Title="@myText.ReturnEmpty" Property="ReturnQuantity2"></RadzenDataGridColumn>
 | 
				
			||||||
            <RadzenDataGridColumn Title="本次归还" Property="CurrentReturnQuantity">
 | 
					        <RadzenDataGridColumn Title="@myText.CurrentReturn" Property="CurrentReturnQuantity">
 | 
				
			||||||
            <EditTemplate Context="mr">
 | 
					            <EditTemplate Context="mr">
 | 
				
			||||||
                <RadzenNumeric Min="0" Style="display: block" Max="@(mr.Quantity - mr.ReturnQuantity1 - mr.ReturnQuantity2)" Name="Quantity" @bind-Value=@mr.CurrentReturnQuantity />
 | 
					                <RadzenNumeric Min="0" Style="display: block" Max="@(mr.Quantity - mr.ReturnQuantity1 - mr.ReturnQuantity2)" Name="Quantity" @bind-Value=@mr.CurrentReturnQuantity />
 | 
				
			||||||
            </EditTemplate>
 | 
					            </EditTemplate>
 | 
				
			||||||
        </RadzenDataGridColumn>
 | 
					        </RadzenDataGridColumn>
 | 
				
			||||||
    </Columns>
 | 
					    </Columns>
 | 
				
			||||||
</RadzenDataGrid>
 | 
					</RadzenDataGrid>
 | 
				
			||||||
</div>
 | 
					
 | 
				
			||||||
<RadzenStack Orientation="Orientation.Horizontal" JustifyContent="JustifyContent.Center" Gap="0.5rem" Style="margin-top:15px;">
 | 
					<RadzenStack Orientation="Orientation.Horizontal" JustifyContent="JustifyContent.Center" Gap="0.5rem" Style="margin-top:15px;">
 | 
				
			||||||
    @if (status < 2)
 | 
					    @if (status < 2)
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        <RadzenButton Click="@StartAdd" IsBusy="status > 0" BusyText="还空瓶中。。。" ButtonStyle="ButtonStyle.Warning" Variant="Variant.Flat" Text="归还" Style="width: 120px" />
 | 
					        <RadzenButton Click="@StartAdd" IsBusy="status > 0" BusyText="@myText.Returning" ButtonStyle="ButtonStyle.Warning" Variant="Variant.Flat" Text="@myText.Return" Style="width: 120px" />
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    @if (status == 2)
 | 
					    @if (status == 2)
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        <RadzenButton Click="@AddFinish" ButtonStyle="ButtonStyle.Success" Variant="Variant.Flat" Text="完成" Style="width: 120px" />
 | 
					        <RadzenButton Click="@AddFinish" ButtonStyle="ButtonStyle.Success" Variant="Variant.Flat" Text="@myText.Complete" Style="width: 120px" />
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    @if (status < 2)
 | 
					    @if (status < 2)
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        <RadzenButton Click="@((args) => CancelOpera())" Variant="Variant.Flat" Text="取消" Style="width: 120px" />
 | 
					        <RadzenButton Click="@((args) => CancelOpera())" Variant="Variant.Flat" Text="@myText.Cancel" Style="width: 120px" />
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
</RadzenStack>
 | 
					</RadzenStack>
 | 
				
			||||||
@code
 | 
					@code
 | 
				
			||||||
| 
						 | 
					@ -84,6 +84,8 @@
 | 
				
			||||||
    @inject IOptions<DrawerConfig> setting;
 | 
					    @inject IOptions<DrawerConfig> setting;
 | 
				
			||||||
    @inject NotificationService _message
 | 
					    @inject NotificationService _message
 | 
				
			||||||
    @inject PortUtil PortUtil;
 | 
					    @inject PortUtil PortUtil;
 | 
				
			||||||
 | 
					    @inject Toolbelt.Blazor.I18nText.I18nText I18nText;
 | 
				
			||||||
 | 
					    private I18nText.local myText = new I18nText.local();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    [Parameter]
 | 
					    [Parameter]
 | 
				
			||||||
    public ChannelStock records { get; set; }
 | 
					    public ChannelStock records { get; set; }
 | 
				
			||||||
| 
						 | 
					@ -169,8 +171,6 @@
 | 
				
			||||||
    async Task OpenDrawer()
 | 
					    async Task OpenDrawer()
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        this.status = 1;
 | 
					        this.status = 1;
 | 
				
			||||||
        PortUtil.PowerOn();
 | 
					 | 
				
			||||||
        await Task.Delay(200);
 | 
					 | 
				
			||||||
        // 解析需要打开的抽屉列表
 | 
					        // 解析需要打开的抽屉列表
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        int drawerNo = records.DrawerNo;
 | 
					        int drawerNo = records.DrawerNo;
 | 
				
			||||||
| 
						 | 
					@ -217,7 +217,7 @@
 | 
				
			||||||
                                new NotificationMessage { Severity = NotificationSeverity.Error, Summary = "提示", Detail = $"抽屉【{drawerNo}】打开失败,请检测硬件", Duration = 4000 }
 | 
					                                new NotificationMessage { Severity = NotificationSeverity.Error, Summary = "提示", Detail = $"抽屉【{drawerNo}】打开失败,请检测硬件", Duration = 4000 }
 | 
				
			||||||
                            );
 | 
					                            );
 | 
				
			||||||
                            logger.Info($"抽屉打开失败");
 | 
					                            logger.Info($"抽屉打开失败");
 | 
				
			||||||
                            PortUtil.PowerOff();
 | 
					                            PortUtil.AllLightOff();
 | 
				
			||||||
                            RestData();
 | 
					                            RestData();
 | 
				
			||||||
                            stop();
 | 
					                            stop();
 | 
				
			||||||
                        }
 | 
					                        }
 | 
				
			||||||
| 
						 | 
					@ -233,7 +233,7 @@
 | 
				
			||||||
                            options._data = 0;
 | 
					                            options._data = 0;
 | 
				
			||||||
                            if (setting.Value.single.Contains(drawerNo))
 | 
					                            if (setting.Value.single.Contains(drawerNo))
 | 
				
			||||||
                            {
 | 
					                            {
 | 
				
			||||||
                                PortUtil.PowerOff();
 | 
					                                PortUtil.AllLightOff();
 | 
				
			||||||
                            }
 | 
					                            }
 | 
				
			||||||
                            PortUtil.speechSynthesizer.SpeakAsyncCancelAll();
 | 
					                            PortUtil.speechSynthesizer.SpeakAsyncCancelAll();
 | 
				
			||||||
                            PortUtil.SpeakAsync($"加药完成,请,点击完成按钮进行确认");
 | 
					                            PortUtil.SpeakAsync($"加药完成,请,点击完成按钮进行确认");
 | 
				
			||||||
| 
						 | 
					@ -273,17 +273,15 @@
 | 
				
			||||||
                );
 | 
					                );
 | 
				
			||||||
                if (setting.Value.single.Contains(drawerNo))
 | 
					                if (setting.Value.single.Contains(drawerNo))
 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
                    PortUtil.PowerOff();
 | 
					                    PortUtil.AllLightOff();
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
                stop();
 | 
					                stop();
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        });
 | 
					        });
 | 
				
			||||||
        PortUtil.PowerOff();
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    void RestData()
 | 
					    void RestData()
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        PortUtil.PowerOff();
 | 
					 | 
				
			||||||
        this.status = 0;
 | 
					        this.status = 0;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -309,4 +307,9 @@
 | 
				
			||||||
        //重置状态
 | 
					        //重置状态
 | 
				
			||||||
        this.RestData();
 | 
					        this.RestData();
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					    protected override async Task OnInitializedAsync()
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        myText = await I18nText.GetTextTableAsync<I18nText.local>(this);
 | 
				
			||||||
 | 
					        base.OnInitializedAsync();
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -6,29 +6,29 @@
 | 
				
			||||||
        <div class="col-12 mb-4">
 | 
					        <div class="col-12 mb-4">
 | 
				
			||||||
            
 | 
					            
 | 
				
			||||||
            <form onsubmit="@(() => grid.Reload())">
 | 
					            <form onsubmit="@(() => grid.Reload())">
 | 
				
			||||||
                <RadzenFieldset Text="查询">
 | 
					                <RadzenFieldset Text="@myText.Search">
 | 
				
			||||||
                    <RadzenStack Orientation="Orientation.Horizontal" Gap="1rem">
 | 
					                    <RadzenStack Orientation="Orientation.Horizontal" Gap="1rem">
 | 
				
			||||||
                        <RadzenRow AlignItems="AlignItems.Center">
 | 
					                        <RadzenRow AlignItems="AlignItems.Center">
 | 
				
			||||||
                            <RadzenColumn Size="4">
 | 
					                            <RadzenColumn Size="4">
 | 
				
			||||||
                                <RadzenLabel Text="开始时间" Component="Start" />
 | 
					                                <RadzenLabel Text="@myText.StartDate" Component="Start" />
 | 
				
			||||||
                            </RadzenColumn>
 | 
					                            </RadzenColumn>
 | 
				
			||||||
                            <RadzenColumn Size="8">
 | 
					                            <RadzenColumn Size="8">
 | 
				
			||||||
                                <RadzenDatePicker DateFormat="yyyy-MM-dd"  @bind-Value="start" Style="width: 100%;" Name="Start" />
 | 
					                                <RadzenDatePicker DateFormat="yyyy-MM-dd HH:mm:ss" ShowTime="true" @bind-Value="start" Style="width: 100%;" Name="Start" />
 | 
				
			||||||
                            </RadzenColumn>
 | 
					                            </RadzenColumn>
 | 
				
			||||||
                        </RadzenRow>
 | 
					                        </RadzenRow>
 | 
				
			||||||
                        <RadzenRow AlignItems="AlignItems.Center">
 | 
					                        <RadzenRow AlignItems="AlignItems.Center">
 | 
				
			||||||
                            <RadzenColumn Size="4">
 | 
					                            <RadzenColumn Size="4">
 | 
				
			||||||
                                <RadzenLabel Text="结束时间" Component="End" />
 | 
					                                <RadzenLabel Text="@myText.EndDate" Component="End" />
 | 
				
			||||||
                            </RadzenColumn>
 | 
					                            </RadzenColumn>
 | 
				
			||||||
                            <RadzenColumn Size="8">
 | 
					                            <RadzenColumn Size="8">
 | 
				
			||||||
                                <RadzenDatePicker DateFormat="yyyy-MM-dd"  @bind-Value="end" Style="width: 100%;" Name="End" />
 | 
					                                <RadzenDatePicker DateFormat="yyyy-MM-dd HH:mm:ss" ShowTime="true" @bind-Value="end" Style="width: 100%;" Name="End" />
 | 
				
			||||||
                            </RadzenColumn>
 | 
					                            </RadzenColumn>
 | 
				
			||||||
                        </RadzenRow>
 | 
					                        </RadzenRow>
 | 
				
			||||||
                    
 | 
					                    
 | 
				
			||||||
                        <RadzenRow AlignItems="AlignItems.Center">
 | 
					                        <RadzenRow AlignItems="AlignItems.Center">
 | 
				
			||||||
                            <RadzenColumn Size="12">
 | 
					                            <RadzenColumn Size="12">
 | 
				
			||||||
                                <RadzenButton Size="ButtonSize.Large" ButtonType="ButtonType.Submit" IsBusy="isLoading" Icon="search" Text="查询" />
 | 
					                                <RadzenButton Size="ButtonSize.Large" ButtonType="ButtonType.Submit" IsBusy="isLoading" Icon="search" Text="@myText.Search" />
 | 
				
			||||||
                                <RadzenButton Size="ButtonSize.Large" Click="reloadGrid" IsBusy="isLoading" Icon="refresh" Text="重置" ButtonStyle="ButtonStyle.Warning" />
 | 
					                                <RadzenButton Size="ButtonSize.Large" Click="reloadGrid" IsBusy="isLoading" Icon="refresh" Text="@myText.Restore" ButtonStyle="ButtonStyle.Warning" />
 | 
				
			||||||
                            </RadzenColumn>
 | 
					                            </RadzenColumn>
 | 
				
			||||||
                        </RadzenRow>
 | 
					                        </RadzenRow>
 | 
				
			||||||
                    </RadzenStack>
 | 
					                    </RadzenStack>
 | 
				
			||||||
| 
						 | 
					@ -41,19 +41,19 @@
 | 
				
			||||||
                    LoadData="@LoadData"
 | 
					                    LoadData="@LoadData"
 | 
				
			||||||
                    IsLoading="@isLoading"
 | 
					                    IsLoading="@isLoading"
 | 
				
			||||||
                    Count="@count"
 | 
					                    Count="@count"
 | 
				
			||||||
                    EmptyText="无数据"
 | 
					                    EmptyText="@myText.NoDate"
 | 
				
			||||||
                    Data="@_forecasts"
 | 
					                    Data="@_forecasts"
 | 
				
			||||||
                    AllowColumnResize="true" AllowAlternatingRows="false"
 | 
					                    AllowColumnResize="true" AllowAlternatingRows="false"
 | 
				
			||||||
                    SelectionMode="DataGridSelectionMode.Single"
 | 
					                    SelectionMode="DataGridSelectionMode.Single"
 | 
				
			||||||
                    AllowPaging="true" PageSize="10" PagerHorizontalAlign="HorizontalAlign.Left" ShowPagingSummary="true" PagingSummaryFormat="{0}/{1} ¹²{2}ÌõÊý¾Ý">
 | 
					                    AllowPaging="true" PageSize="10" PagerHorizontalAlign="HorizontalAlign.Left" ShowPagingSummary="true" PagingSummaryFormat="{0}/{1} ¹²{2}ÌõÊý¾Ý">
 | 
				
			||||||
                    <Columns>
 | 
					                    <Columns>
 | 
				
			||||||
                        <RadzenDataGridColumn Frozen="true" Title="操作人" Property="OperatorUser.NickName"></RadzenDataGridColumn>
 | 
					                        <RadzenDataGridColumn Frozen="true" Title="@myText.Operator" Property="OperatorUser.NickName"></RadzenDataGridColumn>
 | 
				
			||||||
                        <RadzenDataGridColumn Width="170px" Title="操作时间" Property="OperationTime"></RadzenDataGridColumn>
 | 
					                        <RadzenDataGridColumn Width="170px" Title="@myText.OperateDate" Property="OperationTime"></RadzenDataGridColumn>
 | 
				
			||||||
                        <RadzenDataGridColumn Width="200px" Title="药品名称" Property="Drug.DrugName"></RadzenDataGridColumn>
 | 
					                        <RadzenDataGridColumn Width="200px" Title="@myText.DrugName" Property="Drug.DrugName"></RadzenDataGridColumn>
 | 
				
			||||||
                        <RadzenDataGridColumn Title="规格" Property="Drug.DrugSpec"></RadzenDataGridColumn>
 | 
					                        <RadzenDataGridColumn Title="@myText.Spec" Property="Drug.DrugSpec"></RadzenDataGridColumn>
 | 
				
			||||||
                        <RadzenDataGridColumn Title="数量" Property="Quantity"></RadzenDataGridColumn>
 | 
					                        <RadzenDataGridColumn Title="@myText.Quantity" Property="Quantity"></RadzenDataGridColumn>
 | 
				
			||||||
                        <RadzenDataGridColumn Title="批次" Property="ManuNo"></RadzenDataGridColumn>
 | 
					                        <RadzenDataGridColumn Title="@myText.Batch" Property="ManuNo"></RadzenDataGridColumn>
 | 
				
			||||||
                        <RadzenDataGridColumn Title="效期" Property="EffDate">
 | 
					                        <RadzenDataGridColumn Title="@myText.Expiration" Property="EffDate">
 | 
				
			||||||
                            <Template Context="mr">
 | 
					                            <Template Context="mr">
 | 
				
			||||||
                                @mr.EffDate?.ToString("yyyy-MM-dd")
 | 
					                                @mr.EffDate?.ToString("yyyy-MM-dd")
 | 
				
			||||||
                            </Template>
 | 
					                            </Template>
 | 
				
			||||||
| 
						 | 
					@ -67,6 +67,8 @@
 | 
				
			||||||
@code {
 | 
					@code {
 | 
				
			||||||
    @inject IMachineRecordDao machineRecordDao;
 | 
					    @inject IMachineRecordDao machineRecordDao;
 | 
				
			||||||
    @inject DialogService dialogService;
 | 
					    @inject DialogService dialogService;
 | 
				
			||||||
 | 
					    @inject Toolbelt.Blazor.I18nText.I18nText I18nText;
 | 
				
			||||||
 | 
					    private I18nText.local myText = new I18nText.local();
 | 
				
			||||||
    RadzenDataGrid<MachineRecord> grid;
 | 
					    RadzenDataGrid<MachineRecord> grid;
 | 
				
			||||||
    bool isLoading;
 | 
					    bool isLoading;
 | 
				
			||||||
    int count;
 | 
					    int count;
 | 
				
			||||||
| 
						 | 
					@ -94,7 +96,11 @@
 | 
				
			||||||
        await grid.Reload();
 | 
					        await grid.Reload();
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    
 | 
					    protected override async Task OnInitializedAsync()
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        myText = await I18nText.GetTextTableAsync<I18nText.local>(this);
 | 
				
			||||||
 | 
					        base.OnInitializedAsync();
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -6,12 +6,12 @@
 | 
				
			||||||
        <div class="col-12 mb-4">
 | 
					        <div class="col-12 mb-4">
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            <form onsubmit="@(() => grid.Reload())">
 | 
					            <form onsubmit="@(() => grid.Reload())">
 | 
				
			||||||
                <RadzenFieldset Text="查询">
 | 
					                <RadzenFieldset Text="@myText.Search">
 | 
				
			||||||
                    <RadzenStack Orientation="Orientation.Horizontal" JustifyContent="JustifyContent.SpaceBetween">
 | 
					                    <RadzenStack Orientation="Orientation.Horizontal" JustifyContent="JustifyContent.SpaceBetween">
 | 
				
			||||||
                        <RadzenStack Orientation="Orientation.Horizontal" Gap="1rem">
 | 
					                        <RadzenStack Orientation="Orientation.Horizontal" Gap="1rem">
 | 
				
			||||||
                            <RadzenRow AlignItems="AlignItems.Center">
 | 
					                            <RadzenRow AlignItems="AlignItems.Center">
 | 
				
			||||||
                                <RadzenColumn Size="4">
 | 
					                                <RadzenColumn Size="4">
 | 
				
			||||||
                                    <RadzenLabel Text="角色名称" Component="RoleName" />
 | 
					                                    <RadzenLabel Text="@myText.RoleName" Component="RoleName" />
 | 
				
			||||||
                                </RadzenColumn>
 | 
					                                </RadzenColumn>
 | 
				
			||||||
                                <RadzenColumn Size="8">
 | 
					                                <RadzenColumn Size="8">
 | 
				
			||||||
                                    <RadzenTextBox @bind-Value="RoleName" Style="width: 100%;" Name="RoleName"></RadzenTextBox>
 | 
					                                    <RadzenTextBox @bind-Value="RoleName" Style="width: 100%;" Name="RoleName"></RadzenTextBox>
 | 
				
			||||||
| 
						 | 
					@ -20,12 +20,12 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                            <RadzenRow AlignItems="AlignItems.Center">
 | 
					                            <RadzenRow AlignItems="AlignItems.Center">
 | 
				
			||||||
                                <RadzenColumn Size="12">
 | 
					                                <RadzenColumn Size="12">
 | 
				
			||||||
                                    <RadzenButton Size="ButtonSize.Medium" ButtonType="ButtonType.Submit" IsBusy="isLoading" Icon="search" Text="查询" />
 | 
					                                    <RadzenButton Size="ButtonSize.Medium" ButtonType="ButtonType.Submit" IsBusy="isLoading" Icon="search" Text="@myText.Search" />
 | 
				
			||||||
                                    <RadzenButton Size="ButtonSize.Medium" Click="reloadGrid" IsBusy="isLoading" Icon="refresh" Text="重置" ButtonStyle="ButtonStyle.Warning" />
 | 
					                                    <RadzenButton Size="ButtonSize.Medium" Click="reloadGrid" IsBusy="isLoading" Icon="refresh" Text="@myText.Restore" ButtonStyle="ButtonStyle.Warning" />
 | 
				
			||||||
                                </RadzenColumn>
 | 
					                                </RadzenColumn>
 | 
				
			||||||
                            </RadzenRow>
 | 
					                            </RadzenRow>
 | 
				
			||||||
                        </RadzenStack>
 | 
					                        </RadzenStack>
 | 
				
			||||||
                        <RadzenButton Size="ButtonSize.Medium" ButtonStyle="ButtonStyle.Success" Icon="add_circle_outline" Click="@(() => InsertRow())" Disabled="@(rolesToInsert.Count() > 0)" Text="新增" />
 | 
					                        <RadzenButton Size="ButtonSize.Medium" ButtonStyle="ButtonStyle.Success" Icon="add_circle_outline" Click="@(() => InsertRow())" Disabled="@(rolesToInsert.Count() > 0)" Text="@myText.Add" />
 | 
				
			||||||
                    </RadzenStack>
 | 
					                    </RadzenStack>
 | 
				
			||||||
                </RadzenFieldset>
 | 
					                </RadzenFieldset>
 | 
				
			||||||
            </form>
 | 
					            </form>
 | 
				
			||||||
| 
						 | 
					@ -35,7 +35,7 @@
 | 
				
			||||||
            LoadData="@LoadData"
 | 
					            LoadData="@LoadData"
 | 
				
			||||||
            IsLoading="@isLoading"
 | 
					            IsLoading="@isLoading"
 | 
				
			||||||
            Count="@count"
 | 
					            Count="@count"
 | 
				
			||||||
            EmptyText="无数据"
 | 
					            EmptyText="@myText.NoDate"
 | 
				
			||||||
            Data="@roleList"
 | 
					            Data="@roleList"
 | 
				
			||||||
            AllowColumnResize="true" AllowAlternatingRows="false"
 | 
					            AllowColumnResize="true" AllowAlternatingRows="false"
 | 
				
			||||||
            RowUpdate="@((Pojo.Role r) => { OnUpdateRow(r); })" RowCreate="@((Pojo.Role r) => { OnCreateRow(r); })"
 | 
					            RowUpdate="@((Pojo.Role r) => { OnUpdateRow(r); })" RowCreate="@((Pojo.Role r) => { OnCreateRow(r); })"
 | 
				
			||||||
| 
						 | 
					@ -43,13 +43,13 @@
 | 
				
			||||||
            AllowPaging="true" PageSize="10" PagerHorizontalAlign="HorizontalAlign.Left" ShowPagingSummary="true" PagingSummaryFormat="{0}/{1} 共{2}条数据">
 | 
					            AllowPaging="true" PageSize="10" PagerHorizontalAlign="HorizontalAlign.Left" ShowPagingSummary="true" PagingSummaryFormat="{0}/{1} 共{2}条数据">
 | 
				
			||||||
                <Columns>
 | 
					                <Columns>
 | 
				
			||||||
                    <RadzenDataGridColumn Width="50px" Title="ID" Property="Id"></RadzenDataGridColumn>
 | 
					                    <RadzenDataGridColumn Width="50px" Title="ID" Property="Id"></RadzenDataGridColumn>
 | 
				
			||||||
                    <RadzenDataGridColumn Width="120px" Title="角色名称" Property="RoleName">
 | 
					                    <RadzenDataGridColumn Width="120px" Title="@myText.RoleName" Property="RoleName">
 | 
				
			||||||
                        <EditTemplate Context="role">
 | 
					                        <EditTemplate Context="role">
 | 
				
			||||||
                            <RadzenTextBox Name="RoleName" @bind-Value="role.RoleName" Style="width:100%; display: block;" />
 | 
					                            <RadzenTextBox Name="RoleName" @bind-Value="role.RoleName" Style="width:100%; display: block;" />
 | 
				
			||||||
                            <RadzenRequiredValidator Style="position: absolute;z-index: 9999;" Text="请填写角色名称" Component="RoleName" Popup="true" />
 | 
					                            <RadzenRequiredValidator Style="position: absolute;z-index: 9999;" Text="@myText.InputRoleName" Component="RoleName" Popup="true" />
 | 
				
			||||||
                        </EditTemplate>
 | 
					                        </EditTemplate>
 | 
				
			||||||
                    </RadzenDataGridColumn>
 | 
					                    </RadzenDataGridColumn>
 | 
				
			||||||
                    <RadzenDataGridColumn Title="权限" Property="permissions">
 | 
					                    <RadzenDataGridColumn Title="@myText.Role" Property="permissions">
 | 
				
			||||||
                        <Template Context="role">
 | 
					                        <Template Context="role">
 | 
				
			||||||
                            @string.Join(", ", allPremissions.Where(g => role.permissionIds?.Contains(g.Id) == true).Select(g => $"{g.PremissionName}"))
 | 
					                            @string.Join(", ", allPremissions.Where(g => role.permissionIds?.Contains(g.Id) == true).Select(g => $"{g.PremissionName}"))
 | 
				
			||||||
                        </Template>
 | 
					                        </Template>
 | 
				
			||||||
| 
						 | 
					@ -66,7 +66,7 @@
 | 
				
			||||||
                                    @string.Join(", ", allPremissions.Where(g => role.permissionIds?.Contains(g.Id) == true).Take(dd.MaxSelectedLabels).Select(g => $"{g.PremissionName}"))
 | 
					                                    @string.Join(", ", allPremissions.Where(g => role.permissionIds?.Contains(g.Id) == true).Take(dd.MaxSelectedLabels).Select(g => $"{g.PremissionName}"))
 | 
				
			||||||
                                </ValueTemplate>
 | 
					                                </ValueTemplate>
 | 
				
			||||||
                            </RadzenDropDown>
 | 
					                            </RadzenDropDown>
 | 
				
			||||||
                            <RadzenRequiredValidator Style="position: absolute;z-index: 9999;" Text="请选择权限" Component="Permissions" Popup="true" />
 | 
					                            <RadzenRequiredValidator Style="position: absolute;z-index: 9999;" Text="@myText.SelectRole" Component="Permissions" Popup="true" />
 | 
				
			||||||
                        </EditTemplate>
 | 
					                        </EditTemplate>
 | 
				
			||||||
                    </RadzenDataGridColumn>
 | 
					                    </RadzenDataGridColumn>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -97,6 +97,8 @@
 | 
				
			||||||
@code {
 | 
					@code {
 | 
				
			||||||
    @inject IRoleDao roleDao;
 | 
					    @inject IRoleDao roleDao;
 | 
				
			||||||
    @inject DialogService dialogService;
 | 
					    @inject DialogService dialogService;
 | 
				
			||||||
 | 
					    @inject Toolbelt.Blazor.I18nText.I18nText I18nText;
 | 
				
			||||||
 | 
					    private I18nText.local myText = new I18nText.local();
 | 
				
			||||||
    RadzenDataGrid<Pojo.Role> grid;
 | 
					    RadzenDataGrid<Pojo.Role> grid;
 | 
				
			||||||
    bool isLoading;
 | 
					    bool isLoading;
 | 
				
			||||||
    int count;
 | 
					    int count;
 | 
				
			||||||
| 
						 | 
					@ -110,6 +112,7 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    protected override async Task OnInitializedAsync()
 | 
					    protected override async Task OnInitializedAsync()
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
 | 
					        myText = await I18nText.GetTextTableAsync<I18nText.local>(this);
 | 
				
			||||||
        await base.OnInitializedAsync();
 | 
					        await base.OnInitializedAsync();
 | 
				
			||||||
        List<Premission> t = new Premission().getAdminPremission();
 | 
					        List<Premission> t = new Premission().getAdminPremission();
 | 
				
			||||||
        IEnumerable<Premission> t2 = Enumerable.Empty<Premission>();
 | 
					        IEnumerable<Premission> t2 = Enumerable.Empty<Premission>();
 | 
				
			||||||
| 
						 | 
					@ -197,8 +200,8 @@
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            //弹出确认提示框
 | 
					            //弹出确认提示框
 | 
				
			||||||
            var b = await dialogService.OpenAsync<ConfirmDialog>(
 | 
					            var b = await dialogService.OpenAsync<ConfirmDialog>(
 | 
				
			||||||
               $"删除确认",
 | 
					               myText.ConfirmDelete,
 | 
				
			||||||
             new Dictionary<string, object>() { { "confirmInfo", "确认要删除角色:" + role.RoleName+"吗?" } },
 | 
					             new Dictionary<string, object>() { { "confirmInfo", $"{myText.ConfirmDeleteRole}:" + role.RoleName + "?" } },
 | 
				
			||||||
             new DialogOptions() { Width = "45vw", Resizable = true, Draggable = true, ShowClose = false });
 | 
					             new DialogOptions() { Width = "45vw", Resizable = true, Draggable = true, ShowClose = false });
 | 
				
			||||||
            if (b)
 | 
					            if (b)
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -4,102 +4,102 @@
 | 
				
			||||||
        <div class="col-12 mb-4">
 | 
					        <div class="col-12 mb-4">
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            <RadzenTemplateForm Data="@orderInfo" Submit="@(((OrderInfo args) => { Submit(args); }))">
 | 
					            <RadzenTemplateForm Data="@orderInfo" Submit="@(((OrderInfo args) => { Submit(args); }))">
 | 
				
			||||||
                <RadzenFieldset Text="手写处方">
 | 
					                <RadzenFieldset Text="@myText.WriteOrder">
 | 
				
			||||||
                    <RadzenRow Gap="1rem">
 | 
					                    <RadzenRow Gap="1rem">
 | 
				
			||||||
                        <RadzenColumn Size="4">
 | 
					                        <RadzenColumn Size="4">
 | 
				
			||||||
                            <RadzenRow AlignItems="AlignItems.Center">
 | 
					                            <RadzenRow AlignItems="AlignItems.Center">
 | 
				
			||||||
                                <RadzenColumn Size="4">
 | 
					                                <RadzenColumn Size="4">
 | 
				
			||||||
                                    <RadzenLabel Text="处方号" Component="OrderNo" />
 | 
					                                    <RadzenLabel Text="@myText.OrderNo" Component="OrderNo" />
 | 
				
			||||||
                                </RadzenColumn>
 | 
					                                </RadzenColumn>
 | 
				
			||||||
                                <RadzenColumn Size="8">
 | 
					                                <RadzenColumn Size="8">
 | 
				
			||||||
                                    <RadzenTextBox @bind-Value="orderInfo.OrderNo" Style="width: 100%;" Name="OrderNo"></RadzenTextBox>
 | 
					                                    <RadzenTextBox @bind-Value="orderInfo.OrderNo" Style="width: 100%;" Name="OrderNo"></RadzenTextBox>
 | 
				
			||||||
                                    <RadzenRequiredValidator Text="请输入处方号" Component="OrderNo" />
 | 
					                                    <RadzenRequiredValidator Text="@myText.InputOrderTips" Component="OrderNo" />
 | 
				
			||||||
                                </RadzenColumn>
 | 
					                                </RadzenColumn>
 | 
				
			||||||
                            </RadzenRow>
 | 
					                            </RadzenRow>
 | 
				
			||||||
                        </RadzenColumn>
 | 
					                        </RadzenColumn>
 | 
				
			||||||
                        <RadzenColumn Size="4">
 | 
					                        <RadzenColumn Size="4">
 | 
				
			||||||
                            <RadzenRow AlignItems="AlignItems.Center">
 | 
					                            <RadzenRow AlignItems="AlignItems.Center">
 | 
				
			||||||
                                <RadzenColumn Size="4">
 | 
					                                <RadzenColumn Size="4">
 | 
				
			||||||
                                    <RadzenLabel Text="处方时间" Component="OrderDate" />
 | 
					                                    <RadzenLabel Text="@myText.OrderDate" Component="OrderDate" />
 | 
				
			||||||
                                </RadzenColumn>
 | 
					                                </RadzenColumn>
 | 
				
			||||||
                                <RadzenColumn Size="8">
 | 
					                                <RadzenColumn Size="8">
 | 
				
			||||||
                                    <RadzenDatePicker DateFormat="yyyy-MM-dd" CurrentDateChanged="@OnCurrentDateChanged"
 | 
					                                    <RadzenDatePicker DateFormat="yyyy-MM-dd HH:mm:ss" CurrentDateChanged="@OnCurrentDateChanged"
 | 
				
			||||||
                                     ShowSeconds="true"
 | 
					                                    ShowTime="true" ShowSeconds="true"
 | 
				
			||||||
                                                      @bind-Value="orderInfo.ChargeDate" Style="width: 100%;" Name="OrderDate" />
 | 
					                                    @bind-Value="orderInfo.OrderDate" Style="width: 100%;" Name="OrderDate" />
 | 
				
			||||||
                                    <RadzenRequiredValidator Text="请输入处方时间" Component="OrderDate" />
 | 
					                                    <RadzenRequiredValidator Text="@myText.InputOrderDate" Component="OrderDate" />
 | 
				
			||||||
                                </RadzenColumn>
 | 
					                                </RadzenColumn>
 | 
				
			||||||
                            </RadzenRow>
 | 
					                            </RadzenRow>
 | 
				
			||||||
                        </RadzenColumn>
 | 
					                        </RadzenColumn>
 | 
				
			||||||
                        <RadzenColumn Size="4">
 | 
					                        <RadzenColumn Size="4">
 | 
				
			||||||
                            <RadzenRow AlignItems="AlignItems.Center">
 | 
					                            <RadzenRow AlignItems="AlignItems.Center">
 | 
				
			||||||
                                <RadzenColumn Size="4">
 | 
					                                <RadzenColumn Size="4">
 | 
				
			||||||
                                    <RadzenLabel Text="患者姓名" Component="PatientName" />
 | 
					                                    <RadzenLabel Text="@myText.PatientName" Component="PatientName" />
 | 
				
			||||||
                                </RadzenColumn>
 | 
					                                </RadzenColumn>
 | 
				
			||||||
                                <RadzenColumn Size="8">
 | 
					                                <RadzenColumn Size="8">
 | 
				
			||||||
                                    <RadzenTextBox @bind-Value="orderInfo.PatientName" Style="width: 100%;" Name="PatientName"></RadzenTextBox>
 | 
					                                    <RadzenTextBox @bind-Value="orderInfo.PatientName" Style="width: 100%;" Name="PatientName"></RadzenTextBox>
 | 
				
			||||||
                                    <RadzenRequiredValidator Text="请输入患者姓名" Component="PatientName" />
 | 
					                                    <RadzenRequiredValidator Text="@myText.InputPatientName" Component="PatientName" />
 | 
				
			||||||
                                </RadzenColumn>
 | 
					                                </RadzenColumn>
 | 
				
			||||||
                            </RadzenRow>
 | 
					                            </RadzenRow>
 | 
				
			||||||
                        </RadzenColumn>
 | 
					                        </RadzenColumn>
 | 
				
			||||||
                        <RadzenColumn Size="2">
 | 
					                        <RadzenColumn Size="2">
 | 
				
			||||||
                            <RadzenRow AlignItems="AlignItems.Center">
 | 
					                            <RadzenRow AlignItems="AlignItems.Center">
 | 
				
			||||||
                                <RadzenColumn Size="4">
 | 
					                                <RadzenColumn Size="4">
 | 
				
			||||||
                                    <RadzenLabel Text="性别" Component="Sex" />
 | 
					                                    <RadzenLabel Text="@myText.Sex" Component="Sex" />
 | 
				
			||||||
                                </RadzenColumn>
 | 
					                                </RadzenColumn>
 | 
				
			||||||
                                <RadzenColumn Size="8">
 | 
					                                <RadzenColumn Size="8">
 | 
				
			||||||
                                    <RadzenTextBox @bind-Value="orderInfo.Sex" Style="width: 100%;" Name="Sex"></RadzenTextBox>
 | 
					                                    <RadzenTextBox @bind-Value="orderInfo.Sex" Style="width: 100%;" Name="Sex"></RadzenTextBox>
 | 
				
			||||||
                                    <RadzenRequiredValidator Text="请输入患者性别" Component="Sex" />
 | 
					                                    <RadzenRequiredValidator Text="@myText.InputPatientSex" Component="Sex" />
 | 
				
			||||||
                                </RadzenColumn>
 | 
					                                </RadzenColumn>
 | 
				
			||||||
                            </RadzenRow>
 | 
					                            </RadzenRow>
 | 
				
			||||||
                        </RadzenColumn>
 | 
					                        </RadzenColumn>
 | 
				
			||||||
                        <RadzenColumn Size="2">
 | 
					                        <RadzenColumn Size="2">
 | 
				
			||||||
                            <RadzenRow AlignItems="AlignItems.Center">
 | 
					                            <RadzenRow AlignItems="AlignItems.Center">
 | 
				
			||||||
                                <RadzenColumn Size="4">
 | 
					                                <RadzenColumn Size="4">
 | 
				
			||||||
                                    <RadzenLabel Text="年龄" Component="Age" />
 | 
					                                    <RadzenLabel Text="@myText.Age" Component="Age" />
 | 
				
			||||||
                                </RadzenColumn>
 | 
					                                </RadzenColumn>
 | 
				
			||||||
                                <RadzenColumn Size="8">
 | 
					                                <RadzenColumn Size="8">
 | 
				
			||||||
                                    <RadzenTextBox @bind-Value="orderInfo.Age" Style="width: 100%;" Name="Age"></RadzenTextBox>
 | 
					                                    <RadzenTextBox @bind-Value="orderInfo.Age" Style="width: 100%;" Name="Age"></RadzenTextBox>
 | 
				
			||||||
                                    <RadzenRequiredValidator Text="请输入患者年龄" Component="Age" />
 | 
					                                    <RadzenRequiredValidator Text="@myText.InputPatientAge" Component="Age" />
 | 
				
			||||||
                                </RadzenColumn>
 | 
					                                </RadzenColumn>
 | 
				
			||||||
                            </RadzenRow>
 | 
					                            </RadzenRow>
 | 
				
			||||||
                        </RadzenColumn>
 | 
					                        </RadzenColumn>
 | 
				
			||||||
                        <RadzenColumn Size="4">
 | 
					                        <RadzenColumn Size="4">
 | 
				
			||||||
                            <RadzenRow AlignItems="AlignItems.Center">
 | 
					                            <RadzenRow AlignItems="AlignItems.Center">
 | 
				
			||||||
                                <RadzenColumn Size="4">
 | 
					                                <RadzenColumn Size="4">
 | 
				
			||||||
                                    <RadzenLabel Text="处方医生" Component="DoctorName" />
 | 
					                                    <RadzenLabel Text="@myText.OrderDoctor" Component="DoctorName" />
 | 
				
			||||||
                                </RadzenColumn>
 | 
					                                </RadzenColumn>
 | 
				
			||||||
                                <RadzenColumn Size="8">
 | 
					                                <RadzenColumn Size="8">
 | 
				
			||||||
                                    <RadzenTextBox @bind-Value="orderInfo.DoctorName" Style="width: 100%;" Name="DoctorName"></RadzenTextBox>
 | 
					                                    <RadzenTextBox @bind-Value="orderInfo.DoctorName" Style="width: 100%;" Name="DoctorName"></RadzenTextBox>
 | 
				
			||||||
                                    <RadzenRequiredValidator Text="请输入处方医生" Component="DoctorName" />
 | 
					                                    <RadzenRequiredValidator Text="@myText.Doctor" Component="DoctorName" />
 | 
				
			||||||
                                </RadzenColumn>
 | 
					                                </RadzenColumn>
 | 
				
			||||||
                            </RadzenRow>
 | 
					                            </RadzenRow>
 | 
				
			||||||
                        </RadzenColumn>
 | 
					                        </RadzenColumn>
 | 
				
			||||||
                        <RadzenColumn Size="4">
 | 
					                        <RadzenColumn Size="4">
 | 
				
			||||||
                            <RadzenRow AlignItems="AlignItems.Center">
 | 
					                            <RadzenRow AlignItems="AlignItems.Center">
 | 
				
			||||||
                                <RadzenColumn Size="4">
 | 
					                                <RadzenColumn Size="4">
 | 
				
			||||||
                                    <RadzenLabel Text="科室" Component="DeptName" />
 | 
					                                    <RadzenLabel Text="@myText.DeptName" Component="DeptName" />
 | 
				
			||||||
                                </RadzenColumn>
 | 
					                                </RadzenColumn>
 | 
				
			||||||
                                <RadzenColumn Size="8">
 | 
					                                <RadzenColumn Size="8">
 | 
				
			||||||
                                    <RadzenTextBox @bind-Value="orderInfo.DeptName" Style="width: 100%;" Name="DeptName"></RadzenTextBox>
 | 
					                                    <RadzenTextBox @bind-Value="orderInfo.DeptName" Style="width: 100%;" Name="DeptName"></RadzenTextBox>
 | 
				
			||||||
                                    <RadzenRequiredValidator Text="请输入科室" Component="DeptName" />
 | 
					                                    <RadzenRequiredValidator Text="@myText.InputDept" Component="DeptName" />
 | 
				
			||||||
                                </RadzenColumn>
 | 
					                                </RadzenColumn>
 | 
				
			||||||
                            </RadzenRow>
 | 
					                            </RadzenRow>
 | 
				
			||||||
                        </RadzenColumn>
 | 
					                        </RadzenColumn>
 | 
				
			||||||
                        <RadzenColumn Size="6">
 | 
					                        <RadzenColumn Size="6">
 | 
				
			||||||
                            <RadzenRow AlignItems="AlignItems.Center">
 | 
					                            <RadzenRow AlignItems="AlignItems.Center">
 | 
				
			||||||
                                <RadzenColumn Size="2">
 | 
					                                <RadzenColumn Size="2">
 | 
				
			||||||
                                    <RadzenLabel Text="诊断" Component="Disease" />
 | 
					                                    <RadzenLabel Text="@myText.Diagnose" Component="Disease" />
 | 
				
			||||||
                                </RadzenColumn>
 | 
					                                </RadzenColumn>
 | 
				
			||||||
                                <RadzenColumn Size="10">
 | 
					                                <RadzenColumn Size="10">
 | 
				
			||||||
                                    <RadzenTextBox @bind-Value="orderInfo.Disease" Style="width: 100%;" Name="Disease"></RadzenTextBox>
 | 
					                                    <RadzenTextBox @bind-Value="orderInfo.Disease" Style="width: 100%;" Name="Disease"></RadzenTextBox>
 | 
				
			||||||
                                    <RadzenRequiredValidator Text="请输入诊断" Component="Disease" />
 | 
					                                    <RadzenRequiredValidator Text="@myText.InputDisease" Component="Disease" />
 | 
				
			||||||
                                </RadzenColumn>
 | 
					                                </RadzenColumn>
 | 
				
			||||||
                            </RadzenRow>
 | 
					                            </RadzenRow>
 | 
				
			||||||
                        </RadzenColumn>
 | 
					                        </RadzenColumn>
 | 
				
			||||||
                        <RadzenColumn Size="6">
 | 
					                        <RadzenColumn Size="6">
 | 
				
			||||||
                            <RadzenStack Orientation="Orientation.Horizontal" AlignItems="AlignItems.Center" JustifyContent="JustifyContent.SpaceBetween">
 | 
					                            <RadzenStack Orientation="Orientation.Horizontal" AlignItems="AlignItems.Center" JustifyContent="JustifyContent.SpaceBetween">
 | 
				
			||||||
                                <RadzenButton Size="ButtonSize.Large" ButtonType="ButtonType.Submit" Disabled="@(detailsToInsert.Count() > 0 || detailsToUpdate.Count() > 0)" Text="确定" />
 | 
					                                <RadzenButton Size="ButtonSize.Large" ButtonType="ButtonType.Submit" Disabled="@(detailsToInsert.Count() > 0 || detailsToUpdate.Count() > 0)" Text="@myText.Confirm" />
 | 
				
			||||||
                                <RadzenButton Size="ButtonSize.Large" Icon="add_circle_outline" ButtonStyle="ButtonStyle.Success" Click="@InsertRow" Disabled="@(detailsToInsert.Count() > 0)" Text="添加" />
 | 
					                                <RadzenButton Size="ButtonSize.Large" Icon="add_circle_outline" ButtonStyle="ButtonStyle.Success" Click="@InsertRow" Disabled="@(detailsToInsert.Count() > 0)" Text="@myText.Add" />
 | 
				
			||||||
                            </RadzenStack>
 | 
					                            </RadzenStack>
 | 
				
			||||||
                        </RadzenColumn>
 | 
					                        </RadzenColumn>
 | 
				
			||||||
                    </RadzenRow>
 | 
					                    </RadzenRow>
 | 
				
			||||||
| 
						 | 
					@ -109,33 +109,32 @@
 | 
				
			||||||
        <div class="col-12 mb-4">
 | 
					        <div class="col-12 mb-4">
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            <RadzenDataGrid @ref="grid"
 | 
					            <RadzenDataGrid @ref="grid"
 | 
				
			||||||
            EmptyText="请添加手写处方详情"
 | 
					                            EmptyText="@myText.AddNewOrder"
 | 
				
			||||||
            Data="@orderDetails"
 | 
					            Data="@orderDetails"
 | 
				
			||||||
            EditMode="DataGridEditMode.Single"
 | 
					            EditMode="DataGridEditMode.Single"
 | 
				
			||||||
            RowUpdate="@((OrderDetail od) => { OnUpdateRow(od); })" RowCreate="@((OrderDetail od) => { OnCreateRow(od); })"
 | 
					            RowUpdate="@((OrderDetail od) => { OnUpdateRow(od); })" RowCreate="@((OrderDetail od) => { OnCreateRow(od); })"
 | 
				
			||||||
            AllowColumnResize="true" AllowAlternatingRows="false"
 | 
					            AllowColumnResize="true" AllowAlternatingRows="false"
 | 
				
			||||||
            SelectionMode="DataGridSelectionMode.Single">
 | 
					            SelectionMode="DataGridSelectionMode.Single">
 | 
				
			||||||
                <Columns>
 | 
					                <Columns>
 | 
				
			||||||
                    <RadzenDataGridColumn Title="药品名称" Property="Drug.DrugName">
 | 
					                    <RadzenDataGridColumn Title="@myText.DrugName" Property="Drug.DrugName">
 | 
				
			||||||
                        <EditTemplate Context="od">
 | 
					                        <EditTemplate Context="od">
 | 
				
			||||||
                            @* <RadzenDropDown Name="Drug" TValue="DrugInfo" @bind-Value="od.Drug" Data="@drugInfos" Style="width:100%; display: block;"  /> *@
 | 
					 | 
				
			||||||
                            <RadzenDropDownDataGrid AllowVirtualization="true" Name="Drug" TValue="DrugInfo" @bind-Value="od.Drug" Data="@drugInfos" Style="width:100%; display: block;" AllowFilteringByAllStringColumns="true">
 | 
					                            <RadzenDropDownDataGrid AllowVirtualization="true" Name="Drug" TValue="DrugInfo" @bind-Value="od.Drug" Data="@drugInfos" Style="width:100%; display: block;" AllowFilteringByAllStringColumns="true">
 | 
				
			||||||
                                <Columns>
 | 
					                                <Columns>
 | 
				
			||||||
                                    <RadzenDropDownDataGridColumn Property="DrugId" Title="药品编码" />
 | 
					                                    <RadzenDropDownDataGridColumn Property="DrugId" Title="@myText.DrugCode" />
 | 
				
			||||||
                                    <RadzenDropDownDataGridColumn Property="DrugName" Width="120px" Title="名称" />
 | 
					                                    <RadzenDropDownDataGridColumn Property="DrugName" Width="120px" Title="@myText.DrugName" />
 | 
				
			||||||
                                    <RadzenDropDownDataGridColumn Property="DrugSpec" Title="规格" />
 | 
					                                    <RadzenDropDownDataGridColumn Property="DrugSpec" Title="@myText.Spec" />
 | 
				
			||||||
                                    <RadzenDropDownDataGridColumn Property="StockQuantity" Title="库存" Frozen="true" FrozenPosition="FrozenColumnPosition.Right" />
 | 
					                                    <RadzenDropDownDataGridColumn Property="StockQuantity" Title="@myText.Inventory" Frozen="true" FrozenPosition="FrozenColumnPosition.Right" />
 | 
				
			||||||
                                </Columns>
 | 
					                                </Columns>
 | 
				
			||||||
                            </RadzenDropDownDataGrid>
 | 
					                            </RadzenDropDownDataGrid>
 | 
				
			||||||
                            <RadzenCustomValidator Style="position: absolute;z-index: 9999;" Component="Drug" Validator="@(() => !String.IsNullOrEmpty(od.Drug.DrugId ))" Text="请选择药品" />
 | 
					                            <RadzenCustomValidator Style="position: absolute;z-index: 9999;" Component="Drug" Validator="@(() => !String.IsNullOrEmpty(od.Drug.DrugId))" Text="@myText.SelectDrug" />
 | 
				
			||||||
                            <RadzenCustomValidator Component="Drug" Validator="@(() => ValidateDrug(od.Drug))" Text="已经选择的药品不能再次选择" />
 | 
					                            <RadzenCustomValidator Component="Drug" Validator="@(() => ValidateDrug(od.Drug))" Text="@myText.HasSelect" />
 | 
				
			||||||
                        </EditTemplate>
 | 
					                        </EditTemplate>
 | 
				
			||||||
                    </RadzenDataGridColumn>
 | 
					                    </RadzenDataGridColumn>
 | 
				
			||||||
                    <RadzenDataGridColumn Title="规格" Property="Drug.DrugSpec"></RadzenDataGridColumn>
 | 
					                    <RadzenDataGridColumn Title="@myText.Spec" Property="Drug.DrugSpec"></RadzenDataGridColumn>
 | 
				
			||||||
                    <RadzenDataGridColumn Title="数量" Property="Quantity">
 | 
					                    <RadzenDataGridColumn Title="@myText.Quantity" Property="Quantity">
 | 
				
			||||||
                        <EditTemplate Context="od">
 | 
					                        <EditTemplate Context="od">
 | 
				
			||||||
                            <RadzenNumeric Style="width:100%; display: block;" Name="Quantity" @bind-Value=@od.Quantity />
 | 
					                            <RadzenNumeric Style="width:100%; display: block;" Name="Quantity" @bind-Value=@od.Quantity />
 | 
				
			||||||
                            <RadzenNumericRangeValidator Style="position: absolute;z-index: 9999;" Min="1" Max="@od.Drug.StockQuantity" Text="请填写正确的取出数量" Component="Quantity" />
 | 
					                            <RadzenNumericRangeValidator Style="position: absolute;z-index: 9999;" Min="1" Max="@od.Drug.StockQuantity" Text="@myText.InputTips" Component="Quantity" />
 | 
				
			||||||
                        </EditTemplate>
 | 
					                        </EditTemplate>
 | 
				
			||||||
                    </RadzenDataGridColumn>
 | 
					                    </RadzenDataGridColumn>
 | 
				
			||||||
                    <RadzenDataGridColumn Context="detail" Filterable="false" Sortable="false" TextAlign="TextAlign.Right" Frozen="true" FrozenPosition="FrozenColumnPosition.Right">
 | 
					                    <RadzenDataGridColumn Context="detail" Filterable="false" Sortable="false" TextAlign="TextAlign.Right" Frozen="true" FrozenPosition="FrozenColumnPosition.Right">
 | 
				
			||||||
| 
						 | 
					@ -165,6 +164,8 @@
 | 
				
			||||||
    @inject IDrugInfoDao drugInfoDao;
 | 
					    @inject IDrugInfoDao drugInfoDao;
 | 
				
			||||||
    @inject NotificationService _message
 | 
					    @inject NotificationService _message
 | 
				
			||||||
    @inject DialogService dialogService;
 | 
					    @inject DialogService dialogService;
 | 
				
			||||||
 | 
					    @inject Toolbelt.Blazor.I18nText.I18nText I18nText;
 | 
				
			||||||
 | 
					    private I18nText.local myText = new I18nText.local();
 | 
				
			||||||
    RadzenDataGrid<OrderDetail> grid;
 | 
					    RadzenDataGrid<OrderDetail> grid;
 | 
				
			||||||
    List<OrderDetail> orderDetails = new();
 | 
					    List<OrderDetail> orderDetails = new();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -251,21 +252,21 @@
 | 
				
			||||||
        if (orderDetails.Count == 0)
 | 
					        if (orderDetails.Count == 0)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            _message.Notify(
 | 
					            _message.Notify(
 | 
				
			||||||
                new NotificationMessage { Severity = NotificationSeverity.Error, Summary = "提示", Detail = $"请添加用药详情", Duration = 3000 }
 | 
					                new NotificationMessage { Severity = NotificationSeverity.Error, Summary = myText.Tips, Detail = $"请添加用药详情", Duration = 3000 }
 | 
				
			||||||
            );
 | 
					            );
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        else
 | 
					        else
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            //弹出待取药品所在库位、库存信息
 | 
					            //弹出待取药品所在库位、库存信息
 | 
				
			||||||
            var b = await dialogService.OpenAsync<SelfTakeDialog>(
 | 
					            var b = await dialogService.OpenAsync<SelfTakeDialog>(
 | 
				
			||||||
                $"取药详情",
 | 
					                myText.TakeDetail,
 | 
				
			||||||
              new Dictionary<string, object>() { { "order", orderInfo }, { "orderDetails", orderDetails } },
 | 
					              new Dictionary<string, object>() { { "order", orderInfo }, { "orderDetails", orderDetails } },
 | 
				
			||||||
              new DialogOptions() { Width = "85vw", Resizable = true, Draggable = true, ShowClose = false }
 | 
					              new DialogOptions() { Width = "85vw", Resizable = true, Draggable = true, ShowClose = false }
 | 
				
			||||||
            );
 | 
					            );
 | 
				
			||||||
            if (b)
 | 
					            if (b)
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                _message.Notify(
 | 
					                _message.Notify(
 | 
				
			||||||
                new NotificationMessage { Severity = NotificationSeverity.Success, Summary = "提示", Detail = $"取药完成", Duration = 3000 }
 | 
					                new NotificationMessage { Severity = NotificationSeverity.Success, Summary = myText.Tips, Detail = $"取药完成", Duration = 3000 }
 | 
				
			||||||
            );
 | 
					            );
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
| 
						 | 
					@ -282,6 +283,8 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    protected override async Task OnInitializedAsync()
 | 
					    protected override async Task OnInitializedAsync()
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        myText = await I18nText.GetTextTableAsync<I18nText.local>(this);
 | 
				
			||||||
        drugInfos = await drugInfoDao.GetAllDrugAndStock();
 | 
					        drugInfos = await drugInfoDao.GetAllDrugAndStock();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        base.OnInitializedAsync();
 | 
					        base.OnInitializedAsync();
 | 
				
			||||||
| 
						 | 
					@ -289,6 +292,6 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    void OnCurrentDateChanged(DateTime args)
 | 
					    void OnCurrentDateChanged(DateTime args)
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        orderInfo.ChargeDate = new DateTime(args.Year, args.Month, args.Day, args.Hour, args.Minute, args.Second);
 | 
					        orderInfo.OrderDate = new DateTime(args.Year, args.Month, args.Day, args.Hour, args.Minute, args.Second);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -169,7 +169,7 @@
 | 
				
			||||||
                            new NotificationMessage { Severity = NotificationSeverity.Error, Summary = "提示", Detail = $"抽屉【{drawerNo}】打开失败,请检测硬件", Duration = 4000 }
 | 
					                            new NotificationMessage { Severity = NotificationSeverity.Error, Summary = "提示", Detail = $"抽屉【{drawerNo}】打开失败,请检测硬件", Duration = 4000 }
 | 
				
			||||||
                        );
 | 
					                        );
 | 
				
			||||||
                            logger.Info($"抽屉打开失败");
 | 
					                            logger.Info($"抽屉打开失败");
 | 
				
			||||||
                            PortUtil.PowerOff();
 | 
					                            PortUtil.AllLightOff();
 | 
				
			||||||
                            RestData();
 | 
					                            RestData();
 | 
				
			||||||
                            stop();
 | 
					                            stop();
 | 
				
			||||||
                        }
 | 
					                        }
 | 
				
			||||||
| 
						 | 
					@ -193,7 +193,7 @@
 | 
				
			||||||
                            });
 | 
					                            });
 | 
				
			||||||
                            PortUtil.Operate = false;
 | 
					                            PortUtil.Operate = false;
 | 
				
			||||||
                            orderTakeVo.Status = 2;
 | 
					                            orderTakeVo.Status = 2;
 | 
				
			||||||
                            PortUtil.PowerOff();
 | 
					                            PortUtil.AllLightOff();
 | 
				
			||||||
                            if (options._data == drawerNos.Count - 1)
 | 
					                            if (options._data == drawerNos.Count - 1)
 | 
				
			||||||
                            {
 | 
					                            {
 | 
				
			||||||
                                PortUtil.speechSynthesizer.SpeakAsyncCancelAll();
 | 
					                                PortUtil.speechSynthesizer.SpeakAsyncCancelAll();
 | 
				
			||||||
| 
						 | 
					@ -291,7 +291,7 @@
 | 
				
			||||||
                );
 | 
					                );
 | 
				
			||||||
                if (setting.Value.single.Contains(drawerNo))
 | 
					                if (setting.Value.single.Contains(drawerNo))
 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
                    PortUtil.PowerOff();
 | 
					                    PortUtil.AllLightOff();
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
                stop();
 | 
					                stop();
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
| 
						 | 
					@ -304,7 +304,6 @@
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    void RestData()
 | 
					    void RestData()
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        PortUtil.PowerOff();
 | 
					 | 
				
			||||||
        PortUtil.speechSynthesizer.SpeakAsyncCancelAll();
 | 
					        PortUtil.speechSynthesizer.SpeakAsyncCancelAll();
 | 
				
			||||||
        this.status = 0;
 | 
					        this.status = 0;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -62,28 +62,28 @@
 | 
				
			||||||
                                    switch(channel.BoardType)
 | 
					                                    switch(channel.BoardType)
 | 
				
			||||||
                                    {
 | 
					                                    {
 | 
				
			||||||
                                        case 1:
 | 
					                                        case 1:
 | 
				
			||||||
                                            <b>物理隔板</b>
 | 
					                                            <b>@myText.DrawerType1</b>
 | 
				
			||||||
                                            break;
 | 
					                                            break;
 | 
				
			||||||
                                        case 2:
 | 
					                                        case 2:
 | 
				
			||||||
                                            <b>单支计数</b>
 | 
					                                            <b>@myText.DrawerType2</b>
 | 
				
			||||||
                                            break;
 | 
					                                            break;
 | 
				
			||||||
                                        case 3:
 | 
					                                        case 3:
 | 
				
			||||||
                                            <b>管控药盒</b>
 | 
					                                            <b>@myText.DrawerType7</b>
 | 
				
			||||||
                                            break;
 | 
					                                            break;
 | 
				
			||||||
                                        case 4:
 | 
					                                        case 4:
 | 
				
			||||||
                                            <b>储物箱</b>
 | 
					                                            <b>@myText.DrawerType8</b>
 | 
				
			||||||
                                            break;
 | 
					                                            break;
 | 
				
			||||||
                                        case 5:
 | 
					                                        case 5:
 | 
				
			||||||
                                            <b>智能显示</b>
 | 
					                                            <b>@myText.DrawerType4</b>
 | 
				
			||||||
                                            break;
 | 
					                                            break;
 | 
				
			||||||
                                        case 6:
 | 
					                                        case 6:
 | 
				
			||||||
                                            <b>称重计数</b>
 | 
					                                            <b>@myText.DrawerType9</b>
 | 
				
			||||||
                                            break;
 | 
					                                            break;
 | 
				
			||||||
                                        case 63:
 | 
					                                        case 63:
 | 
				
			||||||
                                            <b>称重计数药盒</b>
 | 
					                                            <b>@myText.DrawerType10</b>
 | 
				
			||||||
                                            break;
 | 
					                                            break;
 | 
				
			||||||
                                        case 653:
 | 
					                                        case 653:
 | 
				
			||||||
                                            <b>称重计数药盒智能显示</b>
 | 
					                                            <b>@myText.DrawerType3</b>
 | 
				
			||||||
                                            break;
 | 
					                                            break;
 | 
				
			||||||
                                    }
 | 
					                                    }
 | 
				
			||||||
                                }
 | 
					                                }
 | 
				
			||||||
| 
						 | 
					@ -92,7 +92,7 @@
 | 
				
			||||||
                                    switch (channel.BoardType)
 | 
					                                    switch (channel.BoardType)
 | 
				
			||||||
                                    {
 | 
					                                    {
 | 
				
			||||||
                                        case 1:
 | 
					                                        case 1:
 | 
				
			||||||
                                            <b>内置回收</b>
 | 
					                                            <b>@myText.DrawerType5</b>
 | 
				
			||||||
                                            break;
 | 
					                                            break;
 | 
				
			||||||
                                        case 2:
 | 
					                                        case 2:
 | 
				
			||||||
                                            <b>内置计数回收</b>
 | 
					                                            <b>内置计数回收</b>
 | 
				
			||||||
| 
						 | 
					@ -122,7 +122,7 @@
 | 
				
			||||||
                                    switch (channel.BoardType)
 | 
					                                    switch (channel.BoardType)
 | 
				
			||||||
                                    {
 | 
					                                    {
 | 
				
			||||||
                                        case 1:
 | 
					                                        case 1:
 | 
				
			||||||
                                            <b>外置回收</b>
 | 
					                                            <b>@myText.DrawerType6</b>
 | 
				
			||||||
                                            break;
 | 
					                                            break;
 | 
				
			||||||
                                    }
 | 
					                                    }
 | 
				
			||||||
                                }
 | 
					                                }
 | 
				
			||||||
| 
						 | 
					@ -131,22 +131,22 @@
 | 
				
			||||||
                            <RadzenColumn Size="4" Class="rz-text-align-end">
 | 
					                            <RadzenColumn Size="4" Class="rz-text-align-end">
 | 
				
			||||||
                                @if(channel.Quantity == 0)
 | 
					                                @if(channel.Quantity == 0)
 | 
				
			||||||
                                {
 | 
					                                {
 | 
				
			||||||
                                    <RadzenButton ButtonStyle="ButtonStyle.Secondary" Variant="Variant.Outlined" Size="ButtonSize.Small" Click="@(() => EditChannel(channel))" Text="绑定/解绑" />
 | 
					                                    <RadzenButton ButtonStyle="ButtonStyle.Secondary" Variant="Variant.Outlined" Size="ButtonSize.Small" Click="@(() => EditChannel(channel))" Text="@myText.BindUnBind" />
 | 
				
			||||||
                                }
 | 
					                                }
 | 
				
			||||||
                            </RadzenColumn>
 | 
					                            </RadzenColumn>
 | 
				
			||||||
                        </RadzenRow>
 | 
					                        </RadzenRow>
 | 
				
			||||||
                        <hr style="border: none; background-color: rgba(0,0,0,.2); height: 1px; margin: 1rem 0;" />
 | 
					                        <hr style="border: none; background-color: rgba(0,0,0,.2); height: 1px; margin: 1rem 0;" />
 | 
				
			||||||
                        <RadzenStack Orientation="Orientation.Horizontal" AlignItems="AlignItems.Center">
 | 
					                        <RadzenStack Orientation="Orientation.Horizontal" AlignItems="AlignItems.Center">
 | 
				
			||||||
                            <RadzenStack Gap="0">
 | 
					                            <RadzenStack Gap="0">
 | 
				
			||||||
                                <RadzenText TextStyle="TextStyle.Overline" class="rz-display-flex rz-mt-2 rz-my-0">药品</RadzenText>
 | 
					                                <RadzenText TextStyle="TextStyle.Overline" class="rz-display-flex rz-mt-2 rz-my-0">@myText.DrugName</RadzenText>
 | 
				
			||||||
                                @if (channel.DrugId == null || channel.Quantity == 0)
 | 
					                                @if (channel.DrugId == null || channel.Quantity == 0)
 | 
				
			||||||
                                {
 | 
					                                {
 | 
				
			||||||
                                    <RadzenDropDownDataGrid Change="@((args) => { channel.drugManuNo = null; })" AllowVirtualization="true" Name="@("Drug_" + channel.Id)" TValue="DrugInfo" @bind-Value="channel.Drug" Data="@drugInfos"
 | 
					                                    <RadzenDropDownDataGrid Change="@((args) => { channel.drugManuNo = null; })" AllowVirtualization="true" Name="@("Drug_" + channel.Id)" TValue="DrugInfo" @bind-Value="channel.Drug" Data="@drugInfos"
 | 
				
			||||||
                                    Style="width:260px; display: block;" AllowFilteringByAllStringColumns="true" TextProperty="DrugName">
 | 
					                                    Style="width:100%; display: block;" AllowFilteringByAllStringColumns="true" TextProperty="DrugName">
 | 
				
			||||||
                                        <Columns>
 | 
					                                        <Columns>
 | 
				
			||||||
                                            <RadzenDropDownDataGridColumn Property="DrugId" Title="药品编码" Sortable="false" />
 | 
					                                            <RadzenDropDownDataGridColumn Property="DrugId" Title="@myText.DrugCode" Sortable="false" />
 | 
				
			||||||
                                            <RadzenDropDownDataGridColumn Property="DrugName"  Title="名称" Sortable="false" />
 | 
					                                            <RadzenDropDownDataGridColumn Property="DrugName" Width="120px" Title="@myText.DrugName" Sortable="false" />
 | 
				
			||||||
                                            <RadzenDropDownDataGridColumn Property="DrugSpec" Title="规格" Sortable="false" />
 | 
					                                            <RadzenDropDownDataGridColumn Property="DrugSpec" Title="@myText.Spec" Sortable="false" />
 | 
				
			||||||
                                        </Columns>
 | 
					                                        </Columns>
 | 
				
			||||||
                                    </RadzenDropDownDataGrid>
 | 
					                                    </RadzenDropDownDataGrid>
 | 
				
			||||||
                                } else
 | 
					                                } else
 | 
				
			||||||
| 
						 | 
					@ -156,13 +156,13 @@
 | 
				
			||||||
                                }
 | 
					                                }
 | 
				
			||||||
                                @if(channel.DrawerType == 1)
 | 
					                                @if(channel.DrawerType == 1)
 | 
				
			||||||
                                {
 | 
					                                {
 | 
				
			||||||
                                    <RadzenText TextStyle="TextStyle.Overline" class="rz-display-flex rz-mt-4 rz-mb-0">批次</RadzenText>
 | 
					                                    <RadzenText TextStyle="TextStyle.Overline" class="rz-display-flex rz-mt-4 rz-mb-0">@myText.Batch</RadzenText>
 | 
				
			||||||
                                    @if (channel.DrugId == null || channel.Quantity == 0)
 | 
					                                    @if (channel.DrugId == null || channel.Quantity == 0)
 | 
				
			||||||
                                    {
 | 
					                                    {
 | 
				
			||||||
                                        <RadzenDropDownDataGrid @bind-Value=@channel.drugManuNo Data=@channel.Drug?.Manus Disabled="@(channel.Drug == null)" TValue="DrugManuNo" Name="@("Drugmanu_" + channel.Id)" TextProperty="ManuNo">
 | 
					                                        <RadzenDropDownDataGrid @bind-Value=@channel.drugManuNo Data=@channel.Drug?.Manus Disabled="@(channel.Drug == null)" TValue="DrugManuNo" Name="@("Drugmanu_" + channel.Id)" TextProperty="ManuNo">
 | 
				
			||||||
                                            <Columns>
 | 
					                                            <Columns>
 | 
				
			||||||
                                                <RadzenDropDownDataGridColumn Property="ManuNo" Title="批次" Sortable="false" />
 | 
					                                                <RadzenDropDownDataGridColumn Property="ManuNo" Title="@myText.Batch" Sortable="false" />
 | 
				
			||||||
                                                <RadzenDropDownDataGridColumn Property="EffDate" Title="效期" Sortable="false">
 | 
					                                                <RadzenDropDownDataGridColumn Property="EffDate" Title="@myText.Expiration" Sortable="false">
 | 
				
			||||||
                                                    <Template Context="data">
 | 
					                                                    <Template Context="data">
 | 
				
			||||||
                                                        @data.EffDate.ToString("yyyy-MM-dd")
 | 
					                                                        @data.EffDate.ToString("yyyy-MM-dd")
 | 
				
			||||||
                                                    </Template>
 | 
					                                                    </Template>
 | 
				
			||||||
| 
						 | 
					@ -177,7 +177,7 @@
 | 
				
			||||||
                                    }
 | 
					                                    }
 | 
				
			||||||
                                }
 | 
					                                }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                                <RadzenText TextStyle="TextStyle.Overline" class="rz-display-flex rz-mt-4 rz-mb-0">库存</RadzenText>
 | 
					                                <RadzenText TextStyle="TextStyle.Overline" class="rz-display-flex rz-mt-4 rz-mb-0">@myText.Inventory</RadzenText>
 | 
				
			||||||
                                <RadzenText TextStyle="TextStyle.Body1"><b>@(channel.Quantity)</b></RadzenText>
 | 
					                                <RadzenText TextStyle="TextStyle.Body1"><b>@(channel.Quantity)</b></RadzenText>
 | 
				
			||||||
                            </RadzenStack>
 | 
					                            </RadzenStack>
 | 
				
			||||||
                        </RadzenStack>
 | 
					                        </RadzenStack>
 | 
				
			||||||
| 
						 | 
					@ -193,6 +193,8 @@
 | 
				
			||||||
    @inject IDrugInfoDao drugInfoDao;
 | 
					    @inject IDrugInfoDao drugInfoDao;
 | 
				
			||||||
    @inject DialogService dialogService;
 | 
					    @inject DialogService dialogService;
 | 
				
			||||||
    @inject NotificationService _message
 | 
					    @inject NotificationService _message
 | 
				
			||||||
 | 
					    @inject Toolbelt.Blazor.I18nText.I18nText I18nText;
 | 
				
			||||||
 | 
					    private I18nText.local myText = new I18nText.local();
 | 
				
			||||||
    RadzenDataList<ChannelStock> grid;
 | 
					    RadzenDataList<ChannelStock> grid;
 | 
				
			||||||
    bool isLoading;
 | 
					    bool isLoading;
 | 
				
			||||||
    int count;
 | 
					    int count;
 | 
				
			||||||
| 
						 | 
					@ -209,7 +211,9 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    protected override async Task OnInitializedAsync()
 | 
					    protected override async Task OnInitializedAsync()
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
 | 
					        myText = await I18nText.GetTextTableAsync<I18nText.local>(this);
 | 
				
			||||||
        await base.OnInitializedAsync();
 | 
					        await base.OnInitializedAsync();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        //drugInfos = await drugInfoDao.GetAllDrug();
 | 
					        //drugInfos = await drugInfoDao.GetAllDrug();
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -246,7 +250,7 @@
 | 
				
			||||||
                if(b)
 | 
					                if(b)
 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
                    _message.Notify(
 | 
					                    _message.Notify(
 | 
				
			||||||
                        new NotificationMessage { Severity = NotificationSeverity.Success, Summary = "提示", Detail = $"解除绑定成功", Duration = 4000 }
 | 
					                        new NotificationMessage { Severity = NotificationSeverity.Success, Summary = myText.Tips, Detail = myText.BindSuccess, Duration = 4000 }
 | 
				
			||||||
                    );
 | 
					                    );
 | 
				
			||||||
                    await reloadGrid();
 | 
					                    await reloadGrid();
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
| 
						 | 
					@ -259,7 +263,7 @@
 | 
				
			||||||
                if (b)
 | 
					                if (b)
 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
                    _message.Notify(
 | 
					                    _message.Notify(
 | 
				
			||||||
                        new NotificationMessage { Severity = NotificationSeverity.Success, Summary = "提示", Detail = $"绑定成功", Duration = 4000 }
 | 
					                        new NotificationMessage { Severity = NotificationSeverity.Success, Summary = myText.Tips, Detail = myText.BindSuccess, Duration = 4000 }
 | 
				
			||||||
                    );
 | 
					                    );
 | 
				
			||||||
                    await reloadGrid();
 | 
					                    await reloadGrid();
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
| 
						 | 
					@ -273,7 +277,7 @@
 | 
				
			||||||
                if (b)
 | 
					                if (b)
 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
                    _message.Notify(
 | 
					                    _message.Notify(
 | 
				
			||||||
                        new NotificationMessage { Severity = NotificationSeverity.Success, Summary = "提示", Detail = $"绑定成功", Duration = 4000 }
 | 
					                        new NotificationMessage { Severity = NotificationSeverity.Success, Summary = myText.Tips, Detail = myText.BindSuccess, Duration = 4000 }
 | 
				
			||||||
                    );
 | 
					                    );
 | 
				
			||||||
                    await reloadGrid();
 | 
					                    await reloadGrid();
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -16,15 +16,9 @@
 | 
				
			||||||
            @* <RadzenStack AlignItems="AlignItems.Center" JustifyContent="JustifyContent.Center" Orientation="Orientation.Vertical" Style="margin-top: 220px"> *@
 | 
					            @* <RadzenStack AlignItems="AlignItems.Center" JustifyContent="JustifyContent.Center" Orientation="Orientation.Vertical" Style="margin-top: 220px"> *@
 | 
				
			||||||
            <div class="row justify-content-around align-items-center" style="margin-top: 220px; height: 430px;">
 | 
					            <div class="row justify-content-around align-items-center" style="margin-top: 220px; height: 430px;">
 | 
				
			||||||
                @foreach (int i in DrawerNos)
 | 
					                @foreach (int i in DrawerNos)
 | 
				
			||||||
                {
 | 
					 | 
				
			||||||
                    if (setting.Value.returnDrawer != null && setting.Value.returnDrawer.Contains(i))
 | 
					 | 
				
			||||||
                    {
 | 
					 | 
				
			||||||
                        <RadzenButton class="col-5" Click="@(() => SelectDrawer(i))" Text="@i.ToString()" Disabled="true" Shade="Shade.Light" Variant="@(drawerNo !=i ? Variant.Outlined : Variant.Flat)" Style="background-color: #d3d3d3;" />
 | 
					 | 
				
			||||||
                    }
 | 
					 | 
				
			||||||
                    else
 | 
					 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
                    <RadzenButton class="col-5" Click="@(() => SelectDrawer(i))" Text="@i.ToString()" Disabled="@(status > 0)" Shade="Shade.Light" Variant="@(drawerNo !=i ? Variant.Outlined : Variant.Flat)" />
 | 
					                    <RadzenButton class="col-5" Click="@(() => SelectDrawer(i))" Text="@i.ToString()" Disabled="@(status > 0)" Shade="Shade.Light" Variant="@(drawerNo !=i ? Variant.Outlined : Variant.Flat)" />
 | 
				
			||||||
                    }
 | 
					
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
            </div>
 | 
					            </div>
 | 
				
			||||||
            @* </RadzenStack> *@
 | 
					            @* </RadzenStack> *@
 | 
				
			||||||
| 
						 | 
					@ -34,7 +28,7 @@
 | 
				
			||||||
    LoadData="@LoadData"
 | 
					    LoadData="@LoadData"
 | 
				
			||||||
    IsLoading="@isLoading"
 | 
					    IsLoading="@isLoading"
 | 
				
			||||||
    Count="@count"
 | 
					    Count="@count"
 | 
				
			||||||
    EmptyText="无数据"
 | 
					    EmptyText="@myText.NoDate"
 | 
				
			||||||
    Data="@channels"
 | 
					    Data="@channels"
 | 
				
			||||||
    AllowColumnResize="true" AllowAlternatingRows="false"
 | 
					    AllowColumnResize="true" AllowAlternatingRows="false"
 | 
				
			||||||
    CellClick="@((DataGridCellMouseEventArgs<ChannelStock> args) => OnCellClick(args))"
 | 
					    CellClick="@((DataGridCellMouseEventArgs<ChannelStock> args) => OnCellClick(args))"
 | 
				
			||||||
| 
						 | 
					@ -43,27 +37,27 @@
 | 
				
			||||||
            <RadzenRow JustifyContent="JustifyContent.End">
 | 
					            <RadzenRow JustifyContent="JustifyContent.End">
 | 
				
			||||||
                @if (status < 3)
 | 
					                @if (status < 3)
 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
                    <RadzenButton IsBusy="@(status>0)" BusyText="盘点中。。。" ButtonStyle="ButtonStyle.Warning" Variant="Variant.Flat" Shade="Shade.Light" Text="盘点" Click="@OpenDrawer" />
 | 
					                    <RadzenButton IsBusy="@(status > 0)" BusyText="@myText.Checking" ButtonStyle="ButtonStyle.Warning" Variant="Variant.Flat" Shade="Shade.Light" Text="@myText.Check" Click="@OpenDrawer" />
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
                @if (status == 3)
 | 
					                @if (status == 3)
 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
                    <RadzenButton ButtonStyle="ButtonStyle.Warning" Variant="Variant.Flat" Shade="Shade.Light" Text="完成" Click="@CheckFinish" />
 | 
					                    <RadzenButton ButtonStyle="ButtonStyle.Warning" Variant="Variant.Flat" Shade="Shade.Light" Text="@myText.Complete" Click="@CheckFinish" />
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
                @if (status > 0 && status <= 3)
 | 
					                @if (status > 0 && status <= 3)
 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
                    <RadzenButton Variant="Variant.Flat" Shade="Shade.Light" Text="取消" Click="@Cancel" Style="width: 120px" />
 | 
					                    <RadzenButton Variant="Variant.Flat" Shade="Shade.Light" Text="@myText.Cancel" Click="@Cancel" Style="width: 120px" />
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
            </RadzenRow>
 | 
					            </RadzenRow>
 | 
				
			||||||
        </HeaderTemplate>
 | 
					        </HeaderTemplate>
 | 
				
			||||||
        <Columns>
 | 
					        <Columns>
 | 
				
			||||||
            <RadzenDataGridColumn Width="70px" Title="库位" Property="ColNo"></RadzenDataGridColumn>
 | 
					            <RadzenDataGridColumn Width="70px" Title="@myText.StorageLocation" Property="ColNo"></RadzenDataGridColumn>
 | 
				
			||||||
            <RadzenDataGridColumn Title="药品名称" Property="Drug.DrugName">
 | 
					            <RadzenDataGridColumn Title="@myText.DrugName" Property="Drug.DrugName">
 | 
				
			||||||
                <Template Context="channel">
 | 
					                <Template Context="channel">
 | 
				
			||||||
                    <RadzenText TextStyle="TextStyle.Subtitle2" class="mb-0">@channel.Drug?.DrugName</RadzenText>
 | 
					                    <RadzenText TextStyle="TextStyle.Subtitle2" class="mb-0">@channel.Drug?.DrugName</RadzenText>
 | 
				
			||||||
                    <RadzenText TextStyle="TextStyle.Caption">@channel.Drug?.DrugSpec</RadzenText>
 | 
					                    <RadzenText TextStyle="TextStyle.Caption">@channel.Drug?.DrugSpec</RadzenText>
 | 
				
			||||||
                </Template>
 | 
					                </Template>
 | 
				
			||||||
            </RadzenDataGridColumn>
 | 
					            </RadzenDataGridColumn>
 | 
				
			||||||
            <RadzenDataGridColumn Title="批次" Property="ManuNo">
 | 
					            <RadzenDataGridColumn Title="@myText.Batch" Property="ManuNo">
 | 
				
			||||||
                <Template Context="channel">
 | 
					                <Template Context="channel">
 | 
				
			||||||
                    <RadzenText TextStyle="TextStyle.Subtitle2" class="mb-0">@channel.drugManuNo?.ManuNo</RadzenText>
 | 
					                    <RadzenText TextStyle="TextStyle.Subtitle2" class="mb-0">@channel.drugManuNo?.ManuNo</RadzenText>
 | 
				
			||||||
                    <RadzenText TextStyle="TextStyle.Caption">@channel.drugManuNo?.EffDate</RadzenText>
 | 
					                    <RadzenText TextStyle="TextStyle.Caption">@channel.drugManuNo?.EffDate</RadzenText>
 | 
				
			||||||
| 
						 | 
					@ -84,7 +78,7 @@
 | 
				
			||||||
                                </RadzenStack>
 | 
					                                </RadzenStack>
 | 
				
			||||||
                            </ValueTemplate>
 | 
					                            </ValueTemplate>
 | 
				
			||||||
                        </RadzenDropDown>
 | 
					                        </RadzenDropDown>
 | 
				
			||||||
                        <RadzenRequiredValidator Text="请选择批次" Component="ManuNo" Popup="true" />
 | 
					                        <RadzenRequiredValidator Text="@myText.SelectBatch" Component="ManuNo" Popup="true" />
 | 
				
			||||||
                    }
 | 
					                    }
 | 
				
			||||||
                    else
 | 
					                    else
 | 
				
			||||||
                    {
 | 
					                    {
 | 
				
			||||||
| 
						 | 
					@ -94,12 +88,12 @@
 | 
				
			||||||
                    }
 | 
					                    }
 | 
				
			||||||
                </EditTemplate>
 | 
					                </EditTemplate>
 | 
				
			||||||
            </RadzenDataGridColumn>
 | 
					            </RadzenDataGridColumn>
 | 
				
			||||||
            <RadzenDataGridColumn Title="库存" Property="Quantity">
 | 
					            <RadzenDataGridColumn Title="@myText.Inventory" Property="Quantity">
 | 
				
			||||||
                <Template Context="cs">
 | 
					                <Template Context="cs">
 | 
				
			||||||
                    <RadzenButton ButtonStyle="ButtonStyle.Info" Variant="Variant.Flat" Shade="Shade.Lighter" class="m-1" Text="@cs.Quantity.ToString()" />
 | 
					                    <RadzenButton ButtonStyle="ButtonStyle.Info" Variant="Variant.Flat" Shade="Shade.Lighter" class="m-1" Text="@cs.Quantity.ToString()" />
 | 
				
			||||||
                </Template>
 | 
					                </Template>
 | 
				
			||||||
            </RadzenDataGridColumn>
 | 
					            </RadzenDataGridColumn>
 | 
				
			||||||
            <RadzenDataGridColumn MinWidth="120px" Title="盘点数量" Property="CheckQuantity">
 | 
					            <RadzenDataGridColumn MinWidth="120px" Title="@myText.CheckQuantity" Property="CheckQuantity">
 | 
				
			||||||
                <EditTemplate Context="cs">
 | 
					                <EditTemplate Context="cs">
 | 
				
			||||||
                    @if (cs.BoardType.ToString().Contains("2") || cs.BoardType.ToString().Contains("3"))
 | 
					                    @if (cs.BoardType.ToString().Contains("2") || cs.BoardType.ToString().Contains("3"))
 | 
				
			||||||
                    {
 | 
					                    {
 | 
				
			||||||
| 
						 | 
					@ -108,7 +102,7 @@
 | 
				
			||||||
                    else
 | 
					                    else
 | 
				
			||||||
                    {
 | 
					                    {
 | 
				
			||||||
                        <RadzenNumeric Style="display: block" Name="CheckQuantity" @bind-Value=@cs.CheckQuantity>
 | 
					                        <RadzenNumeric Style="display: block" Name="CheckQuantity" @bind-Value=@cs.CheckQuantity>
 | 
				
			||||||
                            <RadzenNumericRangeValidator Style="position: absolute;z-index: 9999;" Min="1" Max="100" Text="请填写正确的取出数量" Component="CheckQuantity" />
 | 
					                            <RadzenNumericRangeValidator Style="position: absolute;z-index: 9999;" Min="1" Max="100" Text="@myText.InputTips" Component="CheckQuantity" />
 | 
				
			||||||
                        </RadzenNumeric>
 | 
					                        </RadzenNumeric>
 | 
				
			||||||
                    }
 | 
					                    }
 | 
				
			||||||
                </EditTemplate>
 | 
					                </EditTemplate>
 | 
				
			||||||
| 
						 | 
					@ -123,6 +117,8 @@
 | 
				
			||||||
    @inject PortUtil PortUtil;
 | 
					    @inject PortUtil PortUtil;
 | 
				
			||||||
    @inject NotificationService _message
 | 
					    @inject NotificationService _message
 | 
				
			||||||
    @inject IOptions<DrawerConfig> setting;
 | 
					    @inject IOptions<DrawerConfig> setting;
 | 
				
			||||||
 | 
					    @inject Toolbelt.Blazor.I18nText.I18nText I18nText;
 | 
				
			||||||
 | 
					    private I18nText.local myText = new I18nText.local();
 | 
				
			||||||
    int status = 0;
 | 
					    int status = 0;
 | 
				
			||||||
    int drawerNo = 1;
 | 
					    int drawerNo = 1;
 | 
				
			||||||
    RadzenDataGrid<ChannelStock> grid;
 | 
					    RadzenDataGrid<ChannelStock> grid;
 | 
				
			||||||
| 
						 | 
					@ -133,6 +129,11 @@
 | 
				
			||||||
    int[] BeforeQuantity = new int[9];
 | 
					    int[] BeforeQuantity = new int[9];
 | 
				
			||||||
    int[] AfterQuantity = new int[9];
 | 
					    int[] AfterQuantity = new int[9];
 | 
				
			||||||
    private readonly ILog logger = LogManager.GetLogger(typeof(DrawerAdd));
 | 
					    private readonly ILog logger = LogManager.GetLogger(typeof(DrawerAdd));
 | 
				
			||||||
 | 
					    protected override async Task OnInitializedAsync()
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        myText = await I18nText.GetTextTableAsync<I18nText.local>(this);
 | 
				
			||||||
 | 
					        await base.OnInitializedAsync();
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    async Task LoadData(LoadDataArgs args)
 | 
					    async Task LoadData(LoadDataArgs args)
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
| 
						 | 
					@ -157,8 +158,6 @@
 | 
				
			||||||
    async Task OpenDrawer()
 | 
					    async Task OpenDrawer()
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        this.status = 1;
 | 
					        this.status = 1;
 | 
				
			||||||
        PortUtil.PowerOn();
 | 
					 | 
				
			||||||
        await Task.Delay(200);
 | 
					 | 
				
			||||||
        // 根据抽屉类型来决定打开前是否需要查询数量
 | 
					        // 根据抽屉类型来决定打开前是否需要查询数量
 | 
				
			||||||
        var promiseUtil = new PromiseUtil<object>();
 | 
					        var promiseUtil = new PromiseUtil<object>();
 | 
				
			||||||
        await promiseUtil.taskAsyncLoop(500, null, async (data, next, stop) =>
 | 
					        await promiseUtil.taskAsyncLoop(500, null, async (data, next, stop) =>
 | 
				
			||||||
| 
						 | 
					@ -223,7 +222,6 @@
 | 
				
			||||||
                            {
 | 
					                            {
 | 
				
			||||||
                                cl.CheckQuantity = this.AfterQuantity[cl.ColNo - 1];// - this.BeforeQuantity[cl.ColNo - 1];
 | 
					                                cl.CheckQuantity = this.AfterQuantity[cl.ColNo - 1];// - this.BeforeQuantity[cl.ColNo - 1];
 | 
				
			||||||
                            });
 | 
					                            });
 | 
				
			||||||
                            await InvokeAsync(StateHasChanged);
 | 
					 | 
				
			||||||
                        }
 | 
					                        }
 | 
				
			||||||
                        next(); // continue iteration
 | 
					                        next(); // continue iteration
 | 
				
			||||||
                    }
 | 
					                    }
 | 
				
			||||||
| 
						 | 
					@ -238,18 +236,16 @@
 | 
				
			||||||
                );
 | 
					                );
 | 
				
			||||||
                if (setting.Value.single.Contains(this.drawerNo))
 | 
					                if (setting.Value.single.Contains(this.drawerNo))
 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
                    PortUtil.PowerOff();
 | 
					                    PortUtil.AllLightOff();
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
                RestData();
 | 
					                RestData();
 | 
				
			||||||
                stop();
 | 
					                stop();
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        });
 | 
					        });
 | 
				
			||||||
        PortUtil.PowerOff();
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    void RestData()
 | 
					    void RestData()
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        PortUtil.PowerOff();
 | 
					 | 
				
			||||||
        PortUtil.speechSynthesizer.SpeakAsyncCancelAll();
 | 
					        PortUtil.speechSynthesizer.SpeakAsyncCancelAll();
 | 
				
			||||||
        this.status = 0;
 | 
					        this.status = 0;
 | 
				
			||||||
        this.BeforeQuantity = new int[9];
 | 
					        this.BeforeQuantity = new int[9];
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,6 +1,5 @@
 | 
				
			||||||
@page "/stock/list"
 | 
					@page "/stock/list"
 | 
				
			||||||
@using MasaBlazorApp3.Report
 | 
					@using MasaBlazorApp3.Report
 | 
				
			||||||
@using Radzen.Blazor.Rendering
 | 
					 | 
				
			||||||
<style>
 | 
					<style>
 | 
				
			||||||
    @@keyframes shake {
 | 
					    @@keyframes shake {
 | 
				
			||||||
        0% {
 | 
					        0% {
 | 
				
			||||||
| 
						 | 
					@ -39,33 +38,15 @@
 | 
				
			||||||
        transition: color 0.5s linear,opacity 0.5s linear;
 | 
					        transition: color 0.5s linear,opacity 0.5s linear;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    .my-popup {
 | 
					 | 
				
			||||||
    display: none;
 | 
					 | 
				
			||||||
    position: absolute;
 | 
					 | 
				
			||||||
    overflow: auto;
 | 
					 | 
				
			||||||
    /* height: 360px; */
 | 
					 | 
				
			||||||
    width: 900px;
 | 
					 | 
				
			||||||
    border: var(--rz-panel-border);
 | 
					 | 
				
			||||||
    background-color: var(--rz-panel-background-color);
 | 
					 | 
				
			||||||
    box-shadow: var(--rz-panel-shadow);
 | 
					 | 
				
			||||||
    border-radius: var(--rz-border-radius);
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
</style>
 | 
					</style>
 | 
				
			||||||
<div class="col-12 mb-4">
 | 
					<div class="col-12 mb-4">
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    @*   <form onsubmit="@(() => grid.Reload())">
 | 
					    <form onsubmit="@(() => grid.Reload())">
 | 
				
			||||||
        <RadzenFieldset Text="报表导出">
 | 
					        <RadzenFieldset Text="@myText.Search">
 | 
				
			||||||
            <RadzenStack Orientation="Orientation.Horizontal" Gap="1rem">
 | 
					 | 
				
			||||||
                <RadzenRow JustifyContent="JustifyContent.End" AlignItems="AlignItems.Center">
 | 
					 | 
				
			||||||
                    <RadzenButton @ref=button Icon="download" Text="专用账册导出" Variant="Variant.Outlined" Click="@(args => popup2.ToggleAsync(button.Element))" />                   
 | 
					 | 
				
			||||||
                    <Popup @ref=popup2 Lazy=true class="my-popup">
 | 
					 | 
				
			||||||
                        <RadzenStack Orientation="Orientation.Vertical" Gap="1rem" class="rz-h-100 rz-p-4">
 | 
					 | 
				
			||||||
                            <RadzenFieldset Text="条件选择">
 | 
					 | 
				
			||||||
            <RadzenStack Orientation="Orientation.Horizontal" Gap="1rem">
 | 
					            <RadzenStack Orientation="Orientation.Horizontal" Gap="1rem">
 | 
				
			||||||
                <RadzenRow AlignItems="AlignItems.Center">
 | 
					                <RadzenRow AlignItems="AlignItems.Center">
 | 
				
			||||||
                    <RadzenColumn Size="4">
 | 
					                    <RadzenColumn Size="4">
 | 
				
			||||||
                                            <RadzenLabel Text="开始" Component="Start" />
 | 
					                        <RadzenLabel Text="@myText.StartDate" Component="Start" />
 | 
				
			||||||
                                            <RadzenLabel Text="时间" Component="Start" />
 | 
					 | 
				
			||||||
                    </RadzenColumn>
 | 
					                    </RadzenColumn>
 | 
				
			||||||
                    <RadzenColumn Size="8">
 | 
					                    <RadzenColumn Size="8">
 | 
				
			||||||
                        <RadzenDatePicker DateFormat="yyyy-MM-dd HH:mm:ss" ShowTime="true" @bind-Value="start" Style="width: 100%;" Name="Start" />
 | 
					                        <RadzenDatePicker DateFormat="yyyy-MM-dd HH:mm:ss" ShowTime="true" @bind-Value="start" Style="width: 100%;" Name="Start" />
 | 
				
			||||||
| 
						 | 
					@ -73,18 +54,15 @@
 | 
				
			||||||
                </RadzenRow>
 | 
					                </RadzenRow>
 | 
				
			||||||
                <RadzenRow AlignItems="AlignItems.Center">
 | 
					                <RadzenRow AlignItems="AlignItems.Center">
 | 
				
			||||||
                    <RadzenColumn Size="4">
 | 
					                    <RadzenColumn Size="4">
 | 
				
			||||||
                                            <RadzenLabel Text="结束" Component="End" />
 | 
					                        <RadzenLabel Text="@myText.EndDate" Component="End" />
 | 
				
			||||||
                                            <RadzenLabel Text="时间" Component="End" />
 | 
					 | 
				
			||||||
                    </RadzenColumn>
 | 
					                    </RadzenColumn>
 | 
				
			||||||
                    <RadzenColumn Size="8">
 | 
					                    <RadzenColumn Size="8">
 | 
				
			||||||
                        <RadzenDatePicker DateFormat="yyyy-MM-dd HH:mm:ss" ShowTime="true" @bind-Value="end" Style="width: 100%;" Name="End" />
 | 
					                        <RadzenDatePicker DateFormat="yyyy-MM-dd HH:mm:ss" ShowTime="true" @bind-Value="end" Style="width: 100%;" Name="End" />
 | 
				
			||||||
                    </RadzenColumn>
 | 
					                    </RadzenColumn>
 | 
				
			||||||
                </RadzenRow>
 | 
					                </RadzenRow>
 | 
				
			||||||
                <RadzenRow AlignItems="AlignItems.Center">
 | 
					                <RadzenRow AlignItems="AlignItems.Center">
 | 
				
			||||||
                                        <RadzenColumn Size="5">
 | 
					                    <RadzenColumn Size="6">
 | 
				
			||||||
                                            <RadzenLabel Text="药品名称" Component="drug" />
 | 
					                        <RadzenLabel Text="@myText.DrugSearch" Component="drug" />
 | 
				
			||||||
                                            <RadzenLabel Text="拼音码" Component="drug" />
 | 
					 | 
				
			||||||
                                            <RadzenLabel Text="编码" Component="drug" />
 | 
					 | 
				
			||||||
                    </RadzenColumn>
 | 
					                    </RadzenColumn>
 | 
				
			||||||
                    <RadzenColumn Size="6">
 | 
					                    <RadzenColumn Size="6">
 | 
				
			||||||
                        <RadzenAutoComplete Name="drug" Multiline="true" @bind-Value=@drugName Data=@drugInfo TextProperty="@nameof(DrugInfo.DrugNameSpecManufactory)"
 | 
					                        <RadzenAutoComplete Name="drug" Multiline="true" @bind-Value=@drugName Data=@drugInfo TextProperty="@nameof(DrugInfo.DrugNameSpecManufactory)"
 | 
				
			||||||
| 
						 | 
					@ -93,32 +71,29 @@
 | 
				
			||||||
                </RadzenRow>
 | 
					                </RadzenRow>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                <RadzenRow AlignItems="AlignItems.Center">
 | 
					                <RadzenRow AlignItems="AlignItems.Center">
 | 
				
			||||||
                                        <RadzenColumn>
 | 
					                    <RadzenColumn Size="12">
 | 
				
			||||||
                                            <RadzenButton Click="reloadGrid" Icon="refresh" Text="重置" ButtonStyle="ButtonStyle.Warning" />
 | 
					                        @* <RadzenButton Size="ButtonSize.Large" ButtonType="ButtonType.Submit" IsBusy="isLoading" Icon="search" Text="²éѯ" /> *@
 | 
				
			||||||
 | 
					                        <RadzenButton Size="ButtonSize.Large" Click="reloadGrid" IsBusy="isLoading" Icon="refresh" Text="@myText.Restore" ButtonStyle="ButtonStyle.Warning" />
 | 
				
			||||||
                    </RadzenColumn>
 | 
					                    </RadzenColumn>
 | 
				
			||||||
                </RadzenRow>
 | 
					                </RadzenRow>
 | 
				
			||||||
                <RadzenRow JustifyContent="JustifyContent.End" AlignItems="AlignItems.Center">
 | 
					                <RadzenRow JustifyContent="JustifyContent.End" AlignItems="AlignItems.Center">
 | 
				
			||||||
                                        <RadzenButton Icon="download" Text="导出" Variant="Variant.Outlined" Click="AccountBookExport" />
 | 
					                    <RadzenButton Icon="download" Text="@myText.StoreExport" Variant="Variant.Outlined" Click="StockExport" />
 | 
				
			||||||
 | 
					                    <RadzenButton Icon="download" Text="@myText.AccountExport" Variant="Variant.Outlined" Click="AccountBookExport" />
 | 
				
			||||||
                </RadzenRow>
 | 
					                </RadzenRow>
 | 
				
			||||||
            </RadzenStack>
 | 
					            </RadzenStack>
 | 
				
			||||||
        </RadzenFieldset>
 | 
					        </RadzenFieldset>
 | 
				
			||||||
                        </RadzenStack>
 | 
					    </form>
 | 
				
			||||||
                    </Popup>
 | 
					 | 
				
			||||||
                </RadzenRow>
 | 
					 | 
				
			||||||
            </RadzenStack>
 | 
					 | 
				
			||||||
        </RadzenFieldset>
 | 
					 | 
				
			||||||
    </form> *@
 | 
					 | 
				
			||||||
</div>
 | 
					</div>
 | 
				
			||||||
<div class="col-12 mb-4">
 | 
					<div class="col-12 mb-4">
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    <RadzenDataGrid @ref="grid"
 | 
					    <RadzenDataGrid @ref="grid"
 | 
				
			||||||
                    IsLoading="@isLoading"
 | 
					                    IsLoading="@isLoading"
 | 
				
			||||||
                    RowRender="@RowRender"
 | 
					                    RowRender="@RowRender"
 | 
				
			||||||
    EmptyText="无数据"
 | 
					                    EmptyText="@myText.NoDate"
 | 
				
			||||||
                    Data="@_forecasts"
 | 
					                    Data="@_forecasts"
 | 
				
			||||||
                    AllowColumnResize="true" AllowAlternatingRows="false"
 | 
					                    AllowColumnResize="true" AllowAlternatingRows="false"
 | 
				
			||||||
                    SelectionMode="DataGridSelectionMode.Single"
 | 
					                    SelectionMode="DataGridSelectionMode.Single"
 | 
				
			||||||
    ExpandMode="DataGridExpandMode.Single">
 | 
					                    ExpandMode="DataGridExpandMode.Multiple">
 | 
				
			||||||
        @* <HeaderTemplate>
 | 
					        @* <HeaderTemplate>
 | 
				
			||||||
            <RadzenRow JustifyContent="JustifyContent.End" AlignItems="AlignItems.Center">
 | 
					            <RadzenRow JustifyContent="JustifyContent.End" AlignItems="AlignItems.Center">
 | 
				
			||||||
                <RadzenButton Icon="download" Text="¿â´æµ¼³ö" Variant="Variant.Outlined" Click="StockExport" />
 | 
					                <RadzenButton Icon="download" Text="¿â´æµ¼³ö" Variant="Variant.Outlined" Click="StockExport" />
 | 
				
			||||||
| 
						 | 
					@ -126,63 +101,31 @@
 | 
				
			||||||
            </RadzenRow>
 | 
					            </RadzenRow>
 | 
				
			||||||
        </HeaderTemplate> *@
 | 
					        </HeaderTemplate> *@
 | 
				
			||||||
        <Template Context="di">
 | 
					        <Template Context="di">
 | 
				
			||||||
            <RadzenDataGrid Data="@di.Stocks" EmptyText="无数据">
 | 
					            <RadzenDataGrid Data="@di.Stocks" EmptyText="@myText.NoDate">
 | 
				
			||||||
                <Columns>
 | 
					                <Columns>
 | 
				
			||||||
                    <RadzenDataGridColumn Title="库位" Property="DrawerNo">
 | 
					                    <RadzenDataGridColumn Title="@myText.StorageLocation" Property="DrawerNo">
 | 
				
			||||||
                        <Template Context="s">
 | 
					                        <Template Context="s">
 | 
				
			||||||
                            @if (s.MachineId == "DM5")
 | 
					                            @s.DrawerNo - @s.ColNo
 | 
				
			||||||
                            {
 | 
					 | 
				
			||||||
                                switch (s.DrawerNo)
 | 
					 | 
				
			||||||
                                {
 | 
					 | 
				
			||||||
                                    case 99:
 | 
					 | 
				
			||||||
                                        @("急诊药盒")
 | 
					 | 
				
			||||||
                                        break;
 | 
					 | 
				
			||||||
                                    case 111:
 | 
					 | 
				
			||||||
                                        @("恢复室药盒")
 | 
					 | 
				
			||||||
                                        break;
 | 
					 | 
				
			||||||
                                    case 31:
 | 
					 | 
				
			||||||
                                        @("胃镜药盒")
 | 
					 | 
				
			||||||
                                        break;
 | 
					 | 
				
			||||||
                                    case 32:
 | 
					 | 
				
			||||||
                                        @("导管药盒")
 | 
					 | 
				
			||||||
                                        break;
 | 
					 | 
				
			||||||
                                    case 33:
 | 
					 | 
				
			||||||
                                        @("生殖药盒")
 | 
					 | 
				
			||||||
                                        break;
 | 
					 | 
				
			||||||
                                    case 34:
 | 
					 | 
				
			||||||
                                        @("妇门药盒")                                        
 | 
					 | 
				
			||||||
                                        break;
 | 
					 | 
				
			||||||
                                    default:
 | 
					 | 
				
			||||||
                                        @* @($"{s.DrawerNo}-{(s.ColNo == 1 ? '白' : '绿')}") *@
 | 
					 | 
				
			||||||
                                        @("常规神外药盒")
 | 
					 | 
				
			||||||
                                        break;
 | 
					 | 
				
			||||||
                                }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                            }
 | 
					 | 
				
			||||||
                            else
 | 
					 | 
				
			||||||
                            {
 | 
					 | 
				
			||||||
                                @($"{s.DrawerNo}-{s.ColNo}")
 | 
					 | 
				
			||||||
                            }
 | 
					 | 
				
			||||||
                        </Template>
 | 
					                        </Template>
 | 
				
			||||||
                    </RadzenDataGridColumn>
 | 
					                    </RadzenDataGridColumn>
 | 
				
			||||||
                    <RadzenDataGridColumn Title="数量" Property="Quantity">
 | 
					                    <RadzenDataGridColumn Title="@myText.Quantity" Property="Quantity">
 | 
				
			||||||
                    </RadzenDataGridColumn>
 | 
					                    </RadzenDataGridColumn>
 | 
				
			||||||
                    <RadzenDataGridColumn Title="批次" Property="ManuNo"></RadzenDataGridColumn>
 | 
					                    <RadzenDataGridColumn Title="@myText.Batch" Property="ManuNo"></RadzenDataGridColumn>
 | 
				
			||||||
                    <RadzenDataGridColumn Title="效期" Property="EffDate">
 | 
					                    <RadzenDataGridColumn Title="@myText.Expiration" Property="EffDate">
 | 
				
			||||||
                        <Template Context="s">
 | 
					                        <Template Context="s">
 | 
				
			||||||
                            @{
 | 
					                            @{
 | 
				
			||||||
                                DateTime dateTime;
 | 
					                                DateTime dateTime;
 | 
				
			||||||
                                bool success = DateTime.TryParse(s.EffDate, out dateTime);
 | 
					                                bool success = DateTime.TryParse(s.EffDate, out dateTime);
 | 
				
			||||||
                                // if (success && dateTime <= DateTime.Now.AddMonths(3))
 | 
					                                if (success && dateTime <= DateTime.Now.AddMonths(3))
 | 
				
			||||||
                                // {
 | 
					                                {
 | 
				
			||||||
                                //     @s.EffDate
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                                //     <p class="shaky-text">近效期药品!</p>
 | 
					 | 
				
			||||||
                                // }
 | 
					 | 
				
			||||||
                                // else
 | 
					 | 
				
			||||||
                                //{
 | 
					 | 
				
			||||||
                                    @s.EffDate
 | 
					                                    @s.EffDate
 | 
				
			||||||
                                //}
 | 
					
 | 
				
			||||||
 | 
					                                    <p class="shaky-text">@myText.AlertExpir£¡</p>
 | 
				
			||||||
 | 
					                                }
 | 
				
			||||||
 | 
					                                else
 | 
				
			||||||
 | 
					                                {
 | 
				
			||||||
 | 
					                                    @s.EffDate
 | 
				
			||||||
 | 
					                                }
 | 
				
			||||||
                            }
 | 
					                            }
 | 
				
			||||||
                        </Template>
 | 
					                        </Template>
 | 
				
			||||||
                    </RadzenDataGridColumn>
 | 
					                    </RadzenDataGridColumn>
 | 
				
			||||||
| 
						 | 
					@ -190,20 +133,20 @@
 | 
				
			||||||
            </RadzenDataGrid>
 | 
					            </RadzenDataGrid>
 | 
				
			||||||
        </Template>
 | 
					        </Template>
 | 
				
			||||||
        <Columns>
 | 
					        <Columns>
 | 
				
			||||||
            <RadzenDataGridColumn Frozen="true" Width="200px" Title="药品名称" Property="DrugName"></RadzenDataGridColumn>
 | 
					            <RadzenDataGridColumn Frozen="true" Width="200px" Title="@myText.DrugName" Property="DrugName"></RadzenDataGridColumn>
 | 
				
			||||||
            <RadzenDataGridColumn Title="规格" Property="DrugSpec"></RadzenDataGridColumn>
 | 
					            <RadzenDataGridColumn Title="@myText.Spec" Property="DrugSpec"></RadzenDataGridColumn>
 | 
				
			||||||
            <RadzenDataGridColumn Title="总库存" Property="StockQuantity">
 | 
					            <RadzenDataGridColumn Title="@myText.TotalStock" Property="StockQuantity">
 | 
				
			||||||
                <Template Context="s">
 | 
					                <Template Context="s">
 | 
				
			||||||
                    @*   @if (s.StockQuantity < 10)
 | 
					                    @if (s.StockQuantity < 10)
 | 
				
			||||||
                    {
 | 
					                    {
 | 
				
			||||||
                        @s.StockQuantity
 | 
					                        @s.StockQuantity
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                        <p class="shaky-text">库存预警!</p>
 | 
					                        <p class="shaky-text">@myText.AlertStock£¡</p>
 | 
				
			||||||
                    }
 | 
					                    }
 | 
				
			||||||
                    else
 | 
					                    else
 | 
				
			||||||
                    { *@
 | 
					                    {
 | 
				
			||||||
                        @s.StockQuantity
 | 
					                        @s.StockQuantity
 | 
				
			||||||
                    @* } *@
 | 
					                    }
 | 
				
			||||||
                </Template>
 | 
					                </Template>
 | 
				
			||||||
            </RadzenDataGridColumn>
 | 
					            </RadzenDataGridColumn>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -215,6 +158,8 @@
 | 
				
			||||||
    @inject IDrugInfoDao drugInfoDao;
 | 
					    @inject IDrugInfoDao drugInfoDao;
 | 
				
			||||||
    @inject DialogService dialogService;
 | 
					    @inject DialogService dialogService;
 | 
				
			||||||
    @inject IReportDataDao reportDataDao;
 | 
					    @inject IReportDataDao reportDataDao;
 | 
				
			||||||
 | 
					    @inject Toolbelt.Blazor.I18nText.I18nText I18nText;
 | 
				
			||||||
 | 
					    private I18nText.local myText = new I18nText.local();
 | 
				
			||||||
    RadzenDataGrid<DrugInfo> grid;
 | 
					    RadzenDataGrid<DrugInfo> grid;
 | 
				
			||||||
    bool isLoading;
 | 
					    bool isLoading;
 | 
				
			||||||
    int count;
 | 
					    int count;
 | 
				
			||||||
| 
						 | 
					@ -223,13 +168,12 @@
 | 
				
			||||||
    DateTime? end;
 | 
					    DateTime? end;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    string drugName;
 | 
					    string drugName;
 | 
				
			||||||
    RadzenButton button;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    Popup popup2;
 | 
					 | 
				
			||||||
    IEnumerable<DrugInfo> drugInfo;
 | 
					    IEnumerable<DrugInfo> drugInfo;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    protected override async Task OnInitializedAsync()
 | 
					    protected override async Task OnInitializedAsync()
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
 | 
					        myText = await I18nText.GetTextTableAsync<I18nText.local>(this);
 | 
				
			||||||
        await base.OnInitializedAsync();
 | 
					        await base.OnInitializedAsync();
 | 
				
			||||||
        isLoading = true;
 | 
					        isLoading = true;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -258,12 +202,12 @@
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    // //库存导出
 | 
					    //¿â´æµ¼³ö
 | 
				
			||||||
    // async Task StockExport()
 | 
					    async Task StockExport()
 | 
				
			||||||
    // {
 | 
					    {
 | 
				
			||||||
    //     PageData<ReportStockDateInfo> pageData = await reportDataDao.GetStockExportData(drugName);
 | 
					        PageData<ReportStockDateInfo> pageData = await reportDataDao.GetStockExportData(drugName);
 | 
				
			||||||
    //     GridReportUtil.PrintReport("stock_template.grf", pageData);
 | 
					        GridReportUtil.PrintReport("stock_template.grf", pageData);
 | 
				
			||||||
    // }
 | 
					    }
 | 
				
			||||||
    //רÓÃÕ˲ᵼ³ö
 | 
					    //רÓÃÕ˲ᵼ³ö
 | 
				
			||||||
    async Task AccountBookExport()
 | 
					    async Task AccountBookExport()
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -7,12 +7,12 @@
 | 
				
			||||||
        <div class="col-12 mb-4">
 | 
					        <div class="col-12 mb-4">
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            <form onsubmit="@(() => grid.Reload())">
 | 
					            <form onsubmit="@(() => grid.Reload())">
 | 
				
			||||||
                <RadzenFieldset Text="查询">
 | 
					                <RadzenFieldset Text="@myText.Search">
 | 
				
			||||||
                    <RadzenStack Orientation="Orientation.Horizontal" JustifyContent="JustifyContent.SpaceBetween">
 | 
					                    <RadzenStack Orientation="Orientation.Horizontal" JustifyContent="JustifyContent.SpaceBetween">
 | 
				
			||||||
                        <RadzenStack Orientation="Orientation.Horizontal" Gap="1rem">
 | 
					                        <RadzenStack Orientation="Orientation.Horizontal" Gap="1rem">
 | 
				
			||||||
                            <RadzenRow AlignItems="AlignItems.Center">
 | 
					                            <RadzenRow AlignItems="AlignItems.Center">
 | 
				
			||||||
                                <RadzenColumn Size="4">
 | 
					                                <RadzenColumn Size="4">
 | 
				
			||||||
                                    <RadzenLabel Text="用户名" Component="nickname" />
 | 
					                                    <RadzenLabel Text="@myText.Account" Component="nickname" />
 | 
				
			||||||
                                </RadzenColumn>
 | 
					                                </RadzenColumn>
 | 
				
			||||||
                                <RadzenColumn Size="8">
 | 
					                                <RadzenColumn Size="8">
 | 
				
			||||||
                                    <RadzenTextBox @bind-Value="nickname" Style="width: 100%;" Name="nickname"></RadzenTextBox>
 | 
					                                    <RadzenTextBox @bind-Value="nickname" Style="width: 100%;" Name="nickname"></RadzenTextBox>
 | 
				
			||||||
| 
						 | 
					@ -22,12 +22,12 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                            <RadzenRow AlignItems="AlignItems.Center">
 | 
					                            <RadzenRow AlignItems="AlignItems.Center">
 | 
				
			||||||
                                <RadzenColumn Size="12">
 | 
					                                <RadzenColumn Size="12">
 | 
				
			||||||
                                    <RadzenButton Size="ButtonSize.Medium" ButtonType="ButtonType.Submit" IsBusy="isLoading" Icon="search" Text="查询" />
 | 
					                                    <RadzenButton Size="ButtonSize.Medium" ButtonType="ButtonType.Submit" IsBusy="isLoading" Icon="search" Text="@myText.Search" />
 | 
				
			||||||
                                    <RadzenButton Size="ButtonSize.Medium" Click="reloadGrid" IsBusy="isLoading" Icon="refresh" Text="重置" ButtonStyle="ButtonStyle.Warning" />
 | 
					                                    <RadzenButton Size="ButtonSize.Medium" Click="reloadGrid" IsBusy="isLoading" Icon="refresh" Text="@myText.Restore" ButtonStyle="ButtonStyle.Warning" />
 | 
				
			||||||
                                </RadzenColumn>
 | 
					                                </RadzenColumn>
 | 
				
			||||||
                            </RadzenRow>
 | 
					                            </RadzenRow>
 | 
				
			||||||
                        </RadzenStack>
 | 
					                        </RadzenStack>
 | 
				
			||||||
                        <RadzenButton Size="ButtonSize.Medium" ButtonStyle="ButtonStyle.Success" Icon="add_circle_outline" Click="@InsertRow" Disabled="@(usersToInsert.Count() > 0)" Text="新增" />
 | 
					                        <RadzenButton Size="ButtonSize.Medium" ButtonStyle="ButtonStyle.Success" Icon="add_circle_outline" Click="@InsertRow" Disabled="@(usersToInsert.Count() > 0)" Text="@myText.Add" />
 | 
				
			||||||
                    </RadzenStack>
 | 
					                    </RadzenStack>
 | 
				
			||||||
                </RadzenFieldset>
 | 
					                </RadzenFieldset>
 | 
				
			||||||
            </form>
 | 
					            </form>
 | 
				
			||||||
| 
						 | 
					@ -38,7 +38,7 @@
 | 
				
			||||||
            LoadData="@LoadData"
 | 
					            LoadData="@LoadData"
 | 
				
			||||||
            IsLoading="@isLoading"
 | 
					            IsLoading="@isLoading"
 | 
				
			||||||
            Count="@count"
 | 
					            Count="@count"
 | 
				
			||||||
            EmptyText="无数据"
 | 
					            EmptyText="@myText.Date"
 | 
				
			||||||
            Data="@userList"
 | 
					            Data="@userList"
 | 
				
			||||||
            Page="@Reset"
 | 
					            Page="@Reset"
 | 
				
			||||||
            EditMode="DataGridEditMode.Single"
 | 
					            EditMode="DataGridEditMode.Single"
 | 
				
			||||||
| 
						 | 
					@ -48,23 +48,23 @@
 | 
				
			||||||
            AllowPaging="true" PageSize="10" PagerHorizontalAlign="HorizontalAlign.Left" ShowPagingSummary="true" PagingSummaryFormat="{0}/{1} 共{2}条数据">
 | 
					            AllowPaging="true" PageSize="10" PagerHorizontalAlign="HorizontalAlign.Left" ShowPagingSummary="true" PagingSummaryFormat="{0}/{1} 共{2}条数据">
 | 
				
			||||||
                <Columns>
 | 
					                <Columns>
 | 
				
			||||||
                    <RadzenDataGridColumn Title="ID" Property="Id"></RadzenDataGridColumn>
 | 
					                    <RadzenDataGridColumn Title="ID" Property="Id"></RadzenDataGridColumn>
 | 
				
			||||||
                    <RadzenDataGridColumn Title="用户名" Property="NickName">
 | 
					                    <RadzenDataGridColumn Title="@myText.UserName" Property="NickName">
 | 
				
			||||||
                        <EditTemplate Context="user">
 | 
					                        <EditTemplate Context="user">
 | 
				
			||||||
                            <RadzenTextBox Name="NickName" @bind-Value="user.NickName" Style="width:100%; display: block;" />
 | 
					                            <RadzenTextBox Name="NickName" @bind-Value="user.NickName" Style="width:100%; display: block;" />
 | 
				
			||||||
                            <RadzenRequiredValidator Text="请填写用户名" Component="NickName" Popup="true" />
 | 
					                            <RadzenRequiredValidator Text="@myText.loginTips1" Component="NickName" Popup="true" />
 | 
				
			||||||
                        </EditTemplate>
 | 
					                        </EditTemplate>
 | 
				
			||||||
                    </RadzenDataGridColumn>
 | 
					                    </RadzenDataGridColumn>
 | 
				
			||||||
                    <RadzenDataGridColumn Title="账号" Property="Username">
 | 
					                    <RadzenDataGridColumn Title="@myText.Account" Property="Username">
 | 
				
			||||||
                        <EditTemplate Context="user">
 | 
					                        <EditTemplate Context="user">
 | 
				
			||||||
                            <RadzenTextBox Name="Username" @bind-Value="user.Username" Style="width:100%; display: block;" />
 | 
					                            <RadzenTextBox Name="Username" @bind-Value="user.Username" Style="width:100%; display: block;" />
 | 
				
			||||||
                            <RadzenRequiredValidator Text="请填写账号" Component="Username" Popup="true" />
 | 
					                            <RadzenRequiredValidator Text="@myText.InputAccount" Component="Username" Popup="true" />
 | 
				
			||||||
                        </EditTemplate>
 | 
					                        </EditTemplate>
 | 
				
			||||||
                    </RadzenDataGridColumn>
 | 
					                    </RadzenDataGridColumn>
 | 
				
			||||||
                    <RadzenDataGridColumn Title="权限" Property="role.RoleName">
 | 
					                    <RadzenDataGridColumn Title="@myText.Role" Property="role.RoleName">
 | 
				
			||||||
                        <EditTemplate Context="user">
 | 
					                        <EditTemplate Context="user">
 | 
				
			||||||
                            <RadzenDropDown Name="RoleId" @bind-Value="user.RoleId" Data="@roles" TextProperty="RoleName" ValueProperty="Id" Style="width:100%; display: block;"
 | 
					                            <RadzenDropDown Name="RoleId" @bind-Value="user.RoleId" Data="@roles" TextProperty="RoleName" ValueProperty="Id" Style="width:100%; display: block;"
 | 
				
			||||||
                            InputAttributes="@(new Dictionary<string,object>(){ { "aria-label", "Select customer" }})" />
 | 
					                            InputAttributes="@(new Dictionary<string,object>(){ { "aria-label", "Select customer" }})" />
 | 
				
			||||||
                            <RadzenRequiredValidator Text="请选择角色" Component="RoleId" Popup="true" />
 | 
					                            <RadzenRequiredValidator Text="@myText.InputRole" Component="RoleId" Popup="true" />
 | 
				
			||||||
                        </EditTemplate>
 | 
					                        </EditTemplate>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                    </RadzenDataGridColumn>
 | 
					                    </RadzenDataGridColumn>
 | 
				
			||||||
| 
						 | 
					@ -110,7 +110,9 @@
 | 
				
			||||||
    @inject IUserDao userDao;
 | 
					    @inject IUserDao userDao;
 | 
				
			||||||
    @inject IRoleDao roleDao;
 | 
					    @inject IRoleDao roleDao;
 | 
				
			||||||
    @inject DialogService dialogService;
 | 
					    @inject DialogService dialogService;
 | 
				
			||||||
    @inject NotificationService _message
 | 
					    @inject NotificationService _message;
 | 
				
			||||||
 | 
					    @inject Toolbelt.Blazor.I18nText.I18nText I18nText;
 | 
				
			||||||
 | 
					    private I18nText.local myText = new I18nText.local();
 | 
				
			||||||
    RadzenDataGrid<Pojo.User> grid;
 | 
					    RadzenDataGrid<Pojo.User> grid;
 | 
				
			||||||
    bool isLoading;
 | 
					    bool isLoading;
 | 
				
			||||||
    int count;
 | 
					    int count;
 | 
				
			||||||
| 
						 | 
					@ -129,6 +131,7 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    protected override async Task OnInitializedAsync()
 | 
					    protected override async Task OnInitializedAsync()
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
 | 
					        myText = await I18nText.GetTextTableAsync<I18nText.local>(this);
 | 
				
			||||||
        await base.OnInitializedAsync();
 | 
					        await base.OnInitializedAsync();
 | 
				
			||||||
        roles = await roleDao.GetAllRoles();
 | 
					        roles = await roleDao.GetAllRoles();
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
| 
						 | 
					@ -142,7 +145,7 @@
 | 
				
			||||||
    async Task Reg2ZWJ(Pojo.User user)
 | 
					    async Task Reg2ZWJ(Pojo.User user)
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        await dialogService.OpenAsync<FingerRegDialog>(
 | 
					        await dialogService.OpenAsync<FingerRegDialog>(
 | 
				
			||||||
                $"录入指纹",
 | 
					                myText.EnterFingerprint,
 | 
				
			||||||
              new Dictionary<string, object>() { { "userId", user.Id } },
 | 
					              new Dictionary<string, object>() { { "userId", user.Id } },
 | 
				
			||||||
              new DialogOptions() { Width = "55vw", Resizable = true, Draggable = true, ShowClose = false }
 | 
					              new DialogOptions() { Width = "55vw", Resizable = true, Draggable = true, ShowClose = false }
 | 
				
			||||||
        );
 | 
					        );
 | 
				
			||||||
| 
						 | 
					@ -234,7 +237,7 @@
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            //弹出确认提示框
 | 
					            //弹出确认提示框
 | 
				
			||||||
            var b = await dialogService.OpenAsync<ConfirmDialog>(
 | 
					            var b = await dialogService.OpenAsync<ConfirmDialog>(
 | 
				
			||||||
               $"删除确认",
 | 
					               myText.ConfirmDelete,
 | 
				
			||||||
             new Dictionary<string, object>() { { "confirmInfo", "确认要删除用户:"+user.Username+"吗?" } },
 | 
					             new Dictionary<string, object>() { { "confirmInfo", "确认要删除用户:"+user.Username+"吗?" } },
 | 
				
			||||||
             new DialogOptions() { Width = "45vw", Resizable = true, Draggable = true, ShowClose = false });
 | 
					             new DialogOptions() { Width = "45vw", Resizable = true, Draggable = true, ShowClose = false });
 | 
				
			||||||
            if (b)
 | 
					            if (b)
 | 
				
			||||||
| 
						 | 
					@ -267,7 +270,7 @@
 | 
				
			||||||
                // 数据库重置密码
 | 
					                // 数据库重置密码
 | 
				
			||||||
                userDao.ResetPassword(user.Id);
 | 
					                userDao.ResetPassword(user.Id);
 | 
				
			||||||
                //提示密码已重置,下次登录请使用重置后的密码
 | 
					                //提示密码已重置,下次登录请使用重置后的密码
 | 
				
			||||||
                _message.Notify(new NotificationMessage { Severity = NotificationSeverity.Success, Summary = "提示", Detail = $"密码已重置,下次登录请使用重置后的密码", Duration = 4000 });
 | 
					                _message.Notify(new NotificationMessage { Severity = NotificationSeverity.Success, Summary = myText.Tips, Detail = $"密码已重置,下次登录请使用重置后的密码", Duration = 4000 });
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            await grid.Reload();
 | 
					            await grid.Reload();
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -7,7 +7,7 @@ namespace MasaBlazorApp3.Pojo
 | 
				
			||||||
        /// <summary>
 | 
					        /// <summary>
 | 
				
			||||||
        /// 主键
 | 
					        /// 主键
 | 
				
			||||||
        /// </summary>
 | 
					        /// </summary>
 | 
				
			||||||
        [Column("id", IsPrimaryKey = true)]
 | 
					        [Column("id")]
 | 
				
			||||||
        public int Id { get; set; }
 | 
					        public int Id { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        /// <summary>
 | 
					        /// <summary>
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,14 +0,0 @@
 | 
				
			||||||
using System;
 | 
					 | 
				
			||||||
using System.Collections.Generic;
 | 
					 | 
				
			||||||
using System.Linq;
 | 
					 | 
				
			||||||
using System.Text;
 | 
					 | 
				
			||||||
using System.Threading.Tasks;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
namespace MasaBlazorApp3.Pojo
 | 
					 | 
				
			||||||
{
 | 
					 | 
				
			||||||
    public class Anaesthetist
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
        public int Id { get; set; }
 | 
					 | 
				
			||||||
        public string Name { get; set; }
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
| 
						 | 
					@ -1,19 +0,0 @@
 | 
				
			||||||
using System;
 | 
					 | 
				
			||||||
using System.Collections.Generic;
 | 
					 | 
				
			||||||
using System.Linq;
 | 
					 | 
				
			||||||
using System.Text;
 | 
					 | 
				
			||||||
using System.Threading.Tasks;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
namespace MasaBlazorApp3.Pojo
 | 
					 | 
				
			||||||
{
 | 
					 | 
				
			||||||
    public class BoxModel
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
        //库位号
 | 
					 | 
				
			||||||
        public int BoxNo { get; set; }
 | 
					 | 
				
			||||||
        //药箱号
 | 
					 | 
				
			||||||
        public int BoxName { get; set; }
 | 
					 | 
				
			||||||
        public string 药箱号 {
 | 
					 | 
				
			||||||
            get => BoxName + "-" + BoxNo;
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
| 
						 | 
					@ -47,16 +47,10 @@ namespace MasaBlazorApp3.Pojo
 | 
				
			||||||
        //关联药品中的套餐信息表
 | 
					        //关联药品中的套餐信息表
 | 
				
			||||||
        [Association(ThisKey =nameof(DrugId),OtherKey = nameof(Plan.Id))]
 | 
					        [Association(ThisKey =nameof(DrugId),OtherKey = nameof(Plan.Id))]
 | 
				
			||||||
        public Plan PlanInfo { get; set; }=new();
 | 
					        public Plan PlanInfo { get; set; }=new();
 | 
				
			||||||
        //手术室药盒中的库存总数
 | 
					        //手术室药箱中的库存总数
 | 
				
			||||||
        [Column("stock_quantity")]
 | 
					        [Column("stock_quantity")]
 | 
				
			||||||
        public int TotalQuantity { get; set; }
 | 
					        public int TotalQuantity { get; set; }
 | 
				
			||||||
        [Association(ThisKey = nameof(DrugId), OtherKey = nameof(PlanDetails.PlanId))]
 | 
					        [Association(ThisKey = nameof(DrugId), OtherKey = nameof(PlanDetails.PlanId))]
 | 
				
			||||||
        public List<PlanDetails> _PlanDetails { get; set; } = new();
 | 
					        public List<PlanDetails> _PlanDetails { get; set; } = new();
 | 
				
			||||||
        //手术室药盒中的库存总数
 | 
					 | 
				
			||||||
        [Column(IsColumn = false)]
 | 
					 | 
				
			||||||
        public bool IsChecked{get;set;} = false;
 | 
					 | 
				
			||||||
        //手术室药盒中的库存总数
 | 
					 | 
				
			||||||
        [Column(IsColumn = false)]
 | 
					 | 
				
			||||||
        public bool BoxDisabled {get;set;} = false; 
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,5 +1,4 @@
 | 
				
			||||||
using LinqToDB.Mapping;
 | 
					using LinqToDB.Mapping;
 | 
				
			||||||
using Mysqlx.Crud;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace MasaBlazorApp3.Pojo
 | 
					namespace MasaBlazorApp3.Pojo
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
| 
						 | 
					@ -28,10 +27,7 @@ namespace MasaBlazorApp3.Pojo
 | 
				
			||||||
        [Column("quantity")]
 | 
					        [Column("quantity")]
 | 
				
			||||||
        public int Quantity { get; set; }
 | 
					        public int Quantity { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        [Column(IsColumn =false)]
 | 
					 | 
				
			||||||
        public int TotalQuantity { get; set; }
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
        //药盒DrawerType为非1时表示不在库
 | 
					 | 
				
			||||||
        [Column("drawer_type")]
 | 
					        [Column("drawer_type")]
 | 
				
			||||||
        public int DrawerType { get; set; }
 | 
					        public int DrawerType { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -57,7 +53,7 @@ namespace MasaBlazorApp3.Pojo
 | 
				
			||||||
        public int AddQuantity { get; set; } = 0;
 | 
					        public int AddQuantity { get; set; } = 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        [Column(IsColumn = false)]
 | 
					        [Column(IsColumn = false)]
 | 
				
			||||||
        public int ReturnQuantity { get; set; } = 0;
 | 
					        public int ReturnQuantity { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        [Column("dmnguid")]
 | 
					        [Column("dmnguid")]
 | 
				
			||||||
        public string Dmnguid { get; set; }
 | 
					        public string Dmnguid { get; set; }
 | 
				
			||||||
| 
						 | 
					@ -65,8 +61,6 @@ namespace MasaBlazorApp3.Pojo
 | 
				
			||||||
        [LinqToDB.Mapping.Association(ThisKey = nameof(Dmnguid), OtherKey = nameof(DrugManuNo.Id))]
 | 
					        [LinqToDB.Mapping.Association(ThisKey = nameof(Dmnguid), OtherKey = nameof(DrugManuNo.Id))]
 | 
				
			||||||
        public DrugManuNo? drugManuNo { get; set; }
 | 
					        public DrugManuNo? drugManuNo { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        [Association(ThisKey = nameof(DrugId), OtherKey = nameof(DrugManuNo.DrugId))]
 | 
					 | 
				
			||||||
        public List<DrugManuNo> drugManuNoList { get; set; }=new List<DrugManuNo>();
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
        [Column(IsColumn = false)]
 | 
					        [Column(IsColumn = false)]
 | 
				
			||||||
        public string Location
 | 
					        public string Location
 | 
				
			||||||
| 
						 | 
					@ -83,43 +77,17 @@ namespace MasaBlazorApp3.Pojo
 | 
				
			||||||
        [Column("Pos_No")]
 | 
					        [Column("Pos_No")]
 | 
				
			||||||
        public int BiaoDingStatus { get; set; }
 | 
					        public int BiaoDingStatus { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        //手术室药盒中的药品基数
 | 
					        //手术室药箱中的药品基数
 | 
				
			||||||
        [Column("Check_Quantity")]
 | 
					        [Column("Check_Quantity")]
 | 
				
			||||||
        public int BaseQuantity { get; set; }
 | 
					        public int BaseQuantity { get; set; }
 | 
				
			||||||
        //手术室药盒中某药品全部批次的需要加药数
 | 
					        //手术室药箱中某药品全部批次的需要加药数
 | 
				
			||||||
        [Column("col_no2")]
 | 
					        [Column("col_no2")]
 | 
				
			||||||
        public int NeedQuantity { get; set; }
 | 
					        public int NeedQuantity { get; set; }
 | 
				
			||||||
        //手术室药盒中某药品全部批次的已取药待入库数
 | 
					        //手术室药箱中某药品全部批次的已取药待入库数
 | 
				
			||||||
        [Column("col_no1")]
 | 
					        [Column("col_no1")]
 | 
				
			||||||
        public int AddToQuantity { get; set; }
 | 
					        public int AddToQuantity { get; set; }
 | 
				
			||||||
        //手术室药盒中药品补药状态(1需补药2已补药待入库0满库状态)
 | 
					        //手术室药箱中药品补药状态(1需补药2已补药待入库0满库状态)
 | 
				
			||||||
        [Column("state")]
 | 
					        [Column("state")]
 | 
				
			||||||
        public int BoxState { get; set; }
 | 
					        public int BoxState { get; set; }
 | 
				
			||||||
        [Column("fill_time")]
 | 
					 | 
				
			||||||
        public DateTime FillTime { get; set; }
 | 
					 | 
				
			||||||
        //药盒中药品对应的处方信息
 | 
					 | 
				
			||||||
        [Column(IsColumn =false)]
 | 
					 | 
				
			||||||
        public List<OrderInfo> OrderList { get; set; }
 | 
					 | 
				
			||||||
        //药盒中药品对应的选中的处方信息
 | 
					 | 
				
			||||||
        [Column(IsColumn =false)]
 | 
					 | 
				
			||||||
        public IList<OrderInfo> SelectedOrderList { get; set; }
 | 
					 | 
				
			||||||
        //还空瓶库位
 | 
					 | 
				
			||||||
        [Column(IsColumn = false)]
 | 
					 | 
				
			||||||
        public ChannelStock EmptyStock { get; set; }
 | 
					 | 
				
			||||||
        //还空瓶数
 | 
					 | 
				
			||||||
        [Column(IsColumn = false)]
 | 
					 | 
				
			||||||
        public int EmptyQuantity { get; set; } = 0;
 | 
					 | 
				
			||||||
        //用药数
 | 
					 | 
				
			||||||
        [Column(IsColumn =false)]
 | 
					 | 
				
			||||||
        public int UseQuantity { get; set; }
 | 
					 | 
				
			||||||
        //处方数
 | 
					 | 
				
			||||||
        [Column(IsColumn =false)]
 | 
					 | 
				
			||||||
        public int OrderQuantity { get; set; }
 | 
					 | 
				
			||||||
        //药盒中未绑套餐的药所在抽屉库位
 | 
					 | 
				
			||||||
        [Column(IsColumn =false)]
 | 
					 | 
				
			||||||
        public List<ChannelStock> DrawerChanneStockList { get; set; }
 | 
					 | 
				
			||||||
        //药盒中未绑套餐的药所在抽屉库位
 | 
					 | 
				
			||||||
        [Column(IsColumn = false)]
 | 
					 | 
				
			||||||
        public ChannelStock ReturnDrawerChanneStock { get; set; }
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -12,7 +12,6 @@ namespace MasaBlazorApp3.Pojo.Config
 | 
				
			||||||
        public int[] weigh { get; set; }
 | 
					        public int[] weigh { get; set; }
 | 
				
			||||||
        public int[] box { get; set; }
 | 
					        public int[] box { get; set; }
 | 
				
			||||||
        public int[] label { get; set; }
 | 
					        public int[] label { get; set; }
 | 
				
			||||||
        public int[] returnDrawer { get; set; }
 | 
					 | 
				
			||||||
     
 | 
					     
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -17,18 +17,11 @@ namespace MasaBlazorApp3.Pojo.Config
 | 
				
			||||||
        public string canBusPortPath { get; set; }
 | 
					        public string canBusPortPath { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        public bool canBusExsit { get; set; }
 | 
					        public bool canBusExsit { get; set; }
 | 
				
			||||||
        //抽屉总数量:8个抽屉与16个抽屉对应发单支指令不同,开抽屉指令也不同
 | 
					 | 
				
			||||||
        public int totalDrawerCount { get; set; }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        public bool canBusTwoExsit { get; set; }
 | 
					 | 
				
			||||||
        public string canBusPortPathTwo { get; set; }
 | 
					 | 
				
			||||||
        public int doorAddr { get; set; }
 | 
					        public int doorAddr { get; set; }
 | 
				
			||||||
        public int storageBoxAddr { get; set; }
 | 
					        public int storageBoxAddr { get; set; }
 | 
				
			||||||
        //存在冰箱串口
 | 
					        //存在冰箱串口
 | 
				
			||||||
        public bool fridgePortExist { get; set; }
 | 
					        public bool fridgePortExist { get; set; }
 | 
				
			||||||
        //冰箱串口号
 | 
					        //冰箱串口号
 | 
				
			||||||
        public string fridgePortPath { get; set; }
 | 
					        public string fridgePortPath { get; set; }
 | 
				
			||||||
        //储物箱串口
 | 
					 | 
				
			||||||
        public int StorageCan { get; set; }
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -10,21 +10,12 @@ namespace MasaBlazorApp3.Pojo.Config
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        public string machineId {  get; set; }
 | 
					        public string machineId {  get; set; }
 | 
				
			||||||
        public string storage { get; set; }
 | 
					        public string storage { get; set; }
 | 
				
			||||||
        //调拨入库时的in_Pharmacy_Id字段值与storage不一致不确定是传错了还是就两个值先加上这个配置
 | 
					 | 
				
			||||||
        public string inPharmacyId { get; set; }
 | 
					 | 
				
			||||||
        public int loginMode { get; set; }
 | 
					        public int loginMode { get; set; }
 | 
				
			||||||
        public bool opFirst { get; set; }
 | 
					        public bool opFirst { get; set; }
 | 
				
			||||||
        //自动退出登录时间,单位秒(0不自动退出)
 | 
					        //自动退出登录时间,单位秒(0不自动退出)
 | 
				
			||||||
        public int autoOutLog { get; set; }
 | 
					        public int autoOutLog { get; set; }
 | 
				
			||||||
        //手术室药盒的设备id
 | 
					        //手术室药盒的设备id
 | 
				
			||||||
        public string boxMachineId { get; set; }
 | 
					        public string boxMachineId { get; set; }
 | 
				
			||||||
        //手术室名称
 | 
					 | 
				
			||||||
        public string roomName { get; set; }
 | 
					 | 
				
			||||||
        //麻醉医师姓名
 | 
					 | 
				
			||||||
        public string anaesthetist_name { get; set; } 
 | 
					 | 
				
			||||||
        public string boxColor { get; set; }
 | 
					 | 
				
			||||||
        //报警
 | 
					 | 
				
			||||||
        public int alert { get; set; }
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -32,11 +32,6 @@ namespace MasaBlazorApp3.Pojo
 | 
				
			||||||
        public string PackUnit { get; set; }
 | 
					        public string PackUnit { get; set; }
 | 
				
			||||||
        [Column("py_code")]
 | 
					        [Column("py_code")]
 | 
				
			||||||
        public string PyCode { get; set; }
 | 
					        public string PyCode { get; set; }
 | 
				
			||||||
        [Column("pack_h")]
 | 
					 | 
				
			||||||
        public string PackH { get; set; }
 | 
					 | 
				
			||||||
        //用于标识“手术室患者麻醉药品使用登记本”报表中是否导出该药品 1导出0不导
 | 
					 | 
				
			||||||
        //[Column("pack_h")]
 | 
					 | 
				
			||||||
        //public int ReportType { get; set; }
 | 
					 | 
				
			||||||
        [Column(IsColumn =false)]
 | 
					        [Column(IsColumn =false)]
 | 
				
			||||||
        public string DrugNameSpecManufactory 
 | 
					        public string DrugNameSpecManufactory 
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
| 
						 | 
					@ -54,13 +49,7 @@ namespace MasaBlazorApp3.Pojo
 | 
				
			||||||
        [Column(IsColumn = false)]
 | 
					        [Column(IsColumn = false)]
 | 
				
			||||||
        public int StockQuantity
 | 
					        public int StockQuantity
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            get { return Stocks.Aggregate(0, (current, next) => current + next.Quantity); }
 | 
					            get { return Stocks.Aggregate(0, (current, next) => current + next.Quantity); ; }
 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
        //药盒基数
 | 
					 | 
				
			||||||
        [Column(IsColumn = false)]
 | 
					 | 
				
			||||||
        public int BoxBaseQuantity
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
            get { return Stocks.Aggregate(0, (current, next) => current+next.BaseQuantity);}
 | 
					 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        public override bool Equals(object o)
 | 
					        public override bool Equals(object o)
 | 
				
			||||||
| 
						 | 
					@ -75,15 +64,6 @@ namespace MasaBlazorApp3.Pojo
 | 
				
			||||||
            return $"名称: {DrugName},规格:{DrugSpec}";
 | 
					            return $"名称: {DrugName},规格:{DrugSpec}";
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        [Column(IsColumn = false)]
 | 
					 | 
				
			||||||
        public string DrugNameSpec
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
            get => DrugName + " ; " + DrugSpec + ";"+ Manufactory;
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
        [Column(IsColumn =false)]
 | 
					 | 
				
			||||||
        public string set_manu_no { get; set; }
 | 
					 | 
				
			||||||
        [Column(IsColumn =false)]
 | 
					 | 
				
			||||||
        public string set_eff_Date { get; set; }
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -36,7 +36,5 @@ namespace MasaBlazorApp3.Pojo
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            return other?.DrugId == DrugId && other?.ManuNo == ManuNo;
 | 
					            return other?.DrugId == DrugId && other?.ManuNo == ManuNo;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        [Column(IsColumn =false)]
 | 
					 | 
				
			||||||
        public int Quantity { get; set; }
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -39,7 +39,5 @@ namespace MasaBlazorApp3.Pojo
 | 
				
			||||||
        public string optState { get; set; }
 | 
					        public string optState { get; set; }
 | 
				
			||||||
        [Column("machine_id")]
 | 
					        [Column("machine_id")]
 | 
				
			||||||
        public string MachineId { get; set; }
 | 
					        public string MachineId { get; set; }
 | 
				
			||||||
        [Column("Remarks")]
 | 
					 | 
				
			||||||
        public string Remarks { get; set; }
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,23 +0,0 @@
 | 
				
			||||||
using LinqToDB.Mapping;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
namespace MasaBlazorApp3.Pojo
 | 
					 | 
				
			||||||
{
 | 
					 | 
				
			||||||
    [Table("hkc_changeshifts_drug")]
 | 
					 | 
				
			||||||
    public class HkcChangeShiftsDetail
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
        [Column("Id")]
 | 
					 | 
				
			||||||
        public int Id { get; set; }
 | 
					 | 
				
			||||||
        //交接班ID
 | 
					 | 
				
			||||||
        [Column("changeshifts_id")]
 | 
					 | 
				
			||||||
        public int ChangeshiftsId { get; set; }
 | 
					 | 
				
			||||||
        //药品ID
 | 
					 | 
				
			||||||
        [Column("drug_id")]
 | 
					 | 
				
			||||||
        public string DrugId { get; set; }
 | 
					 | 
				
			||||||
        //实物数
 | 
					 | 
				
			||||||
        [Column("RealNumber")]
 | 
					 | 
				
			||||||
        public int RealNumber { get; set; }
 | 
					 | 
				
			||||||
        //处方数
 | 
					 | 
				
			||||||
        [Column("orderNumber")]
 | 
					 | 
				
			||||||
        public int OrderNumber { get; set; }
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
| 
						 | 
					@ -72,8 +72,7 @@ namespace MasaBlazorApp3.Pojo
 | 
				
			||||||
        [Column("eff_date")]
 | 
					        [Column("eff_date")]
 | 
				
			||||||
        public DateTime? EffDate { get; set; }
 | 
					        public DateTime? EffDate { get; set; }
 | 
				
			||||||
        /// <summary>
 | 
					        /// <summary>
 | 
				
			||||||
        /// 出库入库类型(1入库2出库4盘点31还药32还空瓶,21药盒移出移入,69药盒药品替换,) 
 | 
					        /// 出库入库类型(1入库2出库4盘点31还药32还空瓶,21药箱移出移入,69药箱药品替换,55药箱套餐绑定解绑) 
 | 
				
			||||||
        /// 50添加套餐;51删除套餐;52向套餐中添加药品;53修改套餐中的药品;54删除套餐中的药品;55药盒套餐绑定;56药盒套餐解绑,
 | 
					 | 
				
			||||||
        ///</summary>
 | 
					        ///</summary>
 | 
				
			||||||
        [Column("type")]
 | 
					        [Column("type")]
 | 
				
			||||||
        public int Type { get; set; }
 | 
					        public int Type { get; set; }
 | 
				
			||||||
| 
						 | 
					@ -146,25 +145,5 @@ namespace MasaBlazorApp3.Pojo
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            get => DrawerNo + "-" + ColNo;
 | 
					            get => DrawerNo + "-" + ColNo;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        public static MachineRecord Build(MachineRecord machineRecord,DrugInfo drug,User user)
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
            if(machineRecord!=null)
 | 
					 | 
				
			||||||
            {
 | 
					 | 
				
			||||||
                machineRecord.Drug = drug;
 | 
					 | 
				
			||||||
                machineRecord.OperatorUser = user;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
            return machineRecord;
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
        /// <summary>
 | 
					 | 
				
			||||||
        /// 药盒号
 | 
					 | 
				
			||||||
        ///</summary>
 | 
					 | 
				
			||||||
        [Column("Box_Drawer")]
 | 
					 | 
				
			||||||
        public int? BoxDrawer { get; set; }
 | 
					 | 
				
			||||||
        /// <summary>
 | 
					 | 
				
			||||||
        /// 药盒号
 | 
					 | 
				
			||||||
        ///</summary>
 | 
					 | 
				
			||||||
        [Column("Box_ColNo")]
 | 
					 | 
				
			||||||
        public int? BoxColNo { get; set; }
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -31,11 +31,6 @@ namespace MasaBlazorApp3.Pojo
 | 
				
			||||||
        /// <summary>
 | 
					        /// <summary>
 | 
				
			||||||
        ///  
 | 
					        ///  
 | 
				
			||||||
        ///</summary>
 | 
					        ///</summary>
 | 
				
			||||||
        [Column("order_id")]
 | 
					 | 
				
			||||||
        public string OrderId { get; set; }
 | 
					 | 
				
			||||||
        /// <summary>
 | 
					 | 
				
			||||||
        ///  
 | 
					 | 
				
			||||||
        ///</summary>
 | 
					 | 
				
			||||||
        [Column("order_no")]
 | 
					        [Column("order_no")]
 | 
				
			||||||
        public string OrderNo { get; set; }
 | 
					        public string OrderNo { get; set; }
 | 
				
			||||||
        /// <summary>
 | 
					        /// <summary>
 | 
				
			||||||
| 
						 | 
					@ -57,7 +52,6 @@ namespace MasaBlazorApp3.Pojo
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        [Association(ThisKey = nameof(DrugId), OtherKey = nameof(DrugInfo.DrugId))]
 | 
					        [Association(ThisKey = nameof(DrugId), OtherKey = nameof(DrugInfo.DrugId))]
 | 
				
			||||||
        public DrugInfo Drug { get; set; } = new();
 | 
					        public DrugInfo Drug { get; set; } = new();
 | 
				
			||||||
 | 
					 | 
				
			||||||
        /// <summary>
 | 
					        /// <summary>
 | 
				
			||||||
        ///  
 | 
					        ///  
 | 
				
			||||||
        ///</summary>
 | 
					        ///</summary>
 | 
				
			||||||
| 
						 | 
					@ -135,16 +129,5 @@ namespace MasaBlazorApp3.Pojo
 | 
				
			||||||
        ///</summary>
 | 
					        ///</summary>
 | 
				
			||||||
        [Column("use_dosage")]
 | 
					        [Column("use_dosage")]
 | 
				
			||||||
        public string UseDosage { get; set; }
 | 
					        public string UseDosage { get; set; }
 | 
				
			||||||
        /// <summary>
 | 
					 | 
				
			||||||
        ///  
 | 
					 | 
				
			||||||
        /// 默认值: NULL
 | 
					 | 
				
			||||||
        ///</summary>
 | 
					 | 
				
			||||||
        [Column(IsColumn = false)]
 | 
					 | 
				
			||||||
        public int? TotalQuantity { get; set; } = null;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        [LinqToDB.Mapping.Association(ThisKey = nameof(SetManuNo), OtherKey = nameof(DrugManuNo.ManuNo))]
 | 
					 | 
				
			||||||
        public DrugManuNo? drugManuNo { get; set; }
 | 
					 | 
				
			||||||
        [Column(IsColumn =false)]
 | 
					 | 
				
			||||||
        public string DrugName { get; set; }
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -147,43 +147,21 @@ namespace MasaBlazorApp3.Pojo
 | 
				
			||||||
        ///</summary>
 | 
					        ///</summary>
 | 
				
			||||||
        [Column("win_no")]
 | 
					        [Column("win_no")]
 | 
				
			||||||
        public int WinNo { get; set; } = 0;
 | 
					        public int WinNo { get; set; } = 0;
 | 
				
			||||||
        /// <summary>
 | 
					        ///// <summary>
 | 
				
			||||||
        ///  
 | 
					        /////  
 | 
				
			||||||
        /// 默认值: 0
 | 
					        ///// 默认值: 0
 | 
				
			||||||
        ///</summary>
 | 
					        /////</summary>
 | 
				
			||||||
        [Column("state")]
 | 
					        //[Column("state")]
 | 
				
			||||||
        public int state { get; set; } = 0;
 | 
					        //public int state { get; set; } = 0;
 | 
				
			||||||
 | 
					 | 
				
			||||||
        //[Association(ThisKey = nameof(OrderNo), OtherKey = nameof(OrderDetail.OrderNo))]
 | 
					 | 
				
			||||||
        //public List<OrderDetail> DetailList { get; set; } = new();
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
        [Association(ThisKey = nameof(OrderNo), OtherKey = nameof(OrderDetail.OrderNo))]
 | 
					        [Association(ThisKey = nameof(OrderNo), OtherKey = nameof(OrderDetail.OrderNo))]
 | 
				
			||||||
        public OrderDetail DetailInfo { get; set; } = new();
 | 
					        public List<OrderDetail> DetailList { get; set; } = new();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        /// <summary>
 | 
					        /// <summary>
 | 
				
			||||||
        /// 是否选中
 | 
					        /// 是否选中
 | 
				
			||||||
        /// </summary>
 | 
					        /// </summary>
 | 
				
			||||||
        [Column(IsColumn =false)]
 | 
					        [Column(IsColumn =false)]
 | 
				
			||||||
        public bool ItemIsChecked { get; set; } = true;
 | 
					        public bool ItemIsChecked { get; set; }
 | 
				
			||||||
        /// <summary>
 | 
					 | 
				
			||||||
        /// 是否全先中
 | 
					 | 
				
			||||||
        /// </summary>
 | 
					 | 
				
			||||||
        [Column(IsColumn = false)]
 | 
					 | 
				
			||||||
        public bool AllItemIsChecked { get; set; } = true;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
        /// <summary>
 | 
					 | 
				
			||||||
        ///  麻醉师
 | 
					 | 
				
			||||||
        ///</summary>
 | 
					 | 
				
			||||||
        [Column("anaesthetist_name")]
 | 
					 | 
				
			||||||
        public string anaesthetistName { get; set; }
 | 
					 | 
				
			||||||
        /// <summary>
 | 
					 | 
				
			||||||
        ///  手术室
 | 
					 | 
				
			||||||
        ///</summary>
 | 
					 | 
				
			||||||
        [Column("op_room_name")]
 | 
					 | 
				
			||||||
        public string RoomName { get; set; }
 | 
					 | 
				
			||||||
        //药盒中药品对应的选中的处方信息
 | 
					 | 
				
			||||||
        [Column(IsColumn = false)]
 | 
					 | 
				
			||||||
        public IList<OrderInfo> SelectedOrderList { get; set; }
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -33,8 +33,5 @@ namespace MasaBlazorApp3.Pojo
 | 
				
			||||||
        //审核人
 | 
					        //审核人
 | 
				
			||||||
        [Column("reviewerUser")]
 | 
					        [Column("reviewerUser")]
 | 
				
			||||||
        public int ReviewerUser { get; set; }
 | 
					        public int ReviewerUser { get; set; }
 | 
				
			||||||
 | 
					 | 
				
			||||||
        [Column("machine_id")]
 | 
					 | 
				
			||||||
        public string MachineId { get; set; }
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,11 +1,11 @@
 | 
				
			||||||
using Mysqlx.Crud;
 | 
					using MasaBlazorApp3.Pages;
 | 
				
			||||||
 | 
					using Mysqlx.Crud;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace MasaBlazorApp3.Pojo
 | 
					namespace MasaBlazorApp3.Pojo
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    [Serializable]
 | 
					    [Serializable]
 | 
				
			||||||
    public class Premission
 | 
					    public class Premission
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
 | 
					 | 
				
			||||||
        public Premission Parent { get; set; } = null;
 | 
					        public Premission Parent { get; set; } = null;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        public void AddChild(Premission item)
 | 
					        public void AddChild(Premission item)
 | 
				
			||||||
| 
						 | 
					@ -30,51 +30,51 @@ namespace MasaBlazorApp3.Pojo
 | 
				
			||||||
            Premission q = new Premission
 | 
					            Premission q = new Premission
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                Id = 1,
 | 
					                Id = 1,
 | 
				
			||||||
                PremissionName = "出库",
 | 
					                PremissionName =Home.myText.Outbound,// "出库",
 | 
				
			||||||
                PremissionPath = "take"
 | 
					                PremissionPath = "take"
 | 
				
			||||||
            };
 | 
					            };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            //q.AddChild(new Premission()
 | 
					            q.AddChild(new Premission()
 | 
				
			||||||
            //{
 | 
					            {
 | 
				
			||||||
            //    Id = 11,
 | 
					                Id = 11,
 | 
				
			||||||
            //    PremissionName = "处方取药",
 | 
					                PremissionName = Home.myText.OrderTake,// "处方取药",
 | 
				
			||||||
            //    PremissionPath = "/take/order"
 | 
					                PremissionPath = "/take/order"
 | 
				
			||||||
            //});
 | 
					            });
 | 
				
			||||||
            //q.AddChild(new Premission()
 | 
					            q.AddChild(new Premission()
 | 
				
			||||||
            //{
 | 
					            {
 | 
				
			||||||
            //    Id = 12,
 | 
					                Id = 12,
 | 
				
			||||||
            //    PremissionName = "调拨取药",
 | 
					                PremissionName = Home.myText.InvoiceTake,// "调拨取药",
 | 
				
			||||||
            //    PremissionPath = "/take/invoice"
 | 
					                PremissionPath = "/take/invoice"
 | 
				
			||||||
            //});
 | 
					            });
 | 
				
			||||||
            q.AddChild(new Premission()
 | 
					            q.AddChild(new Premission()
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                Id = 13,
 | 
					                Id = 13,
 | 
				
			||||||
                PremissionName = "抽屉取药",
 | 
					                PremissionName =  Home.myText.DrawerTake,// "抽屉取药",
 | 
				
			||||||
                PremissionPath = "/take/drawer"
 | 
					                PremissionPath = "/take/drawer"
 | 
				
			||||||
            });
 | 
					            });
 | 
				
			||||||
            //q.AddChild(new Premission()
 | 
					            q.AddChild(new Premission()
 | 
				
			||||||
            //{
 | 
					            {
 | 
				
			||||||
            //    Id = 14,
 | 
					                Id = 14,
 | 
				
			||||||
            //    PremissionName = "自选取药",
 | 
					                PremissionName =Home.myText.SelfTake,//  "自选取药",
 | 
				
			||||||
            //    PremissionPath = "/take/self"
 | 
					                PremissionPath = "/take/self"
 | 
				
			||||||
            //});
 | 
					            });
 | 
				
			||||||
            q.AddChild(new Premission()
 | 
					            q.AddChild(new Premission()
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                Id = 15,
 | 
					                Id = 15,
 | 
				
			||||||
                PremissionName = "取药记录",
 | 
					                PremissionName = Home.myText.TakeRecord,// "取药记录",
 | 
				
			||||||
                PremissionPath = "/take/record/2"
 | 
					                PremissionPath = "/take/record/2"
 | 
				
			||||||
            });
 | 
					            });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            Premission j = new Premission
 | 
					            Premission j = new Premission
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                Id = 2,
 | 
					                Id = 2,
 | 
				
			||||||
                PremissionName = "入库",
 | 
					                PremissionName = Home.myText.FillStorage,// "入库",
 | 
				
			||||||
                PremissionPath = "add"
 | 
					                PremissionPath = "add"
 | 
				
			||||||
            };
 | 
					            };
 | 
				
			||||||
            j.AddChild(new Premission()
 | 
					            j.AddChild(new Premission()
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                Id = 21,
 | 
					                Id = 21,
 | 
				
			||||||
                PremissionName = "调拨入库",
 | 
					                PremissionName =  Home.myText.InvoiceAdd,//"调拨入库",
 | 
				
			||||||
                PremissionPath = "/add/invoice"
 | 
					                PremissionPath = "/add/invoice"
 | 
				
			||||||
            });
 | 
					            });
 | 
				
			||||||
            //j.AddChild(new Premission()
 | 
					            //j.AddChild(new Premission()
 | 
				
			||||||
| 
						 | 
					@ -86,13 +86,13 @@ namespace MasaBlazorApp3.Pojo
 | 
				
			||||||
            j.AddChild(new Premission()
 | 
					            j.AddChild(new Premission()
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                Id = 23,
 | 
					                Id = 23,
 | 
				
			||||||
                PremissionName = "抽屉入库",
 | 
					                PremissionName =  Home.myText.DrawerAdd,//"抽屉入库",
 | 
				
			||||||
                PremissionPath = "/add/drawer"
 | 
					                PremissionPath = "/add/drawer"
 | 
				
			||||||
            });
 | 
					            });
 | 
				
			||||||
            j.AddChild(new Premission()
 | 
					            j.AddChild(new Premission()
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                Id = 24,
 | 
					                Id = 24,
 | 
				
			||||||
                PremissionName = "入库记录",
 | 
					                PremissionName = Home.myText.AddRecord,//"入库记录",
 | 
				
			||||||
                PremissionPath = "/add/record/1"
 | 
					                PremissionPath = "/add/record/1"
 | 
				
			||||||
            });
 | 
					            });
 | 
				
			||||||
            Premission h = new Premission
 | 
					            Premission h = new Premission
 | 
				
			||||||
| 
						 | 
					@ -102,123 +102,123 @@ namespace MasaBlazorApp3.Pojo
 | 
				
			||||||
                PremissionPath = "return"
 | 
					                PremissionPath = "return"
 | 
				
			||||||
            };
 | 
					            };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            //h.AddChild(new Premission()
 | 
					            h.AddChild(new Premission()
 | 
				
			||||||
            //{
 | 
					            {
 | 
				
			||||||
            //    Id = 31,
 | 
					                Id = 31,
 | 
				
			||||||
            //    PremissionName = "归还药品(处方)",
 | 
					                PremissionName = Home.myText.ReturnDrugByOrder,//"归还药品(处方)",
 | 
				
			||||||
            //    PremissionPath = "/return/order"
 | 
					                PremissionPath = "/return/order"
 | 
				
			||||||
            //});
 | 
					            });
 | 
				
			||||||
            //h.AddChild(new Premission()
 | 
					            h.AddChild(new Premission()
 | 
				
			||||||
            //{
 | 
					            {
 | 
				
			||||||
            //    Id = 32,
 | 
					                Id = 32,
 | 
				
			||||||
            //    PremissionName = "归还药品(记录)",
 | 
					                PremissionName = Home.myText.ReturnRecord,//"归还药品(记录)",
 | 
				
			||||||
            //    PremissionPath = "/return/byRecord"
 | 
					                PremissionPath = "/return/byRecord"
 | 
				
			||||||
            //});
 | 
					            });
 | 
				
			||||||
            //h.AddChild(new Premission()
 | 
					            h.AddChild(new Premission()
 | 
				
			||||||
            //{
 | 
					            {
 | 
				
			||||||
            //    Id = 33,
 | 
					                Id = 33,
 | 
				
			||||||
            //    PremissionName = "归还空瓶",
 | 
					                PremissionName =  Home.myText.ReturnEmpty,//"归还空瓶",
 | 
				
			||||||
            //    PremissionPath = "/return/empty"
 | 
					                PremissionPath = "/return/empty"
 | 
				
			||||||
            //});
 | 
					            });
 | 
				
			||||||
            h.AddChild(new Premission()
 | 
					            h.AddChild(new Premission()
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                Id = 34,
 | 
					                Id = 34,
 | 
				
			||||||
                PremissionName = "归还记录(药品)",
 | 
					                PremissionName =  Home.myText.ReturnRecordDrug,//"归还记录(药品)",
 | 
				
			||||||
                PremissionPath = "/return/record1/31"
 | 
					                PremissionPath = "/return/record1/31"
 | 
				
			||||||
            });
 | 
					            });
 | 
				
			||||||
            h.AddChild(new Premission()
 | 
					            h.AddChild(new Premission()
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                Id = 35,
 | 
					                Id = 35,
 | 
				
			||||||
                PremissionName = "归还记录(空瓶)",
 | 
					                PremissionName = Home.myText.ReturnRecordEmpty,// "归还记录(空瓶)",
 | 
				
			||||||
                PremissionPath = "/return/record2/32"
 | 
					                PremissionPath = "/return/record2/32"
 | 
				
			||||||
            });
 | 
					            });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            Premission k = new Premission
 | 
					            Premission k = new Premission
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                Id = 4,
 | 
					                Id = 4,
 | 
				
			||||||
                PremissionName = "库存管理",
 | 
					                PremissionName = Home.myText.StockManage,//"库存管理",
 | 
				
			||||||
                PremissionPath = "stock"
 | 
					                PremissionPath = "stock"
 | 
				
			||||||
            };
 | 
					            };
 | 
				
			||||||
            k.AddChild(new Premission()
 | 
					            k.AddChild(new Premission()
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                Id = 41,
 | 
					                Id = 41,
 | 
				
			||||||
                PremissionName = "库存列表",
 | 
					                PremissionName = Home.myText.StockList,//"库存列表",
 | 
				
			||||||
                PremissionPath = "/stock/list"
 | 
					                PremissionPath = "/stock/list"
 | 
				
			||||||
            });
 | 
					            });
 | 
				
			||||||
            k.AddChild(new Premission()
 | 
					            k.AddChild(new Premission()
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                Id = 42,
 | 
					                Id = 42,
 | 
				
			||||||
                PremissionName = "库位绑定",
 | 
					                PremissionName =  Home.myText.StockBind,//"库位绑定",
 | 
				
			||||||
                PremissionPath = "/stock/binding"
 | 
					                PremissionPath = "/stock/binding"
 | 
				
			||||||
            });
 | 
					            });
 | 
				
			||||||
            k.AddChild(new Premission()
 | 
					            k.AddChild(new Premission()
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                Id = 43,
 | 
					                Id = 43,
 | 
				
			||||||
                PremissionName = "库存盘点",
 | 
					                PremissionName = Home.myText.StorageCheck,//"库存盘点",
 | 
				
			||||||
                //PremissionName = "盘点交接",
 | 
					                //PremissionName = "盘点交接",
 | 
				
			||||||
                PremissionPath = "/stock/check"
 | 
					                PremissionPath = "/stock/check"
 | 
				
			||||||
            });
 | 
					            });
 | 
				
			||||||
            k.AddChild(new Premission()
 | 
					            k.AddChild(new Premission()
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                Id = 44,
 | 
					                Id = 44,
 | 
				
			||||||
                PremissionName = "盘点记录",
 | 
					                PremissionName =Home.myText.CheckRecord,// "盘点记录",
 | 
				
			||||||
                //PremissionPath = "/stock/checkRecord"
 | 
					                //PremissionPath = "/stock/checkRecord"
 | 
				
			||||||
                PremissionPath = "/stock/record/4"
 | 
					                PremissionPath = "/stock/record/4"
 | 
				
			||||||
            });
 | 
					            });
 | 
				
			||||||
            k.AddChild(new Premission()
 | 
					            k.AddChild(new Premission()
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                Id = 45,
 | 
					                Id = 45,
 | 
				
			||||||
                PremissionName = "药品信息",
 | 
					                PremissionName = Home.myText.DrugInfo,//"药品信息",
 | 
				
			||||||
                PremissionPath = "/stock/drug"
 | 
					                PremissionPath = "/stock/drug"
 | 
				
			||||||
            });
 | 
					            });
 | 
				
			||||||
            //k.AddChild(new Premission()
 | 
					            k.AddChild(new Premission()
 | 
				
			||||||
            //{
 | 
					            {
 | 
				
			||||||
            //    Id = 46,
 | 
					                Id = 46,
 | 
				
			||||||
            //    PremissionName = "药品标定",
 | 
					                PremissionName = Home.myText.DrugSetting,//"药品标定",
 | 
				
			||||||
            //    PremissionPath = "/stock/biaoDing"
 | 
					                PremissionPath = "/stock/biaoDing"
 | 
				
			||||||
            //});
 | 
					            });
 | 
				
			||||||
            k.AddChild(new Premission()
 | 
					            k.AddChild(new Premission()
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                Id = 47,
 | 
					                Id = 47,
 | 
				
			||||||
                PremissionName = "交接班列表",
 | 
					                PremissionName = Home.myText.HandoverList,//"交接班列表",
 | 
				
			||||||
                PremissionPath = "/stock/Change"
 | 
					                PremissionPath = "/stock/Change"
 | 
				
			||||||
            });
 | 
					            });
 | 
				
			||||||
            Premission x = new Premission
 | 
					            Premission x = new Premission
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                Id = 5,
 | 
					                Id = 5,
 | 
				
			||||||
                PremissionName = "系统管理",
 | 
					                PremissionName = Home.myText.SystemManage,//"系统管理",
 | 
				
			||||||
                PremissionPath = "manage"
 | 
					                PremissionPath = "manage"
 | 
				
			||||||
            };
 | 
					            };
 | 
				
			||||||
            x.AddChild(new Premission()
 | 
					            x.AddChild(new Premission()
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                Id = 51,
 | 
					                Id = 51,
 | 
				
			||||||
                PremissionName = "用户管理",
 | 
					                PremissionName = Home.myText.UserManage,//"用户管理",
 | 
				
			||||||
                PremissionPath = "/manage/user"
 | 
					                PremissionPath = "/manage/user"
 | 
				
			||||||
            });
 | 
					            });
 | 
				
			||||||
            x.AddChild(new Premission()
 | 
					            x.AddChild(new Premission()
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                Id = 52,
 | 
					                Id = 52,
 | 
				
			||||||
                PremissionName = "权限管理",
 | 
					                PremissionName = Home.myText.RoleManage,//"权限管理",
 | 
				
			||||||
                PremissionPath = "/manage/role"
 | 
					                PremissionPath = "/manage/role"
 | 
				
			||||||
            });
 | 
					            });
 | 
				
			||||||
            Premission set = new Premission()
 | 
					            Premission set = new Premission()
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                Id = 53,
 | 
					                Id = 53,
 | 
				
			||||||
                PremissionName = "系统设置",
 | 
					                PremissionName = Home.myText.SystemSet,//"系统设置",
 | 
				
			||||||
                PremissionPath = "/manage/setting"
 | 
					                PremissionPath = "/manage/setting"
 | 
				
			||||||
                //PremissionPath = "/Box/Plan"
 | 
					                //PremissionPath = "/Box/Plan"
 | 
				
			||||||
            };
 | 
					            };
 | 
				
			||||||
            set.AddChild(new Premission()
 | 
					            set.AddChild(new Premission()
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                Id = 531,
 | 
					                Id = 531,
 | 
				
			||||||
                PremissionName = "登录设置",
 | 
					                PremissionName = Home.myText.LoginSet,//"登录设置",
 | 
				
			||||||
                PremissionPath = "/manage/setting/login"
 | 
					                PremissionPath = "/manage/setting/login"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            });
 | 
					            });
 | 
				
			||||||
            set.AddChild(new Premission()
 | 
					            set.AddChild(new Premission()
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                Id = 532,
 | 
					                Id = 532,
 | 
				
			||||||
                PremissionName = "冰箱设置",
 | 
					                PremissionName = Home.myText.FridgeSet,//"冰箱设置",
 | 
				
			||||||
                PremissionPath = "/manage/setting/Fridge"
 | 
					                PremissionPath = "/manage/setting/Fridge"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            });
 | 
					            });
 | 
				
			||||||
| 
						 | 
					@ -231,31 +231,31 @@ namespace MasaBlazorApp3.Pojo
 | 
				
			||||||
            //x.AddChild(new Premission()
 | 
					            //x.AddChild(new Premission()
 | 
				
			||||||
            //{
 | 
					            //{
 | 
				
			||||||
            //    Id = 55,
 | 
					            //    Id = 55,
 | 
				
			||||||
            //    PremissionName = "绑定药盒",
 | 
					            //    PremissionName = "绑定药箱",
 | 
				
			||||||
            //    PremissionPath = "/Box/BoxBindings"
 | 
					            //    PremissionPath = "/Box/BoxBindings"
 | 
				
			||||||
            //});
 | 
					            //});
 | 
				
			||||||
            //x.AddChild(new Premission()
 | 
					            //x.AddChild(new Premission()
 | 
				
			||||||
            //{
 | 
					            //{
 | 
				
			||||||
            //    Id = 56,
 | 
					            //    Id = 56,
 | 
				
			||||||
            //    PremissionName = "药盒核对",
 | 
					            //    PremissionName = "药箱核对",
 | 
				
			||||||
            //    PremissionPath = "/Box/Check"
 | 
					            //    PremissionPath = "/Box/Check"
 | 
				
			||||||
            //});
 | 
					            //});
 | 
				
			||||||
            //x.AddChild(new Premission()
 | 
					            //x.AddChild(new Premission()
 | 
				
			||||||
            //{
 | 
					            //{
 | 
				
			||||||
            //    Id = 57,
 | 
					            //    Id = 57,
 | 
				
			||||||
            //    PremissionName = "药盒加药",
 | 
					            //    PremissionName = "药箱加药",
 | 
				
			||||||
            //    PremissionPath = "/Box/BoxAdd"
 | 
					            //    PremissionPath = "/Box/BoxAdd"
 | 
				
			||||||
            //});
 | 
					            //});
 | 
				
			||||||
            //x.AddChild(new Premission()
 | 
					            //x.AddChild(new Premission()
 | 
				
			||||||
            //{
 | 
					            //{
 | 
				
			||||||
            //    Id = 58,
 | 
					            //    Id = 58,
 | 
				
			||||||
            //    PremissionName = "药盒入库",
 | 
					            //    PremissionName = "药箱入库",
 | 
				
			||||||
            //    PremissionPath = "/Box/BoxAddBox"
 | 
					            //    PremissionPath = "/Box/BoxAddBox"
 | 
				
			||||||
            //});
 | 
					            //});
 | 
				
			||||||
            //x.AddChild(new Premission()
 | 
					            //x.AddChild(new Premission()
 | 
				
			||||||
            //{
 | 
					            //{
 | 
				
			||||||
            //    Id = 59,
 | 
					            //    Id = 59,
 | 
				
			||||||
            //    PremissionName = "药盒库存",
 | 
					            //    PremissionName = "药箱库存",
 | 
				
			||||||
            //    PremissionPath = "/Box/BoxStock"
 | 
					            //    PremissionPath = "/Box/BoxStock"
 | 
				
			||||||
            //});
 | 
					            //});
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -263,45 +263,45 @@ namespace MasaBlazorApp3.Pojo
 | 
				
			||||||
            Premission b = new Premission
 | 
					            Premission b = new Premission
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                Id = 6,
 | 
					                Id = 6,
 | 
				
			||||||
                PremissionName = "药盒管理",
 | 
					                PremissionName = Home.myText.BoxManage,//"药箱管理",
 | 
				
			||||||
                PremissionPath = "Box"
 | 
					                PremissionPath = "Box"
 | 
				
			||||||
            };
 | 
					            };
 | 
				
			||||||
            b.AddChild(new Premission()
 | 
					            b.AddChild(new Premission()
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                Id = 61,
 | 
					                Id = 61,
 | 
				
			||||||
                PremissionName = "套餐管理",
 | 
					                PremissionName = Home.myText.MenuManage,//"套餐管理",
 | 
				
			||||||
                PremissionPath = "/Box/Plan"
 | 
					                PremissionPath = "/Box/Plan"
 | 
				
			||||||
            });
 | 
					            });
 | 
				
			||||||
            b.AddChild(new Premission()
 | 
					            b.AddChild(new Premission()
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                Id = 62,
 | 
					                Id = 62,
 | 
				
			||||||
                PremissionName = "绑定药盒",
 | 
					                PremissionName = Home.myText.BindBox,//"绑定药箱",
 | 
				
			||||||
                PremissionPath = "/Box/BoxBindings"
 | 
					                PremissionPath = "/Box/BoxBindings"
 | 
				
			||||||
            });
 | 
					            });
 | 
				
			||||||
            b.AddChild(new Premission()
 | 
					            b.AddChild(new Premission()
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                Id = 63,
 | 
					                Id = 63,
 | 
				
			||||||
                PremissionName = "药盒核对",
 | 
					                PremissionName = Home.myText.BoxCheck,//"药箱核对",
 | 
				
			||||||
                //PremissionName = "盘点交接",
 | 
					                //PremissionName = "盘点交接",
 | 
				
			||||||
                PremissionPath = "/Box/Check"
 | 
					                PremissionPath = "/Box/Check"
 | 
				
			||||||
            });
 | 
					            });
 | 
				
			||||||
            b.AddChild(new Premission()
 | 
					            b.AddChild(new Premission()
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                Id = 66,
 | 
					                Id = 64,
 | 
				
			||||||
                PremissionName = "药盒加药",
 | 
					                PremissionName = Home.myText.BoxAdd,//"药箱加药",
 | 
				
			||||||
                //PremissionPath = "/stock/checkRecord"
 | 
					                //PremissionPath = "/stock/checkRecord"
 | 
				
			||||||
                PremissionPath = "/Box/BoxAdd"
 | 
					                PremissionPath = "/Box/BoxAdd"
 | 
				
			||||||
            });
 | 
					            });
 | 
				
			||||||
            //b.AddChild(new Premission()
 | 
					            b.AddChild(new Premission()
 | 
				
			||||||
            //{
 | 
					            {
 | 
				
			||||||
            //    Id = 65,
 | 
					                Id = 65,
 | 
				
			||||||
            //    PremissionName = "药盒入库",
 | 
					                PremissionName =Home.myText.BoxAddBox,// "药箱入库",
 | 
				
			||||||
            //    PremissionPath = "/Box/BoxAddBox"
 | 
					                PremissionPath = "/Box/BoxAddBox"
 | 
				
			||||||
            //});
 | 
					            });
 | 
				
			||||||
            b.AddChild(new Premission()
 | 
					            b.AddChild(new Premission()
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                Id = 66,
 | 
					                Id = 66,
 | 
				
			||||||
                PremissionName = "药盒库存",
 | 
					                PremissionName =Home.myText.BoxStock,// "药箱库存",
 | 
				
			||||||
                PremissionPath = "/Box/BoxStock"
 | 
					                PremissionPath = "/Box/BoxStock"
 | 
				
			||||||
            });
 | 
					            });
 | 
				
			||||||
            list.Add(q);
 | 
					            list.Add(q);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -3,7 +3,6 @@ using System;
 | 
				
			||||||
using System.Collections.Generic;
 | 
					using System.Collections.Generic;
 | 
				
			||||||
using System.ComponentModel.DataAnnotations.Schema;
 | 
					using System.ComponentModel.DataAnnotations.Schema;
 | 
				
			||||||
using System.Linq;
 | 
					using System.Linq;
 | 
				
			||||||
using System.Runtime.InteropServices;
 | 
					 | 
				
			||||||
using System.Text;
 | 
					using System.Text;
 | 
				
			||||||
using System.Threading.Tasks;
 | 
					using System.Threading.Tasks;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -26,7 +25,7 @@ namespace MasaBlazorApp3.Pojo
 | 
				
			||||||
        // 出库数量
 | 
					        // 出库数量
 | 
				
			||||||
        public int OutQuantity { get; set; } = 0;
 | 
					        public int OutQuantity { get; set; } = 0;
 | 
				
			||||||
        //批号结存
 | 
					        //批号结存
 | 
				
			||||||
        public int ManuQuantity { get; set; } = 0;
 | 
					        //public int ManuQuantity { get; set; } = 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        //总结存
 | 
					        //总结存
 | 
				
			||||||
        public int StockQuantity { get; set; } = 0;
 | 
					        public int StockQuantity { get; set; } = 0;
 | 
				
			||||||
| 
						 | 
					@ -49,16 +48,10 @@ namespace MasaBlazorApp3.Pojo
 | 
				
			||||||
        public string Manufactory { get; set; } = string.Empty;
 | 
					        public string Manufactory { get; set; } = string.Empty;
 | 
				
			||||||
        //凭证号
 | 
					        //凭证号
 | 
				
			||||||
        public string InvoiceId { get; set; } = string.Empty;
 | 
					        public string InvoiceId { get; set; } = string.Empty;
 | 
				
			||||||
        //////供应单位
 | 
					        ////供应单位
 | 
				
			||||||
        //public string SupplierDept { get;set; } = string.Empty;
 | 
					        //public string SupplierDept { get;set; } = string.Empty;
 | 
				
			||||||
        //////领用部门
 | 
					        ////领用部门
 | 
				
			||||||
        //public string ReceiveDept { get; set; } = string.Empty; 
 | 
					        //public string ReceiveDept { get; set; } = string.Empty; 
 | 
				
			||||||
        /// <summary>
 | 
					 | 
				
			||||||
        ///供应单位(领用部门)
 | 
					 | 
				
			||||||
        /// </summary>
 | 
					 | 
				
			||||||
        public string department { get; set; } = string.Empty;
 | 
					 | 
				
			||||||
        //备注
 | 
					 | 
				
			||||||
        public string Remarks { get; set; } = string.Empty; 
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    public class ReportStockDateInfo
 | 
					    public class ReportStockDateInfo
 | 
				
			||||||
| 
						 | 
					@ -90,71 +83,4 @@ namespace MasaBlazorApp3.Pojo
 | 
				
			||||||
        //数量
 | 
					        //数量
 | 
				
			||||||
        public int Quantity { get; set; }
 | 
					        public int Quantity { get; set; }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    //手术室患者麻醉药品使用登记本
 | 
					 | 
				
			||||||
    public class ReportUsageParentDateInfo
 | 
					 | 
				
			||||||
    { 
 | 
					 | 
				
			||||||
        //药品ID
 | 
					 | 
				
			||||||
        public string drugId1 { get; set; }
 | 
					 | 
				
			||||||
        //药品名称
 | 
					 | 
				
			||||||
        public string drugName1 { get; set; }
 | 
					 | 
				
			||||||
        //批次
 | 
					 | 
				
			||||||
        public string manuNo1 { get; set; }
 | 
					 | 
				
			||||||
        //数量
 | 
					 | 
				
			||||||
        public int quantity1 { get; set; }
 | 
					 | 
				
			||||||
        //日期
 | 
					 | 
				
			||||||
        public DateTime portDate { get; set; }
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    //手术室患者麻醉药品使用登记本
 | 
					 | 
				
			||||||
    public class ReportUsageDateInfo
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
        //日期
 | 
					 | 
				
			||||||
        public DateTime portdate { get; set; }
 | 
					 | 
				
			||||||
        //手术间
 | 
					 | 
				
			||||||
        public int ShouShuJian { get; set; }
 | 
					 | 
				
			||||||
        //主麻
 | 
					 | 
				
			||||||
        public string doctor1 { get; set; }
 | 
					 | 
				
			||||||
        //副麻
 | 
					 | 
				
			||||||
        public string doctor2 { get; set; }
 | 
					 | 
				
			||||||
        //ID号
 | 
					 | 
				
			||||||
        public string patientId { get; set; }
 | 
					 | 
				
			||||||
        //患者姓名
 | 
					 | 
				
			||||||
        public string PName { get; set; }
 | 
					 | 
				
			||||||
        public string Diagnose { get; set; }
 | 
					 | 
				
			||||||
        //药品ID
 | 
					 | 
				
			||||||
        public string DrugId { get; set; }
 | 
					 | 
				
			||||||
        //药品名称
 | 
					 | 
				
			||||||
        public string DrugName { get; set; }
 | 
					 | 
				
			||||||
        //批次
 | 
					 | 
				
			||||||
        public string ManuNo { get; set; }
 | 
					 | 
				
			||||||
        //使用量
 | 
					 | 
				
			||||||
        public string UsageDosage { get; set; }
 | 
					 | 
				
			||||||
        //残液量
 | 
					 | 
				
			||||||
        public string CanYeLiang { get; set; }
 | 
					 | 
				
			||||||
        //残液处置方式
 | 
					 | 
				
			||||||
        public string CanYeChuZhi { get; set; }
 | 
					 | 
				
			||||||
        //使用人姓名
 | 
					 | 
				
			||||||
        public string UseUserName { get; set; }
 | 
					 | 
				
			||||||
        //核对人姓名
 | 
					 | 
				
			||||||
        public string CheckUserName { get; set; }
 | 
					 | 
				
			||||||
        //数量
 | 
					 | 
				
			||||||
        public int quantity { get; set; }
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    //请领报表信息
 | 
					 | 
				
			||||||
    public class ReportApplyInfo
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
        //手术间
 | 
					 | 
				
			||||||
        public int BoxNum { get; set; }
 | 
					 | 
				
			||||||
        //请领时间
 | 
					 | 
				
			||||||
        public DateTime ApplyDate { get; set; }
 | 
					 | 
				
			||||||
        //麻醉医生 一线
 | 
					 | 
				
			||||||
        public string UserFirst { get; set; }
 | 
					 | 
				
			||||||
        //麻醉医生 二线
 | 
					 | 
				
			||||||
        public string UserSecond { get; set; }
 | 
					 | 
				
			||||||
        //药品ID
 | 
					 | 
				
			||||||
        public string DrugId { get; set; }
 | 
					 | 
				
			||||||
        //医生签名
 | 
					 | 
				
			||||||
        public string Doctor { get; set; }
 | 
					 | 
				
			||||||
        //管理者签名
 | 
					 | 
				
			||||||
        public string Manager { get; set; }
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,13 +0,0 @@
 | 
				
			||||||
using System;
 | 
					 | 
				
			||||||
using System.Collections.Generic;
 | 
					 | 
				
			||||||
using System.Linq;
 | 
					 | 
				
			||||||
using System.Text;
 | 
					 | 
				
			||||||
using System.Threading.Tasks;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
namespace MasaBlazorApp3.Pojo
 | 
					 | 
				
			||||||
{
 | 
					 | 
				
			||||||
    public class ReturnChannelStock
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
| 
						 | 
					@ -15,9 +15,8 @@ namespace MasaBlazorApp3.Pojo
 | 
				
			||||||
        public string Icon { get; set; }
 | 
					        public string Icon { get; set; }
 | 
				
			||||||
        [Column("Path")]
 | 
					        [Column("Path")]
 | 
				
			||||||
        public string Path { get; set; }
 | 
					        public string Path { get; set; }
 | 
				
			||||||
        //使用状态1在用;0不在用
 | 
					        [Column("Culture")]
 | 
				
			||||||
        [Column("UseStatus")]
 | 
					        public string Culture { get; set; }
 | 
				
			||||||
        public int UseStatus { get; set; }
 | 
					 | 
				
			||||||
        [Column(IsColumn = false)]
 | 
					        [Column(IsColumn = false)]
 | 
				
			||||||
        public List<SettingManu> Children { get; set; } = new();
 | 
					        public List<SettingManu> Children { get; set; } = new();
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -19,7 +19,6 @@ using MasaBlazorApp3.Pojo.Config;
 | 
				
			||||||
using Microsoft.Extensions.Options;
 | 
					using Microsoft.Extensions.Options;
 | 
				
			||||||
using LinqToDB.Common;
 | 
					using LinqToDB.Common;
 | 
				
			||||||
using MasaBlazorApp3.Util;
 | 
					using MasaBlazorApp3.Util;
 | 
				
			||||||
using Microsoft.Extensions.Logging;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace MasaBlazorApp3.Port
 | 
					namespace MasaBlazorApp3.Port
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
| 
						 | 
					@ -30,8 +29,6 @@ namespace MasaBlazorApp3.Port
 | 
				
			||||||
        public SerialPort drawerSerial;
 | 
					        public SerialPort drawerSerial;
 | 
				
			||||||
        // can总线串口
 | 
					        // can总线串口
 | 
				
			||||||
        public SerialPort canBusSerial;
 | 
					        public SerialPort canBusSerial;
 | 
				
			||||||
        // can总线串口
 | 
					 | 
				
			||||||
        public SerialPort canBusSerialTwo;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
        // 条码枪串口
 | 
					        // 条码枪串口
 | 
				
			||||||
        public SerialPort scanCodeSerial;
 | 
					        public SerialPort scanCodeSerial;
 | 
				
			||||||
| 
						 | 
					@ -42,8 +39,6 @@ namespace MasaBlazorApp3.Port
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        public bool Operate { get; set; }
 | 
					        public bool Operate { get; set; }
 | 
				
			||||||
        public DateTime dateTime { get; set; } = DateTime.Now;
 | 
					        public DateTime dateTime { get; set; } = DateTime.Now;
 | 
				
			||||||
       // //鼠标点击时间
 | 
					 | 
				
			||||||
        public DateTime mouseClickTime { get; set; }
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
        // 当前操作的抽屉号
 | 
					        // 当前操作的抽屉号
 | 
				
			||||||
        public int DrawerNo { get; set; }
 | 
					        public int DrawerNo { get; set; }
 | 
				
			||||||
| 
						 | 
					@ -72,8 +67,7 @@ namespace MasaBlazorApp3.Port
 | 
				
			||||||
                logger.Error("抽屉串口打开错误" + e.Message);
 | 
					                logger.Error("抽屉串口打开错误" + e.Message);
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            try
 | 
					            try { 
 | 
				
			||||||
            {
 | 
					 | 
				
			||||||
            string ScanCodePortPath = _portConfig.scanCodePortPath;
 | 
					            string ScanCodePortPath = _portConfig.scanCodePortPath;
 | 
				
			||||||
                logger.Info($"打开条码枪串口【{ScanCodePortPath}】");
 | 
					                logger.Info($"打开条码枪串口【{ScanCodePortPath}】");
 | 
				
			||||||
                scanCodeSerial = new SerialPort(ScanCodePortPath, 9600, Parity.None, 8);
 | 
					                scanCodeSerial = new SerialPort(ScanCodePortPath, 9600, Parity.None, 8);
 | 
				
			||||||
| 
						 | 
					@ -104,21 +98,6 @@ namespace MasaBlazorApp3.Port
 | 
				
			||||||
                    logger.Error("can总线串口打开错误" + e.Message);
 | 
					                    logger.Error("can总线串口打开错误" + e.Message);
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
                
 | 
					                
 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
            //打开第二个can总线串口
 | 
					 | 
				
			||||||
            if (_portConfig.canBusTwoExsit)
 | 
					 | 
				
			||||||
            {
 | 
					 | 
				
			||||||
                try
 | 
					 | 
				
			||||||
                {
 | 
					 | 
				
			||||||
                    string CanBusPortPath = _portConfig.canBusPortPathTwo;
 | 
					 | 
				
			||||||
                    logger.Info($"打开第二个can总线串口【{CanBusPortPath}】");
 | 
					 | 
				
			||||||
                    canBusSerialTwo = new SerialPort(CanBusPortPath, 57600, Parity.None, 8);
 | 
					 | 
				
			||||||
                }
 | 
					 | 
				
			||||||
                catch (Exception e)
 | 
					 | 
				
			||||||
                {
 | 
					 | 
				
			||||||
                    logger.Error("第二个can总线串口打开错误" + e.Message);
 | 
					 | 
				
			||||||
                }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            if (_portConfig.fridgePortExist)
 | 
					            if (_portConfig.fridgePortExist)
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
| 
						 | 
					@ -147,7 +126,6 @@ namespace MasaBlazorApp3.Port
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                _length = serialPort.BytesToRead;
 | 
					                _length = serialPort.BytesToRead;
 | 
				
			||||||
                end = DateTime.Now;
 | 
					                end = DateTime.Now;
 | 
				
			||||||
                //logger.Error($"_length:{_length};length:{length}");
 | 
					 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            if(_length != length)
 | 
					            if(_length != length)
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
| 
						 | 
					@ -180,16 +158,9 @@ namespace MasaBlazorApp3.Port
 | 
				
			||||||
            byte[] buffer = new byte[] { 0xaa, 0x41, (byte)DrawerNo, 0xee };
 | 
					            byte[] buffer = new byte[] { 0xaa, 0x41, (byte)DrawerNo, 0xee };
 | 
				
			||||||
            if (_portConfig.drawerProtocol == 485)
 | 
					            if (_portConfig.drawerProtocol == 485)
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                if (_portConfig.totalDrawerCount > 8)
 | 
					                if (DrawerNo > 8)
 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
                    if (DrawerNo % 2 == 0)
 | 
					                    buffer = new byte[] { 0xaa, 0x21, (byte)(DrawerNo - 8), 0xee };
 | 
				
			||||||
                    {
 | 
					 | 
				
			||||||
                        buffer = new byte[] { 0xaa, 0x21, (byte)(DrawerNo / 2), 0xee };
 | 
					 | 
				
			||||||
                    }
 | 
					 | 
				
			||||||
                    else
 | 
					 | 
				
			||||||
                    {
 | 
					 | 
				
			||||||
                        buffer = new byte[] { 0xaa, 0x11, (byte)(DrawerNo / 2 + DrawerNo % 2), 0xee };
 | 
					 | 
				
			||||||
                    }
 | 
					 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
                else
 | 
					                else
 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
| 
						 | 
					@ -207,17 +178,7 @@ namespace MasaBlazorApp3.Port
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            byte[] buffer = await OpenDrawer(DrawerNo);
 | 
					            byte[] buffer = await OpenDrawer(DrawerNo);
 | 
				
			||||||
            int[] r = buffer.Select(it => Convert.ToInt32(it)).ToArray();
 | 
					            int[] r = buffer.Select(it => Convert.ToInt32(it)).ToArray();
 | 
				
			||||||
            //int index = DrawerNo > 8 ? DrawerNo - 7 : DrawerNo + 1;
 | 
					            int index = DrawerNo > 8 ? DrawerNo - 7 : DrawerNo + 1;
 | 
				
			||||||
            //int index = DrawerNo % 2 > 0 ? ((DrawerNo + 1) / 2) + 1 : (DrawerNo / 2) + 1;
 | 
					 | 
				
			||||||
            int index = 1;
 | 
					 | 
				
			||||||
            if (_portConfig.totalDrawerCount > 8)
 | 
					 | 
				
			||||||
            {
 | 
					 | 
				
			||||||
                index = DrawerNo % 2 > 0 ? ((DrawerNo + 1) / 2) + 1 : (DrawerNo / 2) + 1;
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
            else
 | 
					 | 
				
			||||||
            {
 | 
					 | 
				
			||||||
                index = DrawerNo > 8 ? DrawerNo - 7 : DrawerNo + 1;
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
            return r[index] == 0;
 | 
					            return r[index] == 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
| 
						 | 
					@ -230,11 +191,7 @@ namespace MasaBlazorApp3.Port
 | 
				
			||||||
            byte[] buffer = new byte[] { 0xaa, 0x42, 0xee };
 | 
					            byte[] buffer = new byte[] { 0xaa, 0x42, 0xee };
 | 
				
			||||||
            if (_portConfig.drawerProtocol == 485)
 | 
					            if (_portConfig.drawerProtocol == 485)
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                if (_portConfig.totalDrawerCount > 8)
 | 
					                if (DrawerNo > 8)
 | 
				
			||||||
                {
 | 
					 | 
				
			||||||
                    //if (DrawerNo > 8)
 | 
					 | 
				
			||||||
                    //{
 | 
					 | 
				
			||||||
                    if (DrawerNo % 2 == 0)
 | 
					 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
                    buffer = new byte[] { 0xaa, 0x22, 0xee };
 | 
					                    buffer = new byte[] { 0xaa, 0x22, 0xee };
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
| 
						 | 
					@ -242,16 +199,7 @@ namespace MasaBlazorApp3.Port
 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
                    buffer = new byte[] { 0xaa, 0x12, 0xee };
 | 
					                    buffer = new byte[] { 0xaa, 0x12, 0xee };
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
                    //}
 | 
					
 | 
				
			||||||
                    //else
 | 
					 | 
				
			||||||
                    //{
 | 
					 | 
				
			||||||
                    //    buffer = new byte[] { 0xaa, 0x12, 0xee };
 | 
					 | 
				
			||||||
                    //}
 | 
					 | 
				
			||||||
                }
 | 
					 | 
				
			||||||
                else
 | 
					 | 
				
			||||||
                {
 | 
					 | 
				
			||||||
                    buffer = new byte[] { 0xaa, 0x12, 0xee };
 | 
					 | 
				
			||||||
                }
 | 
					 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            logger.Info($"查询抽屉状态,串口数据:{Convert.ToHexString(buffer)}");
 | 
					            logger.Info($"查询抽屉状态,串口数据:{Convert.ToHexString(buffer)}");
 | 
				
			||||||
| 
						 | 
					@ -263,18 +211,8 @@ namespace MasaBlazorApp3.Port
 | 
				
			||||||
        public async Task<bool> CheckDrawerStatus2(int DrawerNo)
 | 
					        public async Task<bool> CheckDrawerStatus2(int DrawerNo)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            byte[] buffer = await CheckDrawerStatus(DrawerNo);
 | 
					            byte[] buffer = await CheckDrawerStatus(DrawerNo);
 | 
				
			||||||
            logger.Info($"查询抽屉状态,返回:{Convert.ToHexString(buffer)}");
 | 
					 | 
				
			||||||
            int[] r = buffer.Select(it => Convert.ToInt32(it)).ToArray();
 | 
					            int[] r = buffer.Select(it => Convert.ToInt32(it)).ToArray();
 | 
				
			||||||
            //int index = DrawerNo > 8 ? DrawerNo - 7 : DrawerNo + 1;
 | 
					            int index = DrawerNo > 8 ? DrawerNo - 7 : DrawerNo + 1;
 | 
				
			||||||
            int index = 1;
 | 
					 | 
				
			||||||
            if (_portConfig.totalDrawerCount > 8)
 | 
					 | 
				
			||||||
            {
 | 
					 | 
				
			||||||
                index = DrawerNo % 2 > 0 ? ((DrawerNo + 1) / 2) + 1 : (DrawerNo / 2) + 1;
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
            else
 | 
					 | 
				
			||||||
            {
 | 
					 | 
				
			||||||
                index = DrawerNo > 8 ? DrawerNo - 7 : DrawerNo + 1;
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
            return r[index] != 0;
 | 
					            return r[index] != 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
| 
						 | 
					@ -295,23 +233,13 @@ namespace MasaBlazorApp3.Port
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        // 打开电控门储物箱(有灯使能)
 | 
					        // 打开电控门储物箱(有灯使能)
 | 
				
			||||||
        public async Task<byte[]> OpenStorage()
 | 
					        public async Task<byte[]> OpenStorage()
 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
            if (_portConfig.StorageCan == 2)
 | 
					 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            canBusSerial.DiscardInBuffer();
 | 
					            canBusSerial.DiscardInBuffer();
 | 
				
			||||||
            byte[] buffer = new byte[] { 0xaa, (byte)(_portConfig.doorAddr), 0x01, (byte)_portConfig.storageBoxAddr, 0x00, 0x00, 0x00, 0xee };
 | 
					            byte[] buffer = new byte[] { 0xaa, (byte)(_portConfig.doorAddr), 0x01, (byte)_portConfig.storageBoxAddr, 0x00, 0x00, 0x00, 0xee };
 | 
				
			||||||
            canBusSerial.Write(buffer, 0, 8);
 | 
					            canBusSerial.Write(buffer, 0, 8);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            return await GetBufferByPort(canBusSerial, 8);
 | 
					            return await GetBufferByPort(canBusSerial, 8);
 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
            else
 | 
					 | 
				
			||||||
            {
 | 
					 | 
				
			||||||
                canBusSerialTwo.DiscardInBuffer();
 | 
					 | 
				
			||||||
                byte[] buffer = new byte[] { 0xaa, (byte)(_portConfig.doorAddr), 0x01, (byte)_portConfig.storageBoxAddr, 0x00, 0x00, 0x00, 0xee };
 | 
					 | 
				
			||||||
                canBusSerialTwo.Write(buffer, 0, 8);
 | 
					 | 
				
			||||||
                return await GetBufferByPort(canBusSerialTwo, 8);
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        // 关闭电控门储物箱(有灯失能)
 | 
					        // 关闭电控门储物箱(有灯失能)
 | 
				
			||||||
        public void CloseStorage()
 | 
					        public void CloseStorage()
 | 
				
			||||||
| 
						 | 
					@ -360,30 +288,14 @@ namespace MasaBlazorApp3.Port
 | 
				
			||||||
        // 以抽屉为单位获取抽屉内所有库位的药品数量
 | 
					        // 以抽屉为单位获取抽屉内所有库位的药品数量
 | 
				
			||||||
        public async Task<byte[]> CheckQuantityByDrawer(int DrawerNo)
 | 
					        public async Task<byte[]> CheckQuantityByDrawer(int DrawerNo)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            SerialPort serialCanPort = canBusSerial;
 | 
					            canBusSerial.DiscardInBuffer();
 | 
				
			||||||
            int channel = DrawerNo;
 | 
					 | 
				
			||||||
            if (_portConfig.totalDrawerCount > 8)
 | 
					 | 
				
			||||||
            {
 | 
					 | 
				
			||||||
                if (DrawerNo % 2 == 0)
 | 
					 | 
				
			||||||
                {
 | 
					 | 
				
			||||||
                    channel = DrawerNo / 2;
 | 
					 | 
				
			||||||
                }
 | 
					 | 
				
			||||||
                else
 | 
					 | 
				
			||||||
                {
 | 
					 | 
				
			||||||
                    serialCanPort = canBusSerialTwo;
 | 
					 | 
				
			||||||
                    channel = (DrawerNo + 1) / 2;
 | 
					 | 
				
			||||||
                }
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            byte[] buffer = new byte[] { 0xaa, (byte)(0xf0 + DrawerNo), 0x01, 0x00, 0x00, 0x00, 0x00, 0xee };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            serialCanPort.DiscardInBuffer();
 | 
					            logger.Info($"单支板发送库位数量查询【{string.Join(",", buffer)}】");
 | 
				
			||||||
 | 
					            canBusSerial.Write(buffer, 0, 8);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            byte[] buffer = new byte[] { 0xaa, (byte)(0xf0 + channel), 0x01, 0x00, 0x00, 0x00, 0x00, 0xee };
 | 
					            return await GetBufferByPort(canBusSerial, 13);
 | 
				
			||||||
 | 
					 | 
				
			||||||
            logger.Info($"单支板发送库位数量查询【{string.Join(",", buffer)}】,调用串口{serialCanPort.PortName}");
 | 
					 | 
				
			||||||
            serialCanPort.Write(buffer, 0, 8);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            return await GetBufferByPort(serialCanPort, 13);
 | 
					 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        // 获取单个单支板药品数量
 | 
					        // 获取单个单支板药品数量
 | 
				
			||||||
        public async Task<byte[]> CheckQuantityByCol(int DrawerNo, int colNo)
 | 
					        public async Task<byte[]> CheckQuantityByCol(int DrawerNo, int colNo)
 | 
				
			||||||
| 
						 | 
					@ -412,47 +324,19 @@ namespace MasaBlazorApp3.Port
 | 
				
			||||||
        // 以抽屉为单位灭灯
 | 
					        // 以抽屉为单位灭灯
 | 
				
			||||||
        public void LightOffByDrawer(int DrawerNo)
 | 
					        public void LightOffByDrawer(int DrawerNo)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            SerialPort serialPort = canBusSerial;
 | 
					 | 
				
			||||||
            int channelDrawerNo = DrawerNo;
 | 
					 | 
				
			||||||
            if (_portConfig.totalDrawerCount > 8)
 | 
					 | 
				
			||||||
            {
 | 
					 | 
				
			||||||
                if (DrawerNo % 2 == 0)
 | 
					 | 
				
			||||||
                {
 | 
					 | 
				
			||||||
                    channelDrawerNo = DrawerNo / 2;
 | 
					 | 
				
			||||||
                }
 | 
					 | 
				
			||||||
                else
 | 
					 | 
				
			||||||
                {
 | 
					 | 
				
			||||||
                    serialPort = canBusSerialTwo;
 | 
					 | 
				
			||||||
                    channelDrawerNo = (DrawerNo + 1) / 2;
 | 
					 | 
				
			||||||
                }
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
            byte[] buffer = new byte[] { 0xaa, (byte)(0xf0 + DrawerNo), 0x06, 0x00, 0x00, 0x00, 0x00, 0xee };
 | 
					            byte[] buffer = new byte[] { 0xaa, (byte)(0xf0 + DrawerNo), 0x06, 0x00, 0x00, 0x00, 0x00, 0xee };
 | 
				
			||||||
            serialPort.Write(buffer, 0, 8);
 | 
					            canBusSerial.Write(buffer, 0, 8);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        // 以单支板为单位有药位置亮灯
 | 
					        // 以单支板为单位有药位置亮灯
 | 
				
			||||||
        public async Task HasLightOnByCol(int DrawerNo, int[] ColNos)
 | 
					        public async Task HasLightOnByCol(int DrawerNo, int[] ColNos)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            SerialPort serialPort = canBusSerial;
 | 
					
 | 
				
			||||||
            int channelDrawerNo = DrawerNo;
 | 
					 | 
				
			||||||
            if (_portConfig.totalDrawerCount > 8)
 | 
					 | 
				
			||||||
            {
 | 
					 | 
				
			||||||
                if (DrawerNo % 2 == 0)
 | 
					 | 
				
			||||||
                {
 | 
					 | 
				
			||||||
                    channelDrawerNo = DrawerNo / 2;
 | 
					 | 
				
			||||||
                }
 | 
					 | 
				
			||||||
                else
 | 
					 | 
				
			||||||
                {
 | 
					 | 
				
			||||||
                    serialPort = canBusSerialTwo;
 | 
					 | 
				
			||||||
                    channelDrawerNo = (DrawerNo + 1) / 2;
 | 
					 | 
				
			||||||
                }
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
            for (int i = 0; i < ColNos.Length; i++)
 | 
					            for (int i = 0; i < ColNos.Length; i++)
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                var channel = Convert.ToInt32((channelDrawerNo * 10 + ColNos[i]).ToString(), 16);
 | 
					                var channel = Convert.ToInt32((DrawerNo * 10 + ColNos[i]).ToString(), 16);
 | 
				
			||||||
                byte[] buffer = new byte[] { 0xaa, (byte)channel, 0x0a, 0x00, 0x00, 0x00, 0x00, 0xee };
 | 
					                byte[] buffer = new byte[] { 0xaa, (byte)channel, 0x0a, 0x00, 0x00, 0x00, 0x00, 0xee };
 | 
				
			||||||
                serialPort.Write(buffer, 0, 8);
 | 
					                canBusSerial.Write(buffer, 0, 8);
 | 
				
			||||||
                logger.Info($"{serialPort}串口{DrawerNo}号{channelDrawerNo}抽屉{string.Join(',',ColNos)}库位有药位置亮灯发送指令:{Convert.ToHexString(buffer)}");
 | 
					 | 
				
			||||||
                await Task.Delay(TimeSpan.FromMilliseconds(20));
 | 
					                await Task.Delay(TimeSpan.FromMilliseconds(20));
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -460,23 +344,9 @@ namespace MasaBlazorApp3.Port
 | 
				
			||||||
        // 以单支板为单位无药位置亮灯
 | 
					        // 以单支板为单位无药位置亮灯
 | 
				
			||||||
        public async Task NoLightOnByCol(int DrawerNo, int[] ColNos)
 | 
					        public async Task NoLightOnByCol(int DrawerNo, int[] ColNos)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            SerialPort serialPort = canBusSerial;
 | 
					 | 
				
			||||||
            int channelDrawerNo = DrawerNo;
 | 
					 | 
				
			||||||
            if (_portConfig.totalDrawerCount > 8)
 | 
					 | 
				
			||||||
            {
 | 
					 | 
				
			||||||
                if (DrawerNo % 2 == 0)
 | 
					 | 
				
			||||||
                {
 | 
					 | 
				
			||||||
                    channelDrawerNo = DrawerNo / 2;
 | 
					 | 
				
			||||||
                }
 | 
					 | 
				
			||||||
                else
 | 
					 | 
				
			||||||
                {
 | 
					 | 
				
			||||||
                    serialPort = canBusSerialTwo;
 | 
					 | 
				
			||||||
                    channelDrawerNo = (DrawerNo + 1) / 2;
 | 
					 | 
				
			||||||
                }
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
            for (int i = 0; i < ColNos.Length; i++)
 | 
					            for (int i = 0; i < ColNos.Length; i++)
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                var channel = Convert.ToInt32((channelDrawerNo * 10 + ColNos[i]).ToString(), 16);
 | 
					                var channel = Convert.ToInt32((DrawerNo * 10 + ColNos[i]).ToString(), 16);
 | 
				
			||||||
                byte[] buffer = new byte[] { 0xaa, (byte)channel, 0x0b, 0x00, 0x00, 0x00, 0x00, 0xee };
 | 
					                byte[] buffer = new byte[] { 0xaa, (byte)channel, 0x0b, 0x00, 0x00, 0x00, 0x00, 0xee };
 | 
				
			||||||
                canBusSerial.Write(buffer, 0, 8);
 | 
					                canBusSerial.Write(buffer, 0, 8);
 | 
				
			||||||
                await Task.Delay(TimeSpan.FromMilliseconds(20));
 | 
					                await Task.Delay(TimeSpan.FromMilliseconds(20));
 | 
				
			||||||
| 
						 | 
					@ -487,40 +357,6 @@ namespace MasaBlazorApp3.Port
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            byte[] buffer = new byte[] { 0xaa, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0xee };
 | 
					            byte[] buffer = new byte[] { 0xaa, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0xee };
 | 
				
			||||||
            canBusSerial.Write(buffer, 0, 8);
 | 
					            canBusSerial.Write(buffer, 0, 8);
 | 
				
			||||||
            canBusSerialTwo.Write(buffer, 0, 8);
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
        //单支板通电
 | 
					 | 
				
			||||||
        public void PowerOn()
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
            if (_portConfig.StorageCan == 2)
 | 
					 | 
				
			||||||
            {
 | 
					 | 
				
			||||||
                canBusSerial.DiscardInBuffer();
 | 
					 | 
				
			||||||
                byte[] buffer = new byte[] { 0xaa, 0x01, 0x05, 0x07, 0x01, 0x00, 0x00, 0xee };
 | 
					 | 
				
			||||||
                canBusSerial.Write(buffer, 0, 8);
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
            else
 | 
					 | 
				
			||||||
            {
 | 
					 | 
				
			||||||
                canBusSerialTwo.DiscardInBuffer();
 | 
					 | 
				
			||||||
                byte[] buffer = new byte[] { 0xaa, 0x01, 0x05, 0x07, 0x01, 0x00, 0x00, 0xee };
 | 
					 | 
				
			||||||
                canBusSerialTwo.Write(buffer, 0, 8);
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
        //单支板断电
 | 
					 | 
				
			||||||
        public void PowerOff()
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
            if (_portConfig.StorageCan == 2)
 | 
					 | 
				
			||||||
            {
 | 
					 | 
				
			||||||
                canBusSerial.DiscardInBuffer();
 | 
					 | 
				
			||||||
                byte[] buffer = new byte[] { 0xaa, 0x01, 0x05, 0x07, 0x00, 0x00, 0x00, 0xee };
 | 
					 | 
				
			||||||
                canBusSerial.Write(buffer, 0, 8);
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
            else
 | 
					 | 
				
			||||||
            {
 | 
					 | 
				
			||||||
                canBusSerialTwo.DiscardInBuffer();
 | 
					 | 
				
			||||||
                byte[] buffer = new byte[] { 0xaa, 0x01, 0x05, 0x07, 0x00, 0x00, 0x00, 0xee };
 | 
					 | 
				
			||||||
                canBusSerialTwo.Write(buffer, 0, 8);
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        #endregion
 | 
					        #endregion
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1560,31 +1396,5 @@ namespace MasaBlazorApp3.Port
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        #endregion
 | 
					        #endregion
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        #region 抽屉报警
 | 
					 | 
				
			||||||
        //抽屉报警开启
 | 
					 | 
				
			||||||
        public async Task AlertOpen()
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
            drawerSerial.DiscardInBuffer();
 | 
					 | 
				
			||||||
            byte[] buffer = new byte[] { 0xAA, 0x13, 0xA, 0xEE };
 | 
					 | 
				
			||||||
            logger.Info($"打开抽屉报警1:{Convert.ToHexString(buffer)}");
 | 
					 | 
				
			||||||
            drawerSerial.Write(buffer, 0, 4);
 | 
					 | 
				
			||||||
            await Task.Delay(20);
 | 
					 | 
				
			||||||
            byte[] buffer2 = new byte[] { 0xAA, 0x23, 0xA, 0xEE };
 | 
					 | 
				
			||||||
            logger.Info($"打开抽屉报警2:{Convert.ToHexString(buffer2)}");
 | 
					 | 
				
			||||||
            drawerSerial.Write(buffer2, 0, 4);
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
        //抽屉报警关闭
 | 
					 | 
				
			||||||
        public async Task AlertClose()
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
            drawerSerial.DiscardInBuffer();
 | 
					 | 
				
			||||||
            byte[] buffer = new byte[] { 0xAA, 0x13, 0x0, 0xEE };
 | 
					 | 
				
			||||||
            logger.Info($"关闭抽屉报警1:{Convert.ToHexString(buffer)}");
 | 
					 | 
				
			||||||
            drawerSerial.Write(buffer, 0, 4);
 | 
					 | 
				
			||||||
            await Task.Delay(20);
 | 
					 | 
				
			||||||
            byte[] buffer2 = new byte[] { 0xAA, 0x23, 0x0, 0xEE };
 | 
					 | 
				
			||||||
            logger.Info($"关闭抽屉报警2:{Convert.ToHexString(buffer2)}");
 | 
					 | 
				
			||||||
            drawerSerial.Write(buffer2, 0, 4);
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
        #endregion
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -13,6 +13,7 @@ using LinqToDB.AspNet.Logging;
 | 
				
			||||||
using Radzen;
 | 
					using Radzen;
 | 
				
			||||||
using MasaBlazorApp3.Pojo.Config;
 | 
					using MasaBlazorApp3.Pojo.Config;
 | 
				
			||||||
using MasaBlazorApp3.Port;
 | 
					using MasaBlazorApp3.Port;
 | 
				
			||||||
 | 
					using Toolbelt.Blazor.Extensions.DependencyInjection;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
internal class Program
 | 
					internal class Program
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
| 
						 | 
					@ -50,11 +51,11 @@ internal class Program
 | 
				
			||||||
        appBuilder.Services.Configure<fridgeConfig>(config.GetSection("fridge"));
 | 
					        appBuilder.Services.Configure<fridgeConfig>(config.GetSection("fridge"));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        // i18n
 | 
					        // i18n
 | 
				
			||||||
        //appBuilder.Services.AddI18nText();
 | 
					        appBuilder.Services.AddI18nText();
 | 
				
			||||||
        // 数据库
 | 
					        // 数据库
 | 
				
			||||||
        appBuilder.Services.AddLinqToDBContext<AppDataConnection>((provider, options) =>
 | 
					        appBuilder.Services.AddLinqToDBContext<AppDataConnection>((provider, options) =>
 | 
				
			||||||
                options.UseMySql(config.GetValue<String>("connectionStrings"))
 | 
					                options.UseMySql(config.GetValue<String>("connectionStrings"))
 | 
				
			||||||
                .UseDefaultLogging(provider), ServiceLifetime.Transient);
 | 
					                .UseDefaultLogging(provider));
 | 
				
			||||||
        // dao层数据库操作
 | 
					        // dao层数据库操作
 | 
				
			||||||
        appBuilder.Services.AddScoped<IUserDao, UserDao>();
 | 
					        appBuilder.Services.AddScoped<IUserDao, UserDao>();
 | 
				
			||||||
        appBuilder.Services.AddScoped<IRoleDao, RoleDao>();
 | 
					        appBuilder.Services.AddScoped<IRoleDao, RoleDao>();
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,334 +0,0 @@
 | 
				
			||||||
{
 | 
					 | 
				
			||||||
	"Version":"6.8.1.1",
 | 
					 | 
				
			||||||
	"Font":{
 | 
					 | 
				
			||||||
		"Name":"宋体",
 | 
					 | 
				
			||||||
		"Size":105000,
 | 
					 | 
				
			||||||
		"Weight":400,
 | 
					 | 
				
			||||||
		"Charset":134
 | 
					 | 
				
			||||||
	},
 | 
					 | 
				
			||||||
	"Printer":{
 | 
					 | 
				
			||||||
		"LeftMargin":0.3175,
 | 
					 | 
				
			||||||
		"TopMargin":0.899583,
 | 
					 | 
				
			||||||
		"RightMargin":0.396875
 | 
					 | 
				
			||||||
	},
 | 
					 | 
				
			||||||
	"DetailGrid":{
 | 
					 | 
				
			||||||
		"CenterView":true,
 | 
					 | 
				
			||||||
		"IsCrossTab":true,
 | 
					 | 
				
			||||||
		"AppendBlankRow":true,
 | 
					 | 
				
			||||||
		"Recordset":{
 | 
					 | 
				
			||||||
			"Field":[
 | 
					 | 
				
			||||||
				{
 | 
					 | 
				
			||||||
					"Name":"手术间",
 | 
					 | 
				
			||||||
					"DBFieldName":"DrawerNo"
 | 
					 | 
				
			||||||
				},
 | 
					 | 
				
			||||||
				{
 | 
					 | 
				
			||||||
					"Name":"请领时间",
 | 
					 | 
				
			||||||
					"DBFieldName":"TTime"
 | 
					 | 
				
			||||||
				},
 | 
					 | 
				
			||||||
				{
 | 
					 | 
				
			||||||
					"Name":"二线",
 | 
					 | 
				
			||||||
					"DBFieldName":"LineTwo"
 | 
					 | 
				
			||||||
				},
 | 
					 | 
				
			||||||
				{
 | 
					 | 
				
			||||||
					"Name":"一线",
 | 
					 | 
				
			||||||
					"DBFieldName":"LineOne"
 | 
					 | 
				
			||||||
				},
 | 
					 | 
				
			||||||
				{
 | 
					 | 
				
			||||||
					"Name":"操作人",
 | 
					 | 
				
			||||||
					"DBFieldName":"Nickname"
 | 
					 | 
				
			||||||
				},
 | 
					 | 
				
			||||||
				{
 | 
					 | 
				
			||||||
					"Name":"时间",
 | 
					 | 
				
			||||||
					"Type":"DateTime",
 | 
					 | 
				
			||||||
					"Format":"yyyy年MM月dd日",
 | 
					 | 
				
			||||||
					"DBFieldName":"operationTime"
 | 
					 | 
				
			||||||
				},
 | 
					 | 
				
			||||||
				{
 | 
					 | 
				
			||||||
					"Name":"药品名称",
 | 
					 | 
				
			||||||
					"DBFieldName":"DrugName"
 | 
					 | 
				
			||||||
				},
 | 
					 | 
				
			||||||
				{
 | 
					 | 
				
			||||||
					"Name":"数量",
 | 
					 | 
				
			||||||
					"DBFieldName":"quantity"
 | 
					 | 
				
			||||||
				},
 | 
					 | 
				
			||||||
				{
 | 
					 | 
				
			||||||
					"Name":"批次",
 | 
					 | 
				
			||||||
					"DBFieldName":"manuNo"
 | 
					 | 
				
			||||||
				},
 | 
					 | 
				
			||||||
				{
 | 
					 | 
				
			||||||
					"Name":"效期",
 | 
					 | 
				
			||||||
					"Type":"DateTime",
 | 
					 | 
				
			||||||
					"Format":"yyyy/MM/dd",
 | 
					 | 
				
			||||||
					"DBFieldName":"effDate"
 | 
					 | 
				
			||||||
				},
 | 
					 | 
				
			||||||
				{
 | 
					 | 
				
			||||||
					"Name":"库位",
 | 
					 | 
				
			||||||
					"DBFieldName":"drawerNo"
 | 
					 | 
				
			||||||
				},
 | 
					 | 
				
			||||||
				{
 | 
					 | 
				
			||||||
					"Name":"colNo"
 | 
					 | 
				
			||||||
				},
 | 
					 | 
				
			||||||
				{
 | 
					 | 
				
			||||||
					"Name":"type2",
 | 
					 | 
				
			||||||
					"Type":"Integer",
 | 
					 | 
				
			||||||
					"DBFieldName":"type"
 | 
					 | 
				
			||||||
				},
 | 
					 | 
				
			||||||
				{
 | 
					 | 
				
			||||||
					"Name":"医生签名",
 | 
					 | 
				
			||||||
					"DBFieldName":"Doctor"
 | 
					 | 
				
			||||||
				},
 | 
					 | 
				
			||||||
				{
 | 
					 | 
				
			||||||
					"Name":"管理者签名",
 | 
					 | 
				
			||||||
					"DBFieldName":"Manager"
 | 
					 | 
				
			||||||
				}
 | 
					 | 
				
			||||||
			]
 | 
					 | 
				
			||||||
		},
 | 
					 | 
				
			||||||
		"Column":[
 | 
					 | 
				
			||||||
			{
 | 
					 | 
				
			||||||
				"Name":"手术间",
 | 
					 | 
				
			||||||
				"Width":0.978958
 | 
					 | 
				
			||||||
			},
 | 
					 | 
				
			||||||
			{
 | 
					 | 
				
			||||||
				"Name":"请领时间",
 | 
					 | 
				
			||||||
				"Width":2.19604
 | 
					 | 
				
			||||||
			},
 | 
					 | 
				
			||||||
			{
 | 
					 | 
				
			||||||
				"Name":"二线",
 | 
					 | 
				
			||||||
				"Width":2.01083
 | 
					 | 
				
			||||||
			},
 | 
					 | 
				
			||||||
			{
 | 
					 | 
				
			||||||
				"Name":"一线",
 | 
					 | 
				
			||||||
				"Width":1.98438
 | 
					 | 
				
			||||||
			},
 | 
					 | 
				
			||||||
			{
 | 
					 | 
				
			||||||
				"Name":"药品名称",
 | 
					 | 
				
			||||||
				"Width":3.81
 | 
					 | 
				
			||||||
			},
 | 
					 | 
				
			||||||
			{
 | 
					 | 
				
			||||||
				"Name":"医生签名",
 | 
					 | 
				
			||||||
				"Width":2.01083
 | 
					 | 
				
			||||||
			},
 | 
					 | 
				
			||||||
			{
 | 
					 | 
				
			||||||
				"Name":"管理者签名",
 | 
					 | 
				
			||||||
				"Width":1.61396
 | 
					 | 
				
			||||||
			},
 | 
					 | 
				
			||||||
			{
 | 
					 | 
				
			||||||
				"Name":"数量",
 | 
					 | 
				
			||||||
				"Width":1.19063
 | 
					 | 
				
			||||||
			}
 | 
					 | 
				
			||||||
		],
 | 
					 | 
				
			||||||
		"ColumnContent":{
 | 
					 | 
				
			||||||
			"Height":1.00542,
 | 
					 | 
				
			||||||
			"ColumnContentCell":[
 | 
					 | 
				
			||||||
				{
 | 
					 | 
				
			||||||
					"Column":"手术间",
 | 
					 | 
				
			||||||
					"TextAlign":"MiddleCenter",
 | 
					 | 
				
			||||||
					"DataField":"操作人"
 | 
					 | 
				
			||||||
				},
 | 
					 | 
				
			||||||
				{
 | 
					 | 
				
			||||||
					"Column":"请领时间",
 | 
					 | 
				
			||||||
					"TextAlign":"MiddleCenter",
 | 
					 | 
				
			||||||
					"DataField":"请领时间"
 | 
					 | 
				
			||||||
				},
 | 
					 | 
				
			||||||
				{
 | 
					 | 
				
			||||||
					"Column":"二线",
 | 
					 | 
				
			||||||
					"TextAlign":"MiddleCenter",
 | 
					 | 
				
			||||||
					"DataField":"二线"
 | 
					 | 
				
			||||||
				},
 | 
					 | 
				
			||||||
				{
 | 
					 | 
				
			||||||
					"Column":"一线",
 | 
					 | 
				
			||||||
					"TextAlign":"MiddleCenter",
 | 
					 | 
				
			||||||
					"DataField":"一线"
 | 
					 | 
				
			||||||
				},
 | 
					 | 
				
			||||||
				{
 | 
					 | 
				
			||||||
					"Column":"药品名称",
 | 
					 | 
				
			||||||
					"TextAlign":"MiddleCenter",
 | 
					 | 
				
			||||||
					"DataField":"数量"
 | 
					 | 
				
			||||||
				},
 | 
					 | 
				
			||||||
				{
 | 
					 | 
				
			||||||
					"Column":"医生签名",
 | 
					 | 
				
			||||||
					"TextAlign":"MiddleCenter",
 | 
					 | 
				
			||||||
					"DataField":"医生签名"
 | 
					 | 
				
			||||||
				},
 | 
					 | 
				
			||||||
				{
 | 
					 | 
				
			||||||
					"Column":"管理者签名",
 | 
					 | 
				
			||||||
					"TextAlign":"MiddleCenter",
 | 
					 | 
				
			||||||
					"DataField":"管理者签名"
 | 
					 | 
				
			||||||
				},
 | 
					 | 
				
			||||||
				{
 | 
					 | 
				
			||||||
					"Column":"数量",
 | 
					 | 
				
			||||||
					"TextAlign":"MiddleCenter",
 | 
					 | 
				
			||||||
					"DataField":"数量"
 | 
					 | 
				
			||||||
				}
 | 
					 | 
				
			||||||
			]
 | 
					 | 
				
			||||||
		},
 | 
					 | 
				
			||||||
		"ColumnTitle":{
 | 
					 | 
				
			||||||
			"Height":1.79917,
 | 
					 | 
				
			||||||
			"RepeatStyle":"OnPage",
 | 
					 | 
				
			||||||
			"ColumnTitleCell":[
 | 
					 | 
				
			||||||
				{
 | 
					 | 
				
			||||||
					"GroupTitle":false,
 | 
					 | 
				
			||||||
					"Column":"手术间",
 | 
					 | 
				
			||||||
					"Font":{
 | 
					 | 
				
			||||||
						"Name":"宋体",
 | 
					 | 
				
			||||||
						"Size":120000,
 | 
					 | 
				
			||||||
						"Bold":true,
 | 
					 | 
				
			||||||
						"Charset":134
 | 
					 | 
				
			||||||
					},
 | 
					 | 
				
			||||||
					"TextAlign":"MiddleCenter",
 | 
					 | 
				
			||||||
					"Text":"手\r\n术\r\n间"
 | 
					 | 
				
			||||||
				},
 | 
					 | 
				
			||||||
				{
 | 
					 | 
				
			||||||
					"GroupTitle":false,
 | 
					 | 
				
			||||||
					"Column":"请领时间",
 | 
					 | 
				
			||||||
					"Font":{
 | 
					 | 
				
			||||||
						"Name":"宋体",
 | 
					 | 
				
			||||||
						"Size":120000,
 | 
					 | 
				
			||||||
						"Bold":true,
 | 
					 | 
				
			||||||
						"Charset":134
 | 
					 | 
				
			||||||
					},
 | 
					 | 
				
			||||||
					"TextAlign":"MiddleCenter",
 | 
					 | 
				
			||||||
					"Text":"请领时间"
 | 
					 | 
				
			||||||
				},
 | 
					 | 
				
			||||||
				{
 | 
					 | 
				
			||||||
					"GroupTitle":true,
 | 
					 | 
				
			||||||
					"Name":"麻醉医生",
 | 
					 | 
				
			||||||
					"ColumnTitleCell":[
 | 
					 | 
				
			||||||
						{
 | 
					 | 
				
			||||||
							"GroupTitle":false,
 | 
					 | 
				
			||||||
							"Column":"二线",
 | 
					 | 
				
			||||||
							"Font":{
 | 
					 | 
				
			||||||
								"Name":"宋体",
 | 
					 | 
				
			||||||
								"Size":120000,
 | 
					 | 
				
			||||||
								"Bold":true,
 | 
					 | 
				
			||||||
								"Charset":134
 | 
					 | 
				
			||||||
							},
 | 
					 | 
				
			||||||
							"TextAlign":"MiddleCenter",
 | 
					 | 
				
			||||||
							"Text":"二线"
 | 
					 | 
				
			||||||
						},
 | 
					 | 
				
			||||||
						{
 | 
					 | 
				
			||||||
							"GroupTitle":false,
 | 
					 | 
				
			||||||
							"Column":"一线",
 | 
					 | 
				
			||||||
							"Font":{
 | 
					 | 
				
			||||||
								"Name":"宋体",
 | 
					 | 
				
			||||||
								"Size":120000,
 | 
					 | 
				
			||||||
								"Bold":true,
 | 
					 | 
				
			||||||
								"Charset":134
 | 
					 | 
				
			||||||
							},
 | 
					 | 
				
			||||||
							"TextAlign":"MiddleCenter",
 | 
					 | 
				
			||||||
							"Text":"一线"
 | 
					 | 
				
			||||||
						}
 | 
					 | 
				
			||||||
					],
 | 
					 | 
				
			||||||
					"Font":{
 | 
					 | 
				
			||||||
						"Name":"宋体",
 | 
					 | 
				
			||||||
						"Size":105000,
 | 
					 | 
				
			||||||
						"Bold":true,
 | 
					 | 
				
			||||||
						"Charset":134
 | 
					 | 
				
			||||||
					},
 | 
					 | 
				
			||||||
					"TextAlign":"MiddleCenter",
 | 
					 | 
				
			||||||
					"Text":"麻醉医生"
 | 
					 | 
				
			||||||
				},
 | 
					 | 
				
			||||||
				{
 | 
					 | 
				
			||||||
					"GroupTitle":false,
 | 
					 | 
				
			||||||
					"Column":"药品名称",
 | 
					 | 
				
			||||||
					"Font":{
 | 
					 | 
				
			||||||
						"Name":"宋体",
 | 
					 | 
				
			||||||
						"Size":105000,
 | 
					 | 
				
			||||||
						"Bold":true,
 | 
					 | 
				
			||||||
						"Charset":134
 | 
					 | 
				
			||||||
					},
 | 
					 | 
				
			||||||
					"TextAlign":"MiddleCenter",
 | 
					 | 
				
			||||||
					"Text":"[#药品名称#]"
 | 
					 | 
				
			||||||
				},
 | 
					 | 
				
			||||||
				{
 | 
					 | 
				
			||||||
					"GroupTitle":false,
 | 
					 | 
				
			||||||
					"Column":"医生签名",
 | 
					 | 
				
			||||||
					"Font":{
 | 
					 | 
				
			||||||
						"Name":"宋体",
 | 
					 | 
				
			||||||
						"Size":120000,
 | 
					 | 
				
			||||||
						"Bold":true,
 | 
					 | 
				
			||||||
						"Charset":134
 | 
					 | 
				
			||||||
					},
 | 
					 | 
				
			||||||
					"TextAlign":"MiddleCenter",
 | 
					 | 
				
			||||||
					"Text":"医生\r\n签名"
 | 
					 | 
				
			||||||
				},
 | 
					 | 
				
			||||||
				{
 | 
					 | 
				
			||||||
					"GroupTitle":false,
 | 
					 | 
				
			||||||
					"Column":"管理者签名",
 | 
					 | 
				
			||||||
					"Font":{
 | 
					 | 
				
			||||||
						"Name":"宋体",
 | 
					 | 
				
			||||||
						"Size":120000,
 | 
					 | 
				
			||||||
						"Bold":true,
 | 
					 | 
				
			||||||
						"Charset":134
 | 
					 | 
				
			||||||
					},
 | 
					 | 
				
			||||||
					"TextAlign":"MiddleCenter",
 | 
					 | 
				
			||||||
					"Text":"管理者\r\n签名"
 | 
					 | 
				
			||||||
				},
 | 
					 | 
				
			||||||
				{
 | 
					 | 
				
			||||||
					"GroupTitle":false,
 | 
					 | 
				
			||||||
					"Column":"数量",
 | 
					 | 
				
			||||||
					"Font":{
 | 
					 | 
				
			||||||
						"Name":"宋体",
 | 
					 | 
				
			||||||
						"Size":120000,
 | 
					 | 
				
			||||||
						"Bold":true,
 | 
					 | 
				
			||||||
						"Charset":134
 | 
					 | 
				
			||||||
					},
 | 
					 | 
				
			||||||
					"TextAlign":"MiddleCenter",
 | 
					 | 
				
			||||||
					"Text":"数量"
 | 
					 | 
				
			||||||
				}
 | 
					 | 
				
			||||||
			]
 | 
					 | 
				
			||||||
		},
 | 
					 | 
				
			||||||
		"CrossTab":{
 | 
					 | 
				
			||||||
			"PercentFormat":"0.##%",
 | 
					 | 
				
			||||||
			"HCrossFields":"药品名称",
 | 
					 | 
				
			||||||
			"VCrossFields":"手术间",
 | 
					 | 
				
			||||||
			"ListCols":4,
 | 
					 | 
				
			||||||
			"TotalCols":3
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
	},
 | 
					 | 
				
			||||||
	"Parameter":[
 | 
					 | 
				
			||||||
		{
 | 
					 | 
				
			||||||
			"Name":"startDate",
 | 
					 | 
				
			||||||
			"DataType":"DateTime",
 | 
					 | 
				
			||||||
			"Format":"yyyy-MM-dd hh:mm:ss",
 | 
					 | 
				
			||||||
			"Value":"2023/1/1"
 | 
					 | 
				
			||||||
		},
 | 
					 | 
				
			||||||
		{
 | 
					 | 
				
			||||||
			"Name":"endDate",
 | 
					 | 
				
			||||||
			"DataType":"DateTime",
 | 
					 | 
				
			||||||
			"Format":"yyyy-MM-dd hh:mm:ss",
 | 
					 | 
				
			||||||
			"Value":"2023/4/28 23:59:59"
 | 
					 | 
				
			||||||
		},
 | 
					 | 
				
			||||||
		{
 | 
					 | 
				
			||||||
			"Name":"machine_id",
 | 
					 | 
				
			||||||
			"Value":"DM1"
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
	],
 | 
					 | 
				
			||||||
	"ReportHeader":[
 | 
					 | 
				
			||||||
		{
 | 
					 | 
				
			||||||
			"Name":"ReportHeader1",
 | 
					 | 
				
			||||||
			"Height":1.19063,
 | 
					 | 
				
			||||||
			"Control":[
 | 
					 | 
				
			||||||
				{
 | 
					 | 
				
			||||||
					"Type":"MemoBox",
 | 
					 | 
				
			||||||
					"Name":"MemoBox2",
 | 
					 | 
				
			||||||
					"Anchor":"[Left|Top|Right|Bottom]",
 | 
					 | 
				
			||||||
					"Dock":"Fill",
 | 
					 | 
				
			||||||
					"Center":"Both",
 | 
					 | 
				
			||||||
					"Border":{
 | 
					 | 
				
			||||||
						"Styles":"[DrawLeft|DrawTop|DrawRight]"
 | 
					 | 
				
			||||||
					},
 | 
					 | 
				
			||||||
					"Font":{
 | 
					 | 
				
			||||||
						"Name":"宋体",
 | 
					 | 
				
			||||||
						"Size":217500,
 | 
					 | 
				
			||||||
						"Bold":true,
 | 
					 | 
				
			||||||
						"Charset":134
 | 
					 | 
				
			||||||
					},
 | 
					 | 
				
			||||||
					"TextAlign":"MiddleCenter",
 | 
					 | 
				
			||||||
					"Text":"[#时间#]麻醉科毒麻药品请领登记表"
 | 
					 | 
				
			||||||
				}
 | 
					 | 
				
			||||||
			],
 | 
					 | 
				
			||||||
			"RepeatOnPage":true
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
	]
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
| 
						 | 
					@ -1,275 +0,0 @@
 | 
				
			||||||
{
 | 
					 | 
				
			||||||
	"Version":"6.8.1.1",
 | 
					 | 
				
			||||||
	"Font":{
 | 
					 | 
				
			||||||
		"Name":"宋体",
 | 
					 | 
				
			||||||
		"Size":105000,
 | 
					 | 
				
			||||||
		"Weight":400,
 | 
					 | 
				
			||||||
		"Charset":134
 | 
					 | 
				
			||||||
	},
 | 
					 | 
				
			||||||
	"Printer":{
 | 
					 | 
				
			||||||
		"Oriention":"Landscape",
 | 
					 | 
				
			||||||
		"LeftMargin":1,
 | 
					 | 
				
			||||||
		"TopMargin":1.42875,
 | 
					 | 
				
			||||||
		"RightMargin":1,
 | 
					 | 
				
			||||||
		"BottomMargin":1.8
 | 
					 | 
				
			||||||
	},
 | 
					 | 
				
			||||||
	"DetailGrid":{
 | 
					 | 
				
			||||||
		"CenterView":true,
 | 
					 | 
				
			||||||
		"IsCrossTab":true,
 | 
					 | 
				
			||||||
		"FixCols":2,
 | 
					 | 
				
			||||||
		"AppendBlankRow":true,
 | 
					 | 
				
			||||||
		"Recordset":{
 | 
					 | 
				
			||||||
			"Field":[
 | 
					 | 
				
			||||||
				{
 | 
					 | 
				
			||||||
					"Name":"日期",
 | 
					 | 
				
			||||||
					"Type":"DateTime",
 | 
					 | 
				
			||||||
					"Format":"yyyy年MM月dd日",
 | 
					 | 
				
			||||||
					"DBFieldName":"Ddate"
 | 
					 | 
				
			||||||
				},
 | 
					 | 
				
			||||||
				{
 | 
					 | 
				
			||||||
					"Name":"药品名称",
 | 
					 | 
				
			||||||
					"DBFieldName":"DrugName"
 | 
					 | 
				
			||||||
				},
 | 
					 | 
				
			||||||
				{
 | 
					 | 
				
			||||||
					"Name":"DrugId"
 | 
					 | 
				
			||||||
				},
 | 
					 | 
				
			||||||
				{
 | 
					 | 
				
			||||||
					"Name":"时间",
 | 
					 | 
				
			||||||
					"DBFieldName":"TDateTime"
 | 
					 | 
				
			||||||
				},
 | 
					 | 
				
			||||||
				{
 | 
					 | 
				
			||||||
					"Name":"实物",
 | 
					 | 
				
			||||||
					"DBFieldName":"Quantity"
 | 
					 | 
				
			||||||
				},
 | 
					 | 
				
			||||||
				{
 | 
					 | 
				
			||||||
					"Name":"处方",
 | 
					 | 
				
			||||||
					"DBFieldName":"OrderQuantity"
 | 
					 | 
				
			||||||
				},
 | 
					 | 
				
			||||||
				{
 | 
					 | 
				
			||||||
					"Name":"备注",
 | 
					 | 
				
			||||||
					"DBFieldName":"Remarks"
 | 
					 | 
				
			||||||
				},
 | 
					 | 
				
			||||||
				{
 | 
					 | 
				
			||||||
					"Name":"交班人",
 | 
					 | 
				
			||||||
					"DBFieldName":"FromUser"
 | 
					 | 
				
			||||||
				},
 | 
					 | 
				
			||||||
				{
 | 
					 | 
				
			||||||
					"Name":"接班人",
 | 
					 | 
				
			||||||
					"DBFieldName":"ToUser"
 | 
					 | 
				
			||||||
				},
 | 
					 | 
				
			||||||
				{
 | 
					 | 
				
			||||||
					"Name":"规格",
 | 
					 | 
				
			||||||
					"DBFieldName":"Spec"
 | 
					 | 
				
			||||||
				},
 | 
					 | 
				
			||||||
				{
 | 
					 | 
				
			||||||
					"Name":"基数",
 | 
					 | 
				
			||||||
					"DBFieldName":"BaseQuantity"
 | 
					 | 
				
			||||||
				}
 | 
					 | 
				
			||||||
			]
 | 
					 | 
				
			||||||
		},
 | 
					 | 
				
			||||||
		"Column":[
 | 
					 | 
				
			||||||
			{
 | 
					 | 
				
			||||||
				"Name":"日期"
 | 
					 | 
				
			||||||
			},
 | 
					 | 
				
			||||||
			{
 | 
					 | 
				
			||||||
				"Name":"时间"
 | 
					 | 
				
			||||||
			},
 | 
					 | 
				
			||||||
			{
 | 
					 | 
				
			||||||
				"Name":"实物"
 | 
					 | 
				
			||||||
			},
 | 
					 | 
				
			||||||
			{
 | 
					 | 
				
			||||||
				"Name":"处方"
 | 
					 | 
				
			||||||
			},
 | 
					 | 
				
			||||||
			{
 | 
					 | 
				
			||||||
				"Name":"备注"
 | 
					 | 
				
			||||||
			},
 | 
					 | 
				
			||||||
			{
 | 
					 | 
				
			||||||
				"Name":"交班人"
 | 
					 | 
				
			||||||
			},
 | 
					 | 
				
			||||||
			{
 | 
					 | 
				
			||||||
				"Name":"接班人"
 | 
					 | 
				
			||||||
			}
 | 
					 | 
				
			||||||
		],
 | 
					 | 
				
			||||||
		"ColumnContent":{
 | 
					 | 
				
			||||||
			"Height":0.79375,
 | 
					 | 
				
			||||||
			"ColumnContentCell":[
 | 
					 | 
				
			||||||
				{
 | 
					 | 
				
			||||||
					"Column":"日期",
 | 
					 | 
				
			||||||
					"TextAlign":"MiddleCenter",
 | 
					 | 
				
			||||||
					"DataField":"日期"
 | 
					 | 
				
			||||||
				},
 | 
					 | 
				
			||||||
				{
 | 
					 | 
				
			||||||
					"Column":"时间",
 | 
					 | 
				
			||||||
					"TextAlign":"MiddleCenter",
 | 
					 | 
				
			||||||
					"DataField":"时间"
 | 
					 | 
				
			||||||
				},
 | 
					 | 
				
			||||||
				{
 | 
					 | 
				
			||||||
					"Column":"实物",
 | 
					 | 
				
			||||||
					"TextAlign":"MiddleCenter",
 | 
					 | 
				
			||||||
					"DataField":"实物"
 | 
					 | 
				
			||||||
				},
 | 
					 | 
				
			||||||
				{
 | 
					 | 
				
			||||||
					"Column":"处方",
 | 
					 | 
				
			||||||
					"TextAlign":"MiddleCenter",
 | 
					 | 
				
			||||||
					"DataField":"处方"
 | 
					 | 
				
			||||||
				},
 | 
					 | 
				
			||||||
				{
 | 
					 | 
				
			||||||
					"Column":"备注",
 | 
					 | 
				
			||||||
					"TextAlign":"MiddleCenter",
 | 
					 | 
				
			||||||
					"DataField":"备注"
 | 
					 | 
				
			||||||
				},
 | 
					 | 
				
			||||||
				{
 | 
					 | 
				
			||||||
					"Column":"交班人",
 | 
					 | 
				
			||||||
					"TextAlign":"MiddleCenter",
 | 
					 | 
				
			||||||
					"DataField":"交班人"
 | 
					 | 
				
			||||||
				},
 | 
					 | 
				
			||||||
				{
 | 
					 | 
				
			||||||
					"Column":"接班人",
 | 
					 | 
				
			||||||
					"TextAlign":"MiddleCenter",
 | 
					 | 
				
			||||||
					"DataField":"接班人"
 | 
					 | 
				
			||||||
				}
 | 
					 | 
				
			||||||
			]
 | 
					 | 
				
			||||||
		},
 | 
					 | 
				
			||||||
		"ColumnTitle":{
 | 
					 | 
				
			||||||
			"Height":1.5875,
 | 
					 | 
				
			||||||
			"RepeatStyle":"OnPage",
 | 
					 | 
				
			||||||
			"ColumnTitleCell":[
 | 
					 | 
				
			||||||
				{
 | 
					 | 
				
			||||||
					"GroupTitle":true,
 | 
					 | 
				
			||||||
					"Name":"药品名称",
 | 
					 | 
				
			||||||
					"ColumnTitleCell":[
 | 
					 | 
				
			||||||
						{
 | 
					 | 
				
			||||||
							"GroupTitle":true,
 | 
					 | 
				
			||||||
							"Name":"药品规格",
 | 
					 | 
				
			||||||
							"ColumnTitleCell":[
 | 
					 | 
				
			||||||
								{
 | 
					 | 
				
			||||||
									"GroupTitle":true,
 | 
					 | 
				
			||||||
									"Name":"固定基数",
 | 
					 | 
				
			||||||
									"ColumnTitleCell":[
 | 
					 | 
				
			||||||
										{
 | 
					 | 
				
			||||||
											"GroupTitle":false,
 | 
					 | 
				
			||||||
											"Column":"日期",
 | 
					 | 
				
			||||||
											"TextAlign":"MiddleCenter",
 | 
					 | 
				
			||||||
											"Text":"日期"
 | 
					 | 
				
			||||||
										},
 | 
					 | 
				
			||||||
										{
 | 
					 | 
				
			||||||
											"GroupTitle":false,
 | 
					 | 
				
			||||||
											"Column":"时间",
 | 
					 | 
				
			||||||
											"TextAlign":"MiddleCenter",
 | 
					 | 
				
			||||||
											"Text":"时间"
 | 
					 | 
				
			||||||
										}
 | 
					 | 
				
			||||||
									],
 | 
					 | 
				
			||||||
									"TextAlign":"MiddleCenter",
 | 
					 | 
				
			||||||
									"Text":"固定基数"
 | 
					 | 
				
			||||||
								}
 | 
					 | 
				
			||||||
							],
 | 
					 | 
				
			||||||
							"TextAlign":"MiddleCenter",
 | 
					 | 
				
			||||||
							"Text":"药品规格"
 | 
					 | 
				
			||||||
						}
 | 
					 | 
				
			||||||
					],
 | 
					 | 
				
			||||||
					"TextAlign":"MiddleCenter",
 | 
					 | 
				
			||||||
					"Text":"药品名称"
 | 
					 | 
				
			||||||
				},
 | 
					 | 
				
			||||||
				{
 | 
					 | 
				
			||||||
					"GroupTitle":true,
 | 
					 | 
				
			||||||
					"Name":"绑定的药名",
 | 
					 | 
				
			||||||
					"ColumnTitleCell":[
 | 
					 | 
				
			||||||
						{
 | 
					 | 
				
			||||||
							"GroupTitle":true,
 | 
					 | 
				
			||||||
							"Name":"规格",
 | 
					 | 
				
			||||||
							"ColumnTitleCell":[
 | 
					 | 
				
			||||||
								{
 | 
					 | 
				
			||||||
									"GroupTitle":true,
 | 
					 | 
				
			||||||
									"Name":"基数",
 | 
					 | 
				
			||||||
									"ColumnTitleCell":[
 | 
					 | 
				
			||||||
										{
 | 
					 | 
				
			||||||
											"GroupTitle":false,
 | 
					 | 
				
			||||||
											"Column":"实物",
 | 
					 | 
				
			||||||
											"TextAlign":"MiddleCenter",
 | 
					 | 
				
			||||||
											"Text":"实物"
 | 
					 | 
				
			||||||
										},
 | 
					 | 
				
			||||||
										{
 | 
					 | 
				
			||||||
											"GroupTitle":false,
 | 
					 | 
				
			||||||
											"Column":"处方",
 | 
					 | 
				
			||||||
											"TextAlign":"MiddleCenter",
 | 
					 | 
				
			||||||
											"Text":"处方"
 | 
					 | 
				
			||||||
										}
 | 
					 | 
				
			||||||
									],
 | 
					 | 
				
			||||||
									"TextAlign":"MiddleCenter",
 | 
					 | 
				
			||||||
									"Text":"[#规格#]"
 | 
					 | 
				
			||||||
								}
 | 
					 | 
				
			||||||
							],
 | 
					 | 
				
			||||||
							"TextAlign":"MiddleCenter",
 | 
					 | 
				
			||||||
							"Text":"[#规格#]"
 | 
					 | 
				
			||||||
						}
 | 
					 | 
				
			||||||
					],
 | 
					 | 
				
			||||||
					"TextAlign":"MiddleCenter",
 | 
					 | 
				
			||||||
					"Text":"[#药品名称#]"
 | 
					 | 
				
			||||||
				},
 | 
					 | 
				
			||||||
				{
 | 
					 | 
				
			||||||
					"GroupTitle":false,
 | 
					 | 
				
			||||||
					"Column":"备注",
 | 
					 | 
				
			||||||
					"TextAlign":"MiddleCenter",
 | 
					 | 
				
			||||||
					"Text":"备注"
 | 
					 | 
				
			||||||
				},
 | 
					 | 
				
			||||||
				{
 | 
					 | 
				
			||||||
					"GroupTitle":false,
 | 
					 | 
				
			||||||
					"Column":"交班人",
 | 
					 | 
				
			||||||
					"TextAlign":"MiddleCenter",
 | 
					 | 
				
			||||||
					"Text":"交班人"
 | 
					 | 
				
			||||||
				},
 | 
					 | 
				
			||||||
				{
 | 
					 | 
				
			||||||
					"GroupTitle":false,
 | 
					 | 
				
			||||||
					"Column":"接班人",
 | 
					 | 
				
			||||||
					"TextAlign":"MiddleCenter",
 | 
					 | 
				
			||||||
					"Text":"接班人"
 | 
					 | 
				
			||||||
				}
 | 
					 | 
				
			||||||
			]
 | 
					 | 
				
			||||||
		},
 | 
					 | 
				
			||||||
		"CrossTab":{
 | 
					 | 
				
			||||||
			"PercentFormat":"0.##%",
 | 
					 | 
				
			||||||
			"GroupAutoSum":false,
 | 
					 | 
				
			||||||
			"HCrossFields":"DrugId",
 | 
					 | 
				
			||||||
			"VCrossFields":"日期;时间",
 | 
					 | 
				
			||||||
			"ListCols":2,
 | 
					 | 
				
			||||||
			"TotalCols":3
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
	},
 | 
					 | 
				
			||||||
	"Parameter":[
 | 
					 | 
				
			||||||
		{
 | 
					 | 
				
			||||||
			"Name":"machine_id"
 | 
					 | 
				
			||||||
		},
 | 
					 | 
				
			||||||
		{
 | 
					 | 
				
			||||||
			"Name":"startDate",
 | 
					 | 
				
			||||||
			"DataType":"DateTime"
 | 
					 | 
				
			||||||
		},
 | 
					 | 
				
			||||||
		{
 | 
					 | 
				
			||||||
			"Name":"endDate",
 | 
					 | 
				
			||||||
			"DataType":"DateTime"
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
	],
 | 
					 | 
				
			||||||
	"ReportHeader":[
 | 
					 | 
				
			||||||
		{
 | 
					 | 
				
			||||||
			"Name":"ReportHeader1",
 | 
					 | 
				
			||||||
			"Height":1.00542,
 | 
					 | 
				
			||||||
			"Control":[
 | 
					 | 
				
			||||||
				{
 | 
					 | 
				
			||||||
					"Type":"MemoBox",
 | 
					 | 
				
			||||||
					"Name":"MemoBox1",
 | 
					 | 
				
			||||||
					"Dock":"Fill",
 | 
					 | 
				
			||||||
					"Center":"Both",
 | 
					 | 
				
			||||||
					"Font":{
 | 
					 | 
				
			||||||
						"Name":"宋体",
 | 
					 | 
				
			||||||
						"Size":217500,
 | 
					 | 
				
			||||||
						"Bold":true,
 | 
					 | 
				
			||||||
						"Charset":134
 | 
					 | 
				
			||||||
					},
 | 
					 | 
				
			||||||
					"ShrinkFontToFit":true,
 | 
					 | 
				
			||||||
					"TextAlign":"MiddleCenter",
 | 
					 | 
				
			||||||
					"Text":"中部战区总医院麻醉科特殊管理药品交接班记录"
 | 
					 | 
				
			||||||
				}
 | 
					 | 
				
			||||||
			],
 | 
					 | 
				
			||||||
			"RepeatOnPage":true
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
	]
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
| 
						 | 
					@ -1,374 +0,0 @@
 | 
				
			||||||
{
 | 
					 | 
				
			||||||
	"Version":"6.8.1.1",
 | 
					 | 
				
			||||||
	"Font":{
 | 
					 | 
				
			||||||
		"Name":"宋体",
 | 
					 | 
				
			||||||
		"Size":105000,
 | 
					 | 
				
			||||||
		"Weight":400,
 | 
					 | 
				
			||||||
		"Charset":134
 | 
					 | 
				
			||||||
	},
 | 
					 | 
				
			||||||
	"Printer":{
 | 
					 | 
				
			||||||
		"Oriention":"Landscape",
 | 
					 | 
				
			||||||
		"LeftMargin":1,
 | 
					 | 
				
			||||||
		"TopMargin":1.42875,
 | 
					 | 
				
			||||||
		"RightMargin":1,
 | 
					 | 
				
			||||||
		"BottomMargin":1.8
 | 
					 | 
				
			||||||
	},
 | 
					 | 
				
			||||||
	"DetailGrid":{
 | 
					 | 
				
			||||||
		"CenterView":true,
 | 
					 | 
				
			||||||
		"IsCrossTab":true,
 | 
					 | 
				
			||||||
		"FixCols":2,
 | 
					 | 
				
			||||||
		"AppendBlankRow":true,
 | 
					 | 
				
			||||||
		"Recordset":{
 | 
					 | 
				
			||||||
			"Field":[
 | 
					 | 
				
			||||||
				{
 | 
					 | 
				
			||||||
					"Name":"日期",
 | 
					 | 
				
			||||||
					"Type":"DateTime",
 | 
					 | 
				
			||||||
					"Format":"yyyy年MM月dd日",
 | 
					 | 
				
			||||||
					"DBFieldName":"portdate"
 | 
					 | 
				
			||||||
				},
 | 
					 | 
				
			||||||
				{
 | 
					 | 
				
			||||||
					"Name":"手术间",
 | 
					 | 
				
			||||||
					"DBFieldName":"ShouShuJian"
 | 
					 | 
				
			||||||
				},
 | 
					 | 
				
			||||||
				{
 | 
					 | 
				
			||||||
					"Name":"主麻",
 | 
					 | 
				
			||||||
					"DBFieldName":"ZhuMa"
 | 
					 | 
				
			||||||
				},
 | 
					 | 
				
			||||||
				{
 | 
					 | 
				
			||||||
					"Name":"副麻",
 | 
					 | 
				
			||||||
					"DBFieldName":"FuMa"
 | 
					 | 
				
			||||||
				},
 | 
					 | 
				
			||||||
				{
 | 
					 | 
				
			||||||
					"Name":"ID号",
 | 
					 | 
				
			||||||
					"DBFieldName":"IDNumber"
 | 
					 | 
				
			||||||
				},
 | 
					 | 
				
			||||||
				{
 | 
					 | 
				
			||||||
					"Name":"姓名",
 | 
					 | 
				
			||||||
					"DBFieldName":"PName"
 | 
					 | 
				
			||||||
				},
 | 
					 | 
				
			||||||
				{
 | 
					 | 
				
			||||||
					"Name":"诊断",
 | 
					 | 
				
			||||||
					"DBFieldName":"Diagnose"
 | 
					 | 
				
			||||||
				},
 | 
					 | 
				
			||||||
				{
 | 
					 | 
				
			||||||
					"Name":"药品名称",
 | 
					 | 
				
			||||||
					"DBFieldName":"DrugName"
 | 
					 | 
				
			||||||
				},
 | 
					 | 
				
			||||||
				{
 | 
					 | 
				
			||||||
					"Name":"批号",
 | 
					 | 
				
			||||||
					"DBFieldName":"ManuNo"
 | 
					 | 
				
			||||||
				},
 | 
					 | 
				
			||||||
				{
 | 
					 | 
				
			||||||
					"Name":"用量",
 | 
					 | 
				
			||||||
					"DBFieldName":"UsageDosage"
 | 
					 | 
				
			||||||
				},
 | 
					 | 
				
			||||||
				{
 | 
					 | 
				
			||||||
					"Name":"残液量",
 | 
					 | 
				
			||||||
					"DBFieldName":"CanYeLiang"
 | 
					 | 
				
			||||||
				},
 | 
					 | 
				
			||||||
				{
 | 
					 | 
				
			||||||
					"Name":"残液处置方式",
 | 
					 | 
				
			||||||
					"DBFieldName":"CanYeChuZhi"
 | 
					 | 
				
			||||||
				},
 | 
					 | 
				
			||||||
				{
 | 
					 | 
				
			||||||
					"Name":"使用人签名",
 | 
					 | 
				
			||||||
					"DBFieldName":"UseUserName"
 | 
					 | 
				
			||||||
				},
 | 
					 | 
				
			||||||
				{
 | 
					 | 
				
			||||||
					"Name":"复核人签名",
 | 
					 | 
				
			||||||
					"DBFieldName":"CheckUserName"
 | 
					 | 
				
			||||||
				},
 | 
					 | 
				
			||||||
				{
 | 
					 | 
				
			||||||
					"Name":"DrugId"
 | 
					 | 
				
			||||||
				}
 | 
					 | 
				
			||||||
			]
 | 
					 | 
				
			||||||
		},
 | 
					 | 
				
			||||||
		"Column":[
 | 
					 | 
				
			||||||
			{
 | 
					 | 
				
			||||||
				"Name":"手术间",
 | 
					 | 
				
			||||||
				"Width":1.56104
 | 
					 | 
				
			||||||
			},
 | 
					 | 
				
			||||||
			{
 | 
					 | 
				
			||||||
				"Name":"主麻",
 | 
					 | 
				
			||||||
				"Width":1.82563
 | 
					 | 
				
			||||||
			},
 | 
					 | 
				
			||||||
			{
 | 
					 | 
				
			||||||
				"Name":"副麻",
 | 
					 | 
				
			||||||
				"Width":1.79917
 | 
					 | 
				
			||||||
			},
 | 
					 | 
				
			||||||
			{
 | 
					 | 
				
			||||||
				"Name":"ID号"
 | 
					 | 
				
			||||||
			},
 | 
					 | 
				
			||||||
			{
 | 
					 | 
				
			||||||
				"Name":"姓名",
 | 
					 | 
				
			||||||
				"Width":1.79917
 | 
					 | 
				
			||||||
			},
 | 
					 | 
				
			||||||
			{
 | 
					 | 
				
			||||||
				"Name":"诊断",
 | 
					 | 
				
			||||||
				"Width":4.39208
 | 
					 | 
				
			||||||
			},
 | 
					 | 
				
			||||||
			{
 | 
					 | 
				
			||||||
				"Name":"批号"
 | 
					 | 
				
			||||||
			},
 | 
					 | 
				
			||||||
			{
 | 
					 | 
				
			||||||
				"Name":"用量",
 | 
					 | 
				
			||||||
				"Width":2.2225
 | 
					 | 
				
			||||||
			},
 | 
					 | 
				
			||||||
			{
 | 
					 | 
				
			||||||
				"Name":"残液量",
 | 
					 | 
				
			||||||
				"Width":2.01083
 | 
					 | 
				
			||||||
			},
 | 
					 | 
				
			||||||
			{
 | 
					 | 
				
			||||||
				"Name":"残液处置方式",
 | 
					 | 
				
			||||||
				"Width":0.978958
 | 
					 | 
				
			||||||
			},
 | 
					 | 
				
			||||||
			{
 | 
					 | 
				
			||||||
				"Name":"使用人签名",
 | 
					 | 
				
			||||||
				"Width":1.61396
 | 
					 | 
				
			||||||
			},
 | 
					 | 
				
			||||||
			{
 | 
					 | 
				
			||||||
				"Name":"复核人签名",
 | 
					 | 
				
			||||||
				"Width":1.5875
 | 
					 | 
				
			||||||
			}
 | 
					 | 
				
			||||||
		],
 | 
					 | 
				
			||||||
		"ColumnContent":{
 | 
					 | 
				
			||||||
			"Height":0.79375,
 | 
					 | 
				
			||||||
			"ColumnContentCell":[
 | 
					 | 
				
			||||||
				{
 | 
					 | 
				
			||||||
					"Column":"手术间",
 | 
					 | 
				
			||||||
					"TextAlign":"MiddleCenter",
 | 
					 | 
				
			||||||
					"DataField":"手术间"
 | 
					 | 
				
			||||||
				},
 | 
					 | 
				
			||||||
				{
 | 
					 | 
				
			||||||
					"Column":"主麻",
 | 
					 | 
				
			||||||
					"TextAlign":"MiddleCenter",
 | 
					 | 
				
			||||||
					"DataField":"主麻"
 | 
					 | 
				
			||||||
				},
 | 
					 | 
				
			||||||
				{
 | 
					 | 
				
			||||||
					"Column":"副麻",
 | 
					 | 
				
			||||||
					"TextAlign":"MiddleCenter",
 | 
					 | 
				
			||||||
					"DataField":"副麻"
 | 
					 | 
				
			||||||
				},
 | 
					 | 
				
			||||||
				{
 | 
					 | 
				
			||||||
					"Column":"ID号",
 | 
					 | 
				
			||||||
					"TextAlign":"MiddleCenter",
 | 
					 | 
				
			||||||
					"DataField":"ID号"
 | 
					 | 
				
			||||||
				},
 | 
					 | 
				
			||||||
				{
 | 
					 | 
				
			||||||
					"Column":"姓名",
 | 
					 | 
				
			||||||
					"TextAlign":"MiddleCenter",
 | 
					 | 
				
			||||||
					"DataField":"姓名"
 | 
					 | 
				
			||||||
				},
 | 
					 | 
				
			||||||
				{
 | 
					 | 
				
			||||||
					"Column":"诊断",
 | 
					 | 
				
			||||||
					"TextAlign":"MiddleCenter",
 | 
					 | 
				
			||||||
					"DataField":"诊断"
 | 
					 | 
				
			||||||
				},
 | 
					 | 
				
			||||||
				{
 | 
					 | 
				
			||||||
					"Column":"批号",
 | 
					 | 
				
			||||||
					"TextAlign":"MiddleCenter",
 | 
					 | 
				
			||||||
					"DataField":"批号"
 | 
					 | 
				
			||||||
				},
 | 
					 | 
				
			||||||
				{
 | 
					 | 
				
			||||||
					"Column":"用量",
 | 
					 | 
				
			||||||
					"TextAlign":"MiddleCenter",
 | 
					 | 
				
			||||||
					"DataField":"用量"
 | 
					 | 
				
			||||||
				},
 | 
					 | 
				
			||||||
				{
 | 
					 | 
				
			||||||
					"Column":"残液量",
 | 
					 | 
				
			||||||
					"TextAlign":"MiddleCenter",
 | 
					 | 
				
			||||||
					"DataField":"残液量"
 | 
					 | 
				
			||||||
				},
 | 
					 | 
				
			||||||
				{
 | 
					 | 
				
			||||||
					"Column":"残液处置方式",
 | 
					 | 
				
			||||||
					"TextAlign":"MiddleCenter",
 | 
					 | 
				
			||||||
					"DataField":"残液处置方式"
 | 
					 | 
				
			||||||
				},
 | 
					 | 
				
			||||||
				{
 | 
					 | 
				
			||||||
					"Column":"使用人签名",
 | 
					 | 
				
			||||||
					"TextAlign":"MiddleCenter",
 | 
					 | 
				
			||||||
					"DataField":"使用人签名"
 | 
					 | 
				
			||||||
				},
 | 
					 | 
				
			||||||
				{
 | 
					 | 
				
			||||||
					"Column":"复核人签名",
 | 
					 | 
				
			||||||
					"TextAlign":"MiddleCenter",
 | 
					 | 
				
			||||||
					"DataField":"复核人签名"
 | 
					 | 
				
			||||||
				}
 | 
					 | 
				
			||||||
			]
 | 
					 | 
				
			||||||
		},
 | 
					 | 
				
			||||||
		"ColumnTitle":{
 | 
					 | 
				
			||||||
			"Height":1.37583,
 | 
					 | 
				
			||||||
			"RepeatStyle":"OnPage",
 | 
					 | 
				
			||||||
			"ColumnTitleCell":[
 | 
					 | 
				
			||||||
				{
 | 
					 | 
				
			||||||
					"GroupTitle":false,
 | 
					 | 
				
			||||||
					"Column":"手术间",
 | 
					 | 
				
			||||||
					"TextAlign":"MiddleCenter",
 | 
					 | 
				
			||||||
					"Text":"手\r\n术\r\n间"
 | 
					 | 
				
			||||||
				},
 | 
					 | 
				
			||||||
				{
 | 
					 | 
				
			||||||
					"GroupTitle":true,
 | 
					 | 
				
			||||||
					"Name":"麻醉医师",
 | 
					 | 
				
			||||||
					"ColumnTitleCell":[
 | 
					 | 
				
			||||||
						{
 | 
					 | 
				
			||||||
							"GroupTitle":false,
 | 
					 | 
				
			||||||
							"Column":"主麻",
 | 
					 | 
				
			||||||
							"TextAlign":"MiddleCenter",
 | 
					 | 
				
			||||||
							"Text":"主麻"
 | 
					 | 
				
			||||||
						},
 | 
					 | 
				
			||||||
						{
 | 
					 | 
				
			||||||
							"GroupTitle":false,
 | 
					 | 
				
			||||||
							"Column":"副麻",
 | 
					 | 
				
			||||||
							"TextAlign":"MiddleCenter",
 | 
					 | 
				
			||||||
							"Text":"副麻"
 | 
					 | 
				
			||||||
						}
 | 
					 | 
				
			||||||
					],
 | 
					 | 
				
			||||||
					"TextAlign":"MiddleCenter",
 | 
					 | 
				
			||||||
					"Text":"麻醉医师"
 | 
					 | 
				
			||||||
				},
 | 
					 | 
				
			||||||
				{
 | 
					 | 
				
			||||||
					"GroupTitle":true,
 | 
					 | 
				
			||||||
					"Name":"患者基本信息",
 | 
					 | 
				
			||||||
					"ColumnTitleCell":[
 | 
					 | 
				
			||||||
						{
 | 
					 | 
				
			||||||
							"GroupTitle":false,
 | 
					 | 
				
			||||||
							"Column":"ID号",
 | 
					 | 
				
			||||||
							"TextAlign":"MiddleCenter",
 | 
					 | 
				
			||||||
							"Text":"ID号"
 | 
					 | 
				
			||||||
						},
 | 
					 | 
				
			||||||
						{
 | 
					 | 
				
			||||||
							"GroupTitle":false,
 | 
					 | 
				
			||||||
							"Column":"姓名",
 | 
					 | 
				
			||||||
							"TextAlign":"MiddleCenter",
 | 
					 | 
				
			||||||
							"Text":"姓名"
 | 
					 | 
				
			||||||
						},
 | 
					 | 
				
			||||||
						{
 | 
					 | 
				
			||||||
							"GroupTitle":false,
 | 
					 | 
				
			||||||
							"Column":"诊断",
 | 
					 | 
				
			||||||
							"TextAlign":"MiddleCenter",
 | 
					 | 
				
			||||||
							"Text":"诊断"
 | 
					 | 
				
			||||||
						}
 | 
					 | 
				
			||||||
					],
 | 
					 | 
				
			||||||
					"TextAlign":"MiddleCenter",
 | 
					 | 
				
			||||||
					"Text":"患者基本信息"
 | 
					 | 
				
			||||||
				},
 | 
					 | 
				
			||||||
				{
 | 
					 | 
				
			||||||
					"GroupTitle":true,
 | 
					 | 
				
			||||||
					"Name":"药品名称",
 | 
					 | 
				
			||||||
					"ColumnTitleCell":[
 | 
					 | 
				
			||||||
						{
 | 
					 | 
				
			||||||
							"GroupTitle":false,
 | 
					 | 
				
			||||||
							"Column":"批号",
 | 
					 | 
				
			||||||
							"TextAlign":"MiddleCenter",
 | 
					 | 
				
			||||||
							"Text":"批号"
 | 
					 | 
				
			||||||
						},
 | 
					 | 
				
			||||||
						{
 | 
					 | 
				
			||||||
							"GroupTitle":false,
 | 
					 | 
				
			||||||
							"Column":"用量",
 | 
					 | 
				
			||||||
							"TextAlign":"MiddleCenter",
 | 
					 | 
				
			||||||
							"Text":"用量"
 | 
					 | 
				
			||||||
						},
 | 
					 | 
				
			||||||
						{
 | 
					 | 
				
			||||||
							"GroupTitle":false,
 | 
					 | 
				
			||||||
							"Column":"残液量",
 | 
					 | 
				
			||||||
							"TextAlign":"MiddleCenter",
 | 
					 | 
				
			||||||
							"Text":"残液量"
 | 
					 | 
				
			||||||
						}
 | 
					 | 
				
			||||||
					],
 | 
					 | 
				
			||||||
					"TextAlign":"MiddleCenter",
 | 
					 | 
				
			||||||
					"Text":"[#药品名称#]"
 | 
					 | 
				
			||||||
				},
 | 
					 | 
				
			||||||
				{
 | 
					 | 
				
			||||||
					"GroupTitle":false,
 | 
					 | 
				
			||||||
					"Column":"残液处置方式",
 | 
					 | 
				
			||||||
					"TextAlign":"MiddleCenter",
 | 
					 | 
				
			||||||
					"Text":"残液\r\n处置\r\n方式"
 | 
					 | 
				
			||||||
				},
 | 
					 | 
				
			||||||
				{
 | 
					 | 
				
			||||||
					"GroupTitle":false,
 | 
					 | 
				
			||||||
					"Column":"使用人签名",
 | 
					 | 
				
			||||||
					"TextAlign":"MiddleCenter",
 | 
					 | 
				
			||||||
					"Text":"使用人\r\n签名"
 | 
					 | 
				
			||||||
				},
 | 
					 | 
				
			||||||
				{
 | 
					 | 
				
			||||||
					"GroupTitle":false,
 | 
					 | 
				
			||||||
					"Column":"复核人签名",
 | 
					 | 
				
			||||||
					"TextAlign":"MiddleCenter",
 | 
					 | 
				
			||||||
					"Text":"复核人\r\n签名"
 | 
					 | 
				
			||||||
				}
 | 
					 | 
				
			||||||
			]
 | 
					 | 
				
			||||||
		},
 | 
					 | 
				
			||||||
		"CrossTab":{
 | 
					 | 
				
			||||||
			"PercentFormat":"0.##%",
 | 
					 | 
				
			||||||
			"GroupAutoSum":false,
 | 
					 | 
				
			||||||
			"HCrossFields":"DrugId",
 | 
					 | 
				
			||||||
			"VCrossFields":"ID号",
 | 
					 | 
				
			||||||
			"ListCols":6,
 | 
					 | 
				
			||||||
			"TotalCols":3,
 | 
					 | 
				
			||||||
			"TotalExcludeColumns":"残液处置方式;使用人签名;复核人签名"
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
	},
 | 
					 | 
				
			||||||
	"Parameter":[
 | 
					 | 
				
			||||||
		{
 | 
					 | 
				
			||||||
			"Name":"machine_id"
 | 
					 | 
				
			||||||
		},
 | 
					 | 
				
			||||||
		{
 | 
					 | 
				
			||||||
			"Name":"startDate",
 | 
					 | 
				
			||||||
			"DataType":"DateTime"
 | 
					 | 
				
			||||||
		},
 | 
					 | 
				
			||||||
		{
 | 
					 | 
				
			||||||
			"Name":"endDate",
 | 
					 | 
				
			||||||
			"DataType":"DateTime"
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
	],
 | 
					 | 
				
			||||||
	"ReportHeader":[
 | 
					 | 
				
			||||||
		{
 | 
					 | 
				
			||||||
			"Name":"ReportHeader1",
 | 
					 | 
				
			||||||
			"Height":3.81,
 | 
					 | 
				
			||||||
			"Control":[
 | 
					 | 
				
			||||||
				{
 | 
					 | 
				
			||||||
					"Type":"MemoBox",
 | 
					 | 
				
			||||||
					"Name":"MemoBox12",
 | 
					 | 
				
			||||||
					"Anchor":"[Right|Bottom]",
 | 
					 | 
				
			||||||
					"AlignColumnSide":"Right",
 | 
					 | 
				
			||||||
					"Left":19.4469,
 | 
					 | 
				
			||||||
					"Top":2.98979,
 | 
					 | 
				
			||||||
					"Width":3.46604,
 | 
					 | 
				
			||||||
					"Height":0.582083,
 | 
					 | 
				
			||||||
					"ShrinkFontToFit":true,
 | 
					 | 
				
			||||||
					"Text":"日期:[#日期#]"
 | 
					 | 
				
			||||||
				},
 | 
					 | 
				
			||||||
				{
 | 
					 | 
				
			||||||
					"Type":"MemoBox",
 | 
					 | 
				
			||||||
					"Name":"MemoBox1",
 | 
					 | 
				
			||||||
					"Center":"Both",
 | 
					 | 
				
			||||||
					"Left":2.93688,
 | 
					 | 
				
			||||||
					"Top":1.00542,
 | 
					 | 
				
			||||||
					"Width":21.8017,
 | 
					 | 
				
			||||||
					"Height":1.79917,
 | 
					 | 
				
			||||||
					"Font":{
 | 
					 | 
				
			||||||
						"Name":"宋体",
 | 
					 | 
				
			||||||
						"Size":217500,
 | 
					 | 
				
			||||||
						"Bold":true,
 | 
					 | 
				
			||||||
						"Charset":134
 | 
					 | 
				
			||||||
					},
 | 
					 | 
				
			||||||
					"ShrinkFontToFit":true,
 | 
					 | 
				
			||||||
					"TextAlign":"MiddleCenter",
 | 
					 | 
				
			||||||
					"Text":"中国人民解放军中部战区总医院手术患者麻醉药品使用登记本"
 | 
					 | 
				
			||||||
				},
 | 
					 | 
				
			||||||
				{
 | 
					 | 
				
			||||||
					"Type":"MemoBox",
 | 
					 | 
				
			||||||
					"Name":"MemoBox13",
 | 
					 | 
				
			||||||
					"Anchor":"[Right|Bottom]",
 | 
					 | 
				
			||||||
					"Left":23.2569,
 | 
					 | 
				
			||||||
					"Top":3.01625,
 | 
					 | 
				
			||||||
					"Width":3.01625,
 | 
					 | 
				
			||||||
					"Height":0.582083,
 | 
					 | 
				
			||||||
					"ShrinkFontToFit":true,
 | 
					 | 
				
			||||||
					"Text":"手术室:武昌院区"
 | 
					 | 
				
			||||||
				}
 | 
					 | 
				
			||||||
			],
 | 
					 | 
				
			||||||
			"RepeatOnPage":true
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
	]
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
| 
						 | 
					@ -31,6 +31,11 @@
 | 
				
			||||||
					"Name":"批号",
 | 
										"Name":"批号",
 | 
				
			||||||
					"DBFieldName":"manuNo"
 | 
										"DBFieldName":"manuNo"
 | 
				
			||||||
				},
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Name":"上次批次结存",
 | 
				
			||||||
 | 
										"Type":"Integer",
 | 
				
			||||||
 | 
										"DBFieldName":"beforeManuQuan"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
				{
 | 
									{
 | 
				
			||||||
					"Name":"入库数量",
 | 
										"Name":"入库数量",
 | 
				
			||||||
					"Type":"Integer",
 | 
										"Type":"Integer",
 | 
				
			||||||
| 
						 | 
					@ -85,6 +90,14 @@
 | 
				
			||||||
					"Format":"yy/M/d",
 | 
										"Format":"yy/M/d",
 | 
				
			||||||
					"DBFieldName":"effDate"
 | 
										"DBFieldName":"effDate"
 | 
				
			||||||
				},
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Name":"sign1",
 | 
				
			||||||
 | 
										"Type":"Binary"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Name":"sign2",
 | 
				
			||||||
 | 
										"Type":"Binary"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
				{
 | 
									{
 | 
				
			||||||
					"Name":"drugId"
 | 
										"Name":"drugId"
 | 
				
			||||||
				},
 | 
									},
 | 
				
			||||||
| 
						 | 
					@ -99,10 +112,6 @@
 | 
				
			||||||
				{
 | 
									{
 | 
				
			||||||
					"Name":"领用部门",
 | 
										"Name":"领用部门",
 | 
				
			||||||
					"DBFieldName":"receiveDept"
 | 
										"DBFieldName":"receiveDept"
 | 
				
			||||||
				},
 | 
					 | 
				
			||||||
				{
 | 
					 | 
				
			||||||
					"Name":"备注",
 | 
					 | 
				
			||||||
					"DBFieldName":"Remarks"
 | 
					 | 
				
			||||||
				}
 | 
									}
 | 
				
			||||||
			]
 | 
								]
 | 
				
			||||||
		},
 | 
							},
 | 
				
			||||||
| 
						 | 
					@ -116,7 +125,12 @@
 | 
				
			||||||
				"Width":2.19604
 | 
									"Width":2.19604
 | 
				
			||||||
			},
 | 
								},
 | 
				
			||||||
			{
 | 
								{
 | 
				
			||||||
				"Name":"供货单位"
 | 
									"Name":"批号",
 | 
				
			||||||
 | 
									"Width":3.99521
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									"Name":"有效期",
 | 
				
			||||||
 | 
									"Width":2.43417
 | 
				
			||||||
			},
 | 
								},
 | 
				
			||||||
			{
 | 
								{
 | 
				
			||||||
				"Name":"入库数量",
 | 
									"Name":"入库数量",
 | 
				
			||||||
| 
						 | 
					@ -127,18 +141,11 @@
 | 
				
			||||||
				"Width":1.79917
 | 
									"Width":1.79917
 | 
				
			||||||
			},
 | 
								},
 | 
				
			||||||
			{
 | 
								{
 | 
				
			||||||
				"Name":"结存数量"
 | 
									"Name":"Column4",
 | 
				
			||||||
 | 
									"Width":1.98438
 | 
				
			||||||
			},
 | 
								},
 | 
				
			||||||
			{
 | 
								{
 | 
				
			||||||
				"Name":"批号",
 | 
									"Name":"收/发药人",
 | 
				
			||||||
				"Width":3.99521
 | 
					 | 
				
			||||||
			},
 | 
					 | 
				
			||||||
			{
 | 
					 | 
				
			||||||
				"Name":"有效期",
 | 
					 | 
				
			||||||
				"Width":2.43417
 | 
					 | 
				
			||||||
			},
 | 
					 | 
				
			||||||
			{
 | 
					 | 
				
			||||||
				"Name":"接收(发药人)",
 | 
					 | 
				
			||||||
				"Width":2.80458
 | 
									"Width":2.80458
 | 
				
			||||||
			},
 | 
								},
 | 
				
			||||||
			{
 | 
								{
 | 
				
			||||||
| 
						 | 
					@ -146,7 +153,12 @@
 | 
				
			||||||
				"Width":2.80458
 | 
									"Width":2.80458
 | 
				
			||||||
			},
 | 
								},
 | 
				
			||||||
			{
 | 
								{
 | 
				
			||||||
				"Name":"备注"
 | 
									"Name":"Column2",
 | 
				
			||||||
 | 
									"Width":2.35479
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									"Name":"Column3",
 | 
				
			||||||
 | 
									"Width":2.38125
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
		],
 | 
							],
 | 
				
			||||||
		"ColumnContent":{
 | 
							"ColumnContent":{
 | 
				
			||||||
| 
						 | 
					@ -161,29 +173,8 @@
 | 
				
			||||||
				},
 | 
									},
 | 
				
			||||||
				{
 | 
									{
 | 
				
			||||||
					"Column":"凭证号",
 | 
										"Column":"凭证号",
 | 
				
			||||||
					"TextAlign":"MiddleCenter",
 | 
					 | 
				
			||||||
					"DataField":"凭证号"
 | 
										"DataField":"凭证号"
 | 
				
			||||||
				},
 | 
									},
 | 
				
			||||||
				{
 | 
					 | 
				
			||||||
					"Column":"供货单位",
 | 
					 | 
				
			||||||
					"TextAlign":"MiddleCenter",
 | 
					 | 
				
			||||||
					"DataField":"供应单位"
 | 
					 | 
				
			||||||
				},
 | 
					 | 
				
			||||||
				{
 | 
					 | 
				
			||||||
					"Column":"入库数量",
 | 
					 | 
				
			||||||
					"TextAlign":"MiddleCenter",
 | 
					 | 
				
			||||||
					"DataField":"入库数量"
 | 
					 | 
				
			||||||
				},
 | 
					 | 
				
			||||||
				{
 | 
					 | 
				
			||||||
					"Column":"出库数量",
 | 
					 | 
				
			||||||
					"TextAlign":"MiddleCenter",
 | 
					 | 
				
			||||||
					"DataField":"出库数量"
 | 
					 | 
				
			||||||
				},
 | 
					 | 
				
			||||||
				{
 | 
					 | 
				
			||||||
					"Column":"结存数量",
 | 
					 | 
				
			||||||
					"TextAlign":"MiddleCenter",
 | 
					 | 
				
			||||||
					"DataField":"批号结存"
 | 
					 | 
				
			||||||
				},
 | 
					 | 
				
			||||||
				{
 | 
									{
 | 
				
			||||||
					"Column":"批号",
 | 
										"Column":"批号",
 | 
				
			||||||
					"TextAlign":"MiddleCenter",
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
| 
						 | 
					@ -195,7 +186,22 @@
 | 
				
			||||||
					"DataField":"有效期"
 | 
										"DataField":"有效期"
 | 
				
			||||||
				},
 | 
									},
 | 
				
			||||||
				{
 | 
									{
 | 
				
			||||||
					"Column":"接收(发药人)",
 | 
										"Column":"入库数量",
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"DataField":"入库数量"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Column":"出库数量",
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"DataField":"出库数量"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Column":"Column4",
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"DataField":"总结存"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Column":"收/发药人",
 | 
				
			||||||
					"FreeCell":true,
 | 
										"FreeCell":true,
 | 
				
			||||||
					"Control":[
 | 
										"Control":[
 | 
				
			||||||
						{
 | 
											{
 | 
				
			||||||
| 
						 | 
					@ -221,9 +227,30 @@
 | 
				
			||||||
					]
 | 
										]
 | 
				
			||||||
				},
 | 
									},
 | 
				
			||||||
				{
 | 
									{
 | 
				
			||||||
					"Column":"备注",
 | 
										"Column":"Column2",
 | 
				
			||||||
 | 
										"FreeCell":true,
 | 
				
			||||||
 | 
										"Control":[
 | 
				
			||||||
 | 
											{
 | 
				
			||||||
 | 
												"Type":"FieldBox",
 | 
				
			||||||
 | 
												"Name":"FieldBox14",
 | 
				
			||||||
 | 
												"Dock":"Fill",
 | 
				
			||||||
							"TextAlign":"MiddleCenter",
 | 
												"TextAlign":"MiddleCenter",
 | 
				
			||||||
					"DataField":"备注"
 | 
												"DataField":"供应单位"
 | 
				
			||||||
 | 
											}
 | 
				
			||||||
 | 
										]
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Column":"Column3",
 | 
				
			||||||
 | 
										"FreeCell":true,
 | 
				
			||||||
 | 
										"Control":[
 | 
				
			||||||
 | 
											{
 | 
				
			||||||
 | 
												"Type":"FieldBox",
 | 
				
			||||||
 | 
												"Name":"FieldBox15",
 | 
				
			||||||
 | 
												"Dock":"Fill",
 | 
				
			||||||
 | 
												"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
												"DataField":"领用部门"
 | 
				
			||||||
 | 
											}
 | 
				
			||||||
 | 
										]
 | 
				
			||||||
				}
 | 
									}
 | 
				
			||||||
			]
 | 
								]
 | 
				
			||||||
		},
 | 
							},
 | 
				
			||||||
| 
						 | 
					@ -255,54 +282,6 @@
 | 
				
			||||||
					"TextAlign":"MiddleCenter",
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
					"Text":"凭证号"
 | 
										"Text":"凭证号"
 | 
				
			||||||
				},
 | 
									},
 | 
				
			||||||
				{
 | 
					 | 
				
			||||||
					"GroupTitle":false,
 | 
					 | 
				
			||||||
					"Column":"供货单位",
 | 
					 | 
				
			||||||
					"Font":{
 | 
					 | 
				
			||||||
						"Name":"宋体",
 | 
					 | 
				
			||||||
						"Size":105000,
 | 
					 | 
				
			||||||
						"Bold":true,
 | 
					 | 
				
			||||||
						"Charset":134
 | 
					 | 
				
			||||||
					},
 | 
					 | 
				
			||||||
					"TextAlign":"MiddleCenter",
 | 
					 | 
				
			||||||
					"Text":"供货单位\r\n(领用部门)"
 | 
					 | 
				
			||||||
				},
 | 
					 | 
				
			||||||
				{
 | 
					 | 
				
			||||||
					"GroupTitle":false,
 | 
					 | 
				
			||||||
					"Column":"入库数量",
 | 
					 | 
				
			||||||
					"Font":{
 | 
					 | 
				
			||||||
						"Name":"宋体",
 | 
					 | 
				
			||||||
						"Size":105000,
 | 
					 | 
				
			||||||
						"Bold":true,
 | 
					 | 
				
			||||||
						"Charset":134
 | 
					 | 
				
			||||||
					},
 | 
					 | 
				
			||||||
					"TextAlign":"MiddleCenter",
 | 
					 | 
				
			||||||
					"Text":"入库\r\n数量"
 | 
					 | 
				
			||||||
				},
 | 
					 | 
				
			||||||
				{
 | 
					 | 
				
			||||||
					"GroupTitle":false,
 | 
					 | 
				
			||||||
					"Column":"出库数量",
 | 
					 | 
				
			||||||
					"Font":{
 | 
					 | 
				
			||||||
						"Name":"宋体",
 | 
					 | 
				
			||||||
						"Size":105000,
 | 
					 | 
				
			||||||
						"Bold":true,
 | 
					 | 
				
			||||||
						"Charset":134
 | 
					 | 
				
			||||||
					},
 | 
					 | 
				
			||||||
					"TextAlign":"MiddleCenter",
 | 
					 | 
				
			||||||
					"Text":"出库\r\n数量"
 | 
					 | 
				
			||||||
				},
 | 
					 | 
				
			||||||
				{
 | 
					 | 
				
			||||||
					"GroupTitle":false,
 | 
					 | 
				
			||||||
					"Column":"结存数量",
 | 
					 | 
				
			||||||
					"Font":{
 | 
					 | 
				
			||||||
						"Name":"宋体",
 | 
					 | 
				
			||||||
						"Size":105000,
 | 
					 | 
				
			||||||
						"Bold":true,
 | 
					 | 
				
			||||||
						"Charset":134
 | 
					 | 
				
			||||||
					},
 | 
					 | 
				
			||||||
					"TextAlign":"MiddleCenter",
 | 
					 | 
				
			||||||
					"Text":"结存数量"
 | 
					 | 
				
			||||||
				},
 | 
					 | 
				
			||||||
				{
 | 
									{
 | 
				
			||||||
					"GroupTitle":false,
 | 
										"GroupTitle":false,
 | 
				
			||||||
					"Column":"批号",
 | 
										"Column":"批号",
 | 
				
			||||||
| 
						 | 
					@ -329,7 +308,7 @@
 | 
				
			||||||
				},
 | 
									},
 | 
				
			||||||
				{
 | 
									{
 | 
				
			||||||
					"GroupTitle":false,
 | 
										"GroupTitle":false,
 | 
				
			||||||
					"Column":"接收(发药人)",
 | 
										"Column":"入库数量",
 | 
				
			||||||
					"Font":{
 | 
										"Font":{
 | 
				
			||||||
						"Name":"宋体",
 | 
											"Name":"宋体",
 | 
				
			||||||
						"Size":105000,
 | 
											"Size":105000,
 | 
				
			||||||
| 
						 | 
					@ -337,7 +316,43 @@
 | 
				
			||||||
						"Charset":134
 | 
											"Charset":134
 | 
				
			||||||
					},
 | 
										},
 | 
				
			||||||
					"TextAlign":"MiddleCenter",
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
					"Text":"接收人\r\n(发药人)"
 | 
										"Text":"入库\r\n数量"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"GroupTitle":false,
 | 
				
			||||||
 | 
										"Column":"出库数量",
 | 
				
			||||||
 | 
										"Font":{
 | 
				
			||||||
 | 
											"Name":"宋体",
 | 
				
			||||||
 | 
											"Size":105000,
 | 
				
			||||||
 | 
											"Bold":true,
 | 
				
			||||||
 | 
											"Charset":134
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"Text":"发出\r\n数量"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"GroupTitle":false,
 | 
				
			||||||
 | 
										"Column":"Column4",
 | 
				
			||||||
 | 
										"Font":{
 | 
				
			||||||
 | 
											"Name":"宋体",
 | 
				
			||||||
 | 
											"Size":105000,
 | 
				
			||||||
 | 
											"Bold":true,
 | 
				
			||||||
 | 
											"Charset":134
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"Text":"总结存"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"GroupTitle":false,
 | 
				
			||||||
 | 
										"Column":"收/发药人",
 | 
				
			||||||
 | 
										"Font":{
 | 
				
			||||||
 | 
											"Name":"宋体",
 | 
				
			||||||
 | 
											"Size":105000,
 | 
				
			||||||
 | 
											"Bold":true,
 | 
				
			||||||
 | 
											"Charset":134
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"Text":"发药人"
 | 
				
			||||||
				},
 | 
									},
 | 
				
			||||||
				{
 | 
									{
 | 
				
			||||||
					"GroupTitle":false,
 | 
										"GroupTitle":false,
 | 
				
			||||||
| 
						 | 
					@ -353,7 +368,7 @@
 | 
				
			||||||
				},
 | 
									},
 | 
				
			||||||
				{
 | 
									{
 | 
				
			||||||
					"GroupTitle":false,
 | 
										"GroupTitle":false,
 | 
				
			||||||
					"Column":"备注",
 | 
										"Column":"Column2",
 | 
				
			||||||
					"Font":{
 | 
										"Font":{
 | 
				
			||||||
						"Name":"宋体",
 | 
											"Name":"宋体",
 | 
				
			||||||
						"Size":105000,
 | 
											"Size":105000,
 | 
				
			||||||
| 
						 | 
					@ -361,7 +376,19 @@
 | 
				
			||||||
						"Charset":134
 | 
											"Charset":134
 | 
				
			||||||
					},
 | 
										},
 | 
				
			||||||
					"TextAlign":"MiddleCenter",
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
					"Text":"备注"
 | 
										"Text":"供应单位"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"GroupTitle":false,
 | 
				
			||||||
 | 
										"Column":"Column3",
 | 
				
			||||||
 | 
										"Font":{
 | 
				
			||||||
 | 
											"Name":"宋体",
 | 
				
			||||||
 | 
											"Size":105000,
 | 
				
			||||||
 | 
											"Bold":true,
 | 
				
			||||||
 | 
											"Charset":134
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"Text":"领用部门"
 | 
				
			||||||
				}
 | 
									}
 | 
				
			||||||
			]
 | 
								]
 | 
				
			||||||
		},
 | 
							},
 | 
				
			||||||
| 
						 | 
					@ -373,6 +400,15 @@
 | 
				
			||||||
					"PrintGridBorder":false,
 | 
										"PrintGridBorder":false,
 | 
				
			||||||
					"RepeatOnPage":true,
 | 
										"RepeatOnPage":true,
 | 
				
			||||||
					"Control":[
 | 
										"Control":[
 | 
				
			||||||
 | 
											{
 | 
				
			||||||
 | 
												"Type":"StaticBox",
 | 
				
			||||||
 | 
												"Name":"StaticBox15",
 | 
				
			||||||
 | 
												"Left":28.3898,
 | 
				
			||||||
 | 
												"Top":0.238125,
 | 
				
			||||||
 | 
												"Width":2.01083,
 | 
				
			||||||
 | 
												"Height":0.79375,
 | 
				
			||||||
 | 
												"Text":"生产厂家:"
 | 
				
			||||||
 | 
											},
 | 
				
			||||||
						{
 | 
											{
 | 
				
			||||||
							"Type":"MemoBox",
 | 
												"Type":"MemoBox",
 | 
				
			||||||
							"Name":"MemoBox11",
 | 
												"Name":"MemoBox11",
 | 
				
			||||||
| 
						 | 
					@ -394,7 +430,7 @@
 | 
				
			||||||
								"Bold":true,
 | 
													"Bold":true,
 | 
				
			||||||
								"Charset":134
 | 
													"Charset":134
 | 
				
			||||||
							},
 | 
												},
 | 
				
			||||||
							"Text":"药品名称:"
 | 
												"Text":"品名:"
 | 
				
			||||||
						},
 | 
											},
 | 
				
			||||||
						{
 | 
											{
 | 
				
			||||||
							"Type":"FieldBox",
 | 
												"Type":"FieldBox",
 | 
				
			||||||
| 
						 | 
					@ -514,7 +550,7 @@
 | 
				
			||||||
								"Bold":true,
 | 
													"Bold":true,
 | 
				
			||||||
								"Charset":134
 | 
													"Charset":134
 | 
				
			||||||
							},
 | 
												},
 | 
				
			||||||
							"Text":"生产企业:"
 | 
												"Text":"生产厂家:"
 | 
				
			||||||
						},
 | 
											},
 | 
				
			||||||
						{
 | 
											{
 | 
				
			||||||
							"Type":"FieldBox",
 | 
												"Type":"FieldBox",
 | 
				
			||||||
| 
						 | 
					@ -570,7 +606,7 @@
 | 
				
			||||||
						"Charset":134
 | 
											"Charset":134
 | 
				
			||||||
					},
 | 
										},
 | 
				
			||||||
					"TextAlign":"MiddleCenter",
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
					"Text":"中部战区总医院麻醉药品、第一类精神药品进出专用账册"
 | 
										"Text":"麻醉、精神药品逐笔专用账册"
 | 
				
			||||||
				}
 | 
									}
 | 
				
			||||||
			],
 | 
								],
 | 
				
			||||||
			"RepeatOnPage":true
 | 
								"RepeatOnPage":true
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,453 +0,0 @@
 | 
				
			||||||
{
 | 
					 | 
				
			||||||
	"Version":"6.8.1.1",
 | 
					 | 
				
			||||||
	"Font":{
 | 
					 | 
				
			||||||
		"Name":"宋体",
 | 
					 | 
				
			||||||
		"Size":105000,
 | 
					 | 
				
			||||||
		"Weight":400,
 | 
					 | 
				
			||||||
		"Charset":134
 | 
					 | 
				
			||||||
	},
 | 
					 | 
				
			||||||
	"Printer":{
 | 
					 | 
				
			||||||
		"Oriention":"Landscape"
 | 
					 | 
				
			||||||
	},
 | 
					 | 
				
			||||||
	"DetailGrid":{
 | 
					 | 
				
			||||||
		"Recordset":{
 | 
					 | 
				
			||||||
			"Field":[
 | 
					 | 
				
			||||||
				{
 | 
					 | 
				
			||||||
					"Name":"药品",
 | 
					 | 
				
			||||||
					"DBFieldName":"drugName1"
 | 
					 | 
				
			||||||
				},
 | 
					 | 
				
			||||||
				{
 | 
					 | 
				
			||||||
					"Name":"批次",
 | 
					 | 
				
			||||||
					"DBFieldName":"manuNo1"
 | 
					 | 
				
			||||||
				},
 | 
					 | 
				
			||||||
				{
 | 
					 | 
				
			||||||
					"Name":"数量",
 | 
					 | 
				
			||||||
					"DBFieldName":"quantity1"
 | 
					 | 
				
			||||||
				},
 | 
					 | 
				
			||||||
				{
 | 
					 | 
				
			||||||
					"Name":"日期",
 | 
					 | 
				
			||||||
					"Type":"DateTime",
 | 
					 | 
				
			||||||
					"Format":"yyyy年MM月dd日",
 | 
					 | 
				
			||||||
					"DBFieldName":"portDate"
 | 
					 | 
				
			||||||
				}
 | 
					 | 
				
			||||||
			]
 | 
					 | 
				
			||||||
		},
 | 
					 | 
				
			||||||
		"Column":[
 | 
					 | 
				
			||||||
			{
 | 
					 | 
				
			||||||
				"Name":"药品",
 | 
					 | 
				
			||||||
				"Width":6.16479
 | 
					 | 
				
			||||||
			},
 | 
					 | 
				
			||||||
			{
 | 
					 | 
				
			||||||
				"Name":"批次",
 | 
					 | 
				
			||||||
				"Width":2.40771
 | 
					 | 
				
			||||||
			},
 | 
					 | 
				
			||||||
			{
 | 
					 | 
				
			||||||
				"Name":"数量",
 | 
					 | 
				
			||||||
				"Width":1.79917
 | 
					 | 
				
			||||||
			}
 | 
					 | 
				
			||||||
		],
 | 
					 | 
				
			||||||
		"ColumnContent":{
 | 
					 | 
				
			||||||
			"Height":1.00542,
 | 
					 | 
				
			||||||
			"ColumnContentCell":[
 | 
					 | 
				
			||||||
				{
 | 
					 | 
				
			||||||
					"Column":"药品",
 | 
					 | 
				
			||||||
					"TextAlign":"MiddleCenter",
 | 
					 | 
				
			||||||
					"DataField":"药品"
 | 
					 | 
				
			||||||
				},
 | 
					 | 
				
			||||||
				{
 | 
					 | 
				
			||||||
					"Column":"批次",
 | 
					 | 
				
			||||||
					"TextAlign":"MiddleCenter",
 | 
					 | 
				
			||||||
					"DataField":"批次"
 | 
					 | 
				
			||||||
				},
 | 
					 | 
				
			||||||
				{
 | 
					 | 
				
			||||||
					"Column":"数量",
 | 
					 | 
				
			||||||
					"TextAlign":"MiddleCenter",
 | 
					 | 
				
			||||||
					"DataField":"数量"
 | 
					 | 
				
			||||||
				}
 | 
					 | 
				
			||||||
			]
 | 
					 | 
				
			||||||
		},
 | 
					 | 
				
			||||||
		"ColumnTitle":{
 | 
					 | 
				
			||||||
			"Height":0.608542,
 | 
					 | 
				
			||||||
			"ColumnTitleCell":[
 | 
					 | 
				
			||||||
				{
 | 
					 | 
				
			||||||
					"GroupTitle":false,
 | 
					 | 
				
			||||||
					"Column":"药品",
 | 
					 | 
				
			||||||
					"TextAlign":"MiddleCenter",
 | 
					 | 
				
			||||||
					"Text":"药品"
 | 
					 | 
				
			||||||
				},
 | 
					 | 
				
			||||||
				{
 | 
					 | 
				
			||||||
					"GroupTitle":false,
 | 
					 | 
				
			||||||
					"Column":"批次",
 | 
					 | 
				
			||||||
					"TextAlign":"MiddleCenter",
 | 
					 | 
				
			||||||
					"Text":"批次"
 | 
					 | 
				
			||||||
				},
 | 
					 | 
				
			||||||
				{
 | 
					 | 
				
			||||||
					"GroupTitle":false,
 | 
					 | 
				
			||||||
					"Column":"数量",
 | 
					 | 
				
			||||||
					"TextAlign":"MiddleCenter",
 | 
					 | 
				
			||||||
					"Text":"数量"
 | 
					 | 
				
			||||||
				}
 | 
					 | 
				
			||||||
			]
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
	},
 | 
					 | 
				
			||||||
	"ReportHeader":[
 | 
					 | 
				
			||||||
		{
 | 
					 | 
				
			||||||
			"Name":"ReportHeader1",
 | 
					 | 
				
			||||||
			"Height":3.41313,
 | 
					 | 
				
			||||||
			"Control":[
 | 
					 | 
				
			||||||
				{
 | 
					 | 
				
			||||||
					"Type":"MemoBox",
 | 
					 | 
				
			||||||
					"Name":"MemoBox12",
 | 
					 | 
				
			||||||
					"Anchor":"[Right|Bottom]",
 | 
					 | 
				
			||||||
					"AlignColumnSide":"Right",
 | 
					 | 
				
			||||||
					"Left":17.6212,
 | 
					 | 
				
			||||||
					"Top":2.80458,
 | 
					 | 
				
			||||||
					"Width":3.46604,
 | 
					 | 
				
			||||||
					"Height":0.582083,
 | 
					 | 
				
			||||||
					"ShrinkFontToFit":true,
 | 
					 | 
				
			||||||
					"Text":"日期:[#日期#]"
 | 
					 | 
				
			||||||
				},
 | 
					 | 
				
			||||||
				{
 | 
					 | 
				
			||||||
					"Type":"MemoBox",
 | 
					 | 
				
			||||||
					"Name":"MemoBox1",
 | 
					 | 
				
			||||||
					"Center":"Both",
 | 
					 | 
				
			||||||
					"Left":1.45521,
 | 
					 | 
				
			||||||
					"Top":0.79375,
 | 
					 | 
				
			||||||
					"Width":21.8017,
 | 
					 | 
				
			||||||
					"Height":1.79917,
 | 
					 | 
				
			||||||
					"Font":{
 | 
					 | 
				
			||||||
						"Name":"宋体",
 | 
					 | 
				
			||||||
						"Size":217500,
 | 
					 | 
				
			||||||
						"Bold":true,
 | 
					 | 
				
			||||||
						"Charset":134
 | 
					 | 
				
			||||||
					},
 | 
					 | 
				
			||||||
					"ShrinkFontToFit":true,
 | 
					 | 
				
			||||||
					"TextAlign":"MiddleCenter",
 | 
					 | 
				
			||||||
					"Text":"中国人民解放军中部战区总医院手术患者麻醉药品使用登记本"
 | 
					 | 
				
			||||||
				},
 | 
					 | 
				
			||||||
				{
 | 
					 | 
				
			||||||
					"Type":"MemoBox",
 | 
					 | 
				
			||||||
					"Name":"MemoBox13",
 | 
					 | 
				
			||||||
					"Anchor":"[Right|Bottom]",
 | 
					 | 
				
			||||||
					"Left":21.4313,
 | 
					 | 
				
			||||||
					"Top":2.83104,
 | 
					 | 
				
			||||||
					"Width":3.01625,
 | 
					 | 
				
			||||||
					"Height":0.582083,
 | 
					 | 
				
			||||||
					"ShrinkFontToFit":true,
 | 
					 | 
				
			||||||
					"Text":"手术室:武昌院区"
 | 
					 | 
				
			||||||
				}
 | 
					 | 
				
			||||||
			]
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
	],
 | 
					 | 
				
			||||||
	"ReportFooter":[
 | 
					 | 
				
			||||||
		{
 | 
					 | 
				
			||||||
			"Name":"ReportFooter2",
 | 
					 | 
				
			||||||
			"Height":0.608542
 | 
					 | 
				
			||||||
		},
 | 
					 | 
				
			||||||
		{
 | 
					 | 
				
			||||||
			"Name":"ReportFooter1",
 | 
					 | 
				
			||||||
			"CanGrow":true,
 | 
					 | 
				
			||||||
			"Height":1.5875,
 | 
					 | 
				
			||||||
			"Control":[
 | 
					 | 
				
			||||||
				{
 | 
					 | 
				
			||||||
					"Type":"SubReport",
 | 
					 | 
				
			||||||
					"Name":"SubReport1",
 | 
					 | 
				
			||||||
					"Dock":"Fill",
 | 
					 | 
				
			||||||
"Report":{
 | 
					 | 
				
			||||||
	"Version":"6.8.1.1",
 | 
					 | 
				
			||||||
	"Font":{
 | 
					 | 
				
			||||||
		"Name":"宋体",
 | 
					 | 
				
			||||||
		"Size":105000,
 | 
					 | 
				
			||||||
		"Weight":400,
 | 
					 | 
				
			||||||
		"Charset":134
 | 
					 | 
				
			||||||
	},
 | 
					 | 
				
			||||||
	"Printer":{
 | 
					 | 
				
			||||||
		"Oriention":"Landscape"
 | 
					 | 
				
			||||||
	},
 | 
					 | 
				
			||||||
	"DetailGrid":{
 | 
					 | 
				
			||||||
		"Recordset":{
 | 
					 | 
				
			||||||
			"Field":[
 | 
					 | 
				
			||||||
				{
 | 
					 | 
				
			||||||
					"Name":"药品",
 | 
					 | 
				
			||||||
					"DBFieldName":"drugName"
 | 
					 | 
				
			||||||
				},
 | 
					 | 
				
			||||||
				{
 | 
					 | 
				
			||||||
					"Name":"批次",
 | 
					 | 
				
			||||||
					"DBFieldName":"manuNo"
 | 
					 | 
				
			||||||
				},
 | 
					 | 
				
			||||||
				{
 | 
					 | 
				
			||||||
					"Name":"数量",
 | 
					 | 
				
			||||||
					"Type":"Integer",
 | 
					 | 
				
			||||||
					"DBFieldName":"quantity"
 | 
					 | 
				
			||||||
				},
 | 
					 | 
				
			||||||
				{
 | 
					 | 
				
			||||||
					"Name":"主麻",
 | 
					 | 
				
			||||||
					"DBFieldName":"doctor1"
 | 
					 | 
				
			||||||
				},
 | 
					 | 
				
			||||||
				{
 | 
					 | 
				
			||||||
					"Name":"药品id",
 | 
					 | 
				
			||||||
					"DBFieldName":"DrugId"
 | 
					 | 
				
			||||||
				},
 | 
					 | 
				
			||||||
				{
 | 
					 | 
				
			||||||
					"Name":"副麻",
 | 
					 | 
				
			||||||
					"DBFieldName":"doctor2"
 | 
					 | 
				
			||||||
				},
 | 
					 | 
				
			||||||
				{
 | 
					 | 
				
			||||||
					"Name":"患者",
 | 
					 | 
				
			||||||
					"DBFieldName":"PName"
 | 
					 | 
				
			||||||
				},
 | 
					 | 
				
			||||||
				{
 | 
					 | 
				
			||||||
					"Name":"患者id",
 | 
					 | 
				
			||||||
					"DBFieldName":"patientId"
 | 
					 | 
				
			||||||
				},
 | 
					 | 
				
			||||||
				{
 | 
					 | 
				
			||||||
					"Name":"诊断",
 | 
					 | 
				
			||||||
					"DBFieldName":"Diagnose"
 | 
					 | 
				
			||||||
				},
 | 
					 | 
				
			||||||
				{
 | 
					 | 
				
			||||||
					"Name":"残余液",
 | 
					 | 
				
			||||||
					"DBFieldName":"residual"
 | 
					 | 
				
			||||||
				},
 | 
					 | 
				
			||||||
				{
 | 
					 | 
				
			||||||
					"Name":"用量",
 | 
					 | 
				
			||||||
					"DBFieldName":"usage"
 | 
					 | 
				
			||||||
				},
 | 
					 | 
				
			||||||
				{
 | 
					 | 
				
			||||||
					"Name":"残液处置方式",
 | 
					 | 
				
			||||||
					"DBFieldName":"CanYeChuZhi"
 | 
					 | 
				
			||||||
				}
 | 
					 | 
				
			||||||
			]
 | 
					 | 
				
			||||||
		},
 | 
					 | 
				
			||||||
		"Column":[
 | 
					 | 
				
			||||||
			{
 | 
					 | 
				
			||||||
				"Name":"药品",
 | 
					 | 
				
			||||||
				"Width":5.76792
 | 
					 | 
				
			||||||
			},
 | 
					 | 
				
			||||||
			{
 | 
					 | 
				
			||||||
				"Name":"批次",
 | 
					 | 
				
			||||||
				"Width":3.41313
 | 
					 | 
				
			||||||
			},
 | 
					 | 
				
			||||||
			{
 | 
					 | 
				
			||||||
				"Name":"数量",
 | 
					 | 
				
			||||||
				"Width":1.21708
 | 
					 | 
				
			||||||
			},
 | 
					 | 
				
			||||||
			{
 | 
					 | 
				
			||||||
				"Name":"患者"
 | 
					 | 
				
			||||||
			},
 | 
					 | 
				
			||||||
			{
 | 
					 | 
				
			||||||
				"Name":"患者id"
 | 
					 | 
				
			||||||
			},
 | 
					 | 
				
			||||||
			{
 | 
					 | 
				
			||||||
				"Name":"诊断"
 | 
					 | 
				
			||||||
			},
 | 
					 | 
				
			||||||
			{
 | 
					 | 
				
			||||||
				"Name":"残余液",
 | 
					 | 
				
			||||||
				"Width":2.03729
 | 
					 | 
				
			||||||
			},
 | 
					 | 
				
			||||||
			{
 | 
					 | 
				
			||||||
				"Name":"用量",
 | 
					 | 
				
			||||||
				"Width":1.19063
 | 
					 | 
				
			||||||
			},
 | 
					 | 
				
			||||||
			{
 | 
					 | 
				
			||||||
				"Name":"残液处置方式",
 | 
					 | 
				
			||||||
				"Width":1.77271
 | 
					 | 
				
			||||||
			}
 | 
					 | 
				
			||||||
		],
 | 
					 | 
				
			||||||
		"ColumnContent":{
 | 
					 | 
				
			||||||
			"Height":0.6,
 | 
					 | 
				
			||||||
			"ColumnContentCell":[
 | 
					 | 
				
			||||||
				{
 | 
					 | 
				
			||||||
					"Column":"药品",
 | 
					 | 
				
			||||||
					"ShrinkFontToFit":true,
 | 
					 | 
				
			||||||
					"DataField":"药品"
 | 
					 | 
				
			||||||
				},
 | 
					 | 
				
			||||||
				{
 | 
					 | 
				
			||||||
					"Column":"批次",
 | 
					 | 
				
			||||||
					"CanGrow":true,
 | 
					 | 
				
			||||||
					"DataField":"批次"
 | 
					 | 
				
			||||||
				},
 | 
					 | 
				
			||||||
				{
 | 
					 | 
				
			||||||
					"Column":"数量",
 | 
					 | 
				
			||||||
					"FreeCell":true,
 | 
					 | 
				
			||||||
					"Control":[
 | 
					 | 
				
			||||||
						{
 | 
					 | 
				
			||||||
							"Type":"MemoBox",
 | 
					 | 
				
			||||||
							"Name":"MemoBox2",
 | 
					 | 
				
			||||||
							"Dock":"Fill",
 | 
					 | 
				
			||||||
							"Text":"[#SumAcc(数量)#]"
 | 
					 | 
				
			||||||
						}
 | 
					 | 
				
			||||||
					]
 | 
					 | 
				
			||||||
				},
 | 
					 | 
				
			||||||
				{
 | 
					 | 
				
			||||||
					"Column":"患者",
 | 
					 | 
				
			||||||
					"DataField":"患者"
 | 
					 | 
				
			||||||
				},
 | 
					 | 
				
			||||||
				{
 | 
					 | 
				
			||||||
					"Column":"患者id",
 | 
					 | 
				
			||||||
					"DataField":"患者id"
 | 
					 | 
				
			||||||
				},
 | 
					 | 
				
			||||||
				{
 | 
					 | 
				
			||||||
					"Column":"诊断",
 | 
					 | 
				
			||||||
					"DataField":"诊断"
 | 
					 | 
				
			||||||
				},
 | 
					 | 
				
			||||||
				{
 | 
					 | 
				
			||||||
					"Column":"残余液",
 | 
					 | 
				
			||||||
					"DataField":"残余液"
 | 
					 | 
				
			||||||
				},
 | 
					 | 
				
			||||||
				{
 | 
					 | 
				
			||||||
					"Column":"用量",
 | 
					 | 
				
			||||||
					"DataField":"用量"
 | 
					 | 
				
			||||||
				},
 | 
					 | 
				
			||||||
				{
 | 
					 | 
				
			||||||
					"Column":"残液处置方式",
 | 
					 | 
				
			||||||
					"DataField":"残液处置方式"
 | 
					 | 
				
			||||||
				}
 | 
					 | 
				
			||||||
			]
 | 
					 | 
				
			||||||
		},
 | 
					 | 
				
			||||||
		"ColumnTitle":{
 | 
					 | 
				
			||||||
			"RepeatStyle":"OnGroupHeader",
 | 
					 | 
				
			||||||
			"ColumnTitleCell":[
 | 
					 | 
				
			||||||
				{
 | 
					 | 
				
			||||||
					"GroupTitle":false,
 | 
					 | 
				
			||||||
					"Column":"药品",
 | 
					 | 
				
			||||||
					"TextAlign":"MiddleCenter",
 | 
					 | 
				
			||||||
					"Text":"药品"
 | 
					 | 
				
			||||||
				},
 | 
					 | 
				
			||||||
				{
 | 
					 | 
				
			||||||
					"GroupTitle":false,
 | 
					 | 
				
			||||||
					"Column":"批次",
 | 
					 | 
				
			||||||
					"TextAlign":"MiddleCenter",
 | 
					 | 
				
			||||||
					"Text":"批次"
 | 
					 | 
				
			||||||
				},
 | 
					 | 
				
			||||||
				{
 | 
					 | 
				
			||||||
					"GroupTitle":false,
 | 
					 | 
				
			||||||
					"Column":"数量",
 | 
					 | 
				
			||||||
					"TextAlign":"MiddleCenter",
 | 
					 | 
				
			||||||
					"Text":"数量"
 | 
					 | 
				
			||||||
				},
 | 
					 | 
				
			||||||
				{
 | 
					 | 
				
			||||||
					"GroupTitle":false,
 | 
					 | 
				
			||||||
					"Column":"患者",
 | 
					 | 
				
			||||||
					"TextAlign":"MiddleCenter",
 | 
					 | 
				
			||||||
					"Text":"患者"
 | 
					 | 
				
			||||||
				},
 | 
					 | 
				
			||||||
				{
 | 
					 | 
				
			||||||
					"GroupTitle":false,
 | 
					 | 
				
			||||||
					"Column":"患者id",
 | 
					 | 
				
			||||||
					"TextAlign":"MiddleCenter",
 | 
					 | 
				
			||||||
					"Text":"患者id"
 | 
					 | 
				
			||||||
				},
 | 
					 | 
				
			||||||
				{
 | 
					 | 
				
			||||||
					"GroupTitle":false,
 | 
					 | 
				
			||||||
					"Column":"诊断",
 | 
					 | 
				
			||||||
					"TextAlign":"MiddleCenter",
 | 
					 | 
				
			||||||
					"Text":"诊断"
 | 
					 | 
				
			||||||
				},
 | 
					 | 
				
			||||||
				{
 | 
					 | 
				
			||||||
					"GroupTitle":false,
 | 
					 | 
				
			||||||
					"Column":"残余液",
 | 
					 | 
				
			||||||
					"TextAlign":"MiddleCenter",
 | 
					 | 
				
			||||||
					"Text":"残余液"
 | 
					 | 
				
			||||||
				},
 | 
					 | 
				
			||||||
				{
 | 
					 | 
				
			||||||
					"GroupTitle":false,
 | 
					 | 
				
			||||||
					"Column":"用量",
 | 
					 | 
				
			||||||
					"TextAlign":"MiddleCenter",
 | 
					 | 
				
			||||||
					"Text":"用量"
 | 
					 | 
				
			||||||
				},
 | 
					 | 
				
			||||||
				{
 | 
					 | 
				
			||||||
					"GroupTitle":false,
 | 
					 | 
				
			||||||
					"Column":"残液处置方式",
 | 
					 | 
				
			||||||
					"TextAlign":"MiddleCenter",
 | 
					 | 
				
			||||||
					"CanGrow":true,
 | 
					 | 
				
			||||||
					"CanShrink":true,
 | 
					 | 
				
			||||||
					"Text":"残液\r\n处置\r\n方式"
 | 
					 | 
				
			||||||
				}
 | 
					 | 
				
			||||||
			]
 | 
					 | 
				
			||||||
		},
 | 
					 | 
				
			||||||
		"Group":[
 | 
					 | 
				
			||||||
			{
 | 
					 | 
				
			||||||
				"Name":"Group1",
 | 
					 | 
				
			||||||
				"ByFields":"主麻;副麻",
 | 
					 | 
				
			||||||
				"GroupHeader":{
 | 
					 | 
				
			||||||
					"Height":2.98979,
 | 
					 | 
				
			||||||
					"PrintGridBorder":false,
 | 
					 | 
				
			||||||
					"Control":[
 | 
					 | 
				
			||||||
						{
 | 
					 | 
				
			||||||
							"Type":"MemoBox",
 | 
					 | 
				
			||||||
							"Name":"MemoBox1",
 | 
					 | 
				
			||||||
							"Top":0.79375,
 | 
					 | 
				
			||||||
							"Width":6.79979,
 | 
					 | 
				
			||||||
							"Height":2.19604,
 | 
					 | 
				
			||||||
							"Text":"麻醉医师\r\n主麻:[#主麻#]\r\n副麻:[#副麻#]"
 | 
					 | 
				
			||||||
						}
 | 
					 | 
				
			||||||
					]
 | 
					 | 
				
			||||||
				},
 | 
					 | 
				
			||||||
				"GroupFooter":{
 | 
					 | 
				
			||||||
					"Visible":false,
 | 
					 | 
				
			||||||
					"Height":0
 | 
					 | 
				
			||||||
				}
 | 
					 | 
				
			||||||
			},
 | 
					 | 
				
			||||||
			{
 | 
					 | 
				
			||||||
				"Name":"Group2",
 | 
					 | 
				
			||||||
				"ByFields":"药品id",
 | 
					 | 
				
			||||||
				"GroupHeader":{
 | 
					 | 
				
			||||||
					"CanGrow":true,
 | 
					 | 
				
			||||||
					"Height":0.6,
 | 
					 | 
				
			||||||
					"Control":[
 | 
					 | 
				
			||||||
						{
 | 
					 | 
				
			||||||
							"Type":"MemoBox",
 | 
					 | 
				
			||||||
							"Name":"MemoBox3",
 | 
					 | 
				
			||||||
							"AlignColumn":"药品",
 | 
					 | 
				
			||||||
							"Width":5.74146,
 | 
					 | 
				
			||||||
							"Height":0.6,
 | 
					 | 
				
			||||||
							"CanGrow":true,
 | 
					 | 
				
			||||||
							"ShrinkFontToFit":true,
 | 
					 | 
				
			||||||
							"Text":"[#药品#]"
 | 
					 | 
				
			||||||
						},
 | 
					 | 
				
			||||||
						{
 | 
					 | 
				
			||||||
							"Type":"SummaryBox",
 | 
					 | 
				
			||||||
							"Name":"SummaryBox1",
 | 
					 | 
				
			||||||
							"AlignColumn":"数量",
 | 
					 | 
				
			||||||
							"Left":9.18104,
 | 
					 | 
				
			||||||
							"Width":1.19063,
 | 
					 | 
				
			||||||
							"Height":0.6,
 | 
					 | 
				
			||||||
							"DataField":"数量"
 | 
					 | 
				
			||||||
						}
 | 
					 | 
				
			||||||
					],
 | 
					 | 
				
			||||||
					"OccupyColumn":true,
 | 
					 | 
				
			||||||
					"SameAsColumn":false,
 | 
					 | 
				
			||||||
					"OccupiedColumns":"药品;数量",
 | 
					 | 
				
			||||||
					"VAlign":"Middle"
 | 
					 | 
				
			||||||
				},
 | 
					 | 
				
			||||||
				"GroupFooter":{
 | 
					 | 
				
			||||||
					"Visible":false,
 | 
					 | 
				
			||||||
					"Height":0
 | 
					 | 
				
			||||||
				}
 | 
					 | 
				
			||||||
			}
 | 
					 | 
				
			||||||
		]
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
				}
 | 
					 | 
				
			||||||
			]
 | 
					 | 
				
			||||||
		},
 | 
					 | 
				
			||||||
		{
 | 
					 | 
				
			||||||
			"Name":"ReportFooter3",
 | 
					 | 
				
			||||||
			"Height":0.79375,
 | 
					 | 
				
			||||||
			"Control":[
 | 
					 | 
				
			||||||
				{
 | 
					 | 
				
			||||||
					"Type":"StaticBox",
 | 
					 | 
				
			||||||
					"Name":"StaticBox1",
 | 
					 | 
				
			||||||
					"AlignColumnSide":"Left",
 | 
					 | 
				
			||||||
					"Left":0.396875,
 | 
					 | 
				
			||||||
					"Top":0.211667,
 | 
					 | 
				
			||||||
					"Width":24.2094,
 | 
					 | 
				
			||||||
					"Height":0.396875,
 | 
					 | 
				
			||||||
					"ShrinkFontToFit":true,
 | 
					 | 
				
			||||||
					"Text":"残余毒麻药品处置方法:①未使用完的注射液和镇痛泵中的残余药液,由医师、药师或护士在视频监控下双人将残余液完全倾泻入下水道并用水冲净,双人复核确认并签字,空安瓿按流程回收;②废贴需核对批次和数量,在领用后次日交回药房,并在药房签字确认"
 | 
					 | 
				
			||||||
				}
 | 
					 | 
				
			||||||
			],
 | 
					 | 
				
			||||||
			"PrintAtBottom":true
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
	]
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
| 
						 | 
					@ -7,7 +7,6 @@
 | 
				
			||||||
<style>
 | 
					<style>
 | 
				
			||||||
    .my-tab-menu{
 | 
					    .my-tab-menu{
 | 
				
			||||||
    padding: 10px 20px;
 | 
					    padding: 10px 20px;
 | 
				
			||||||
        flex-shrink: 0;
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    .my-tab-menu:hover{
 | 
					    .my-tab-menu:hover{
 | 
				
			||||||
| 
						 | 
					@ -16,7 +15,6 @@
 | 
				
			||||||
    background: #255dd6;
 | 
					    background: #255dd6;
 | 
				
			||||||
    border-radius: 20px;
 | 
					    border-radius: 20px;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					 | 
				
			||||||
    a.active {
 | 
					    a.active {
 | 
				
			||||||
    background: #255dd4;
 | 
					    background: #255dd4;
 | 
				
			||||||
    border-radius: 20px;
 | 
					    border-radius: 20px;
 | 
				
			||||||
| 
						 | 
					@ -27,16 +25,13 @@
 | 
				
			||||||
<RadzenLayout>
 | 
					<RadzenLayout>
 | 
				
			||||||
    <RadzenHeader Style="height: 75px;">
 | 
					    <RadzenHeader Style="height: 75px;">
 | 
				
			||||||
        <RadzenRow JustifyContent="JustifyContent.Start" AlignItems="AlignItems.Center" Style="height: 100%;">
 | 
					        <RadzenRow JustifyContent="JustifyContent.Start" AlignItems="AlignItems.Center" Style="height: 100%;">
 | 
				
			||||||
            <RadzenColumn Size="1">
 | 
					            <RadzenColumn Size="2">
 | 
				
			||||||
                <RadzenStack Orientation="Orientation.Horizontal" AlignItems="AlignItems.Center">
 | 
					                <RadzenStack Orientation="Orientation.Horizontal" AlignItems="AlignItems.Center">
 | 
				
			||||||
                    <RadzenIcon Icon="chevron_left" Style="font-size:3rem;cursor: pointer;padding: 0 10px;" @onclick="@(() => { backHome(); })" />
 | 
					                    <RadzenIcon Icon="chevron_left" Style="font-size:3rem;cursor: pointer;padding: 0 10px;" @onclick="@(() => { backHome(); })" />
 | 
				
			||||||
                </RadzenStack>
 | 
					                </RadzenStack>
 | 
				
			||||||
            </RadzenColumn>
 | 
					            </RadzenColumn>
 | 
				
			||||||
            <RadzenColumn Size="10" Orientation="Orientation.Horizontal" AlignItems="AlignItems.Center" JustifyContent="JustifyContent.Start">
 | 
					            <RadzenColumn Size="8" Orientation="Orientation.Horizontal" AlignItems="AlignItems.Center" JustifyContent="JustifyContent.End">
 | 
				
			||||||
                @if (children.Count > 5)
 | 
					                <RadzenStack Orientation="Orientation.Horizontal" JustifyContent="JustifyContent.Center" AlignItems="AlignItems.Center">
 | 
				
			||||||
                {
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                    <RadzenStack Style="width: 100%; overflow-x: auto; white-space: nowrap; display: flex;" Orientation="Orientation.Horizontal" AlignItems="AlignItems.Center">
 | 
					 | 
				
			||||||
                    @foreach (Premission p in children)
 | 
					                    @foreach (Premission p in children)
 | 
				
			||||||
                    {
 | 
					                    {
 | 
				
			||||||
                        if (childrenIds.Any(id => id == p.Id))
 | 
					                        if (childrenIds.Any(id => id == p.Id))
 | 
				
			||||||
| 
						 | 
					@ -44,33 +39,11 @@
 | 
				
			||||||
                            <RadzenLink Match="NavLinkMatch.All" class="my-tab-menu" Path="@p.PremissionPath">@p.PremissionName</RadzenLink>
 | 
					                            <RadzenLink Match="NavLinkMatch.All" class="my-tab-menu" Path="@p.PremissionPath">@p.PremissionName</RadzenLink>
 | 
				
			||||||
                        }
 | 
					                        }
 | 
				
			||||||
                    }
 | 
					                    }
 | 
				
			||||||
                        @if (children.Any(c => c.PremissionPath.Contains("Box")))
 | 
					 | 
				
			||||||
                        {
 | 
					 | 
				
			||||||
                            <RadzenIcon Icon="card_travel" Style="font-size:2rem;cursor: pointer;" class="rz-ripple" IconColor="white" @onclick="@(() => { OpenStorage(); })" />
 | 
					 | 
				
			||||||
                        }
 | 
					 | 
				
			||||||
                </RadzenStack>
 | 
					                </RadzenStack>
 | 
				
			||||||
                }
 | 
					 | 
				
			||||||
                else
 | 
					 | 
				
			||||||
                {
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                    <RadzenStack Style="width: 100%; overflow-x: auto; white-space: nowrap; display: flex;" Orientation="Orientation.Horizontal" JustifyContent="JustifyContent.Center" AlignItems="AlignItems.Center">
 | 
					 | 
				
			||||||
                        @foreach (Premission p in children)
 | 
					 | 
				
			||||||
                        {
 | 
					 | 
				
			||||||
                            if (childrenIds.Any(id => id == p.Id))
 | 
					 | 
				
			||||||
                            {
 | 
					 | 
				
			||||||
                                <RadzenLink Match="NavLinkMatch.All" class="my-tab-menu" Path="@p.PremissionPath">@p.PremissionName</RadzenLink>
 | 
					 | 
				
			||||||
                            }
 | 
					 | 
				
			||||||
                        }
 | 
					 | 
				
			||||||
                        @if (children.Any(c => c.PremissionPath.Contains("Box")))
 | 
					 | 
				
			||||||
                        {
 | 
					 | 
				
			||||||
                            <RadzenIcon Icon="card_travel" Style="font-size:2rem;cursor: pointer;" class="rz-ripple" IconColor="white" @onclick="@(() => { OpenStorage(); })" />
 | 
					 | 
				
			||||||
                        }
 | 
					 | 
				
			||||||
                    </RadzenStack>
 | 
					 | 
				
			||||||
                }
 | 
					 | 
				
			||||||
            </RadzenColumn>
 | 
					            </RadzenColumn>
 | 
				
			||||||
            <RadzenColumn Size="1">
 | 
					            <RadzenColumn Size="2">
 | 
				
			||||||
                <RadzenStack Orientation="Orientation.Horizontal" AlignItems="AlignItems.Center" JustifyContent="JustifyContent.Center">
 | 
					                <RadzenStack Orientation="Orientation.Horizontal" AlignItems="AlignItems.Center" JustifyContent="JustifyContent.Center">
 | 
				
			||||||
 | 
					                    @* <RadzenText TextAlign="TextAlign.Center" class="rz-color-white">退出</RadzenText> *@
 | 
				
			||||||
                    <RadzenIcon Icon="exit_to_app" Style="font-size:2rem;cursor: pointer;" class="rz-ripple" IconColor="white" @onclick="@(() => { logout(); })" />
 | 
					                    <RadzenIcon Icon="exit_to_app" Style="font-size:2rem;cursor: pointer;" class="rz-ripple" IconColor="white" @onclick="@(() => { logout(); })" />
 | 
				
			||||||
                </RadzenStack>
 | 
					                </RadzenStack>
 | 
				
			||||||
            </RadzenColumn>
 | 
					            </RadzenColumn>
 | 
				
			||||||
| 
						 | 
					@ -89,7 +62,6 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@code
 | 
					@code
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    @inject IJSRuntime JSRuntime
 | 
					 | 
				
			||||||
    @inject GlobalStateService globalStateService;
 | 
					    @inject GlobalStateService globalStateService;
 | 
				
			||||||
    @inject NavigationManager na;
 | 
					    @inject NavigationManager na;
 | 
				
			||||||
    int selectedIndex = 0;
 | 
					    int selectedIndex = 0;
 | 
				
			||||||
| 
						 | 
					@ -98,7 +70,6 @@
 | 
				
			||||||
    List<Premission> children;
 | 
					    List<Premission> children;
 | 
				
			||||||
    @inject Microsoft.Extensions.Options.IOptions<Pojo.Config.SettingConfig> setting;
 | 
					    @inject Microsoft.Extensions.Options.IOptions<Pojo.Config.SettingConfig> setting;
 | 
				
			||||||
    @inject PortUtil _portUtil;
 | 
					    @inject PortUtil _portUtil;
 | 
				
			||||||
    @inject NotificationService _message
 | 
					 | 
				
			||||||
    private readonly ILog logger = LogManager.GetLogger(typeof(MainLayout));
 | 
					    private readonly ILog logger = LogManager.GetLogger(typeof(MainLayout));
 | 
				
			||||||
    bool currentPage = true;
 | 
					    bool currentPage = true;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -132,9 +103,9 @@
 | 
				
			||||||
                       if(!_portUtil.Operate)
 | 
					                       if(!_portUtil.Operate)
 | 
				
			||||||
                       {
 | 
					                       {
 | 
				
			||||||
                           // 无人操作鼠标键盘
 | 
					                           // 无人操作鼠标键盘
 | 
				
			||||||
                           if ((DateTime.Now - _portUtil.dateTime).TotalSeconds > setting.Value.autoOutLog && (DateTime.Now - _portUtil.mouseClickTime).TotalSeconds > setting.Value.autoOutLog)
 | 
					                           if((DateTime.Now - _portUtil.dateTime).TotalSeconds > setting.Value.autoOutLog && CheckComputerFreeState.GetLastInputTime() > setting.Value.autoOutLog)
 | 
				
			||||||
                           {
 | 
					                           {
 | 
				
			||||||
                               logger.Info($"设备{setting.Value.autoOutLog}内无人操作,用户【{Operator?.NickName}】自动退出登录,_portUtil.Operate:{_portUtil.Operate},totalSecond:{(DateTime.Now - _portUtil.dateTime).TotalSeconds},lastInputTime:{(DateTime.Now - _portUtil.mouseClickTime).TotalSeconds},autoOutLog:{setting.Value.autoOutLog}");
 | 
					                               logger.Info($"设备{setting.Value.autoOutLog}内无人操作,用户【{Operator?.NickName}】自动退出登录,_portUtil.Operate:{_portUtil.Operate},totalSecond:{(DateTime.Now - _portUtil.dateTime).TotalSeconds},lastInputTime:{CheckComputerFreeState.GetLastInputTime()},autoOutLog:{setting.Value.autoOutLog}");
 | 
				
			||||||
                               globalStateService.Operator = null;
 | 
					                               globalStateService.Operator = null;
 | 
				
			||||||
                               globalStateService.Reviewer = null;
 | 
					                               globalStateService.Reviewer = null;
 | 
				
			||||||
                               na.NavigateTo("");
 | 
					                               na.NavigateTo("");
 | 
				
			||||||
| 
						 | 
					@ -178,41 +149,8 @@
 | 
				
			||||||
        globalStateService.Reviewer = null;
 | 
					        globalStateService.Reviewer = null;
 | 
				
			||||||
        na.NavigateTo("");
 | 
					        na.NavigateTo("");
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    async Task OpenStorage()
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
        try
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
            var b = await _portUtil.OpenStorage();
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
        catch (Exception ex)
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
            logger.Info($"开储物箱发生错误,{ex.Message}");
 | 
					 | 
				
			||||||
            _message.Notify(
 | 
					 | 
				
			||||||
                new NotificationMessage { Severity = NotificationSeverity.Error, Summary = "提示", Detail = $"开储物箱发生错误,{ex.Message}", Duration = 4000 }
 | 
					 | 
				
			||||||
            );
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    private DotNetObjectReference<MainLayout>? dotNetObjectReference;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    protected override async Task OnAfterRenderAsync(bool firstRender)
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
        if (firstRender)
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
            dotNetObjectReference = DotNetObjectReference.Create(this);
 | 
					 | 
				
			||||||
            await JSRuntime.InvokeVoidAsync("registerMouseClickHandler", dotNetObjectReference);
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    [JSInvokable]
 | 
					@code
 | 
				
			||||||
    public void HandleMouseClick(int clientX, int clientY)
 | 
					 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
        // 这里处理鼠标点击事件,例如记录日志或更新状态
 | 
					 | 
				
			||||||
        // Console.WriteLine($"Mouse clicked at: ({clientX}, {clientY})");
 | 
					 | 
				
			||||||
        _portUtil.mouseClickTime = DateTime.Now;
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    public void Dispose()
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
        dotNetObjectReference?.Dispose();
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -77,13 +77,17 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@inject NavigationManager Navigation
 | 
					@inject NavigationManager Navigation
 | 
				
			||||||
@inject ISettingManuDao settingManuDao;
 | 
					@inject ISettingManuDao settingManuDao;
 | 
				
			||||||
 | 
					@inject Toolbelt.Blazor.I18nText.I18nText I18nText;
 | 
				
			||||||
@code {
 | 
					@code {
 | 
				
			||||||
 | 
					    private I18nText.local myText = new I18nText.local();
 | 
				
			||||||
    RadzenPanelMenu panelMenu;
 | 
					    RadzenPanelMenu panelMenu;
 | 
				
			||||||
    List<SettingManu> menuItems = new();
 | 
					    List<SettingManu> menuItems = new();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    protected override async Task OnInitializedAsync()
 | 
					    protected override async Task OnInitializedAsync()
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        menuItems = await settingManuDao.GetMenuItemsAsync();
 | 
					        myText = await I18nText.GetTextTableAsync<I18nText.local>(this);
 | 
				
			||||||
 | 
					        string culture = I18nText.GetCurrentLanguageAsync().Result == "en-US" ? "en" : "zh-CN"; ;
 | 
				
			||||||
 | 
					        menuItems = await settingManuDao.GetMenuItemsAsync(culture);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    // async void jump2Page(string path)
 | 
					    // async void jump2Page(string path)
 | 
				
			||||||
    // {
 | 
					    // {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,5 +1,5 @@
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
  "connectionStrings": "server=127.0.0.1;port=3306;database=zhongbuzhanqu;userid=root;password=qq1223;Charset=utf8mb4;",
 | 
					  "connectionStrings": "server=127.0.0.1;port=3306;database=hkcdb;userid=root;password=qq1223;Charset=utf8mb4;",
 | 
				
			||||||
  "finger": {
 | 
					  "finger": {
 | 
				
			||||||
    "ip": "192.168.50.59",
 | 
					    "ip": "192.168.50.59",
 | 
				
			||||||
    "port": 4370,
 | 
					    "port": 4370,
 | 
				
			||||||
| 
						 | 
					@ -7,44 +7,29 @@
 | 
				
			||||||
  },
 | 
					  },
 | 
				
			||||||
  "setting": {
 | 
					  "setting": {
 | 
				
			||||||
    "machineId": "DM1",
 | 
					    "machineId": "DM1",
 | 
				
			||||||
    //药房代码,有则写无则空
 | 
					    "storage": 1,
 | 
				
			||||||
    //. 药房代码:      武昌  07010323  麻醉科小药柜 8个抽屉     
 | 
					    "loginMode": 2,
 | 
				
			||||||
    //                  汉口  "07010363" "麻醉科 16个抽屉",
 | 
					 | 
				
			||||||
    "storage": "07010323",
 | 
					 | 
				
			||||||
    "inPharmacyId": "062303",
 | 
					 | 
				
			||||||
    "roomName": "麻醉科手术室",
 | 
					 | 
				
			||||||
    "loginMode": 1,
 | 
					 | 
				
			||||||
    "opFirst": true,
 | 
					    "opFirst": true,
 | 
				
			||||||
    //自动退出登录时间,单位秒(0不自动退出)
 | 
					    //自动退出登录时间,单位秒(0不自动退出)
 | 
				
			||||||
    "autoOutLog": 0,
 | 
					    "autoOutLog": 0,
 | 
				
			||||||
    "boxMachineId": "DM5",
 | 
					    "boxMachineId": "DM5"
 | 
				
			||||||
    "anaesthetist_name": "未选择,杨俊哲,周丹,刘方,罗丁,陈晓龙,杜金菊,季楠,王彩红,凌娜佳,汪宏,谈世刚,罗中兵,郭慧,廖家涛,殷国江,李坤,周翔,秦明哲,王庆利,张燕辉,姜佳佳,宋晓阳,胡晓",
 | 
					 | 
				
			||||||
    "boxColor": "白,绿",
 | 
					 | 
				
			||||||
    //打开抽屉时报警0关闭1开启
 | 
					 | 
				
			||||||
    "alert": 0
 | 
					 | 
				
			||||||
  },
 | 
					  },
 | 
				
			||||||
  "port": {
 | 
					  "port": {
 | 
				
			||||||
    "drawerPortPath": "COM5",
 | 
					    "drawerPortPath": "COM2",
 | 
				
			||||||
    "drawerProtocol": 485,
 | 
					    "drawerProtocol": 485,
 | 
				
			||||||
    "scanCodePortPath": "COM3",
 | 
					    "scanCodePortPath": "COM1",
 | 
				
			||||||
 | 
					    "canBusPortPath": "COM31",
 | 
				
			||||||
    "canBusExsit": true,
 | 
					    "canBusExsit": true,
 | 
				
			||||||
    "canBusPortPath": "COM6",
 | 
					 | 
				
			||||||
    "totalDrawerCount": 16,
 | 
					 | 
				
			||||||
    "canBusTwoExsit": true,
 | 
					 | 
				
			||||||
    "StorageCan": 1,
 | 
					 | 
				
			||||||
    //第二个can总线端口
 | 
					 | 
				
			||||||
    "canBusPortPathTwo": "COM9",
 | 
					 | 
				
			||||||
    "doorAddr": 0,
 | 
					    "doorAddr": 0,
 | 
				
			||||||
    "storageBoxAddr": 0,
 | 
					    "storageBoxAddr": 0,
 | 
				
			||||||
    "fridgePortExist": false,
 | 
					    "fridgePortExist": false,
 | 
				
			||||||
    "fridgePortPath": "COM3"
 | 
					    "fridgePortPath": "COM3"
 | 
				
			||||||
  },
 | 
					  },
 | 
				
			||||||
  "drawer": {
 | 
					  "drawer": {
 | 
				
			||||||
    "single": [ 1,2 ],
 | 
					    "single": [ 3 ],
 | 
				
			||||||
    "weigh": [ 4 ],
 | 
					    "weigh": [ 4 ],
 | 
				
			||||||
    "box": [ 4 ],
 | 
					    "box": [ 4 ],
 | 
				
			||||||
    "label": [ 4 ],
 | 
					    "label": [ 4 ]
 | 
				
			||||||
    "returnDrawer": [12,14]
 | 
					 | 
				
			||||||
  },
 | 
					  },
 | 
				
			||||||
  "fridge": {
 | 
					  "fridge": {
 | 
				
			||||||
    //冰箱温度区间
 | 
					    //冰箱温度区间
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
Some files were not shown because too many files have changed in this diff Show More
		Loading…
	
		Reference in New Issue