Compare commits
	
		
			No commits in common. "ba687a1dd0e05cbf3d80255e50f5eee79576dafa" and "1c91715d36915afa70282a69bf940cff862016f5" have entirely different histories.
		
	
	
		
			ba687a1dd0
			...
			1c91715d36
		
	
		| 
						 | 
					@ -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>();
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
        
 | 
					        
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -32,69 +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(int DrawerNo, int? take, int? skip);
 | 
					        Task<PageData<PlanDetails>> GetBoxDrugInfo(int DrawerNo, int? take, int? skip);
 | 
				
			||||||
        //药盒移库时获取选中药盒号的药品信息
 | 
					        //药箱移库时获取选中药箱号的药品信息
 | 
				
			||||||
        Task<PageData<ChannelStock>> GetChannelStockByDrug(ChannelStock cs, int 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<int[]> 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<int[]> 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, int 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();
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -26,11 +26,9 @@ 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 OrderrNo, DateTime? OrderDate, int? take, int? skip);
 | 
					 | 
				
			||||||
        //获取所有药盒号 
 | 
					 | 
				
			||||||
        public Task<int[]> GetDrawerNum(string machineId);
 | 
					        public Task<int[]> GetDrawerNum(string machineId);
 | 
				
			||||||
        //核对处方
 | 
					        //核对处方
 | 
				
			||||||
        public Task<bool> CheckOrderInfo(IList<OrderInfo> selectedOrderInfos, int DrawerNo);
 | 
					        public Task<bool> CheckOrderInfo(IList<OrderInfo> selectedOrderInfos, int DrawerNo);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -13,9 +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<PageData<ReportUsageDateInfo>> GetOrderInfoData(DateTime? startDate);
 | 
					 | 
				
			||||||
        //请领登记表导出
 | 
					 | 
				
			||||||
        Task<PageData<ReportApplyInfo>> GetApplyInfoDate(DateTime searchDate);
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -11,7 +11,6 @@ using Microsoft.Extensions.Options;
 | 
				
			||||||
using Mysqlx.Crud;
 | 
					using Mysqlx.Crud;
 | 
				
			||||||
using System.Collections.Generic;
 | 
					using System.Collections.Generic;
 | 
				
			||||||
using System.Data;
 | 
					using System.Data;
 | 
				
			||||||
using System.Linq;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace MasaBlazorApp3.DataAccess.Impl
 | 
					namespace MasaBlazorApp3.DataAccess.Impl
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
| 
						 | 
					@ -550,7 +549,7 @@ namespace MasaBlazorApp3.DataAccess.Impl
 | 
				
			||||||
                .ToListAsync();
 | 
					                .ToListAsync();
 | 
				
			||||||
            return new ChannelStockWithDrawerCount<ChannelStock>() { DrawerArray = ints, ChannelStocks = channelStocks };
 | 
					            return new ChannelStockWithDrawerCount<ChannelStock>() { DrawerArray = ints, ChannelStocks = channelStocks };
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        //手术室药盒获取绑定数据
 | 
					        //手术室药箱获取绑定数据
 | 
				
			||||||
        public async Task<PageMultiData<ChannelList, Plan>> GetAllChannelListWithPlan(int? take, int? skip)
 | 
					        public async Task<PageMultiData<ChannelList, Plan>> GetAllChannelListWithPlan(int? take, int? skip)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -604,83 +603,7 @@ namespace MasaBlazorApp3.DataAccess.Impl
 | 
				
			||||||
            };
 | 
					            };
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        /// <summary>
 | 
					        /// <summary>
 | 
				
			||||||
        /// 手术室药盒绑定套餐
 | 
					        /// 手术室药箱绑定套餐
 | 
				
			||||||
        /// </summary>
 | 
					 | 
				
			||||||
        /// <returns></returns>
 | 
					 | 
				
			||||||
        public async Task<bool> BindBox(ChannelList list,Plan plan)
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
            try
 | 
					 | 
				
			||||||
            {
 | 
					 | 
				
			||||||
                _connection.BeginTransaction();
 | 
					 | 
				
			||||||
                bool bFlag = true;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                var q = _connection.ChannelList
 | 
					 | 
				
			||||||
                    .Where(cs => cs.Id == list.Id).Set(cs => cs.DrugId, plan.Id.ToString());
 | 
					 | 
				
			||||||
                //将套餐中的药品信息写入channelStock
 | 
					 | 
				
			||||||
                //查询套餐中药品信息
 | 
					 | 
				
			||||||
                var query = _connection.PlanDetails.AsQueryable().Where(p => p.PlanId == plan.Id && p.UseState == 1);
 | 
					 | 
				
			||||||
                List<PlanDetails> planInfos = await query.ToListAsync();
 | 
					 | 
				
			||||||
                if (planInfos != null && planInfos.Count > 0)
 | 
					 | 
				
			||||||
                {
 | 
					 | 
				
			||||||
                    for (int i = 0; i < planInfos.Count; i++)
 | 
					 | 
				
			||||||
                    {
 | 
					 | 
				
			||||||
                        int mid = await _connection.InsertAsync(new ChannelStock()
 | 
					 | 
				
			||||||
                        {
 | 
					 | 
				
			||||||
                            Id = Guid.NewGuid().ToString(),
 | 
					 | 
				
			||||||
                            ListId = list.Id,
 | 
					 | 
				
			||||||
                            MachineId = list.MachineId,
 | 
					 | 
				
			||||||
                            DrawerNo = list.DrawerNo,
 | 
					 | 
				
			||||||
                            DrugId = planInfos[i].DrugId.ToString(),
 | 
					 | 
				
			||||||
                            BaseQuantity = planInfos[i].BaseQuantity,
 | 
					 | 
				
			||||||
                            //BoxState = 1
 | 
					 | 
				
			||||||
                        });
 | 
					 | 
				
			||||||
                        if (mid > 0)
 | 
					 | 
				
			||||||
                        {
 | 
					 | 
				
			||||||
                            bFlag = true;
 | 
					 | 
				
			||||||
                        }
 | 
					 | 
				
			||||||
                        else
 | 
					 | 
				
			||||||
                        {
 | 
					 | 
				
			||||||
                            bFlag = false;
 | 
					 | 
				
			||||||
                            break;
 | 
					 | 
				
			||||||
                        }
 | 
					 | 
				
			||||||
                    }
 | 
					 | 
				
			||||||
                }
 | 
					 | 
				
			||||||
                var r = await q.UpdateAsync();
 | 
					 | 
				
			||||||
                if (bFlag && r > 0)
 | 
					 | 
				
			||||||
                {
 | 
					 | 
				
			||||||
                    //保存操作记录
 | 
					 | 
				
			||||||
                    int mid = _connection.InsertWithInt32Identity(new MachineRecord()
 | 
					 | 
				
			||||||
                    {
 | 
					 | 
				
			||||||
                        MachineId = _setting.machineId,
 | 
					 | 
				
			||||||
                        DrawerNo = list.DrawerNo,
 | 
					 | 
				
			||||||
                        ColNo = list.ColNo,
 | 
					 | 
				
			||||||
                        DrugId = list.DrugId,
 | 
					 | 
				
			||||||
                        OperationTime = DateTime.Now,
 | 
					 | 
				
			||||||
                        Type = 55,
 | 
					 | 
				
			||||||
                        Quantity = list.TotalQuantity,
 | 
					 | 
				
			||||||
                        Operator = _globalStateService.Operator.Id,
 | 
					 | 
				
			||||||
                        Reviewer = _globalStateService.Reviewer?.Id ?? _globalStateService.Operator.Id,
 | 
					 | 
				
			||||||
                        InvoiceId = $"药盒{list.DrawerNo}绑定套餐{list.DrugId}",
 | 
					 | 
				
			||||||
                        //GetId = operationVo.data.Id
 | 
					 | 
				
			||||||
                    });
 | 
					 | 
				
			||||||
                    _connection.CommitTransaction();
 | 
					 | 
				
			||||||
                    return true;
 | 
					 | 
				
			||||||
                }
 | 
					 | 
				
			||||||
                else
 | 
					 | 
				
			||||||
                {
 | 
					 | 
				
			||||||
                    _connection.RollbackTransaction();
 | 
					 | 
				
			||||||
                    return false;
 | 
					 | 
				
			||||||
                }
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
            catch (Exception ex)
 | 
					 | 
				
			||||||
            {
 | 
					 | 
				
			||||||
                _connection.RollbackTransaction();
 | 
					 | 
				
			||||||
                logger.Info($"绑定套餐异常{ex.Message}");
 | 
					 | 
				
			||||||
                return false;
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
        /// <summary>
 | 
					 | 
				
			||||||
        /// 手术室药盒绑定套餐
 | 
					 | 
				
			||||||
        /// </summary>
 | 
					        /// </summary>
 | 
				
			||||||
        /// <returns></returns>
 | 
					        /// <returns></returns>
 | 
				
			||||||
        public async Task<bool> BindBox(ChannelList list)
 | 
					        public async Task<bool> BindBox(ChannelList list)
 | 
				
			||||||
| 
						 | 
					@ -708,7 +631,7 @@ namespace MasaBlazorApp3.DataAccess.Impl
 | 
				
			||||||
                            DrawerNo = list.DrawerNo,
 | 
					                            DrawerNo = list.DrawerNo,
 | 
				
			||||||
                            DrugId = planInfos[i].DrugId.ToString(),
 | 
					                            DrugId = planInfos[i].DrugId.ToString(),
 | 
				
			||||||
                            BaseQuantity = planInfos[i].BaseQuantity,
 | 
					                            BaseQuantity = planInfos[i].BaseQuantity,
 | 
				
			||||||
                            //BoxState = 1
 | 
					                            BoxState = 1
 | 
				
			||||||
                        });
 | 
					                        });
 | 
				
			||||||
                        if (mid > 0)
 | 
					                        if (mid > 0)
 | 
				
			||||||
                        {
 | 
					                        {
 | 
				
			||||||
| 
						 | 
					@ -724,21 +647,6 @@ namespace MasaBlazorApp3.DataAccess.Impl
 | 
				
			||||||
                var r = await q.UpdateAsync();
 | 
					                var r = await q.UpdateAsync();
 | 
				
			||||||
                if (bFlag && r > 0)
 | 
					                if (bFlag && r > 0)
 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
                    //保存操作记录
 | 
					 | 
				
			||||||
                    int mid = _connection.InsertWithInt32Identity(new MachineRecord()
 | 
					 | 
				
			||||||
                    {
 | 
					 | 
				
			||||||
                        MachineId = _setting.machineId,
 | 
					 | 
				
			||||||
                        DrawerNo = list.DrawerNo,
 | 
					 | 
				
			||||||
                        ColNo = list.ColNo,
 | 
					 | 
				
			||||||
                        DrugId = list.DrugId,
 | 
					 | 
				
			||||||
                        OperationTime = DateTime.Now,
 | 
					 | 
				
			||||||
                        Type = 55,
 | 
					 | 
				
			||||||
                        Quantity = list.TotalQuantity,
 | 
					 | 
				
			||||||
                        Operator = _globalStateService.Operator.Id,
 | 
					 | 
				
			||||||
                        Reviewer = _globalStateService.Reviewer?.Id ?? _globalStateService.Operator.Id,
 | 
					 | 
				
			||||||
                        InvoiceId = $"药盒{list.DrawerNo}绑定套餐{list.DrugId}",
 | 
					 | 
				
			||||||
                        //GetId = operationVo.data.Id
 | 
					 | 
				
			||||||
                    });
 | 
					 | 
				
			||||||
                    _connection.CommitTransaction();
 | 
					                    _connection.CommitTransaction();
 | 
				
			||||||
                    return true;
 | 
					                    return true;
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
| 
						 | 
					@ -756,7 +664,7 @@ namespace MasaBlazorApp3.DataAccess.Impl
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        /// <summary>
 | 
					        /// <summary>
 | 
				
			||||||
        /// 手术室药盒解绑套餐
 | 
					        /// 手术室药箱解绑套餐
 | 
				
			||||||
        /// </summary>
 | 
					        /// </summary>
 | 
				
			||||||
        /// <param name="list"></param>
 | 
					        /// <param name="list"></param>
 | 
				
			||||||
        /// <returns></returns>
 | 
					        /// <returns></returns>
 | 
				
			||||||
| 
						 | 
					@ -770,29 +678,10 @@ namespace MasaBlazorApp3.DataAccess.Impl
 | 
				
			||||||
                     .Where(cs => cs.Id == list.Id)
 | 
					                     .Where(cs => cs.Id == list.Id)
 | 
				
			||||||
                     .Set(cs => cs.DrugId, String.Empty)
 | 
					                     .Set(cs => cs.DrugId, String.Empty)
 | 
				
			||||||
                     .UpdateAsync();
 | 
					                     .UpdateAsync();
 | 
				
			||||||
                int iCount = await _connection.ChannelStock.Where(cs => cs.ListId == list.Id).CountAsync();
 | 
					
 | 
				
			||||||
                int cs = 0;
 | 
					                var cs = await _connection.ChannelStock.Where(cs => cs.ListId == list.Id).DeleteAsync();
 | 
				
			||||||
                if (iCount > 0)
 | 
					                if (r > 0 && cs > 0)
 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
                    cs = await _connection.ChannelStock.Where(cs => cs.ListId == list.Id).DeleteAsync();
 | 
					 | 
				
			||||||
                }
 | 
					 | 
				
			||||||
                if (r > 0 && (iCount > 0 && cs > 0 || iCount <= 0))
 | 
					 | 
				
			||||||
                {
 | 
					 | 
				
			||||||
                    //保存操作记录
 | 
					 | 
				
			||||||
                    int mid = _connection.InsertWithInt32Identity(new MachineRecord()
 | 
					 | 
				
			||||||
                    {
 | 
					 | 
				
			||||||
                        MachineId = _setting.machineId,
 | 
					 | 
				
			||||||
                        DrawerNo = list.DrawerNo,
 | 
					 | 
				
			||||||
                        ColNo = list.ColNo,
 | 
					 | 
				
			||||||
                        DrugId = list.DrugId,
 | 
					 | 
				
			||||||
                        OperationTime = DateTime.Now,
 | 
					 | 
				
			||||||
                        Type = 56,
 | 
					 | 
				
			||||||
                        Quantity = list.TotalQuantity,
 | 
					 | 
				
			||||||
                        Operator = _globalStateService.Operator.Id,
 | 
					 | 
				
			||||||
                        Reviewer = _globalStateService.Reviewer?.Id ?? _globalStateService.Operator.Id,
 | 
					 | 
				
			||||||
                        InvoiceId = $"药盒{list.DrawerNo}解绑套餐{list.DrugId}",
 | 
					 | 
				
			||||||
                        //GetId = operationVo.data.Id
 | 
					 | 
				
			||||||
                    });
 | 
					 | 
				
			||||||
                    _connection.CommitTransaction();
 | 
					                    _connection.CommitTransaction();
 | 
				
			||||||
                    return true;
 | 
					                    return true;
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
| 
						 | 
					@ -805,31 +694,29 @@ namespace MasaBlazorApp3.DataAccess.Impl
 | 
				
			||||||
            catch (Exception ex)
 | 
					            catch (Exception ex)
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                _connection.RollbackTransaction();
 | 
					                _connection.RollbackTransaction();
 | 
				
			||||||
                logger.Info($"手术室药盒解绑异常:{ex.Message}");
 | 
					                logger.Info($"手术室药箱解绑异常:{ex.Message}");
 | 
				
			||||||
                return false;
 | 
					                return false;
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        //获取手术室药盒中所有要补药的数据
 | 
					        //获取手术室药箱中所有要补药的数据
 | 
				
			||||||
        public async Task<PageData<ChannelList>> GetAllBoxAddDrug(int? take, int? skip)
 | 
					        public async Task<PageData<ChannelList>> GetAllBoxAddDrug(int? take, int? skip)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            try
 | 
					            try
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                List<ChannelList> channelLists = new List<ChannelList>();
 | 
					                List<ChannelList> channelLists = new List<ChannelList>();
 | 
				
			||||||
                var query = _connection.ChannelStock//.AsQueryable()
 | 
					                var query = _connection.ChannelStock//.AsQueryable()
 | 
				
			||||||
                .Where(cs => cs.MachineId == _setting.boxMachineId)
 | 
					                .Where(cs => cs.MachineId == _setting.boxMachineId && cs.BoxState == 1)
 | 
				
			||||||
                .GroupBy(cs => new { cs.DrawerNo, cs.DrugId })
 | 
					                .GroupBy(cs => new { cs.DrawerNo, cs.DrugId })
 | 
				
			||||||
                .Select(g => new
 | 
					                .Select(g => new
 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
                    DrawerNo = g.Key.DrawerNo,
 | 
					                    DrawerNo = g.Key.DrawerNo,
 | 
				
			||||||
                    DrugId = g.Key.DrugId,
 | 
					                    DrugId = g.Key.DrugId,
 | 
				
			||||||
                    sumQuantity = g.Sum(cs => cs.Quantity),
 | 
					                    sumQuantity = g.Sum(cs => cs.Quantity)
 | 
				
			||||||
                    baseQuantity = g.Max(cs => cs.BaseQuantity),
 | 
					                })
 | 
				
			||||||
                    sumAdd=g.Sum(cs=>cs.AddToQuantity)
 | 
					 | 
				
			||||||
                }).Where(x => x.baseQuantity > x.sumQuantity+x.sumAdd)
 | 
					 | 
				
			||||||
                .ToList();
 | 
					                .ToList();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                var queryChannelStock = _connection.ChannelStock.AsQueryable()
 | 
					                var queryChannelStock = _connection.ChannelStock.AsQueryable()
 | 
				
			||||||
               .Where(cs => cs.MachineId == _setting.boxMachineId)
 | 
					               .Where(cs => cs.MachineId == _setting.boxMachineId && cs.BoxState == 1)
 | 
				
			||||||
               .LoadWith(cs => cs.Drug).ToList();
 | 
					               .LoadWith(cs => cs.Drug).ToList();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -853,31 +740,6 @@ namespace MasaBlazorApp3.DataAccess.Impl
 | 
				
			||||||
                        channelLists.Add(queryList[i]);
 | 
					                        channelLists.Add(queryList[i]);
 | 
				
			||||||
                    }
 | 
					                    }
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
 | 
					 | 
				
			||||||
                //if (query != null && query.Count > 0)
 | 
					 | 
				
			||||||
                //{
 | 
					 | 
				
			||||||
                //    var queryList = await _connection.ChannelList.AsQueryable().Where(cl => cl.MachineId == _setting.boxMachineId).ToListAsync();
 | 
					 | 
				
			||||||
                //    for (int i = 0; i < queryList.Count; i++)
 | 
					 | 
				
			||||||
                //    {
 | 
					 | 
				
			||||||
                //        foreach (var item in query)
 | 
					 | 
				
			||||||
                //        {
 | 
					 | 
				
			||||||
                //            if (queryList[i].DrawerNo == item.DrawerNo)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                //            {
 | 
					 | 
				
			||||||
                //                ChannelStock? stock = _connection.ChannelStock.AsQueryable()
 | 
					 | 
				
			||||||
                //                    .Where(cs => cs.MachineId == _setting.boxMachineId && cs.DrawerNo == item.DrawerNo && cs.DrugId == item.DrugId).LoadWith(cs => cs.Drug).FirstOrDefault();
 | 
					 | 
				
			||||||
                //                stock.NeedQuantity = item.baseQuantity - item.sumQuantity;
 | 
					 | 
				
			||||||
                //                queryList[i].ChannelStocks.Add(stock);
 | 
					 | 
				
			||||||
                //            }
 | 
					 | 
				
			||||||
                //        }
 | 
					 | 
				
			||||||
                //        if (queryList[i].ChannelStocks != null && queryList[i].ChannelStocks.Count > 0)
 | 
					 | 
				
			||||||
                //        {
 | 
					 | 
				
			||||||
                //            channelLists.Add(queryList[i]);
 | 
					 | 
				
			||||||
                //        }
 | 
					 | 
				
			||||||
                //    }
 | 
					 | 
				
			||||||
                //}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                int pagedData = channelLists.Count;
 | 
					                int pagedData = channelLists.Count;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -892,12 +754,12 @@ namespace MasaBlazorApp3.DataAccess.Impl
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            catch (Exception ex)
 | 
					            catch (Exception ex)
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                logger.Info($"获取药盒中补药数据失败{ex.Message}");
 | 
					                logger.Info($"获取药箱中补药数据失败{ex.Message}");
 | 
				
			||||||
                return null;
 | 
					                return null;
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        //手术室药盒补药获取毒麻柜中的药品信息
 | 
					        //手术室药箱补药获取毒麻柜中的药品信息
 | 
				
			||||||
        public async Task<List<BoxTakeVo>> getTakeInfoByBox(ChannelList cl)
 | 
					        public async Task<List<BoxTakeVo>> getTakeInfoByBox(ChannelList cl)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            try
 | 
					            try
 | 
				
			||||||
| 
						 | 
					@ -986,7 +848,7 @@ namespace MasaBlazorApp3.DataAccess.Impl
 | 
				
			||||||
                return null;
 | 
					                return null;
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        //手术室药盒补药完成
 | 
					        //手术室药箱补药完成
 | 
				
			||||||
        public async Task<bool> BoxTakeFinish(List<BoxTakeVo> datas, ChannelList boxChannelList)
 | 
					        public async Task<bool> BoxTakeFinish(List<BoxTakeVo> datas, ChannelList boxChannelList)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -994,6 +856,17 @@ namespace MasaBlazorApp3.DataAccess.Impl
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                _connection.BeginTransaction();
 | 
					                _connection.BeginTransaction();
 | 
				
			||||||
                var flag = true;
 | 
					                var flag = true;
 | 
				
			||||||
 | 
					                // 更新处方状态
 | 
				
			||||||
 | 
					                //int r1 = _connection.ChannelStock.Where(oi => oi.OrderNo == datas.First().OrderDetail.OrderNo)
 | 
				
			||||||
 | 
					                //        .Set(oi => oi.Status, 1)
 | 
				
			||||||
 | 
					                //        .Update();
 | 
				
			||||||
 | 
					                //if (!(r1 > 0))
 | 
				
			||||||
 | 
					                //{
 | 
				
			||||||
 | 
					                //    flag = false;
 | 
				
			||||||
 | 
					                //    logger.Error("处方取药完成更新处方状态失败");
 | 
				
			||||||
 | 
					                //    _connection.RollbackTransaction();
 | 
				
			||||||
 | 
					                //    return flag;
 | 
				
			||||||
 | 
					                //}
 | 
				
			||||||
                for (var i = 0; i < datas.Count; i++)
 | 
					                for (var i = 0; i < datas.Count; i++)
 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
                    var boxTakeVo = datas[i];
 | 
					                    var boxTakeVo = datas[i];
 | 
				
			||||||
| 
						 | 
					@ -1048,7 +921,7 @@ namespace MasaBlazorApp3.DataAccess.Impl
 | 
				
			||||||
                    int r = _connection.ChannelStock.Where(cs => cs.Id == boxTakeVo.ChannelStock.Id)
 | 
					                    int r = _connection.ChannelStock.Where(cs => cs.Id == boxTakeVo.ChannelStock.Id)
 | 
				
			||||||
                        .Set(cs => cs.Quantity, boxTakeVo.ChannelStock.Quantity - boxTakeVo.GetQuantity)
 | 
					                        .Set(cs => cs.Quantity, boxTakeVo.ChannelStock.Quantity - boxTakeVo.GetQuantity)
 | 
				
			||||||
                        .Update();
 | 
					                        .Update();
 | 
				
			||||||
                    #region 保存账册,给药盒补药不记录出库账册
 | 
					                    #region 保存账册,给药箱补药不记录出库账册
 | 
				
			||||||
                    // 获取更新完库存之后的药品库存
 | 
					                    // 获取更新完库存之后的药品库存
 | 
				
			||||||
                    //List<ChannelStock> list = await _connection.ChannelStock.AsQueryable()
 | 
					                    //List<ChannelStock> list = await _connection.ChannelStock.AsQueryable()
 | 
				
			||||||
                    //     .InnerJoin(
 | 
					                    //     .InnerJoin(
 | 
				
			||||||
| 
						 | 
					@ -1058,7 +931,7 @@ namespace MasaBlazorApp3.DataAccess.Impl
 | 
				
			||||||
                    //     )
 | 
					                    //     )
 | 
				
			||||||
                    //     .Where(cs => cs.DrugId.Equals(boxTakeVo.ChannelStock.DrugId))
 | 
					                    //     .Where(cs => cs.DrugId.Equals(boxTakeVo.ChannelStock.DrugId))
 | 
				
			||||||
                    //     .ToListAsync();
 | 
					                    //     .ToListAsync();
 | 
				
			||||||
                    // 保存账册,给药盒补药不记录出库账册
 | 
					                    // 保存账册,给药箱补药不记录出库账册
 | 
				
			||||||
                    //int acid = _connection.InsertWithInt32Identity(new AccountBook()
 | 
					                    //int acid = _connection.InsertWithInt32Identity(new AccountBook()
 | 
				
			||||||
                    //{
 | 
					                    //{
 | 
				
			||||||
                    //    MachineId = _setting.machineId,
 | 
					                    //    MachineId = _setting.machineId,
 | 
				
			||||||
| 
						 | 
					@ -1076,40 +949,24 @@ namespace MasaBlazorApp3.DataAccess.Impl
 | 
				
			||||||
                    //    //InvoiceId = orderTakeVo.OrderDetail.Id.ToString()
 | 
					                    //    //InvoiceId = orderTakeVo.OrderDetail.Id.ToString()
 | 
				
			||||||
                    //});
 | 
					                    //});
 | 
				
			||||||
                    #endregion
 | 
					                    #endregion
 | 
				
			||||||
                    //查询药盒中是否有该批次药品,有则把对应数量累加,无则insert
 | 
					
 | 
				
			||||||
                    ChannelStock? BoxChannelStock = _connection.ChannelStock.AsQueryable()
 | 
					                    //更新药箱中的药品数量
 | 
				
			||||||
                        .Where(cs => cs.MachineId == boxTakeVo.BoxDetail.MachineId && cs.DrawerNo == boxTakeVo.BoxDetail.DrawerNo && cs.DrugId == boxTakeVo.ChannelStock.DrugId && cs.ManuNo == boxTakeVo.ChannelStock.ManuNo && cs.EffDate == EffDate).FirstOrDefault();
 | 
					                    int boxID = _connection.Insert(new ChannelStock()
 | 
				
			||||||
                    int boxID = 0;
 | 
					 | 
				
			||||||
                    if (BoxChannelStock != null)
 | 
					 | 
				
			||||||
                    {
 | 
					 | 
				
			||||||
                        //BoxChannelStock.AddToQuantity += boxTakeVo.GetQuantity;
 | 
					 | 
				
			||||||
                        //BoxChannelStock.BoxState = 2;
 | 
					 | 
				
			||||||
                        //改为直接加到药盒库存中
 | 
					 | 
				
			||||||
                        BoxChannelStock.Quantity += boxTakeVo.GetQuantity;
 | 
					 | 
				
			||||||
                        boxID = await _connection.UpdateAsync(BoxChannelStock);
 | 
					 | 
				
			||||||
                    }
 | 
					 | 
				
			||||||
                    else
 | 
					 | 
				
			||||||
                    {
 | 
					 | 
				
			||||||
                        //更新药盒中的药品数量
 | 
					 | 
				
			||||||
                        boxID = _connection.Insert(new ChannelStock()
 | 
					 | 
				
			||||||
                    {
 | 
					                    {
 | 
				
			||||||
                        Id = Guid.NewGuid().ToString(),
 | 
					                        Id = Guid.NewGuid().ToString(),
 | 
				
			||||||
                            ListId = boxTakeVo.BoxDetail.ListId,
 | 
					                        ListId = boxTakeVo.BoxDetail.Id,
 | 
				
			||||||
                        MachineId = _setting.boxMachineId,
 | 
					                        MachineId = _setting.boxMachineId,
 | 
				
			||||||
                        DrawerNo = boxTakeVo.BoxDetail.DrawerNo,
 | 
					                        DrawerNo = boxTakeVo.BoxDetail.DrawerNo,
 | 
				
			||||||
                            //AddToQuantity = boxTakeVo.Quantity,//boxTakeVo.GetQuantity,
 | 
					                        AddToQuantity = boxTakeVo.GetQuantity,
 | 
				
			||||||
                            //NeedQuantity = 0,
 | 
					                        NeedQuantity = 0,
 | 
				
			||||||
                            Quantity = boxTakeVo.GetQuantity,
 | 
					 | 
				
			||||||
                        DrugId = boxTakeVo.ChannelStock.DrugId,
 | 
					                        DrugId = boxTakeVo.ChannelStock.DrugId,
 | 
				
			||||||
                        ManuNo = boxTakeVo.ChannelStock.ManuNo,
 | 
					                        ManuNo = boxTakeVo.ChannelStock.ManuNo,
 | 
				
			||||||
                        EffDate = EffDate,
 | 
					                        EffDate = EffDate,
 | 
				
			||||||
                        BaseQuantity = boxTakeVo.BoxDetail.BaseQuantity,
 | 
					                        BaseQuantity = boxTakeVo.BoxDetail.BaseQuantity,
 | 
				
			||||||
                        BoardType = boxTakeVo.BoxDetail.BoardType,
 | 
					                        BoardType = boxTakeVo.BoxDetail.BoardType,
 | 
				
			||||||
                            //BoxState = 2, //补药完成
 | 
					                        BoxState = 2 //补药完成
 | 
				
			||||||
                            FillTime = DateTime.Now
 | 
					 | 
				
			||||||
                    });
 | 
					                    });
 | 
				
			||||||
                    }
 | 
					                    // 手术室药箱入库记录
 | 
				
			||||||
                    // 手术室药盒入库记录
 | 
					 | 
				
			||||||
                    int boxMId = _connection.InsertWithInt32Identity(new MachineRecord()
 | 
					                    int boxMId = _connection.InsertWithInt32Identity(new MachineRecord()
 | 
				
			||||||
                    {
 | 
					                    {
 | 
				
			||||||
                        MachineId = _setting.machineId,
 | 
					                        MachineId = _setting.machineId,
 | 
				
			||||||
| 
						 | 
					@ -1124,7 +981,11 @@ namespace MasaBlazorApp3.DataAccess.Impl
 | 
				
			||||||
                        Reviewer = _globalStateService.Reviewer?.Id ?? _globalStateService.Operator.Id,
 | 
					                        Reviewer = _globalStateService.Reviewer?.Id ?? _globalStateService.Operator.Id,
 | 
				
			||||||
                        InvoiceId = boxTakeVo.ChannelStock.Id.ToString(),
 | 
					                        InvoiceId = boxTakeVo.ChannelStock.Id.ToString(),
 | 
				
			||||||
                    });
 | 
					                    });
 | 
				
			||||||
                    int delResutl = await _connection.ChannelStock.Where(cs => cs.MachineId == boxTakeVo.BoxDetail.MachineId && cs.DrugId == boxTakeVo.BoxDetail.DrugId && cs.ManuNo == null).DeleteAsync();
 | 
					                    //int totalQuantity = _connection.PlanDetails.Where(p => p.PlanId == Convert.ToInt32(boxChannelList.DrugId)&&p.DrugId== boxTakeVo.BoxDetail.DrugId).Sum(p => p.BaseQuantity);
 | 
				
			||||||
 | 
					                    //int list = _connection.ChannelList.Where(cl => cl.Id == boxChannelList.Id)
 | 
				
			||||||
 | 
					                    //    .Set(cl => cl.TotalQuantity, totalQuantity)
 | 
				
			||||||
 | 
					                    //    .Update();
 | 
				
			||||||
 | 
					                    int delResutl = await _connection.ChannelStock.Where(cs => cs.Id == boxTakeVo.BoxDetail.Id).DeleteAsync();
 | 
				
			||||||
                    if (mid > 0 && r > 0 && boxID > 0 && boxMId > 0)
 | 
					                    if (mid > 0 && r > 0 && boxID > 0 && boxMId > 0)
 | 
				
			||||||
                    {
 | 
					                    {
 | 
				
			||||||
                        if (boxTakeVo.ChannelStock.BoardType.ToString().Contains("5"))
 | 
					                        if (boxTakeVo.ChannelStock.BoardType.ToString().Contains("5"))
 | 
				
			||||||
| 
						 | 
					@ -1141,10 +1002,6 @@ namespace MasaBlazorApp3.DataAccess.Impl
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
                if (flag)
 | 
					                if (flag)
 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
                    int totalQuantity = boxChannelList.TotalQuantity + datas.Sum(it => it.GetQuantity);
 | 
					 | 
				
			||||||
                    int list = _connection.ChannelList.Where(cl => cl.Id == boxChannelList.Id)
 | 
					 | 
				
			||||||
                        .Set(cl => cl.TotalQuantity, totalQuantity)
 | 
					 | 
				
			||||||
                        .Update();
 | 
					 | 
				
			||||||
                    _connection.CommitTransaction();
 | 
					                    _connection.CommitTransaction();
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
                else
 | 
					                else
 | 
				
			||||||
| 
						 | 
					@ -1163,23 +1020,21 @@ namespace MasaBlazorApp3.DataAccess.Impl
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        //手术室药盒入库
 | 
					        //手术室药箱入库
 | 
				
			||||||
        public async Task<PageData<ChannelList>> GetBoxWaitInfo(int? take, int? skip)
 | 
					        public async Task<PageData<ChannelList>> GetBoxWaitInfo(int? take, int? skip)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            try
 | 
					            try
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                List<ChannelList> channelLists = new List<ChannelList>();
 | 
					                List<ChannelList> channelLists = new List<ChannelList>();
 | 
				
			||||||
                var query = _connection.ChannelStock//.AsQueryable()
 | 
					                var query = _connection.ChannelStock//.AsQueryable()
 | 
				
			||||||
                .Where(cs => cs.MachineId == _setting.boxMachineId)
 | 
					                .Where(cs => cs.MachineId == _setting.boxMachineId && cs.BoxState == 2)
 | 
				
			||||||
                .GroupBy(cs => new { cs.DrawerNo, cs.DrugId })
 | 
					                .GroupBy(cs => new { cs.DrawerNo, cs.DrugId })
 | 
				
			||||||
                .Select(g => new
 | 
					                .Select(g => new
 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
                    DrawerNo = g.Key.DrawerNo,
 | 
					                    DrawerNo = g.Key.DrawerNo,
 | 
				
			||||||
                    DrugId = g.Key.DrugId,
 | 
					                    DrugId = g.Key.DrugId,
 | 
				
			||||||
                    sumQuantity = g.Sum(cs => cs.Quantity),
 | 
					                    sumQuantity = g.Sum(cs => cs.Quantity)
 | 
				
			||||||
                    baseQuantity = g.Max(cs => cs.BaseQuantity),
 | 
					                })
 | 
				
			||||||
                    AddToQuantity = g.Sum(cs => cs.AddToQuantity)
 | 
					 | 
				
			||||||
                }).Where(x => x.baseQuantity > x.sumQuantity)
 | 
					 | 
				
			||||||
                .ToList();
 | 
					                .ToList();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                var queryChannelStock = _connection.ChannelStock.AsQueryable()
 | 
					                var queryChannelStock = _connection.ChannelStock.AsQueryable()
 | 
				
			||||||
| 
						 | 
					@ -1194,11 +1049,10 @@ namespace MasaBlazorApp3.DataAccess.Impl
 | 
				
			||||||
                    {
 | 
					                    {
 | 
				
			||||||
                        if (queryList[i].DrawerNo == item.DrawerNo)
 | 
					                        if (queryList[i].DrawerNo == item.DrawerNo)
 | 
				
			||||||
                        {
 | 
					                        {
 | 
				
			||||||
                            ChannelStock? stock = queryChannelStock.Where(cs => cs.DrawerNo == item.DrawerNo && cs.DrugId == item.DrugId && cs.BaseQuantity > item.sumQuantity).FirstOrDefault();
 | 
					                            ChannelStock stock = queryChannelStock.Where(cs => cs.DrawerNo == item.DrawerNo && cs.DrugId == item.DrugId && cs.BaseQuantity > item.sumQuantity).FirstOrDefault();
 | 
				
			||||||
                            if (stock != null)
 | 
					                            if (stock != null)
 | 
				
			||||||
                            {
 | 
					                            {
 | 
				
			||||||
                                stock.NeedQuantity = stock.BaseQuantity - item.sumQuantity;
 | 
					                                stock.NeedQuantity = stock.BaseQuantity - item.sumQuantity;
 | 
				
			||||||
                                stock.AddToQuantity = item.AddToQuantity;
 | 
					 | 
				
			||||||
                                queryList[i].ChannelStocks.Add(stock);
 | 
					                                queryList[i].ChannelStocks.Add(stock);
 | 
				
			||||||
                            }
 | 
					                            }
 | 
				
			||||||
                        }
 | 
					                        }
 | 
				
			||||||
| 
						 | 
					@ -1222,43 +1076,11 @@ namespace MasaBlazorApp3.DataAccess.Impl
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            catch (Exception ex)
 | 
					            catch (Exception ex)
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                logger.Info($"获取药盒中补药数据失败{ex.Message}");
 | 
					                logger.Info($"获取药箱中补药数据失败{ex.Message}");
 | 
				
			||||||
                return null;
 | 
					                return null;
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        // 药盒入库弹窗页面获取要入库的药品明细信息
 | 
					        //手术室药箱入库获取待入库明细
 | 
				
			||||||
        public async Task<List<ChannelStock>> GetBoxAddToBox(ChannelList cl)
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
            if (cl != null)
 | 
					 | 
				
			||||||
            {
 | 
					 | 
				
			||||||
                List<DrugManuNo> manuNosList = new List<DrugManuNo>();
 | 
					 | 
				
			||||||
                foreach (var item in cl.ChannelStocks)
 | 
					 | 
				
			||||||
                {
 | 
					 | 
				
			||||||
                    List<DrugManuNo> manuList = new List<DrugManuNo>();
 | 
					 | 
				
			||||||
                    List<ChannelStock> csList = _connection.ChannelStock.Where(cs => cs.DrawerNo == item.DrawerNo && cs.DrugId == item.DrugId && cs.BoxState == 2).ToList();
 | 
					 | 
				
			||||||
                    for (int i = 0; i < csList.Count; i++)
 | 
					 | 
				
			||||||
                    {
 | 
					 | 
				
			||||||
                        var existingItem = manuList.FirstOrDefault(item => item.DrugId == csList[i].DrugId && item.ManuNo == csList[i].ManuNo&& item.EffDate.ToString() == csList[i].EffDate);
 | 
					 | 
				
			||||||
                        if (existingItem != null)
 | 
					 | 
				
			||||||
                        {
 | 
					 | 
				
			||||||
                            existingItem.Quantity += csList[i].AddToQuantity;
 | 
					 | 
				
			||||||
                        }
 | 
					 | 
				
			||||||
                        else
 | 
					 | 
				
			||||||
                        {
 | 
					 | 
				
			||||||
                            DrugManuNo manu = new DrugManuNo();
 | 
					 | 
				
			||||||
                            manu.DrugId = csList[i].DrugId;
 | 
					 | 
				
			||||||
                            manu.ManuNo = csList[i].ManuNo;
 | 
					 | 
				
			||||||
                            manu.EffDate = Convert.ToDateTime(csList[i].EffDate);
 | 
					 | 
				
			||||||
                            manu.Quantity = csList[i].AddToQuantity;
 | 
					 | 
				
			||||||
                            manuList.Add(manu);
 | 
					 | 
				
			||||||
                        }
 | 
					 | 
				
			||||||
                    }
 | 
					 | 
				
			||||||
                    item.drugManuNoList = manuList;
 | 
					 | 
				
			||||||
                }
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
            return cl.ChannelStocks;
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
        //手术室药盒入库获取待入库明细
 | 
					 | 
				
			||||||
        public async Task<List<BoxTakeVo>> getBoxWaitByBox(ChannelList cl, int? take, int? skip)
 | 
					        public async Task<List<BoxTakeVo>> getBoxWaitByBox(ChannelList cl, int? take, int? skip)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            try
 | 
					            try
 | 
				
			||||||
| 
						 | 
					@ -1297,7 +1119,7 @@ namespace MasaBlazorApp3.DataAccess.Impl
 | 
				
			||||||
                return null;
 | 
					                return null;
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        // 手术室药盒待入库明细入库完成
 | 
					        // 手术室药箱待入库明细入库完成
 | 
				
			||||||
        public async Task<bool> BoxAddBoxFinish(ChannelList boxChannelList)
 | 
					        public async Task<bool> BoxAddBoxFinish(ChannelList boxChannelList)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            try
 | 
					            try
 | 
				
			||||||
| 
						 | 
					@ -1307,74 +1129,61 @@ namespace MasaBlazorApp3.DataAccess.Impl
 | 
				
			||||||
                int totalQuantity =0;
 | 
					                int totalQuantity =0;
 | 
				
			||||||
                for (var i = 0; i < boxChannelList.ChannelStocks.Count; i++)
 | 
					                for (var i = 0; i < boxChannelList.ChannelStocks.Count; i++)
 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
                    for (int j = 0; j < boxChannelList.ChannelStocks[i].drugManuNoList.Count; j++)
 | 
					
 | 
				
			||||||
                    {
 | 
					                    var EffDate = boxChannelList.ChannelStocks[i].EffDate;
 | 
				
			||||||
                        var EffDate = boxChannelList.ChannelStocks[i].drugManuNoList[j].EffDate?.ToString("yyyy-MM-dd");
 | 
					 | 
				
			||||||
                    //效期转换出错
 | 
					                    //效期转换出错
 | 
				
			||||||
                        //if (boxChannelList.ChannelStocks[i].EffDate != null)
 | 
					                    if (boxChannelList.ChannelStocks[i].EffDate != null)
 | 
				
			||||||
                        //{
 | 
					                    {
 | 
				
			||||||
                        //    string[] idate = boxChannelList.ChannelStocks[i].EffDate.Split('/');
 | 
					                        string[] idate = boxChannelList.ChannelStocks[i].EffDate.Split('/');
 | 
				
			||||||
                        //    foreach (string iS in idate)
 | 
					                        foreach (string iS in idate)
 | 
				
			||||||
                        //    {
 | 
					                        {
 | 
				
			||||||
                        //        if (!string.IsNullOrEmpty(iS.Trim()))
 | 
					                            if (!string.IsNullOrEmpty(iS.Trim()))
 | 
				
			||||||
                        //        {
 | 
					                            {
 | 
				
			||||||
                        //            switch (iS.Trim().Length)
 | 
					                                switch (iS.Trim().Length)
 | 
				
			||||||
                        //            {
 | 
					                                {
 | 
				
			||||||
                        //                case 4:
 | 
					                                    case 4:
 | 
				
			||||||
                        //                    EffDate = iS.Trim();
 | 
					                                        EffDate = iS.Trim();
 | 
				
			||||||
                        //                    break;
 | 
					                                        break;
 | 
				
			||||||
                        //                case 2:
 | 
					                                    case 2:
 | 
				
			||||||
                        //                    EffDate += "-" + iS.Trim();
 | 
					                                        EffDate += "-" + iS.Trim();
 | 
				
			||||||
                        //                    break;
 | 
					                                        break;
 | 
				
			||||||
                        //                case 1:
 | 
					                                    case 1:
 | 
				
			||||||
                        //                    EffDate += "-0" + iS.Trim();
 | 
					                                        EffDate += "-0" + iS.Trim();
 | 
				
			||||||
                        //                    break;
 | 
					                                        break;
 | 
				
			||||||
                        //            }
 | 
					                                }
 | 
				
			||||||
                        //        }
 | 
					                            }
 | 
				
			||||||
                        //    }
 | 
					                        }
 | 
				
			||||||
                        //}
 | 
					                    }
 | 
				
			||||||
                        // 手术室药盒入库记录
 | 
					                    // 手术室药箱入库记录
 | 
				
			||||||
                    int mid = _connection.InsertWithInt32Identity(new MachineRecord()
 | 
					                    int mid = _connection.InsertWithInt32Identity(new MachineRecord()
 | 
				
			||||||
                    {
 | 
					                    {
 | 
				
			||||||
                        MachineId = _setting.boxMachineId,
 | 
					                        MachineId = _setting.boxMachineId,
 | 
				
			||||||
                        DrawerNo = boxChannelList.ChannelStocks[i].DrawerNo, 
 | 
					                        DrawerNo = boxChannelList.ChannelStocks[i].DrawerNo, 
 | 
				
			||||||
                        DrugId = boxChannelList.ChannelStocks[i].DrugId,
 | 
					                        DrugId = boxChannelList.ChannelStocks[i].DrugId,
 | 
				
			||||||
                            ManuNo = boxChannelList.ChannelStocks[i].drugManuNoList[j].ManuNo,
 | 
					                        ManuNo = boxChannelList.ChannelStocks[i].ManuNo,
 | 
				
			||||||
                            EffDate = boxChannelList.ChannelStocks[i].drugManuNoList[j].EffDate,//!String.IsNullOrEmpty(EffDate) ? DateTime.ParseExact(EffDate, "yyyy-MM-dd", System.Globalization.CultureInfo.CurrentCulture) : null,
 | 
					                        EffDate = !String.IsNullOrEmpty(EffDate) ? DateTime.ParseExact(EffDate, "yyyy-MM-dd", System.Globalization.CultureInfo.CurrentCulture) : null,
 | 
				
			||||||
                        OperationTime = DateTime.Now,
 | 
					                        OperationTime = DateTime.Now,
 | 
				
			||||||
                        Type = 1,
 | 
					                        Type = 1,
 | 
				
			||||||
                            Quantity = boxChannelList.ChannelStocks[i].drugManuNoList[j].Quantity,
 | 
					                        Quantity = boxChannelList.ChannelStocks[i].AddToQuantity,
 | 
				
			||||||
                        Operator = _globalStateService.Operator.Id,
 | 
					                        Operator = _globalStateService.Operator.Id,
 | 
				
			||||||
                        Reviewer = _globalStateService.Reviewer?.Id ?? _globalStateService.Operator.Id,
 | 
					                        Reviewer = _globalStateService.Reviewer?.Id ?? _globalStateService.Operator.Id,
 | 
				
			||||||
                        InvoiceId = boxChannelList.ChannelStocks[i].Id.ToString(),
 | 
					                        InvoiceId = boxChannelList.ChannelStocks[i].Id.ToString(),
 | 
				
			||||||
                    });
 | 
					                    });
 | 
				
			||||||
                    // 更新库存
 | 
					                    // 更新库存
 | 
				
			||||||
                        ChannelStock? updateChannelStock = _connection.ChannelStock.AsQueryable()
 | 
					                    boxChannelList.ChannelStocks[i].Quantity= boxChannelList.ChannelStocks[i].Quantity+ boxChannelList.ChannelStocks[i].AddToQuantity;
 | 
				
			||||||
                            .Where(cs => cs.DrawerNo == boxChannelList.ChannelStocks[i].DrawerNo && cs.DrugId == boxChannelList.ChannelStocks[i].drugManuNoList[j].DrugId&&cs.ManuNo== boxChannelList.ChannelStocks[i].drugManuNoList[j].ManuNo&&cs.EffDate == EffDate)
 | 
					                    boxChannelList.ChannelStocks[i].AddToQuantity = 0;
 | 
				
			||||||
                            .FirstOrDefault();
 | 
					                    boxChannelList.ChannelStocks[i].NeedQuantity = 0;
 | 
				
			||||||
                        int r = 0;
 | 
					                    boxChannelList.ChannelStocks[i].BoxState=0;
 | 
				
			||||||
                        if (updateChannelStock != null)
 | 
					                    boxChannelList.ChannelStocks[i].EffDate = EffDate;
 | 
				
			||||||
                        {
 | 
					                    int r = _connection.Update(boxChannelList.ChannelStocks[i]);
 | 
				
			||||||
                            updateChannelStock.Quantity = updateChannelStock.Quantity+ boxChannelList.ChannelStocks[i].drugManuNoList[j].Quantity;
 | 
					 | 
				
			||||||
                            updateChannelStock.AddToQuantity = 0;
 | 
					 | 
				
			||||||
                            updateChannelStock.NeedQuantity = 0;
 | 
					 | 
				
			||||||
                            updateChannelStock.BoxState = 0;
 | 
					 | 
				
			||||||
                            //updateChannelStock.EffDate = EffDate?.ToString("yyyy-MM-dd");
 | 
					 | 
				
			||||||
                            //updateChannelStock.ManuNo = boxChannelList.ChannelStocks[i].drugManuNoList[j].ManuNo;
 | 
					 | 
				
			||||||
                            r = _connection.Update(updateChannelStock);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
                        }
 | 
					                    totalQuantity += _connection.PlanDetails.Where(p => p.PlanId == Convert.ToInt32(boxChannelList.DrugId) && p.DrugId == boxChannelList.ChannelStocks[i].DrugId).Sum(p => p.BaseQuantity);
 | 
				
			||||||
                  
 | 
					                  
 | 
				
			||||||
                        //totalQuantity += _connection.PlanDetails.Where(p => p.PlanId == Convert.ToInt32(boxChannelList.DrugId) && p.DrugId == boxChannelList.ChannelStocks[i].DrugId).Sum(p => p.BaseQuantity);
 | 
					                    if (!(mid > 0 && r > 0 ))                   
 | 
				
			||||||
                        totalQuantity += boxChannelList.ChannelStocks[i].drugManuNoList[j].Quantity;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                        if (!(mid > 0 && (updateChannelStock == null || r > 0)))
 | 
					 | 
				
			||||||
                    {
 | 
					                    {
 | 
				
			||||||
                        flag = false;
 | 
					                        flag = false;
 | 
				
			||||||
                        break;
 | 
					                        break;
 | 
				
			||||||
                    }
 | 
					                    }
 | 
				
			||||||
 | 
					 | 
				
			||||||
                    }
 | 
					 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
                if (flag)
 | 
					                if (flag)
 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
| 
						 | 
					@ -1386,8 +1195,7 @@ namespace MasaBlazorApp3.DataAccess.Impl
 | 
				
			||||||
                        _connection.CommitTransaction();
 | 
					                        _connection.CommitTransaction();
 | 
				
			||||||
                    }
 | 
					                    }
 | 
				
			||||||
                    else
 | 
					                    else
 | 
				
			||||||
                    {
 | 
					                    {                         flag = false;
 | 
				
			||||||
                        flag = false;
 | 
					 | 
				
			||||||
                        _connection.RollbackTransaction();
 | 
					                        _connection.RollbackTransaction();
 | 
				
			||||||
                    }
 | 
					                    }
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
| 
						 | 
					@ -1399,12 +1207,12 @@ namespace MasaBlazorApp3.DataAccess.Impl
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            catch (Exception ex)
 | 
					            catch (Exception ex)
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                logger.Info($"手术室药盒待入库明细入库完成操作异常:{ex.Message}");
 | 
					                logger.Info($"手术室药箱待入库明细入库完成操作异常:{ex.Message}");
 | 
				
			||||||
                return false;
 | 
					                return false;
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        //手术室药盒获取药盒药品及库存信息
 | 
					        //手术室药箱获取药箱药品及库存信息
 | 
				
			||||||
        public async Task<PageData<PlanDetails>> GetBoxDrugInfo(int DrawerNo, int? take, int? skip)
 | 
					        public async Task<PageData<PlanDetails>> GetBoxDrugInfo(int DrawerNo, int? take, int? skip)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            var query = _connection.PlanDetails.AsQueryable()
 | 
					            var query = _connection.PlanDetails.AsQueryable()
 | 
				
			||||||
| 
						 | 
					@ -1456,7 +1264,7 @@ namespace MasaBlazorApp3.DataAccess.Impl
 | 
				
			||||||
            };
 | 
					            };
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        //药盒移库时获取选中药盒号的药品信息
 | 
					        //药箱移库时获取选中药箱号的药品信息
 | 
				
			||||||
        public async Task<PageData<ChannelStock>> GetChannelStockByDrug(ChannelStock cs, int drawerNo, int? take, int? skip)
 | 
					        public async Task<PageData<ChannelStock>> GetChannelStockByDrug(ChannelStock cs, int drawerNo, int? take, int? skip)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            try
 | 
					            try
 | 
				
			||||||
| 
						 | 
					@ -1483,14 +1291,14 @@ namespace MasaBlazorApp3.DataAccess.Impl
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            catch (Exception ex)
 | 
					            catch (Exception ex)
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                logger.Info($"药盒移库时获取选中药盒号的药品信息异常:{ex.Message}");
 | 
					                logger.Info($"药箱移库时获取选中药箱号的药品信息异常:{ex.Message}");
 | 
				
			||||||
                return null;
 | 
					                return null;
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        /// <summary>
 | 
					        /// <summary>
 | 
				
			||||||
        /// 药盒交换药品获取所有除本药盒外的所有药盒号
 | 
					        /// 药箱交换药品获取所有除本药箱外的所有药箱号
 | 
				
			||||||
        /// </summary>
 | 
					        /// </summary>
 | 
				
			||||||
        /// <param name="machineId"></param>
 | 
					        /// <param name="machineId"></param>
 | 
				
			||||||
        /// <returns></returns>
 | 
					        /// <returns></returns>
 | 
				
			||||||
| 
						 | 
					@ -1501,7 +1309,7 @@ namespace MasaBlazorApp3.DataAccess.Impl
 | 
				
			||||||
            return ints;
 | 
					            return ints;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        /// <summary>
 | 
					        /// <summary>
 | 
				
			||||||
        /// 药盒移除药品,获取所有除本药盒外的所有包含该药品的药盒号
 | 
					        /// 药箱移除药品,获取所有除本药箱外的所有包含该药品的药箱号
 | 
				
			||||||
        /// </summary>
 | 
					        /// </summary>
 | 
				
			||||||
        /// <param name="machineId"></param>
 | 
					        /// <param name="machineId"></param>
 | 
				
			||||||
        /// <returns></returns>
 | 
					        /// <returns></returns>
 | 
				
			||||||
| 
						 | 
					@ -1510,7 +1318,7 @@ namespace MasaBlazorApp3.DataAccess.Impl
 | 
				
			||||||
            int[] ints = _connection.ChannelStock.Where(cs => cs.MachineId == channelStock.MachineId && cs.DrugId == channelStock.DrugId && cs.DrawerNo != channelStock.DrawerNo).GroupBy(cs => cs.DrawerNo).Select(cs => cs.Key).ToArray();
 | 
					            int[] ints = _connection.ChannelStock.Where(cs => cs.MachineId == channelStock.MachineId && cs.DrugId == channelStock.DrugId && cs.DrawerNo != channelStock.DrawerNo).GroupBy(cs => cs.DrawerNo).Select(cs => cs.Key).ToArray();
 | 
				
			||||||
            return ints;
 | 
					            return ints;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        //手术室药盒交换药品完成
 | 
					        //手术室药箱交换药品完成
 | 
				
			||||||
        public async Task<bool> BoxReplaceFinish(ChannelStock stock, List<ChannelStock> stockList)
 | 
					        public async Task<bool> BoxReplaceFinish(ChannelStock stock, List<ChannelStock> stockList)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            try
 | 
					            try
 | 
				
			||||||
| 
						 | 
					@ -1519,7 +1327,7 @@ namespace MasaBlazorApp3.DataAccess.Impl
 | 
				
			||||||
                _connection.BeginTransaction();
 | 
					                _connection.BeginTransaction();
 | 
				
			||||||
                for (int i = 0; i < stockList.Count; i++)
 | 
					                for (int i = 0; i < stockList.Count; i++)
 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
                    //查询出药的药盒是否有该批次的药品
 | 
					                    //查询出药的药箱是否有该批次的药品
 | 
				
			||||||
                    ChannelStock replace1ChannelStock = _connection.ChannelStock.AsQueryable()
 | 
					                    ChannelStock replace1ChannelStock = _connection.ChannelStock.AsQueryable()
 | 
				
			||||||
                        .Where(cs => cs.MachineId == stockList[i].MachineId && cs.DrawerNo == stock.DrawerNo && cs.DrugId == stockList[i].DrugId && cs.ManuNo == stockList[i].ManuNo && cs.EffDate == stockList[i].EffDate)
 | 
					                        .Where(cs => cs.MachineId == stockList[i].MachineId && cs.DrawerNo == stock.DrawerNo && cs.DrugId == stockList[i].DrugId && cs.ManuNo == stockList[i].ManuNo && cs.EffDate == stockList[i].EffDate)
 | 
				
			||||||
                        .FirstOrDefault();
 | 
					                        .FirstOrDefault();
 | 
				
			||||||
| 
						 | 
					@ -1531,7 +1339,7 @@ namespace MasaBlazorApp3.DataAccess.Impl
 | 
				
			||||||
                            .Update();
 | 
					                            .Update();
 | 
				
			||||||
                        if (r <= 0)
 | 
					                        if (r <= 0)
 | 
				
			||||||
                        {
 | 
					                        {
 | 
				
			||||||
                            logger.Info($"更新药盒药品数量失败,药盒号:{stockList[i].DrawerNo},药品ID:{stockList[i].DrugId}");
 | 
					                            logger.Info($"更新药箱药品数量失败,药箱号:{stockList[i].DrawerNo},药品ID:{stockList[i].DrugId}");
 | 
				
			||||||
                        }
 | 
					                        }
 | 
				
			||||||
                    }
 | 
					                    }
 | 
				
			||||||
                    else
 | 
					                    else
 | 
				
			||||||
| 
						 | 
					@ -1547,11 +1355,11 @@ namespace MasaBlazorApp3.DataAccess.Impl
 | 
				
			||||||
                            EffDate = stockList[i].EffDate,
 | 
					                            EffDate = stockList[i].EffDate,
 | 
				
			||||||
                            Quantity = stockList[i].AddToQuantity,
 | 
					                            Quantity = stockList[i].AddToQuantity,
 | 
				
			||||||
                            BaseQuantity = stockList[i].BaseQuantity,
 | 
					                            BaseQuantity = stockList[i].BaseQuantity,
 | 
				
			||||||
                            //BoxState = 1
 | 
					                            BoxState = 1
 | 
				
			||||||
                        });
 | 
					                        });
 | 
				
			||||||
                        if (mid <= 0)
 | 
					                        if (mid <= 0)
 | 
				
			||||||
                        {
 | 
					                        {
 | 
				
			||||||
                            logger.Info($"新增药盒药品记录失败,药盒号:{stockList[i].DrawerNo},药品ID:{stockList[i].DrugId}");
 | 
					                            logger.Info($"新增药箱药品记录失败,药箱号:{stockList[i].DrawerNo},药品ID:{stockList[i].DrugId}");
 | 
				
			||||||
                            flag = false;
 | 
					                            flag = false;
 | 
				
			||||||
                            break;
 | 
					                            break;
 | 
				
			||||||
                        }
 | 
					                        }
 | 
				
			||||||
| 
						 | 
					@ -1574,14 +1382,14 @@ namespace MasaBlazorApp3.DataAccess.Impl
 | 
				
			||||||
                    });
 | 
					                    });
 | 
				
			||||||
                    if (recordId <= 0)
 | 
					                    if (recordId <= 0)
 | 
				
			||||||
                    {
 | 
					                    {
 | 
				
			||||||
                        logger.Info($"药盒{stock.DrawerNo}交换药品新增操作记录失败,药盒号:{stockList[i].DrawerNo},药品ID:{stockList[i].DrugId}");
 | 
					                        logger.Info($"药箱{stock.DrawerNo}交换药品新增操作记录失败,药箱号:{stockList[i].DrawerNo},药品ID:{stockList[i].DrugId}");
 | 
				
			||||||
                        flag = false;
 | 
					                        flag = false;
 | 
				
			||||||
                        break;
 | 
					                        break;
 | 
				
			||||||
                    }
 | 
					                    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                    //更新入药的药盒中的药品数量
 | 
					                    //更新入药的药箱中的药品数量
 | 
				
			||||||
                    ChannelStock replace2ChannelStock = _connection.ChannelStock.AsQueryable()
 | 
					                    ChannelStock replace2ChannelStock = _connection.ChannelStock.AsQueryable()
 | 
				
			||||||
                         .Where(cs => cs.MachineId == stockList[i].MachineId && cs.DrawerNo == stockList[i].DrawerNo && cs.DrugId == stock.DrugId && cs.ManuNo == stock.ManuNo && cs.EffDate == stock.EffDate)
 | 
					                         .Where(cs => cs.MachineId == stockList[i].MachineId && cs.DrawerNo == stockList[i].DrawerNo && cs.DrugId == stock.DrugId && cs.ManuNo == stock.ManuNo && cs.EffDate == stock.EffDate)
 | 
				
			||||||
                         .FirstOrDefault();
 | 
					                         .FirstOrDefault();
 | 
				
			||||||
| 
						 | 
					@ -1593,7 +1401,7 @@ namespace MasaBlazorApp3.DataAccess.Impl
 | 
				
			||||||
                            .Update();
 | 
					                            .Update();
 | 
				
			||||||
                        if (r <= 0)
 | 
					                        if (r <= 0)
 | 
				
			||||||
                        {
 | 
					                        {
 | 
				
			||||||
                            logger.Info($"更新药盒药品数量失败,药盒号:{stockList[i].DrawerNo},药品ID:{stockList[i].DrugId}");
 | 
					                            logger.Info($"更新药箱药品数量失败,药箱号:{stockList[i].DrawerNo},药品ID:{stockList[i].DrugId}");
 | 
				
			||||||
                            flag = false;
 | 
					                            flag = false;
 | 
				
			||||||
                            break;
 | 
					                            break;
 | 
				
			||||||
                        }
 | 
					                        }
 | 
				
			||||||
| 
						 | 
					@ -1611,11 +1419,11 @@ namespace MasaBlazorApp3.DataAccess.Impl
 | 
				
			||||||
                            EffDate = stock.EffDate,
 | 
					                            EffDate = stock.EffDate,
 | 
				
			||||||
                            Quantity = stockList[i].AddQuantity,
 | 
					                            Quantity = stockList[i].AddQuantity,
 | 
				
			||||||
                            BaseQuantity = stock.BaseQuantity,
 | 
					                            BaseQuantity = stock.BaseQuantity,
 | 
				
			||||||
                            //BoxState = 1
 | 
					                            BoxState = 1
 | 
				
			||||||
                        });
 | 
					                        });
 | 
				
			||||||
                        if (mid <= 0)
 | 
					                        if (mid <= 0)
 | 
				
			||||||
                        {
 | 
					                        {
 | 
				
			||||||
                            logger.Info($"新增药盒药品记录失败,药盒号:{stockList[i].DrawerNo},药品ID:{stockList[i].DrugId}");
 | 
					                            logger.Info($"新增药箱药品记录失败,药箱号:{stockList[i].DrawerNo},药品ID:{stockList[i].DrugId}");
 | 
				
			||||||
                            flag = false;
 | 
					                            flag = false;
 | 
				
			||||||
                            break;
 | 
					                            break;
 | 
				
			||||||
                        }
 | 
					                        }
 | 
				
			||||||
| 
						 | 
					@ -1638,27 +1446,27 @@ namespace MasaBlazorApp3.DataAccess.Impl
 | 
				
			||||||
                    });
 | 
					                    });
 | 
				
			||||||
                    if (record2Id <= 0)
 | 
					                    if (record2Id <= 0)
 | 
				
			||||||
                    {
 | 
					                    {
 | 
				
			||||||
                        logger.Info($"药盒{stock.DrawerNo}交换药品新增操作记录失败,药盒号:{stockList[i].DrawerNo},药品ID:{stockList[i].DrugId}");
 | 
					                        logger.Info($"药箱{stock.DrawerNo}交换药品新增操作记录失败,药箱号:{stockList[i].DrawerNo},药品ID:{stockList[i].DrugId}");
 | 
				
			||||||
                        flag = false;
 | 
					                        flag = false;
 | 
				
			||||||
                        break;
 | 
					                        break;
 | 
				
			||||||
                    }
 | 
					                    }
 | 
				
			||||||
                    //出库药盒减数量
 | 
					                    //出库药箱减数量
 | 
				
			||||||
                    int updateQuantity = _connection.ChannelStock.Where(cs => cs.Id == stock.Id)
 | 
					                    int updateQuantity = _connection.ChannelStock.Where(cs => cs.Id == stock.Id)
 | 
				
			||||||
                           .Set(cs => cs.Quantity, stock.Quantity - stockList[i].AddQuantity)
 | 
					                           .Set(cs => cs.Quantity, stock.Quantity - stockList[i].AddQuantity)
 | 
				
			||||||
                           .Update();
 | 
					                           .Update();
 | 
				
			||||||
                    if (updateQuantity <= 0)
 | 
					                    if (updateQuantity <= 0)
 | 
				
			||||||
                    {
 | 
					                    {
 | 
				
			||||||
                        logger.Info($"更新出库药盒药品减数量失败,药盒号:{stock.DrawerNo},药品ID:{stock.DrugId}");
 | 
					                        logger.Info($"更新出库药箱药品减数量失败,药箱号:{stock.DrawerNo},药品ID:{stock.DrugId}");
 | 
				
			||||||
                        flag = false;
 | 
					                        flag = false;
 | 
				
			||||||
                        break;
 | 
					                        break;
 | 
				
			||||||
                    }
 | 
					                    }
 | 
				
			||||||
                    //入库药盒减数量
 | 
					                    //入库药箱减数量
 | 
				
			||||||
                    int updateQuantity2 = _connection.ChannelStock.Where(cs => cs.Id == stockList[i].Id)
 | 
					                    int updateQuantity2 = _connection.ChannelStock.Where(cs => cs.Id == stockList[i].Id)
 | 
				
			||||||
                            .Set(cs => cs.Quantity, stockList[i].Quantity - stockList[i].AddQuantity)
 | 
					                            .Set(cs => cs.Quantity, stockList[i].Quantity - stockList[i].AddQuantity)
 | 
				
			||||||
                            .Update();
 | 
					                            .Update();
 | 
				
			||||||
                    if (updateQuantity2 <= 0)
 | 
					                    if (updateQuantity2 <= 0)
 | 
				
			||||||
                    {
 | 
					                    {
 | 
				
			||||||
                        logger.Info($"更新入库药盒药品减数量失败,药盒号:{stockList[i].DrawerNo},药品ID:{stockList[i].DrugId}"); flag = false;
 | 
					                        logger.Info($"更新入库药箱药品减数量失败,药箱号:{stockList[i].DrawerNo},药品ID:{stockList[i].DrugId}"); flag = false;
 | 
				
			||||||
                        break;
 | 
					                        break;
 | 
				
			||||||
                    }
 | 
					                    }
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
| 
						 | 
					@ -1676,12 +1484,12 @@ namespace MasaBlazorApp3.DataAccess.Impl
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            catch (Exception ex)
 | 
					            catch (Exception ex)
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                logger.Info($"手术室药盒交换药品完成异常:{ex.Message}");
 | 
					                logger.Info($"手术室药箱交换药品完成异常:{ex.Message}");
 | 
				
			||||||
                _connection.RollbackTransaction();
 | 
					                _connection.RollbackTransaction();
 | 
				
			||||||
                return false;
 | 
					                return false;
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        //手术室药盒移出药品完成
 | 
					        //手术室药箱移出药品完成
 | 
				
			||||||
        public async Task<bool> BoxRemoveFinish(ChannelStock stock, int SelectedDrawerNo, int removeQuantity)
 | 
					        public async Task<bool> BoxRemoveFinish(ChannelStock stock, int SelectedDrawerNo, int removeQuantity)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            try
 | 
					            try
 | 
				
			||||||
| 
						 | 
					@ -1700,7 +1508,7 @@ namespace MasaBlazorApp3.DataAccess.Impl
 | 
				
			||||||
                        .Update();
 | 
					                        .Update();
 | 
				
			||||||
                    if (r <= 0)
 | 
					                    if (r <= 0)
 | 
				
			||||||
                    {
 | 
					                    {
 | 
				
			||||||
                        logger.Info($"手术室药盒移出药品更新数量失败,药盒号:{SelectedDrawerNo},药品ID:{stock.DrugId}");
 | 
					                        logger.Info($"手术室药箱移出药品更新数量失败,药箱号:{SelectedDrawerNo},药品ID:{stock.DrugId}");
 | 
				
			||||||
                    }
 | 
					                    }
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
                else
 | 
					                else
 | 
				
			||||||
| 
						 | 
					@ -1718,7 +1526,7 @@ namespace MasaBlazorApp3.DataAccess.Impl
 | 
				
			||||||
                        .Update();
 | 
					                        .Update();
 | 
				
			||||||
                        if (mid <= 0)
 | 
					                        if (mid <= 0)
 | 
				
			||||||
                        {
 | 
					                        {
 | 
				
			||||||
                            logger.Info($"更新药盒药品批次记录失败,药盒号:{stock.DrawerNo},药品ID:{stock.DrugId}");
 | 
					                            logger.Info($"更新药箱药品批次记录失败,药箱号:{stock.DrawerNo},药品ID:{stock.DrugId}");
 | 
				
			||||||
                            flag = false;
 | 
					                            flag = false;
 | 
				
			||||||
                        }
 | 
					                        }
 | 
				
			||||||
                    }
 | 
					                    }
 | 
				
			||||||
| 
						 | 
					@ -1734,11 +1542,11 @@ namespace MasaBlazorApp3.DataAccess.Impl
 | 
				
			||||||
                            EffDate = stock.EffDate,
 | 
					                            EffDate = stock.EffDate,
 | 
				
			||||||
                            Quantity = removeQuantity,
 | 
					                            Quantity = removeQuantity,
 | 
				
			||||||
                            BaseQuantity = stock.BaseQuantity,
 | 
					                            BaseQuantity = stock.BaseQuantity,
 | 
				
			||||||
                            //BoxState = 1
 | 
					                            BoxState = 1
 | 
				
			||||||
                        });
 | 
					                        });
 | 
				
			||||||
                        if (mid <= 0)
 | 
					                        if (mid <= 0)
 | 
				
			||||||
                        {
 | 
					                        {
 | 
				
			||||||
                            logger.Info($"新增药盒药品记录失败,药盒号:{stock.DrawerNo},药品ID:{stock.DrugId}");
 | 
					                            logger.Info($"新增药箱药品记录失败,药箱号:{stock.DrawerNo},药品ID:{stock.DrugId}");
 | 
				
			||||||
                            flag = false;
 | 
					                            flag = false;
 | 
				
			||||||
                        }
 | 
					                        }
 | 
				
			||||||
                    }
 | 
					                    }
 | 
				
			||||||
| 
						 | 
					@ -1751,7 +1559,7 @@ namespace MasaBlazorApp3.DataAccess.Impl
 | 
				
			||||||
                            .Update();
 | 
					                            .Update();
 | 
				
			||||||
                    if (updateQuantity2 <= 0)
 | 
					                    if (updateQuantity2 <= 0)
 | 
				
			||||||
                    {
 | 
					                    {
 | 
				
			||||||
                        logger.Info($"更新入库药盒药品减数量失败,药盒号:{stock.DrawerNo},药品ID:{stock.DrugId}");
 | 
					                        logger.Info($"更新入库药箱药品减数量失败,药箱号:{stock.DrawerNo},药品ID:{stock.DrugId}");
 | 
				
			||||||
                        flag = false;
 | 
					                        flag = false;
 | 
				
			||||||
                    }
 | 
					                    }
 | 
				
			||||||
                    else
 | 
					                    else
 | 
				
			||||||
| 
						 | 
					@ -1766,7 +1574,7 @@ namespace MasaBlazorApp3.DataAccess.Impl
 | 
				
			||||||
                                .Set(cl => cl.TotalQuantity, channelList.TotalQuantity - removeQuantity)
 | 
					                                .Set(cl => cl.TotalQuantity, channelList.TotalQuantity - removeQuantity)
 | 
				
			||||||
                                .Update();
 | 
					                                .Update();
 | 
				
			||||||
                        }
 | 
					                        }
 | 
				
			||||||
                        //修改移入药盒的总库存数
 | 
					                        //修改移入药箱的总库存数
 | 
				
			||||||
                        ChannelList moveToChannelList = _connection.ChannelList.Where(cl => cl.MachineId == stock.MachineId && cl.DrawerNo == SelectedDrawerNo && cl.DrugId == stock.DrugId).FirstOrDefault();
 | 
					                        ChannelList moveToChannelList = _connection.ChannelList.Where(cl => cl.MachineId == stock.MachineId && cl.DrawerNo == SelectedDrawerNo && cl.DrugId == stock.DrugId).FirstOrDefault();
 | 
				
			||||||
                        if (moveToChannelList != null)
 | 
					                        if (moveToChannelList != null)
 | 
				
			||||||
                        {
 | 
					                        {
 | 
				
			||||||
| 
						 | 
					@ -1791,7 +1599,7 @@ namespace MasaBlazorApp3.DataAccess.Impl
 | 
				
			||||||
                        {
 | 
					                        {
 | 
				
			||||||
                            MachineId = stock.MachineId,
 | 
					                            MachineId = stock.MachineId,
 | 
				
			||||||
                            DrawerNo = stock.DrawerNo,
 | 
					                            DrawerNo = stock.DrawerNo,
 | 
				
			||||||
                            ColNo = SelectedDrawerNo,//移入的药盒号
 | 
					                            ColNo = SelectedDrawerNo,//移入的药箱号
 | 
				
			||||||
                            DrugId = stock.DrugId,
 | 
					                            DrugId = stock.DrugId,
 | 
				
			||||||
                            ManuNo = stock.ManuNo,
 | 
					                            ManuNo = stock.ManuNo,
 | 
				
			||||||
                            EffDate = !String.IsNullOrEmpty(stock.EffDate) ? DateTime.ParseExact(stock.EffDate, "yyyy-MM-dd", System.Globalization.CultureInfo.CurrentCulture) : null,
 | 
					                            EffDate = !String.IsNullOrEmpty(stock.EffDate) ? DateTime.ParseExact(stock.EffDate, "yyyy-MM-dd", System.Globalization.CultureInfo.CurrentCulture) : null,
 | 
				
			||||||
| 
						 | 
					@ -1804,7 +1612,7 @@ namespace MasaBlazorApp3.DataAccess.Impl
 | 
				
			||||||
                        });
 | 
					                        });
 | 
				
			||||||
                        if (recordId <= 0)
 | 
					                        if (recordId <= 0)
 | 
				
			||||||
                        {
 | 
					                        {
 | 
				
			||||||
                            logger.Info($"药盒{stock.DrawerNo}交换药品新增操作记录失败,药盒号:{stock.DrawerNo},药品ID:{stock.DrugId}");
 | 
					                            logger.Info($"药箱{stock.DrawerNo}交换药品新增操作记录失败,药箱号:{stock.DrawerNo},药品ID:{stock.DrugId}");
 | 
				
			||||||
                            flag = false;
 | 
					                            flag = false;
 | 
				
			||||||
                        }
 | 
					                        }
 | 
				
			||||||
                    }
 | 
					                    }
 | 
				
			||||||
| 
						 | 
					@ -1823,63 +1631,11 @@ namespace MasaBlazorApp3.DataAccess.Impl
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            catch (Exception ex)
 | 
					            catch (Exception ex)
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                logger.Info($"手术室药盒移出药品异常{ex.Message}");
 | 
					                logger.Info($"手术室药箱移出药品异常{ex.Message}");
 | 
				
			||||||
                _connection.RollbackTransaction();
 | 
					                _connection.RollbackTransaction();
 | 
				
			||||||
                return false;
 | 
					                return false;
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 | 
				
			||||||
        public async Task<List<ChannelList>> GetAllBox()
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
            var query = _connection.ChannelList.AsQueryable();
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            return await query                
 | 
					 | 
				
			||||||
                .Where(cl => cl.MachineId == _setting.boxMachineId)
 | 
					 | 
				
			||||||
                .OrderBy((cl) => cl.DrawerNo)
 | 
					 | 
				
			||||||
                .ThenBy((cl) => cl.DrawerNo)
 | 
					 | 
				
			||||||
                .ThenBy((cl) => cl.ColNo)
 | 
					 | 
				
			||||||
                .ToListAsync();
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
        //根据药盒查询药品信息
 | 
					 | 
				
			||||||
        public async Task<List<ChannelStock>> GetChannelStockByBox(int BoxNum)
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
            var query = _connection.ChannelStock.AsQueryable()
 | 
					 | 
				
			||||||
                .Where(cl=>cl.MachineId==_setting.boxMachineId&&cl.DrawerNo==BoxNum&&cl.Quantity>0);
 | 
					 | 
				
			||||||
            return await query
 | 
					 | 
				
			||||||
                //.Where(cl=>cl.Quantity<=0)
 | 
					 | 
				
			||||||
                .OrderBy((cl) => cl.DrawerNo)
 | 
					 | 
				
			||||||
                .ThenBy((cl) => cl.DrawerNo)
 | 
					 | 
				
			||||||
                .ThenBy((cl) => cl.ColNo)
 | 
					 | 
				
			||||||
                .ToListAsync();
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
        //根据套餐下无库存的药箱
 | 
					 | 
				
			||||||
        public async Task<List<ChannelStock>> GetChannelStockByPlan(string plan)
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
            var query = await _connection.ChannelList.AsQueryable().Where(cl=>cl.MachineId==_setting.boxMachineId&&cl.DrugId== plan).Select(c=>c.DrawerNo).ToListAsync();
 | 
					 | 
				
			||||||
            if(query!=null&& query.Count>0)
 | 
					 | 
				
			||||||
            {
 | 
					 | 
				
			||||||
                return await _connection.ChannelStock.Where(c => query.Contains(c.DrawerNo) && c.MachineId == _setting.boxMachineId&&c.Quantity<=0).ToListAsync();
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
            return null;
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        //手术室药盒获取绑定数据
 | 
					 | 
				
			||||||
        public async Task<List<ChannelList>> GetAllChannelList()
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            var query = _connection.ChannelList.AsQueryable()
 | 
					 | 
				
			||||||
                .Where(cl => cl.MachineId == _setting.boxMachineId);
 | 
					 | 
				
			||||||
            //.LoadWith(cl=>cl.PlanInfo);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            int pagedData = await query.CountAsync();
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            List<ChannelList> list = await query
 | 
					 | 
				
			||||||
                .OrderBy((cl) => cl.DrawerNo)
 | 
					 | 
				
			||||||
                .ToListAsync();
 | 
					 | 
				
			||||||
            return list;
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -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)
 | 
				
			||||||
| 
						 | 
					@ -233,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,
 | 
					 | 
				
			||||||
                                });
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
                            }
 | 
					                            }
 | 
				
			||||||
                            // 更新 取药记录 设置还药数量、状态
 | 
					                            // 更新 取药记录 设置还药数量、状态
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,5 +1,4 @@
 | 
				
			||||||
using Google.Protobuf;
 | 
					using LinqToDB;
 | 
				
			||||||
using LinqToDB;
 | 
					 | 
				
			||||||
using LinqToDB.SqlQuery;
 | 
					using LinqToDB.SqlQuery;
 | 
				
			||||||
using log4net;
 | 
					using log4net;
 | 
				
			||||||
using log4net.Util;
 | 
					using log4net.Util;
 | 
				
			||||||
| 
						 | 
					@ -11,12 +10,10 @@ 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 Radzen;
 | 
					 | 
				
			||||||
using Radzen.Blazor.Rendering;
 | 
					using Radzen.Blazor.Rendering;
 | 
				
			||||||
using System;
 | 
					using System;
 | 
				
			||||||
using System.Collections;
 | 
					using System.Collections;
 | 
				
			||||||
using System.Collections.Generic;
 | 
					using System.Collections.Generic;
 | 
				
			||||||
using System.Data;
 | 
					 | 
				
			||||||
using System.Linq;
 | 
					using System.Linq;
 | 
				
			||||||
using System.Text;
 | 
					using System.Text;
 | 
				
			||||||
using System.Threading.Tasks;
 | 
					using System.Threading.Tasks;
 | 
				
			||||||
| 
						 | 
					@ -31,14 +28,13 @@ namespace MasaBlazorApp3.DataAccess.Impl
 | 
				
			||||||
        private GlobalStateService _globalStateService;
 | 
					        private GlobalStateService _globalStateService;
 | 
				
			||||||
        private readonly ILog logger = LogManager.GetLogger(typeof(OrderInfoDao));
 | 
					        private readonly ILog logger = LogManager.GetLogger(typeof(OrderInfoDao));
 | 
				
			||||||
        private readonly PortUtil _portUtil;
 | 
					        private readonly PortUtil _portUtil;
 | 
				
			||||||
        NotificationService _message;
 | 
					
 | 
				
			||||||
        public OrderInfoDao(AppDataConnection connection, IOptions<SettingConfig> setting, GlobalStateService globalStateService, PortUtil portUtil, NotificationService message)
 | 
					        public OrderInfoDao(AppDataConnection connection, IOptions<SettingConfig> setting, GlobalStateService globalStateService, PortUtil portUtil)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            _connection = connection;
 | 
					            _connection = connection;
 | 
				
			||||||
            _setting = setting.Value;
 | 
					            _setting = setting.Value;
 | 
				
			||||||
            _globalStateService = globalStateService;
 | 
					            _globalStateService = globalStateService;
 | 
				
			||||||
            _portUtil = portUtil;
 | 
					            _portUtil = portUtil;
 | 
				
			||||||
            _message = message;
 | 
					 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        public async Task<PageData<OrderInfo>> GetAllOrderInfo(string OrderrNo, DateTime OrderDate, int? take, int? skip)
 | 
					        public async Task<PageData<OrderInfo>> GetAllOrderInfo(string OrderrNo, DateTime OrderDate, int? take, int? skip)
 | 
				
			||||||
| 
						 | 
					@ -61,7 +57,7 @@ namespace MasaBlazorApp3.DataAccess.Impl
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            if (OrderDate != null && OrderDate != DateTime.MinValue)
 | 
					            if (OrderDate != null && OrderDate != DateTime.MinValue)
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                query = query.Where(oi => oi.ChargeDate.Date.Equals(OrderDate.Date));
 | 
					                query = query.Where(oi => oi.OrderDate.Date.Equals(OrderDate.Date));
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            query = query.Where(oi => oi.Status == 0);
 | 
					            query = query.Where(oi => oi.Status == 0);
 | 
				
			||||||
| 
						 | 
					@ -367,7 +363,7 @@ namespace MasaBlazorApp3.DataAccess.Impl
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            if (OrderDate != null && OrderDate != DateTime.MinValue)
 | 
					            if (OrderDate != null && OrderDate != DateTime.MinValue)
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                query = query.Where(oi => oi.ChargeDate.Date.Equals(OrderDate.Date));
 | 
					                query = query.Where(oi => oi.OrderDate.Date.Equals(OrderDate.Date));
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            query = query.Where(oi => oi.Status == 1);
 | 
					            query = query.Where(oi => oi.Status == 1);
 | 
				
			||||||
| 
						 | 
					@ -585,7 +581,7 @@ namespace MasaBlazorApp3.DataAccess.Impl
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        /// <summary>
 | 
					        /// <summary>
 | 
				
			||||||
        /// 获取药盒中的用药信息
 | 
					        /// 获取药箱中的用药信息
 | 
				
			||||||
        /// </summary>
 | 
					        /// </summary>
 | 
				
			||||||
        /// <param name="OrderrNo"></param>
 | 
					        /// <param name="OrderrNo"></param>
 | 
				
			||||||
        /// <param name="OrderDate"></param>
 | 
					        /// <param name="OrderDate"></param>
 | 
				
			||||||
| 
						 | 
					@ -595,12 +591,11 @@ namespace MasaBlazorApp3.DataAccess.Impl
 | 
				
			||||||
        public async Task<PageData<OrderInfo>> GetAllOrderInfoByBox(int box, string OrderrNo, DateTime OrderDate, int? take, int? skip)
 | 
					        public async Task<PageData<OrderInfo>> GetAllOrderInfoByBox(int box, string OrderrNo, DateTime OrderDate, int? take, int? skip)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            var query2 = from od in _connection.OrderDetail
 | 
					            var query2 = from od in _connection.OrderDetail
 | 
				
			||||||
                         from cl in _connection.ChannelStock.Where(c => c.MachineId == _setting.boxMachineId).InnerJoin(c => c.DrugId == od.DrugId)
 | 
					                         from cl in _connection.ChannelStock.Where(c => c.MachineId == _setting.machineId).InnerJoin(c => c.DrugId == od.DrugId)
 | 
				
			||||||
                         group od by od.OrderNo into temp
 | 
					                         group od by od.OrderNo into temp
 | 
				
			||||||
                         select new { temp.Key };
 | 
					                         select new { temp.Key };
 | 
				
			||||||
            var query = from oi in _connection.OrderInfo
 | 
					            var query = from oi in _connection.OrderInfo
 | 
				
			||||||
                        from od in query2.InnerJoin(od => od.Key == oi.OrderNo)
 | 
					                        from od in query2.InnerJoin(od => od.Key == oi.OrderNo)
 | 
				
			||||||
                        where oi.Pharmacy == _setting.storage
 | 
					 | 
				
			||||||
                        select oi;
 | 
					                        select oi;
 | 
				
			||||||
            if (!String.IsNullOrEmpty(OrderrNo))
 | 
					            if (!String.IsNullOrEmpty(OrderrNo))
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
| 
						 | 
					@ -608,7 +603,7 @@ namespace MasaBlazorApp3.DataAccess.Impl
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            if (OrderDate != null && OrderDate != DateTime.MinValue)
 | 
					            if (OrderDate != null && OrderDate != DateTime.MinValue)
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                query = query.Where(oi => oi.ChargeDate.Date.Equals(OrderDate.Date));
 | 
					                query = query.Where(oi => oi.OrderDate.Date.Equals(OrderDate.Date));
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            query = query.Where(oi => oi.Status == 0);
 | 
					            query = query.Where(oi => oi.Status == 0);
 | 
				
			||||||
| 
						 | 
					@ -619,7 +614,7 @@ namespace MasaBlazorApp3.DataAccess.Impl
 | 
				
			||||||
            int pagedData = await query.CountAsync();
 | 
					            int pagedData = await query.CountAsync();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            List<OrderInfo> list = await query
 | 
					            List<OrderInfo> list = await query
 | 
				
			||||||
                .LoadWith(oi => oi.DetailInfo)
 | 
					                //.LoadWith(oi => oi.DetailList)
 | 
				
			||||||
                .OrderBy((oi) => oi.RecvDate)
 | 
					                .OrderBy((oi) => oi.RecvDate)
 | 
				
			||||||
                .ThenBy((oi => oi.OrderNo))
 | 
					                .ThenBy((oi => oi.OrderNo))
 | 
				
			||||||
                .Skip((int)skip)
 | 
					                .Skip((int)skip)
 | 
				
			||||||
| 
						 | 
					@ -629,18 +624,11 @@ namespace MasaBlazorApp3.DataAccess.Impl
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                for (int i = 0; i < list.Count; i++)
 | 
					                for (int i = 0; i < list.Count; i++)
 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
                    //for (int j = 0; j < list[i].DetailList.Count; j++)
 | 
					                    for (int j = 0; j < list[i].DetailList.Count; j++)
 | 
				
			||||||
                    //{
 | 
					 | 
				
			||||||
                    if (list[i].DetailInfo != null && list[i].DetailInfo.Id > 0)
 | 
					 | 
				
			||||||
                    {
 | 
					                    {
 | 
				
			||||||
                        list[i].DetailInfo.Drug = await _connection.DrugInfo.AsQueryable().Where(d => d.DrugId == list[i].DetailInfo.DrugId).FirstOrDefaultAsync();
 | 
					                        list[i].DetailList[j].Drug = await _connection.DrugInfo.AsQueryable().Where(d => d.DrugId == list[i].DetailList[j].DrugId).FirstOrDefaultAsync();
 | 
				
			||||||
                        if (list[i].DetailInfo.Drug != null)
 | 
					 | 
				
			||||||
                        {
 | 
					 | 
				
			||||||
                            list[i].DetailInfo.Drug.Manus = await _connection.DrugManuNo.AsQueryable().Where(m => m.DrugId == list[i].DetailInfo.DrugId).ToListAsync();
 | 
					 | 
				
			||||||
                    }
 | 
					                    }
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
                    //}
 | 
					 | 
				
			||||||
                }
 | 
					 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -694,71 +682,7 @@ namespace MasaBlazorApp3.DataAccess.Impl
 | 
				
			||||||
            };
 | 
					            };
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        /// <summary>
 | 
					        /// <summary>
 | 
				
			||||||
        /// 获取待处理处方中的麻醉师
 | 
					        /// 获取所有药箱号
 | 
				
			||||||
        /// </summary>
 | 
					 | 
				
			||||||
        /// <param name="OrderrNo"></param>
 | 
					 | 
				
			||||||
        /// <param name="OrderDate"></param>
 | 
					 | 
				
			||||||
        /// <param name="take"></param>
 | 
					 | 
				
			||||||
        /// <param name="skip"></param>
 | 
					 | 
				
			||||||
        /// <returns></returns>
 | 
					 | 
				
			||||||
        public async Task<PageData<OrderInfo>> GetAllOrderInfo(string Name, string OrderrNo, DateTime? OrderDate, int? take, int? skip)
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
            var query2 = from od in _connection.OrderDetail
 | 
					 | 
				
			||||||
                         from cl in _connection.ChannelStock.Where(c => c.MachineId == _setting.boxMachineId).InnerJoin(c => c.DrugId == od.DrugId)
 | 
					 | 
				
			||||||
                         group od by od.OrderNo into temp
 | 
					 | 
				
			||||||
                         select new { temp.Key };
 | 
					 | 
				
			||||||
            var query = from oi in _connection.OrderInfo
 | 
					 | 
				
			||||||
                        from od in query2.InnerJoin(od => od.Key == oi.OrderNo)
 | 
					 | 
				
			||||||
                        where oi.Pharmacy == _setting.storage
 | 
					 | 
				
			||||||
                        select oi;
 | 
					 | 
				
			||||||
            if (!string.IsNullOrEmpty(Name))
 | 
					 | 
				
			||||||
            {
 | 
					 | 
				
			||||||
                query = query.Where(oi => oi.anaesthetistName == Name);
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            if (!String.IsNullOrEmpty(OrderrNo))
 | 
					 | 
				
			||||||
            {
 | 
					 | 
				
			||||||
                query = query.Where(oi => oi.OrderNo.Equals(OrderrNo));
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
            if (OrderDate != null && OrderDate != DateTime.MinValue)
 | 
					 | 
				
			||||||
            {
 | 
					 | 
				
			||||||
                query = query.Where(oi => oi.ChargeDate.Date.Equals(((DateTime)OrderDate).Date));
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
            query = query.Where(oi => oi.Status == 0);
 | 
					 | 
				
			||||||
            query = query.Where(oi => oi.HisDispFlag == 0);
 | 
					 | 
				
			||||||
            query = query.Where(oi => oi.CancelFlag == 0);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            int pagedData = await query.CountAsync();
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            List<OrderInfo> list = await query
 | 
					 | 
				
			||||||
                .LoadWith(oi => oi.DetailInfo)
 | 
					 | 
				
			||||||
                .OrderBy((oi) => oi.RecvDate)
 | 
					 | 
				
			||||||
                .ThenBy((oi => oi.OrderNo))
 | 
					 | 
				
			||||||
                //.Skip((int)skip)
 | 
					 | 
				
			||||||
                //.Take((int)take)
 | 
					 | 
				
			||||||
                .ToListAsync();
 | 
					 | 
				
			||||||
            if (list != null && list.Count > 0)
 | 
					 | 
				
			||||||
            {
 | 
					 | 
				
			||||||
                for (int i = 0; i < list.Count; i++)
 | 
					 | 
				
			||||||
                {
 | 
					 | 
				
			||||||
                    if (list[i].DetailInfo != null && list[i].DetailInfo.Id > 0)
 | 
					 | 
				
			||||||
                    {
 | 
					 | 
				
			||||||
                        list[i].DetailInfo.Drug = await _connection.DrugInfo.AsQueryable().Where(d => d.DrugId == list[i].DetailInfo.DrugId).FirstOrDefaultAsync();
 | 
					 | 
				
			||||||
                        if (list[i].DetailInfo.Drug != null)
 | 
					 | 
				
			||||||
                        {
 | 
					 | 
				
			||||||
                            list[i].DetailInfo.Drug.Manus = await _connection.DrugManuNo.AsQueryable().Where(m => m.DrugId == list[i].DetailInfo.DrugId).ToListAsync();
 | 
					 | 
				
			||||||
                        }
 | 
					 | 
				
			||||||
                    }
 | 
					 | 
				
			||||||
                }
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
            return new PageData<OrderInfo>()
 | 
					 | 
				
			||||||
            {
 | 
					 | 
				
			||||||
                TotalDesserts = pagedData,
 | 
					 | 
				
			||||||
                Desserts = list
 | 
					 | 
				
			||||||
            };
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
        /// <summary>
 | 
					 | 
				
			||||||
        /// 获取所有药盒号
 | 
					 | 
				
			||||||
        /// </summary>
 | 
					        /// </summary>
 | 
				
			||||||
        /// <param name="machineId"></param>
 | 
					        /// <param name="machineId"></param>
 | 
				
			||||||
        /// <returns></returns>
 | 
					        /// <returns></returns>
 | 
				
			||||||
| 
						 | 
					@ -783,38 +707,8 @@ namespace MasaBlazorApp3.DataAccess.Impl
 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
                    OrderInfo oi = selectedOrderInfos[i];
 | 
					                    OrderInfo oi = selectedOrderInfos[i];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 | 
				
			||||||
                    int drawerNo = DrawerNo;
 | 
					 | 
				
			||||||
                    if (oi.DetailInfo != null && oi.DetailInfo.Id > 0)
 | 
					 | 
				
			||||||
                    {
 | 
					 | 
				
			||||||
                        //ChannelStock? cs = _connection.ChannelStock.AsQueryable()
 | 
					 | 
				
			||||||
                        //                 .Where(cs => cs.DrugId == oi.DetailList[j].DrugId
 | 
					 | 
				
			||||||
                        //                       // && cs.ManuNo == oi.DetailList[j].SetManuNo
 | 
					 | 
				
			||||||
                        //                        // && cs.EffDate == oi._OrderDetail.SetEffDate
 | 
					 | 
				
			||||||
                        //                        && cs.MachineId.Equals(_setting.boxMachineId)
 | 
					 | 
				
			||||||
                        //                        && cs.DrawerNo == drawerNo
 | 
					 | 
				
			||||||
                        //                        && cs.Quantity >= oi.DetailList[j].Quantity).FirstOrDefault();
 | 
					 | 
				
			||||||
                        List<ChannelStock> cs = _connection.ChannelStock.AsQueryable()
 | 
					 | 
				
			||||||
                                        .Where(cs => cs.DrugId == oi.DetailInfo.DrugId
 | 
					 | 
				
			||||||
                                                && cs.ManuNo == oi.DetailInfo.drugManuNo.ManuNo
 | 
					 | 
				
			||||||
                                                && cs.EffDate == ((DateTime)oi.DetailInfo.drugManuNo.EffDate).ToString("yyyy-MM-dd")
 | 
					 | 
				
			||||||
                                               && cs.MachineId.Equals(_setting.boxMachineId)
 | 
					 | 
				
			||||||
                                               && cs.DrawerNo == drawerNo).OrderBy(cs => cs.EffDate).ToList();
 | 
					 | 
				
			||||||
                        if (cs.Count <= 0)
 | 
					 | 
				
			||||||
                        {
 | 
					 | 
				
			||||||
                            logger.Info($"处方{oi.OrderNo}中药品{oi.DetailInfo.DrugId}在{drawerNo}号药盒无库存");
 | 
					 | 
				
			||||||
                            empChannelStock += $"处方{oi.OrderNo}中药品{oi.DetailInfo.DrugId}在{drawerNo}号药盒无库存 ";
 | 
					 | 
				
			||||||
                            continue;
 | 
					 | 
				
			||||||
                        }
 | 
					 | 
				
			||||||
                        int csQuantity = cs.Sum(cs => cs.Quantity);
 | 
					 | 
				
			||||||
                        if (csQuantity < oi.DetailInfo.Quantity)
 | 
					 | 
				
			||||||
                        {
 | 
					 | 
				
			||||||
                            logger.Info($"处方{oi.OrderNo}中药品{oi.DetailInfo.DrugId}在{drawerNo}号库存不足,需要核对数{oi.DetailInfo.Quantity},库存总数{csQuantity}");
 | 
					 | 
				
			||||||
                            empChannelStock += $"处方{oi.OrderNo}中药品{oi.DetailInfo.DrugId}在{drawerNo}号库存不足,需要核对数{oi.DetailInfo.Quantity},库存总数{csQuantity} ";
 | 
					 | 
				
			||||||
                            continue;
 | 
					 | 
				
			||||||
                        }
 | 
					 | 
				
			||||||
                    //更新处方状态
 | 
					                    //更新处方状态
 | 
				
			||||||
                        if (oi.Status == 0)
 | 
					                    if (oi.Status == 1)
 | 
				
			||||||
                    {
 | 
					                    {
 | 
				
			||||||
                        int iUpdate = _connection.OrderInfo.Where(o => o.OrderNo == oi.OrderNo).Set(o => o.Status, 2).Update();
 | 
					                        int iUpdate = _connection.OrderInfo.Where(o => o.OrderNo == oi.OrderNo).Set(o => o.Status, 2).Update();
 | 
				
			||||||
                        _connection.Insert(new OrderFinish()
 | 
					                        _connection.Insert(new OrderFinish()
 | 
				
			||||||
| 
						 | 
					@ -822,59 +716,61 @@ namespace MasaBlazorApp3.DataAccess.Impl
 | 
				
			||||||
                            OrderNo = oi.OrderNo,
 | 
					                            OrderNo = oi.OrderNo,
 | 
				
			||||||
                            PatientId = oi.PatientId,
 | 
					                            PatientId = oi.PatientId,
 | 
				
			||||||
                            Pharmacy = oi.Pharmacy,
 | 
					                            Pharmacy = oi.Pharmacy,
 | 
				
			||||||
                                State = 1,
 | 
					                            State = 2,
 | 
				
			||||||
                            //WinNo = DrawerNo + 1 + "号手术间",
 | 
					                            //WinNo = DrawerNo + 1 + "号手术间",
 | 
				
			||||||
                            Operator = _globalStateService.Operator.NickName,
 | 
					                            Operator = _globalStateService.Operator.NickName,
 | 
				
			||||||
                        });
 | 
					                        });
 | 
				
			||||||
                    }
 | 
					                    }
 | 
				
			||||||
                        int Break = 0;
 | 
					                    int drawerNo = DrawerNo;
 | 
				
			||||||
                        for (int k = 0; (k < cs.Count && Break == 0); k++)
 | 
					                    if (oi.DetailList != null && oi.DetailList.Count > 0)
 | 
				
			||||||
                    {
 | 
					                    {
 | 
				
			||||||
                            int oldQuantity = cs[k].Quantity;
 | 
					                        for (int j = 0; j < oi.DetailList.Count; j++)
 | 
				
			||||||
                            int useQuantity = 0; //实际使用数量
 | 
					 | 
				
			||||||
                            if (cs[k].Quantity >= oi.DetailInfo.Quantity)
 | 
					 | 
				
			||||||
                        {
 | 
					                        {
 | 
				
			||||||
                                cs[k].Quantity = cs[k].Quantity - oi.DetailInfo.Quantity;
 | 
					                            ChannelStock cs = _connection.ChannelStock.AsQueryable()
 | 
				
			||||||
                                Break = 1;//药品够取跳出循环
 | 
					                                             .Where(cs => cs.DrugId == oi.DetailList[j].DrugId
 | 
				
			||||||
                                useQuantity = oi.DetailInfo.Quantity;
 | 
					                                                    && cs.ManuNo == oi.DetailList[j].SetManuNo
 | 
				
			||||||
                            }
 | 
					                                                    // && cs.EffDate == oi._OrderDetail.SetEffDate
 | 
				
			||||||
                            else
 | 
					                                                    && cs.MachineId.Equals(_setting.boxMachineId)
 | 
				
			||||||
                            {
 | 
					                                                    && cs.DrawerNo == drawerNo
 | 
				
			||||||
                                oi.DetailInfo.Quantity = oi.DetailInfo.Quantity - cs[k].Quantity;
 | 
					                                                    && cs.Quantity >= oi.DetailList[j].Quantity).First();
 | 
				
			||||||
                                useQuantity = cs[k].Quantity;
 | 
					                            if (cs == null)
 | 
				
			||||||
                                cs[k].Quantity = 0;
 | 
					                            {
 | 
				
			||||||
 | 
					                                logger.Info($"手麻单{oi.OrderNo}对药品批次{oi.DetailList[j].DrugId}-{oi.DetailList[j].SetManuNo}在{drawerNo}药箱无库存");
 | 
				
			||||||
 | 
					                                continue;
 | 
				
			||||||
                            }
 | 
					                            }
 | 
				
			||||||
 | 
					                            cs.Quantity = cs.Quantity - oi.DetailList[j].Quantity;
 | 
				
			||||||
                            //cs.NeedNum = cs.NeedNum > 0 ? cs.NeedNum + oi._OrderDetail.Quantity : oi._OrderDetail.Quantity;
 | 
					                            //cs.NeedNum = cs.NeedNum > 0 ? cs.NeedNum + oi._OrderDetail.Quantity : oi._OrderDetail.Quantity;
 | 
				
			||||||
                            logger.Info($"更新药盒{cs[k].DrawerNo}药品{cs[k].DrugId}批次{cs[k].ManuNo}库存为{oldQuantity},处方用药数量为{oi.DetailInfo.Quantity}");
 | 
					                            logger.Info($"更新手术间{cs.DrawerNo}药品{cs.DrugId}批次{cs.ManuNo}库存为{cs.Quantity},需补药数量为{oi.DetailList[j].Quantity}");
 | 
				
			||||||
                            // 更新数据 库存信息
 | 
					                            // 更新数据 库存信息
 | 
				
			||||||
                            _connection.Update(cs[k]);
 | 
					                            _connection.Update(cs);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                            //更新ChannelList对应的总库存
 | 
					                            //更新ChannelList对应的总库存
 | 
				
			||||||
                            ChannelList? channelList = _connection.ChannelList.AsQueryable().Where(cl => cl.MachineId.Equals(cs[k].MachineId) && cl.Id.Equals(cs[k].ListId) && cl.DrawerNo.Equals(cs[k].DrawerNo)).FirstOrDefault();
 | 
					                            ChannelList channelList = _connection.ChannelList.AsQueryable().Where(cl => cl.MachineId.Equals(cs.MachineId) && cl.Id.Equals(cs.ListId) && cl.DrawerNo.Equals(cs.DrawerNo)).FirstOrDefault();
 | 
				
			||||||
                            if (channelList != null)
 | 
					                            channelList.TotalQuantity = channelList.TotalQuantity - oi.DetailList[j].Quantity;
 | 
				
			||||||
                            {
 | 
					 | 
				
			||||||
                                channelList.TotalQuantity = channelList.TotalQuantity - useQuantity;// oi.DetailList[j].Quantity;
 | 
					 | 
				
			||||||
                            _connection.Update(channelList);
 | 
					                            _connection.Update(channelList);
 | 
				
			||||||
                            }
 | 
					
 | 
				
			||||||
                            // 获取更新完库存后的药品库存
 | 
					                            // 获取更新完库存后的药品库存
 | 
				
			||||||
                            List<ChannelStock> nowChannels = _connection.ChannelStock.AsQueryable()
 | 
					                            List<ChannelStock> nowChannels = _connection.ChannelStock.AsQueryable()
 | 
				
			||||||
                                .Where(it => it.MachineId.Equals(cs[k].MachineId) || it.MachineId.Equals(_setting.machineId))
 | 
					                                .Where(it => it.MachineId.Equals(cs.MachineId) || it.MachineId.Equals(_setting.machineId))
 | 
				
			||||||
                                .Where(it => it.DrugId.Equals(cs[k].DrugId))
 | 
					                                .Where(it => it.DrugId.Equals(cs.DrugId))
 | 
				
			||||||
                                .Where(it => it.ManuNo.Equals(cs[k].ManuNo))
 | 
					                                .Where(it => it.ManuNo.Equals(cs.ManuNo))
 | 
				
			||||||
                                .Where(it => it.DrawerType == 1)
 | 
					                                .Where(it => it.DrawerType == 1)
 | 
				
			||||||
                                .ToList();
 | 
					                                .ToList();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                            if (cs != null)
 | 
				
			||||||
 | 
					                            {
 | 
				
			||||||
                                _connection.Insert(new MachineRecord()
 | 
					                                _connection.Insert(new MachineRecord()
 | 
				
			||||||
                                {
 | 
					                                {
 | 
				
			||||||
                                    MachineId = _setting.machineId,
 | 
					                                    MachineId = _setting.machineId,
 | 
				
			||||||
                                DrawerNo = cs[k].DrawerNo,
 | 
					                                    DrawerNo = cs.DrawerNo,
 | 
				
			||||||
                                ColNo = cs[k].ColNo,
 | 
					                                    ColNo = cs.ColNo,
 | 
				
			||||||
                                DrugId = cs[k].DrugId,
 | 
					                                    DrugId = cs.DrugId,
 | 
				
			||||||
                                ManuNo = cs[k].ManuNo,
 | 
					                                    ManuNo = cs.ManuNo,
 | 
				
			||||||
                                EffDate = !String.IsNullOrEmpty(cs[k].EffDate) ? DateTime.ParseExact(cs[k].EffDate, "yyyy-MM-dd", System.Globalization.CultureInfo.CurrentCulture) : null,
 | 
					                                    EffDate = !String.IsNullOrEmpty(cs.EffDate) ? DateTime.ParseExact(cs.EffDate, "yyyy-MM-dd", System.Globalization.CultureInfo.CurrentCulture) : null,
 | 
				
			||||||
                                    Operator = _globalStateService.Operator?.Id,
 | 
					                                    Operator = _globalStateService.Operator?.Id,
 | 
				
			||||||
                                    Reviewer = _globalStateService.Reviewer?.Id,
 | 
					                                    Reviewer = _globalStateService.Reviewer?.Id,
 | 
				
			||||||
                                    OperationTime = DateTime.Now,
 | 
					                                    OperationTime = DateTime.Now,
 | 
				
			||||||
                                Quantity = useQuantity,// oi.DetailList[j].Quantity,
 | 
					                                    Quantity = oi.DetailList[j].Quantity,
 | 
				
			||||||
                                    Type = 2,
 | 
					                                    Type = 2,
 | 
				
			||||||
                                    InvoiceId = oi.OrderNo
 | 
					                                    InvoiceId = oi.OrderNo
 | 
				
			||||||
                                    //, StockQuantity = nowChannels.Sum(it => it.Quantity)
 | 
					                                    //, StockQuantity = nowChannels.Sum(it => it.Quantity)
 | 
				
			||||||
| 
						 | 
					@ -882,21 +778,21 @@ namespace MasaBlazorApp3.DataAccess.Impl
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                                //查询上一条账册中的空瓶数
 | 
					                                //查询上一条账册中的空瓶数
 | 
				
			||||||
                            AccountBookG2? accountBookEmpty = _connection.AccountBookG2.AsQueryable()
 | 
					                                AccountBookG2 accountBookEmpty = _connection.AccountBookG2.AsQueryable()
 | 
				
			||||||
                                .Where(ab => ab.MachineId.Equals(_setting.machineId))
 | 
					                                .Where(ab => ab.MachineId.Equals(_setting.machineId))
 | 
				
			||||||
                                .Where(ab => ab.Type == 1 || ab.Type == 2)
 | 
					                                .Where(ab => ab.Type == 1 || ab.Type == 2)
 | 
				
			||||||
                            .Where(ab => ab.DrugId == oi.DetailInfo.DrugId)
 | 
					                                .Where(ab => ab.DrugId == oi.DetailList[j].DrugId)
 | 
				
			||||||
                            .Where(ab => ab.ManuNo == cs[k].ManuNo).OrderByDescending(ab => ab.Id).FirstOrDefault();
 | 
					                                .Where(ab => ab.ManuNo == cs.ManuNo).OrderByDescending(ab => ab.Id).First();
 | 
				
			||||||
                                //保存账册
 | 
					                                //保存账册
 | 
				
			||||||
                                int iInsertResult = _connection.Insert(new AccountBookG2()
 | 
					                                int iInsertResult = _connection.Insert(new AccountBookG2()
 | 
				
			||||||
                                {
 | 
					                                {
 | 
				
			||||||
                                DrugId = oi.DetailInfo.DrugId,
 | 
					                                    DrugId = oi.DetailList[j].DrugId,
 | 
				
			||||||
                                    Type = 2,
 | 
					                                    Type = 2,
 | 
				
			||||||
                                    Department = oi.DeptName,
 | 
					                                    Department = oi.DeptName,
 | 
				
			||||||
                                    OrderNo = oi.OrderNo,
 | 
					                                    OrderNo = oi.OrderNo,
 | 
				
			||||||
                                ManuNo = cs[k].ManuNo,
 | 
					                                    ManuNo = cs.ManuNo,
 | 
				
			||||||
                                EffDate = cs[k].EffDate,
 | 
					                                    EffDate = cs.EffDate,
 | 
				
			||||||
                                OutQuantity = useQuantity,// oi.DetailList[j].Quantity,
 | 
					                                    OutQuantity = oi.DetailList[j].Quantity,
 | 
				
			||||||
                                    UserId1 = _globalStateService.Operator?.Id,
 | 
					                                    UserId1 = _globalStateService.Operator?.Id,
 | 
				
			||||||
                                    UserId2 = _globalStateService.Reviewer?.Id,
 | 
					                                    UserId2 = _globalStateService.Reviewer?.Id,
 | 
				
			||||||
                                    MachineId = _setting.machineId,
 | 
					                                    MachineId = _setting.machineId,
 | 
				
			||||||
| 
						 | 
					@ -904,19 +800,19 @@ namespace MasaBlazorApp3.DataAccess.Impl
 | 
				
			||||||
                                    CreateTime = DateTime.Now,
 | 
					                                    CreateTime = DateTime.Now,
 | 
				
			||||||
                                    InvoiceNo = oi.OrderNo,
 | 
					                                    InvoiceNo = oi.OrderNo,
 | 
				
			||||||
                                    ManuStock = nowChannels.Sum(it => it.Quantity),
 | 
					                                    ManuStock = nowChannels.Sum(it => it.Quantity),
 | 
				
			||||||
                                TotalStock = (accountBookEmpty != null ? (accountBookEmpty.TotalStock > 0 ? accountBookEmpty.TotalStock : 0) : 0) + oi.DetailInfo.Quantity,
 | 
					                                    TotalStock = (accountBookEmpty != null ? (accountBookEmpty.TotalStock > 0 ? accountBookEmpty.TotalStock : 0) : 0) + oi.DetailList[j].Quantity,
 | 
				
			||||||
                                    ShoushuJian = drawerNo.ToString()
 | 
					                                    ShoushuJian = drawerNo.ToString()
 | 
				
			||||||
                                });
 | 
					                                });
 | 
				
			||||||
                                //修改凌晨生成的日结存与总结存数据
 | 
					                                //修改凌晨生成的日结存与总结存数据
 | 
				
			||||||
                            AccountBookG2? accountBookG2Day = _connection.AccountBookG2.AsQueryable()
 | 
					                                AccountBookG2 accountBookG2Day = _connection.AccountBookG2.AsQueryable()
 | 
				
			||||||
                                .Where(ab => ab.MachineId.Equals(_setting.machineId))
 | 
					                                .Where(ab => ab.MachineId.Equals(_setting.machineId))
 | 
				
			||||||
                                .Where(ab => ab.Type == 3)
 | 
					                                .Where(ab => ab.Type == 3)
 | 
				
			||||||
                            .Where(ab => ab.DrugId == oi.DetailInfo.DrugId)
 | 
					                                .Where(ab => ab.DrugId == oi.DetailList[j].DrugId)
 | 
				
			||||||
                            .Where(ab => ab.ManuNo == cs[k].ManuNo)
 | 
					                                .Where(ab => ab.ManuNo == cs.ManuNo)
 | 
				
			||||||
                            .Where(ab => ab.CreateDate == DateTime.Now.ToString("yyyy-MM-dd")).FirstOrDefault();
 | 
					                                .Where(ab => ab.CreateDate == DateTime.Now.ToString("yyyy-MM-dd")).First();
 | 
				
			||||||
                                if (accountBookG2Day != null)
 | 
					                                if (accountBookG2Day != null)
 | 
				
			||||||
                                {
 | 
					                                {
 | 
				
			||||||
                                accountBookG2Day.ManuStock = accountBookG2Day.ManuStock - useQuantity;// oi.DetailList[j].Quantity;
 | 
					                                    accountBookG2Day.ManuStock = accountBookG2Day.ManuStock - oi.DetailList[j].Quantity;
 | 
				
			||||||
                                    _connection.Update(accountBookG2Day);
 | 
					                                    _connection.Update(accountBookG2Day);
 | 
				
			||||||
                                }
 | 
					                                }
 | 
				
			||||||
                                else
 | 
					                                else
 | 
				
			||||||
| 
						 | 
					@ -924,13 +820,13 @@ namespace MasaBlazorApp3.DataAccess.Impl
 | 
				
			||||||
                                    //生成日结存时可能没有该库位的绑定信息,需要写入日结存
 | 
					                                    //生成日结存时可能没有该库位的绑定信息,需要写入日结存
 | 
				
			||||||
                                    int iDayResult = _connection.Insert(new AccountBookG2()
 | 
					                                    int iDayResult = _connection.Insert(new AccountBookG2()
 | 
				
			||||||
                                    {
 | 
					                                    {
 | 
				
			||||||
                                    DrugId = oi.DetailInfo.DrugId,
 | 
					                                        DrugId = oi.DetailList[j].DrugId,
 | 
				
			||||||
                                        Type = 3,
 | 
					                                        Type = 3,
 | 
				
			||||||
                                    ManuNo = cs[k].ManuNo,
 | 
					                                        ManuNo = cs.ManuNo,
 | 
				
			||||||
                                    EffDate = cs[k].EffDate,
 | 
					                                        EffDate = cs.EffDate,
 | 
				
			||||||
                                        YQuantity = 0,
 | 
					                                        YQuantity = 0,
 | 
				
			||||||
                                    ManuStock = useQuantity,// oi.DetailList[j].Quantity,
 | 
					                                        ManuStock = oi.DetailList[j].Quantity,
 | 
				
			||||||
                                    TotalStock = useQuantity,// oi.DetailList[j].Quantity,
 | 
					                                        TotalStock = oi.DetailList[j].Quantity,
 | 
				
			||||||
                                        UserId1 = _globalStateService.Operator?.Id,
 | 
					                                        UserId1 = _globalStateService.Operator?.Id,
 | 
				
			||||||
                                        UserId2 = _globalStateService.Reviewer?.Id,
 | 
					                                        UserId2 = _globalStateService.Reviewer?.Id,
 | 
				
			||||||
                                        MachineId = _setting.machineId,
 | 
					                                        MachineId = _setting.machineId,
 | 
				
			||||||
| 
						 | 
					@ -939,19 +835,18 @@ namespace MasaBlazorApp3.DataAccess.Impl
 | 
				
			||||||
                                    });
 | 
					                                    });
 | 
				
			||||||
                                    if (iDayResult <= 0)
 | 
					                                    if (iDayResult <= 0)
 | 
				
			||||||
                                    {
 | 
					                                    {
 | 
				
			||||||
                                    logger.Info($"未写入日结存数据{oi.DetailInfo.DrugId}-{cs[k].ManuNo}-{cs[k].EffDate}-{useQuantity}");
 | 
					                                        logger.Info($"未写入日结存数据{oi.DetailList[j].DrugId}-{cs.ManuNo}-{cs.EffDate}-{cs.Quantity}");
 | 
				
			||||||
                                    empChannelStock += $"未写入日结存数据{oi.DetailInfo.DrugId}-{cs[k].ManuNo}-{cs[k].EffDate}-{useQuantity} ";
 | 
					 | 
				
			||||||
                                    }
 | 
					                                    }
 | 
				
			||||||
                                }
 | 
					                                }
 | 
				
			||||||
                                //修改凌晨生成的日结存与总结存数据
 | 
					                                //修改凌晨生成的日结存与总结存数据
 | 
				
			||||||
                            AccountBookG2? accountBookG2Total = _connection.AccountBookG2.AsQueryable()
 | 
					                                AccountBookG2 accountBookG2Total = _connection.AccountBookG2.AsQueryable()
 | 
				
			||||||
                                .Where(ab => ab.MachineId.Equals(_setting.machineId))
 | 
					                                .Where(ab => ab.MachineId.Equals(_setting.machineId))
 | 
				
			||||||
                                .Where(ab => ab.Type == 4)
 | 
					                                .Where(ab => ab.Type == 4)
 | 
				
			||||||
                            .Where(ab => ab.DrugId == oi.DetailInfo.DrugId)
 | 
					                                .Where(ab => ab.DrugId == oi.DetailList[j].DrugId)
 | 
				
			||||||
                            .Where(ab => ab.CreateDate == DateTime.Now.ToString("yyyy-MM-dd")).FirstOrDefault();
 | 
					                                .Where(ab => ab.CreateDate == DateTime.Now.ToString("yyyy-MM-dd")).First();
 | 
				
			||||||
                                if (accountBookG2Total != null)
 | 
					                                if (accountBookG2Total != null)
 | 
				
			||||||
                                {
 | 
					                                {
 | 
				
			||||||
                                accountBookG2Total.TotalStock = accountBookG2Total.TotalStock - useQuantity;// oi.DetailList[j].Quantity;
 | 
					                                    accountBookG2Total.TotalStock = accountBookG2Total.TotalStock - oi.DetailList[j].Quantity;
 | 
				
			||||||
                                    _connection.Update(accountBookG2Total);
 | 
					                                    _connection.Update(accountBookG2Total);
 | 
				
			||||||
                                }
 | 
					                                }
 | 
				
			||||||
                                else
 | 
					                                else
 | 
				
			||||||
| 
						 | 
					@ -959,11 +854,11 @@ namespace MasaBlazorApp3.DataAccess.Impl
 | 
				
			||||||
                                    //生成总结存时可能没有该库位的绑定信息,需要写入总结存
 | 
					                                    //生成总结存时可能没有该库位的绑定信息,需要写入总结存
 | 
				
			||||||
                                    int iTotalResult = _connection.Insert(new AccountBookG2()
 | 
					                                    int iTotalResult = _connection.Insert(new AccountBookG2()
 | 
				
			||||||
                                    {
 | 
					                                    {
 | 
				
			||||||
                                    DrugId = oi.DetailInfo.DrugId,
 | 
					                                        DrugId = oi.DetailList[j].DrugId,
 | 
				
			||||||
                                        Type = 4,
 | 
					                                        Type = 4,
 | 
				
			||||||
                                        YQuantity = 0,
 | 
					                                        YQuantity = 0,
 | 
				
			||||||
                                    ManuStock = useQuantity,//oi.DetailList[j].Quantity,
 | 
					                                        ManuStock = oi.DetailList[j].Quantity,
 | 
				
			||||||
                                    TotalStock = useQuantity,// oi.DetailList[j].Quantity,
 | 
					                                        TotalStock = oi.DetailList[j].Quantity,
 | 
				
			||||||
                                        UserId1 = _globalStateService.Operator?.Id,
 | 
					                                        UserId1 = _globalStateService.Operator?.Id,
 | 
				
			||||||
                                        UserId2 = _globalStateService.Reviewer?.Id,
 | 
					                                        UserId2 = _globalStateService.Reviewer?.Id,
 | 
				
			||||||
                                        MachineId = _setting.machineId,
 | 
					                                        MachineId = _setting.machineId,
 | 
				
			||||||
| 
						 | 
					@ -972,32 +867,25 @@ namespace MasaBlazorApp3.DataAccess.Impl
 | 
				
			||||||
                                    });
 | 
					                                    });
 | 
				
			||||||
                                    if (iTotalResult <= 0)
 | 
					                                    if (iTotalResult <= 0)
 | 
				
			||||||
                                    {
 | 
					                                    {
 | 
				
			||||||
                                    logger.Info($"未写入总结存数据{oi.DetailInfo.DrugId}-{useQuantity}");
 | 
					                                        logger.Info($"未写入总结存数据{oi.DetailList[j].DrugId}-{oi.DetailList[j].Quantity}");
 | 
				
			||||||
                                    empChannelStock += $"未写入总结存数据{oi.DetailInfo.DrugId}-{useQuantity} ";
 | 
					 | 
				
			||||||
                                }
 | 
					 | 
				
			||||||
                                    }
 | 
					                                    }
 | 
				
			||||||
                                }
 | 
					                                }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                            }
 | 
					                            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                        }
 | 
					                        }
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                return true;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                logger.Info($"管理员{_globalStateService.Operator.NickName}结束确认手麻单");
 | 
					                logger.Info($"管理员{_globalStateService.Operator.NickName}结束确认手麻单");
 | 
				
			||||||
                if(!string.IsNullOrEmpty(empChannelStock))
 | 
					
 | 
				
			||||||
                {
 | 
					 | 
				
			||||||
                    _message.Notify(
 | 
					 | 
				
			||||||
                          new NotificationMessage { Severity = NotificationSeverity.Error, Summary = "提示", Detail = $"有未核对处方:{empChannelStock}", Duration = 4000 }
 | 
					 | 
				
			||||||
                      );
 | 
					 | 
				
			||||||
                }
 | 
					 | 
				
			||||||
                if (bFlag)
 | 
					                if (bFlag)
 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
                    _connection.CommitTransaction();
 | 
					                    _connection.CommitTransaction();
 | 
				
			||||||
                    return true;
 | 
					                    return true;
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
                else
 | 
					 | 
				
			||||||
                {
 | 
					 | 
				
			||||||
                    _connection.RollbackTransaction();
 | 
					 | 
				
			||||||
                    logger.Info($"管理员{_globalStateService.Operator.NickName}确认手麻单失败");
 | 
					 | 
				
			||||||
                    return false;
 | 
					 | 
				
			||||||
                }
 | 
					 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            catch (Exception ex)
 | 
					            catch (Exception ex)
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -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,67 +104,5 @@ namespace MasaBlazorApp3.DataAccess.Impl
 | 
				
			||||||
                Desserts = accountList
 | 
					                Desserts = accountList
 | 
				
			||||||
            };
 | 
					            };
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        //手术室患者麻醉药品使用登记本
 | 
					 | 
				
			||||||
        public async Task<PageData<ReportUsageDateInfo>> GetOrderInfoData(DateTime? searchDate)
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
            List<ReportUsageDateInfo> accountList = new List<ReportUsageDateInfo>();
 | 
					 | 
				
			||||||
            int pagedData = 0;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            string SQL = $@"SELECT oi.Order_date as portdate, od.drug_id as DrugId,1 as ShouShuJian,'' as ZhuMa,'' as FuMa,oi.patient_id as IDNumber,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
 | 
					 | 
				
			||||||
                            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.Order_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";
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            var reportList = _connection.FromSql<ReportUsageDateInfo>(SQL);
 | 
					 | 
				
			||||||
            if (reportList != null)
 | 
					 | 
				
			||||||
            {
 | 
					 | 
				
			||||||
                foreach (var report in reportList)
 | 
					 | 
				
			||||||
                {
 | 
					 | 
				
			||||||
                    accountList.Add(report);
 | 
					 | 
				
			||||||
                }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                pagedData = await reportList.CountAsync();
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
            return new PageData<ReportUsageDateInfo>()
 | 
					 | 
				
			||||||
            {
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                TotalDesserts = pagedData,
 | 
					 | 
				
			||||||
                Desserts = accountList
 | 
					 | 
				
			||||||
            };
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        //麻醉科毒麻药品请领登记表
 | 
					 | 
				
			||||||
        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
 | 
					 | 
				
			||||||
            };
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -26,7 +26,7 @@ namespace MasaBlazorApp3.DataAccess.Impl
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        public async Task<List<SettingManu>> GetMenuItemsAsync()
 | 
					        public async Task<List<SettingManu>> GetMenuItemsAsync()
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            var query = _connection.SettingManu.Where(s=>s.UseStatus==1).AsQueryable();
 | 
					            var query = _connection.SettingManu.AsQueryable();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            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();
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -93,8 +93,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>
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -70,9 +70,9 @@
 | 
				
			||||||
            </RadzenDataGrid>
 | 
					            </RadzenDataGrid>
 | 
				
			||||||
        </Template>
 | 
					        </Template>
 | 
				
			||||||
        <Columns>
 | 
					        <Columns>
 | 
				
			||||||
            <RadzenDataGridColumn Frozen="true" Width="200px" Title="药盒号" Property="DrawerNo">
 | 
					            <RadzenDataGridColumn Frozen="true" Width="200px" Title="药箱号" Property="DrawerNo">
 | 
				
			||||||
                <Template Context="DrawerNo">
 | 
					                <Template Context="DrawerNo">
 | 
				
			||||||
                    @DrawerNo.DrawerNo 号药盒
 | 
					                    @DrawerNo.DrawerNo 号药箱
 | 
				
			||||||
                </Template>
 | 
					                </Template>
 | 
				
			||||||
            </RadzenDataGridColumn>
 | 
					            </RadzenDataGridColumn>
 | 
				
			||||||
            <RadzenDataGridColumn Title="总库存" Property="TotalQuantity"></RadzenDataGridColumn>
 | 
					            <RadzenDataGridColumn Title="总库存" Property="TotalQuantity"></RadzenDataGridColumn>
 | 
				
			||||||
| 
						 | 
					@ -124,7 +124,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);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -192,11 +192,7 @@
 | 
				
			||||||
                                }
 | 
					                                }
 | 
				
			||||||
                            });
 | 
					                            });
 | 
				
			||||||
                            orderTakeVo.Status = 2;
 | 
					                            orderTakeVo.Status = 2;
 | 
				
			||||||
                            if (data.Any(it => it.ChannelStock.BoardType == 2))
 | 
					 | 
				
			||||||
                            {
 | 
					 | 
				
			||||||
                                //有单支抽屉则广播灭灯
 | 
					 | 
				
			||||||
                            PortUtil.AllLightOff();
 | 
					                            PortUtil.AllLightOff();
 | 
				
			||||||
                            }
 | 
					 | 
				
			||||||
                            if (options._data == drawerNos.Count - 1)
 | 
					                            if (options._data == drawerNos.Count - 1)
 | 
				
			||||||
                            {
 | 
					                            {
 | 
				
			||||||
                                PortUtil.speechSynthesizer.SpeakAsyncCancelAll();
 | 
					                                PortUtil.speechSynthesizer.SpeakAsyncCancelAll();
 | 
				
			||||||
| 
						 | 
					@ -315,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,46 +37,10 @@
 | 
				
			||||||
    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="无数据"
 | 
				
			||||||
| 
						 | 
					@ -107,9 +69,9 @@
 | 
				
			||||||
            </RadzenDataGrid>
 | 
					            </RadzenDataGrid>
 | 
				
			||||||
        </Template>
 | 
					        </Template>
 | 
				
			||||||
        <Columns>
 | 
					        <Columns>
 | 
				
			||||||
            <RadzenDataGridColumn Frozen="true" Width="200px" Title="药盒号" Property="DrawerNo">
 | 
					            <RadzenDataGridColumn Frozen="true" Width="200px" Title="药箱号" Property="DrawerNo">
 | 
				
			||||||
                <Template Context="DrawerNo">
 | 
					                <Template Context="DrawerNo">
 | 
				
			||||||
                    @DrawerNo.DrawerNo 号药盒
 | 
					                    @DrawerNo.DrawerNo 号药箱
 | 
				
			||||||
                </Template>
 | 
					                </Template>
 | 
				
			||||||
            </RadzenDataGridColumn>
 | 
					            </RadzenDataGridColumn>
 | 
				
			||||||
            <RadzenDataGridColumn Title="总库存" Property="TotalQuantity"></RadzenDataGridColumn>
 | 
					            <RadzenDataGridColumn Title="总库存" Property="TotalQuantity"></RadzenDataGridColumn>
 | 
				
			||||||
| 
						 | 
					@ -120,15 +82,13 @@
 | 
				
			||||||
@code {
 | 
					@code {
 | 
				
			||||||
    @inject IChannelListDao channelStockDao;
 | 
					    @inject IChannelListDao channelStockDao;
 | 
				
			||||||
    @inject DialogService dialogService;
 | 
					    @inject DialogService dialogService;
 | 
				
			||||||
    @inject IReportDataDao reportDataDao;
 | 
					 | 
				
			||||||
    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()
 | 
				
			||||||
| 
						 | 
					@ -163,7 +123,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}号药盒加药",
 | 
					               $"{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 }
 | 
				
			||||||
       );
 | 
					       );
 | 
				
			||||||
| 
						 | 
					@ -174,14 +134,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,4 +1,4 @@
 | 
				
			||||||
@page "/Box/BoxBindings123"
 | 
					@page "/Box/BoxBindings"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
<div class="container-fluid">
 | 
					<div class="container-fluid">
 | 
				
			||||||
| 
						 | 
					@ -12,7 +12,7 @@
 | 
				
			||||||
                        <RadzenRow>
 | 
					                        <RadzenRow>
 | 
				
			||||||
                            <RadzenColumn Size="8" Class="rz-text-truncate">
 | 
					                            <RadzenColumn Size="8" Class="rz-text-truncate">
 | 
				
			||||||
                                <b class="rz-pr-3">@(channel.DrawerNo)</b>
 | 
					                                <b class="rz-pr-3">@(channel.DrawerNo)</b>
 | 
				
			||||||
                                <b>号药盒</b>
 | 
					                                <b>号手术间</b>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                            </RadzenColumn>
 | 
					                            </RadzenColumn>
 | 
				
			||||||
                            <RadzenColumn Size="4" Class="rz-text-align-end">
 | 
					                            <RadzenColumn Size="4" Class="rz-text-align-end">
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,204 +0,0 @@
 | 
				
			||||||
@page "/Box/BoxBindings"
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
<div class="container-fluid">
 | 
					 | 
				
			||||||
    <div class="row">
 | 
					 | 
				
			||||||
        <RadzenFieldset class="col-12 mb-4  justify-content-around align-items-center" style="overflow:auto" 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))" />
 | 
					 | 
				
			||||||
                                <RadzenLabel Text=@item.DrawerNo.ToString() Component="@($"CheckBox_{item.DrawerNo}")" />
 | 
					 | 
				
			||||||
                            </div>
 | 
					 | 
				
			||||||
                        }
 | 
					 | 
				
			||||||
                    }
 | 
					 | 
				
			||||||
                </div>
 | 
					 | 
				
			||||||
            </div>
 | 
					 | 
				
			||||||
        </RadzenFieldset>
 | 
					 | 
				
			||||||
        <RadzenCard class="col-12 mb-4">
 | 
					 | 
				
			||||||
            <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;
 | 
					 | 
				
			||||||
                }
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
| 
						 | 
					@ -24,7 +24,7 @@
 | 
				
			||||||
    <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>
 | 
				
			||||||
            <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>
 | 
				
			||||||
| 
						 | 
					@ -109,14 +109,14 @@
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        if (SelectedDrawerNo<=0)
 | 
					        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;            
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        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
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -19,7 +19,7 @@
 | 
				
			||||||
            <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>
 | 
				
			||||||
            <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>
 | 
				
			||||||
            <RadzenDropDown @bind-Value="SelectedDrawerNo" Data="@DrawerNos" Style="display: block;" Change="@(args => SelectedDrawerChange(args))" Name="DropDownChangeEvent">
 | 
					            <RadzenDropDown @bind-Value="SelectedDrawerNo" Data="@DrawerNos" Style="display: block;" Change="@(args => SelectedDrawerChange(args))" Name="DropDownChangeEvent">
 | 
				
			||||||
              
 | 
					              
 | 
				
			||||||
                    <RadzenText TextStyle="TextStyle.Subtitle2" class="mb-0">@(SelectedDrawerNo)</RadzenText>
 | 
					                    <RadzenText TextStyle="TextStyle.Subtitle2" class="mb-0">@(SelectedDrawerNo)</RadzenText>
 | 
				
			||||||
| 
						 | 
					@ -31,7 +31,7 @@
 | 
				
			||||||
                        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="药箱号">
 | 
				
			||||||
                </RadzenDataGridColumn>
 | 
					                </RadzenDataGridColumn>
 | 
				
			||||||
                <RadzenDataGridColumn Property="Drug.DrugName" Title="药品" />
 | 
					                <RadzenDataGridColumn Property="Drug.DrugName" Title="药品" />
 | 
				
			||||||
                <RadzenDataGridColumn Property="Drug.DrugSpec" Title="规格" />
 | 
					                <RadzenDataGridColumn Property="Drug.DrugSpec" Title="规格" />
 | 
				
			||||||
| 
						 | 
					@ -134,7 +134,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(selectedDrawerData.Where(cl => cl.AddQuantity != 0).ToList())}");
 | 
					                logger.Error($"药箱药品替换保存数据库失败,数据{JsonConvert.SerializeObject(selectedDrawerData.Where(cl => cl.AddQuantity != 0).ToList())}");
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            else
 | 
					            else
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -2,39 +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 (int i in DrawerNos)
 | 
					            @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)" />
 | 
					                <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="">
 | 
				
			||||||
 | 
					            <RadzenStack Orientation="Orientation.Horizontal" Gap="1rem">
 | 
				
			||||||
 | 
					                <RadzenRow AlignItems="AlignItems.Center">
 | 
				
			||||||
 | 
					                    <RadzenColumn Size="12">
 | 
				
			||||||
 | 
					                        <RadzenButton Size="ButtonSize.Medium" ButtonType="ButtonType.Submit" IsBusy="isLoading" Icon="search" Text="替换药品" />
 | 
				
			||||||
 | 
					                        <RadzenButton Size="ButtonSize.Medium" Click="reloadGrid" IsBusy="isLoading" Icon="refresh" Text="移出药品" ButtonStyle="ButtonStyle.Warning" />
 | 
				
			||||||
 | 
					                    </RadzenColumn>
 | 
				
			||||||
 | 
					                </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"
 | 
					                        Data="@_forecasts" PageSize="6" AllowPaging="true" PagerHorizontalAlign="HorizontalAlign.Left"
 | 
				
			||||||
                        ShowPagingSummary="true" PagingSummaryFormat="{0}/{1} 共{2}条数据">
 | 
					                        ShowPagingSummary="true" PagingSummaryFormat="{0}/{1} 共{2}条数据">
 | 
				
			||||||
            <Template Context="pd">
 | 
					            <Template Context="pd">
 | 
				
			||||||
                <RadzenCard Variant="Variant.Outlined" class="rz-p-0" Style="width: 100%;">
 | 
					                <RadzenCard Variant="Variant.Outlined" class="rz-p-0" Style="width: 100%; overflow: hidden;">
 | 
				
			||||||
                    <RadzenRow Gap="0">
 | 
					                    <RadzenRow Gap="0">
 | 
				
			||||||
                        <RadzenColumn Size="2">
 | 
					                        <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>
 | 
					                            <RadzenText TextStyle="TextStyle.H6" TagName="TagName.H5" class="rz-color-on-secondary-lighter">@(pd._DrugInfo.DrugName)</RadzenText>
 | 
				
			||||||
                        </RadzenColumn>
 | 
					                        </RadzenColumn>
 | 
				
			||||||
                        <RadzenColumn Size="5">
 | 
					                        <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>
 | 
					                            <RadzenText TextStyle="TextStyle.H6" TagName="TagName.H5" class="rz-color-on-secondary-lighter">@(pd._DrugInfo.Manufactory)</RadzenText>
 | 
				
			||||||
                        </RadzenColumn>
 | 
					                        </RadzenColumn>
 | 
				
			||||||
                        <RadzenColumn Size="3">
 | 
					                        <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>
 | 
					                            <RadzenText TextStyle="TextStyle.H6" TagName="TagName.H5" class="rz-color-on-secondary-lighter">@(pd._DrugInfo.DrugSpec)</RadzenText>
 | 
				
			||||||
                        </RadzenColumn>
 | 
					                        </RadzenColumn>
 | 
				
			||||||
                        <RadzenColumn Size="1">
 | 
					                        <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>
 | 
					                            <RadzenText TextStyle="TextStyle.H6" TagName="TagName.H5" class="rz-color-on-secondary-lighter">@(pd.BaseQuantity)</RadzenText>
 | 
				
			||||||
                        </RadzenColumn>
 | 
					                        </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">
 | 
					                       @*  <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>
 | 
				
			||||||
| 
						 | 
					@ -51,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">批次</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">效期</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">库存</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="替换药品" 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="移出药品" 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">未绑定批次</RadzenText>
 | 
				
			||||||
                                            </RadzenColumn>
 | 
					                                            </RadzenColumn>
 | 
				
			||||||
                                        </RadzenRow>
 | 
					                                        </RadzenRow>
 | 
				
			||||||
                                    }
 | 
					                                    }
 | 
				
			||||||
                                </RadzenColumn>
 | 
					                                </RadzenColumn>
 | 
				
			||||||
 | 
					                            }
 | 
				
			||||||
 | 
					                        }
 | 
				
			||||||
                    </RadzenRow>
 | 
					                    </RadzenRow>
 | 
				
			||||||
                        }
 | 
					 | 
				
			||||||
                    }
 | 
					 | 
				
			||||||
                </RadzenCard>
 | 
					                </RadzenCard>
 | 
				
			||||||
            </Template>
 | 
					            </Template>
 | 
				
			||||||
        </RadzenDataList>
 | 
					        </RadzenDataList>
 | 
				
			||||||
| 
						 | 
					@ -168,7 +196,7 @@
 | 
				
			||||||
        if (cs.Quantity > 0)
 | 
					        if (cs.Quantity > 0)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            var b = await dialogService.OpenAsync<BoxReplace>(
 | 
					            var b = await dialogService.OpenAsync<BoxReplace>(
 | 
				
			||||||
                   $"{cs.DrawerNo}号药盒替换药品详情",
 | 
					                   $"{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 }
 | 
				
			||||||
           );
 | 
					           );
 | 
				
			||||||
| 
						 | 
					@ -191,7 +219,7 @@
 | 
				
			||||||
        if (cs.Quantity > 0)
 | 
					        if (cs.Quantity > 0)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            var b = await dialogService.OpenAsync<BoxRemoveDialog>(
 | 
					            var b = await dialogService.OpenAsync<BoxRemoveDialog>(
 | 
				
			||||||
                   $"{cs.DrawerNo}号药盒替换药品详情",
 | 
					                   $"{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 }
 | 
				
			||||||
           );
 | 
					           );
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -48,7 +48,7 @@
 | 
				
			||||||
    <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">
 | 
				
			||||||
                交接班登录验证
 | 
					                登录
 | 
				
			||||||
            </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">
 | 
				
			||||||
| 
						 | 
					@ -66,19 +66,10 @@
 | 
				
			||||||
                        <RadzenRequiredValidator Component="Password" Text="请填写密码" />
 | 
					                        <RadzenRequiredValidator Component="Password" Text="请填写密码" />
 | 
				
			||||||
                    </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="登录" />
 | 
				
			||||||
                        <RadzenButton Style="border-color:#255dd4;width:110px" Variant="Variant.Outlined" Text="取消" Click="@Exit" />
 | 
					                        <RadzenButton Style="border-color:#255dd4;width:110px" Variant="Variant.Outlined" Text="取消" Click="@Exit" />
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                    </div>
 | 
					                    </div>
 | 
				
			||||||
| 
						 | 
					@ -114,7 +105,7 @@
 | 
				
			||||||
    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();
 | 
				
			||||||
| 
						 | 
					@ -216,8 +207,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 +247,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)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -12,7 +12,7 @@
 | 
				
			||||||
                                <RadzenLabel Text="开始时间" Component="Start" />
 | 
					                                <RadzenLabel Text="开始时间" 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">
 | 
				
			||||||
| 
						 | 
					@ -20,7 +20,7 @@
 | 
				
			||||||
                                <RadzenLabel Text="结束时间" Component="End" />
 | 
					                                <RadzenLabel Text="结束时间" 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>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,113 +1,52 @@
 | 
				
			||||||
@page "/Box/Check"
 | 
					@page "/Box/Check"
 | 
				
			||||||
@using MasaBlazorApp3.Pojo.Config
 | 
					@using MasaBlazorApp3.Pojo.Config
 | 
				
			||||||
@using MasaBlazorApp3.Report
 | 
					 | 
				
			||||||
@using Radzen.Blazor.Rendering
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
<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);
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
</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="@(() => grid.Reload())">
 | 
				
			||||||
            <RadzenFieldset Text="查询">
 | 
					            <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" />
 | 
					 | 
				
			||||||
                        <RadzenDropDownDataGrid AllowVirtualization="true" Name="NamesList" TValue="Anaesthetist" Data="@NamesList" @bind-Value="Name"
 | 
					 | 
				
			||||||
                                                Style="width:100%; display: block;" AllowFilteringByAllStringColumns="true" TextProperty="Name">
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                            <Columns>
 | 
					 | 
				
			||||||
                                <RadzenDropDownDataGridColumn Property="Name" Title="麻醉师" Sortable="false" />
 | 
					 | 
				
			||||||
                            </Columns>
 | 
					 | 
				
			||||||
                        </RadzenDropDownDataGrid>
 | 
					 | 
				
			||||||
                    </RadzenColumn>
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                    <RadzenColumn Size="6">
 | 
					 | 
				
			||||||
                            <RadzenLabel Text="处方号" Component="OrderNo" />
 | 
					                            <RadzenLabel Text="处方号" Component="OrderNo" />
 | 
				
			||||||
 | 
					                        </RadzenColumn>
 | 
				
			||||||
 | 
					                        <RadzenColumn Size="8">
 | 
				
			||||||
                            <RadzenTextBox @bind-Value="OrderNo" Style="width: 100%;" Name="OrderNo"></RadzenTextBox>
 | 
					                            <RadzenTextBox @bind-Value="OrderNo" Style="width: 100%;" Name="OrderNo"></RadzenTextBox>
 | 
				
			||||||
 | 
					 | 
				
			||||||
                        </RadzenColumn>
 | 
					                        </RadzenColumn>
 | 
				
			||||||
                    </RadzenRow>
 | 
					                    </RadzenRow>
 | 
				
			||||||
                    <RadzenRow AlignItems="AlignItems.Center">
 | 
					                    <RadzenRow AlignItems="AlignItems.Center">
 | 
				
			||||||
                    <RadzenColumn Size="6">
 | 
					                        <RadzenColumn Size="4">
 | 
				
			||||||
                            <RadzenLabel Text="处方时间" Component="OrderDate" />
 | 
					                            <RadzenLabel Text="处方时间" Component="OrderDate" />
 | 
				
			||||||
                        <RadzenDatePicker DateFormat="yyyy-MM-dd" CurrentDateChanged="@OnCurrentDateChanged" AllowClear @bind-Value="OrderDate" Style="width: 100%;" Name="OrderDate" />
 | 
					 | 
				
			||||||
                        </RadzenColumn>
 | 
					                        </RadzenColumn>
 | 
				
			||||||
                    <RadzenColumn Size="6" Style="margin-top:0.5rem">
 | 
					                        <RadzenColumn Size="8">
 | 
				
			||||||
 | 
					                            <RadzenDatePicker DateFormat="yyyy-MM-dd" CurrentDateChanged="@OnCurrentDateChanged" @bind-Value="OrderDate" Style="width: 100%;" Name="OrderDate" />
 | 
				
			||||||
 | 
					                        </RadzenColumn>
 | 
				
			||||||
 | 
					                    </RadzenRow>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                    <RadzenRow AlignItems="AlignItems.Center">
 | 
				
			||||||
 | 
					                        <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="查询" />
 | 
				
			||||||
                            <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="重置" ButtonStyle="ButtonStyle.Warning" />
 | 
				
			||||||
                        </RadzenColumn>
 | 
					                        </RadzenColumn>
 | 
				
			||||||
                    </RadzenRow>
 | 
					                    </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="BoxName">
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                    <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>
 | 
					                </RadzenStack>
 | 
				
			||||||
            </RadzenFieldset>
 | 
					            </RadzenFieldset>
 | 
				
			||||||
                    </RadzenStack>
 | 
					            <RadzenButton Size="ButtonSize.Medium" Click="Confirm" ButtonType="ButtonType.Button" IsBusy="isLoading" Icon="check_circle" Text="确认" Style="margin:0.5rem" />
 | 
				
			||||||
                </Popup>
 | 
					
 | 
				
			||||||
            </RadzenStack>
 | 
					 | 
				
			||||||
        </form>
 | 
					        </form>
 | 
				
			||||||
        <RadzenDataGrid @ref="grid" AllowRowSelectOnRowClick="@allowRowSelectOnRowClick" AllowFiltering="true" LoadData="@LoadData"
 | 
					        <RadzenDataGrid @ref="grid" AllowRowSelectOnRowClick="@allowRowSelectOnRowClick" AllowFiltering="true" LoadData="@LoadData"
 | 
				
			||||||
                        FilterPopupRenderMode="PopupRenderMode.OnDemand" FilterCaseSensitivity="FilterCaseSensitivity.CaseInsensitive"
 | 
					                        FilterPopupRenderMode="PopupRenderMode.OnDemand" FilterCaseSensitivity="FilterCaseSensitivity.CaseInsensitive"
 | 
				
			||||||
                        Data="@orderInfos" ColumnWidth="200px" IsLoading="@isLoading" Count="@count" EmptyText="无数据"
 | 
					                        Data="@orderInfos" ColumnWidth="200px" IsLoading="@isLoading" Count="@count" EmptyText="无数据"
 | 
				
			||||||
                        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="true" PageSize="10" PagerHorizontalAlign="HorizontalAlign.Left" ShowPagingSummary="true" PagingSummaryFormat="{0}/{1} 共{2}条数据">
 | 
				
			||||||
            <Columns>
 | 
					            <Columns>
 | 
				
			||||||
                <RadzenDataGridColumn Sortable="false" Filterable="false" Width="4rem">
 | 
					                <RadzenDataGridColumn Sortable="false" Filterable="false" Width="4rem">
 | 
				
			||||||
| 
						 | 
					@ -124,16 +63,16 @@
 | 
				
			||||||
                <RadzenDataGridColumn Property="PatientName" Title="姓名" Sortable="false" Filterable="false" Width="4rem" />
 | 
					                <RadzenDataGridColumn Property="PatientName" Title="姓名" Sortable="false" Filterable="false" Width="4rem" />
 | 
				
			||||||
                <RadzenDataGridColumn Property="Sex" Title="性别" Sortable="false" Filterable="false" Width="2rem" />
 | 
					                <RadzenDataGridColumn Property="Sex" Title="性别" Sortable="false" Filterable="false" Width="2rem" />
 | 
				
			||||||
                <RadzenDataGridColumn Property="OrderNo" Title="单号" Sortable="false" Filterable="false" Width="8rem" />
 | 
					                <RadzenDataGridColumn Property="OrderNo" Title="单号" Sortable="false" Filterable="false" Width="8rem" />
 | 
				
			||||||
                <RadzenDataGridColumn Property="DetailInfo.Drug.DrugName" Title="药品名称" FormatString="{0:d}" Sortable="false" Filterable="false" Width="8rem" />
 | 
					                <RadzenDataGridColumn Property="Detail.Drug.DrugName" Title="药品名称" FormatString="{0:d}" Sortable="false" Filterable="false" Width="8rem">
 | 
				
			||||||
                @* <Template Context="DetailInfo">
 | 
					                    <Template Context="DetailList">
 | 
				
			||||||
                        @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="药品批次" 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++)
 | 
				
			||||||
                        {
 | 
					                        {
 | 
				
			||||||
| 
						 | 
					@ -141,61 +80,16 @@
 | 
				
			||||||
                            <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 Width="110px" Title="批次" Property="DetailInfo.SetManuNo">
 | 
					 | 
				
			||||||
                    @*            <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>
 | 
				
			||||||
                <RadzenDataGridColumn Property="DetailInfo.Quantity" Title="数量" Sortable="false" Filterable="false" Width="2rem" />
 | 
					                <RadzenDataGridColumn Property="Detail.Quantity" Title="数量" Sortable="false" Filterable="false" Width="2rem">
 | 
				
			||||||
                @*  <Template Context="DetailInfo">
 | 
					                    <Template Context="DetailList">
 | 
				
			||||||
                        @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">@orderDetail.Quantity</RadzenText>
 | 
					                            <RadzenText TextStyle="TextStyle.Subtitle2" class="rz-mb-0">@orderDetail.Quantity</RadzenText>
 | 
				
			||||||
                        }
 | 
					                        }
 | 
				
			||||||
                    </Template>
 | 
					                    </Template>
 | 
				
			||||||
                </RadzenDataGridColumn> *@
 | 
					                </RadzenDataGridColumn>
 | 
				
			||||||
            </Columns>
 | 
					            </Columns>
 | 
				
			||||||
        </RadzenDataGrid>
 | 
					        </RadzenDataGrid>
 | 
				
			||||||
    </div>
 | 
					    </div>
 | 
				
			||||||
| 
						 | 
					@ -204,36 +98,27 @@
 | 
				
			||||||
    @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 IReportDataDao reportDataDao;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    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 Name;
 | 
					 | 
				
			||||||
    //麻醉师集合
 | 
					 | 
				
			||||||
    List<BoxModel> BoxList = new List<BoxModel>();
 | 
					 | 
				
			||||||
    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;
 | 
				
			||||||
    DateTime? OrderDate = null;
 | 
					    DateTime OrderDate;
 | 
				
			||||||
    DateTime PortOrderDate = DateTime.Now;
 | 
					    void SelectDrawer(int drawerNo)
 | 
				
			||||||
    Popup popup; 
 | 
					    {
 | 
				
			||||||
    RadzenButton button;
 | 
					        this.drawerNo = drawerNo;
 | 
				
			||||||
 | 
					        grid.Reload();
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
    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 reloadGrid()
 | 
					    async Task reloadGrid()
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
| 
						 | 
					@ -241,113 +126,25 @@
 | 
				
			||||||
        OrderDate = DateTime.MinValue;
 | 
					        OrderDate = DateTime.MinValue;
 | 
				
			||||||
        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();
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
        grid.EditRow(args.Data);
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    //确认
 | 
					    //确认
 | 
				
			||||||
    async Task Confirm()
 | 
					    async Task Confirm()
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        if (selectedOrderInfos.Any(it => it.DetailInfo.drugManuNo == null))
 | 
					        orderInfoDao.CheckOrderInfo(selectedOrderInfos, drawerNo);
 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
            _message.Notify(
 | 
					 | 
				
			||||||
                         new NotificationMessage { Severity = NotificationSeverity.Error, Summary = "提示", Detail = $"请选择批次信息", Duration = 4000 }
 | 
					 | 
				
			||||||
                     );
 | 
					 | 
				
			||||||
            return;
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
        bool bResult = await orderInfoDao.CheckOrderInfo(selectedOrderInfos, BoxNum.BoxNo);
 | 
					 | 
				
			||||||
        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()
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
        await GetInitialDate();
 | 
					 | 
				
			||||||
        await base.OnInitializedAsync();
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    async Task GetInitialDate()
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
         result = await orderInfoDao.GetAllOrderInfo(null, null, null, null, null);
 | 
					 | 
				
			||||||
        List<string> nameList = result.Desserts.Select(it => it.anaesthetistName).Distinct().ToList();
 | 
					 | 
				
			||||||
        NamesList = nameList.Select(it => new Anaesthetist { Name = it }).ToList();
 | 
					 | 
				
			||||||
        Name = NamesList.FirstOrDefault();        
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    async Task LoadData(LoadDataArgs args)
 | 
					    async Task LoadData(LoadDataArgs args)
 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
        if (result != null)
 | 
					 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        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
 | 
					        // Update the count
 | 
				
			||||||
        count = result.TotalDesserts;
 | 
					        count = result.TotalDesserts;
 | 
				
			||||||
            // Update the Data property
 | 
					 | 
				
			||||||
            if (Name != null)
 | 
					 | 
				
			||||||
            {
 | 
					 | 
				
			||||||
                orderInfos = orderInfos.Where(it => it.anaesthetistName == Name.Name);
 | 
					 | 
				
			||||||
                count = orderInfos.Count();
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
            if(OrderDate != null && OrderDate != DateTime.MinValue)
 | 
					 | 
				
			||||||
            {
 | 
					 | 
				
			||||||
                orderInfos = orderInfos.Where(it => it.OrderDate.Date == OrderDate.Value.Date);
 | 
					 | 
				
			||||||
                // Update the count
 | 
					 | 
				
			||||||
                count = orderInfos.Count();
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
            if(!string.IsNullOrEmpty(OrderNo))
 | 
					 | 
				
			||||||
            {
 | 
					 | 
				
			||||||
                orderInfos = orderInfos.Where(it => it.OrderNo.Contains(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.OrderDate.Date == OrderDate.Value.Date && it.OrderNo.Contains(OrderNo));
 | 
					 | 
				
			||||||
                // Update the count
 | 
					 | 
				
			||||||
                count = orderInfos.Count();
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
            orderInfos = orderInfos.Skip(args.Skip.Value).Take(args.Top.Value).ToList();
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            //查找该麻醉师对应的手术室
 | 
					 | 
				
			||||||
            List<string> roomNameList = orderInfos.Select(it => it.RoomName).Distinct().ToList();
 | 
					 | 
				
			||||||
            BoxList = 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);
 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    //麻醉药品使用登记本导出
 | 
					 | 
				
			||||||
    async Task StockExport()
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
        if (OrderDate == DateTime.MinValue)
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
            _message.Notify(
 | 
					 | 
				
			||||||
                           new NotificationMessage { Severity = NotificationSeverity.Error, Summary = "提示", Detail = $"请选择处方时间再导出", Duration = 4000 }
 | 
					 | 
				
			||||||
                    );
 | 
					 | 
				
			||||||
            return;
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
        PageData<ReportUsageDateInfo> pageData = await reportDataDao.GetOrderInfoData(OrderDate);
 | 
					 | 
				
			||||||
        GridReportUtil.PrintReport("Usage_Temp.grf", pageData);
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    // protected override async Task OnInitializedAsync()
 | 
					    // protected override async Task OnInitializedAsync()
 | 
				
			||||||
    // {
 | 
					    // {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -36,7 +36,7 @@
 | 
				
			||||||
            </div>
 | 
					            </div>
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    </div>
 | 
					    </div>
 | 
				
			||||||
    <RadzenDataGrid @ref="grid" Style="overflow:auto"
 | 
					    <RadzenDataGrid @ref="grid"
 | 
				
			||||||
    LoadData="@LoadData"
 | 
					    LoadData="@LoadData"
 | 
				
			||||||
    IsLoading="@isLoading"
 | 
					    IsLoading="@isLoading"
 | 
				
			||||||
    Count="@count"
 | 
					    Count="@count"
 | 
				
			||||||
| 
						 | 
					@ -63,13 +63,13 @@
 | 
				
			||||||
        </HeaderTemplate>
 | 
					        </HeaderTemplate>
 | 
				
			||||||
        <Columns>
 | 
					        <Columns>
 | 
				
			||||||
            <RadzenDataGridColumn Width="70px" Title="库位" Property="ColNo"></RadzenDataGridColumn>
 | 
					            <RadzenDataGridColumn Width="70px" Title="库位" Property="ColNo"></RadzenDataGridColumn>
 | 
				
			||||||
            <RadzenDataGridColumn Width="130px" Title="药品名称" Property="Drug.DrugName">
 | 
					            <RadzenDataGridColumn Title="药品名称" 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="110px" Title="批次" Property="ManuNo">
 | 
					            <RadzenDataGridColumn Title="批次" 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>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -130,7 +130,7 @@
 | 
				
			||||||
                    }
 | 
					                    }
 | 
				
			||||||
                </EditTemplate>
 | 
					                </EditTemplate>
 | 
				
			||||||
            </RadzenDataGridColumn>
 | 
					            </RadzenDataGridColumn>
 | 
				
			||||||
            <RadzenDataGridColumn Title="库存" Width="60px" Property="Quantity">
 | 
					            <RadzenDataGridColumn Title="库存" 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>
 | 
				
			||||||
| 
						 | 
					@ -301,7 +301,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))
 | 
				
			||||||
| 
						 | 
					@ -481,7 +480,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);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -36,7 +36,7 @@
 | 
				
			||||||
            </div>
 | 
					            </div>
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    </div>
 | 
					    </div>
 | 
				
			||||||
    <RadzenDataGrid @ref="grid" Style="overflow:auto"
 | 
					    <RadzenDataGrid @ref="grid"
 | 
				
			||||||
                    LoadData="@LoadData"
 | 
					                    LoadData="@LoadData"
 | 
				
			||||||
                    IsLoading="@isLoading"
 | 
					                    IsLoading="@isLoading"
 | 
				
			||||||
                    Count="@count"
 | 
					                    Count="@count"
 | 
				
			||||||
| 
						 | 
					@ -63,24 +63,24 @@
 | 
				
			||||||
        </HeaderTemplate>
 | 
					        </HeaderTemplate>
 | 
				
			||||||
        <Columns>
 | 
					        <Columns>
 | 
				
			||||||
            <RadzenDataGridColumn Width="70px" Title="库位" Property="ColNo"></RadzenDataGridColumn>
 | 
					            <RadzenDataGridColumn Width="70px" Title="库位" Property="ColNo"></RadzenDataGridColumn>
 | 
				
			||||||
            <RadzenDataGridColumn  Width="130px" Title="药品名称" Property="Drug.DrugName">
 | 
					            <RadzenDataGridColumn Title="药品名称" 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="110px" Title="批次" Property="ManuNo">
 | 
					            <RadzenDataGridColumn Title="批次" 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="60px" Property="Quantity">
 | 
					            <RadzenDataGridColumn Title="库存" 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="100px" Title="取药数量" Property="TakeQuantity">
 | 
					            <RadzenDataGridColumn MinWidth="120px" Title="取药数量" Property="TakeQuantity">
 | 
				
			||||||
                <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"))
 | 
				
			||||||
                    {
 | 
					                    {
 | 
				
			||||||
| 
						 | 
					@ -434,7 +434,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);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -45,7 +45,7 @@
 | 
				
			||||||
        </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="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>
 | 
				
			||||||
| 
						 | 
					@ -120,8 +120,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">药箱管理</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))
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -56,12 +56,10 @@
 | 
				
			||||||
                    msg = "指纹模块连接失败";
 | 
					                    msg = "指纹模块连接失败";
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
                InvokeAsync(StateHasChanged);
 | 
					                InvokeAsync(StateHasChanged);
 | 
				
			||||||
            }
 | 
					            } catch (Exception e)
 | 
				
			||||||
            catch (Exception e)
 | 
					 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                msg = "指纹模块连接失败";
 | 
					                msg = "指纹模块连接失败";
 | 
				
			||||||
                errMsg += "【指纹模块连接失败】";
 | 
					                errMsg += "【指纹模块连接失败】";
 | 
				
			||||||
                logger.Info($"指纹模块连接失败【{e.Message}】");
 | 
					 | 
				
			||||||
                InvokeAsync(StateHasChanged);
 | 
					                InvokeAsync(StateHasChanged);
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            await Task.Delay(500);
 | 
					            await Task.Delay(500);
 | 
				
			||||||
| 
						 | 
					@ -73,12 +71,10 @@
 | 
				
			||||||
                logger.Info($"抽屉串口打开结果【{PortUtil.drawerSerial.IsOpen}】");
 | 
					                logger.Info($"抽屉串口打开结果【{PortUtil.drawerSerial.IsOpen}】");
 | 
				
			||||||
                msg = "抽屉串口连接成功";
 | 
					                msg = "抽屉串口连接成功";
 | 
				
			||||||
                InvokeAsync(StateHasChanged);
 | 
					                InvokeAsync(StateHasChanged);
 | 
				
			||||||
            }
 | 
					            } catch (Exception e)
 | 
				
			||||||
            catch (Exception e)
 | 
					 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                msg = "抽屉串口连接失败";
 | 
					                msg = "抽屉串口连接失败";
 | 
				
			||||||
                errMsg += "【抽屉串口连接失败】";
 | 
					                errMsg += "【抽屉串口连接失败】";
 | 
				
			||||||
                logger.Info($"抽屉串口连接失败【{e.Message}】");
 | 
					 | 
				
			||||||
                InvokeAsync(StateHasChanged);
 | 
					                InvokeAsync(StateHasChanged);
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            await Task.Delay(500);
 | 
					            await Task.Delay(500);
 | 
				
			||||||
| 
						 | 
					@ -90,29 +86,10 @@
 | 
				
			||||||
                logger.Info($"CanBus模块打开结果【{PortUtil.canBusSerial.IsOpen}】");
 | 
					                logger.Info($"CanBus模块打开结果【{PortUtil.canBusSerial.IsOpen}】");
 | 
				
			||||||
                msg = "CanBus模块连接成功";
 | 
					                msg = "CanBus模块连接成功";
 | 
				
			||||||
                InvokeAsync(StateHasChanged);
 | 
					                InvokeAsync(StateHasChanged);
 | 
				
			||||||
            }
 | 
					            } catch (Exception e)
 | 
				
			||||||
            catch (Exception e)
 | 
					 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                msg = "CanBus模块连接失败";
 | 
					                msg = "CanBus模块连接失败";
 | 
				
			||||||
                errMsg += "【CanBus模块连接失败】";
 | 
					                errMsg += "【CanBus模块连接失败】";
 | 
				
			||||||
                logger.Info($"模块连接失败【{e.Message}】"); 
 | 
					 | 
				
			||||||
                InvokeAsync(StateHasChanged);
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
            await Task.Delay(500);
 | 
					 | 
				
			||||||
            msg = "开始连接第二个CanBus模块";
 | 
					 | 
				
			||||||
            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);
 | 
					                InvokeAsync(StateHasChanged);
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            await Task.Delay(500);
 | 
					            await Task.Delay(500);
 | 
				
			||||||
| 
						 | 
					@ -124,12 +101,10 @@
 | 
				
			||||||
                logger.Info($"条码扫描模块打开结果【{PortUtil.scanCodeSerial.IsOpen}】");
 | 
					                logger.Info($"条码扫描模块打开结果【{PortUtil.scanCodeSerial.IsOpen}】");
 | 
				
			||||||
                msg = "条码扫描模块连接成功";
 | 
					                msg = "条码扫描模块连接成功";
 | 
				
			||||||
                InvokeAsync(StateHasChanged);
 | 
					                InvokeAsync(StateHasChanged);
 | 
				
			||||||
            }
 | 
					            } catch (Exception e)
 | 
				
			||||||
            catch (Exception e)
 | 
					 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                msg = "条码扫描模块连接失败";
 | 
					                msg = "条码扫描模块连接失败";
 | 
				
			||||||
                errMsg += "【条码扫描模块连接失败】";
 | 
					                errMsg += "【条码扫描模块连接失败】";
 | 
				
			||||||
                logger.Info($"条码扫描模块打开结果【{e.Message}】"); 
 | 
					 | 
				
			||||||
                InvokeAsync(StateHasChanged);
 | 
					                InvokeAsync(StateHasChanged);
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            if (portSetting.Value.fridgePortExist)
 | 
					            if (portSetting.Value.fridgePortExist)
 | 
				
			||||||
| 
						 | 
					@ -141,11 +116,10 @@
 | 
				
			||||||
                    msg = "冰箱串口连接成功";
 | 
					                    msg = "冰箱串口连接成功";
 | 
				
			||||||
                    InvokeAsync(StateHasChanged);
 | 
					                    InvokeAsync(StateHasChanged);
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
                catch (Exception e)
 | 
					                catch (Exception)
 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
                    msg = "冰箱串口打开失败";
 | 
					                    msg = "冰箱串口打开失败";
 | 
				
			||||||
                    errMsg += "【冰箱串口打开失败】";
 | 
					                    errMsg += "【冰箱串口打开失败】";
 | 
				
			||||||
                    logger.Info($"冰箱串口打开失败【{e.Message}】");
 | 
					 | 
				
			||||||
                    InvokeAsync(StateHasChanged);
 | 
					                    InvokeAsync(StateHasChanged);
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -18,7 +18,7 @@
 | 
				
			||||||
                                <RadzenLabel Text="开始时间" Component="Start" />
 | 
					                                <RadzenLabel Text="开始时间" 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">
 | 
				
			||||||
| 
						 | 
					@ -26,7 +26,7 @@
 | 
				
			||||||
                                <RadzenLabel Text="结束时间" Component="End" />
 | 
					                                <RadzenLabel Text="结束时间" 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>
 | 
				
			||||||
                    
 | 
					                    
 | 
				
			||||||
| 
						 | 
					@ -36,10 +36,10 @@
 | 
				
			||||||
                                <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="重置" 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="库存导出" Variant="Variant.Outlined" Click="StockExport" />
 | 
				
			||||||
                            <RadzenButton Icon="download" Text="专用账册导出" Variant="Variant.Outlined" Click="AccountBookExport" />
 | 
					                            <RadzenButton Icon="download" Text="专用账册导出" Variant="Variant.Outlined" Click="AccountBookExport" />
 | 
				
			||||||
                        </RadzenRow> *@
 | 
					                        </RadzenRow>
 | 
				
			||||||
                    </RadzenStack>
 | 
					                    </RadzenStack>
 | 
				
			||||||
                </RadzenFieldset>
 | 
					                </RadzenFieldset>
 | 
				
			||||||
            </form>
 | 
					            </form>
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -19,7 +19,7 @@
 | 
				
			||||||
                </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"
 | 
				
			||||||
| 
						 | 
					@ -37,14 +37,14 @@
 | 
				
			||||||
                            <RadzenRequiredValidator Text="请填写套餐名称" Component="Name" Popup="true" />
 | 
					                            <RadzenRequiredValidator Text="请填写套餐名称" Component="Name" Popup="true" />
 | 
				
			||||||
                        </EditTemplate>
 | 
					                        </EditTemplate>
 | 
				
			||||||
                    </RadzenDataGridColumn>
 | 
					                    </RadzenDataGridColumn>
 | 
				
			||||||
                    @*   <RadzenDataGridColumn Width="200px" Title="套餐描述" Property="Description">
 | 
					                    <RadzenDataGridColumn Width="200px" Title="套餐描述" 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="请填写套餐描述" 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="操作" 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,7 +63,7 @@
 | 
				
			||||||
                </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="无数据"
 | 
				
			||||||
                            Data="@(SelectedPlan?.FirstOrDefault()?._PlanDetails)"
 | 
					                            Data="@(SelectedPlan?.FirstOrDefault()?._PlanDetails)"
 | 
				
			||||||
                            RowUpdate="@((PlanDetails pd) => { OnUpdateRow(pd); })"
 | 
					                            RowUpdate="@((PlanDetails pd) => { OnUpdateRow(pd); })"
 | 
				
			||||||
| 
						 | 
					@ -76,12 +76,12 @@
 | 
				
			||||||
                        </RadzenRow>
 | 
					                        </RadzenRow>
 | 
				
			||||||
                    </HeaderTemplate> *@
 | 
					                    </HeaderTemplate> *@
 | 
				
			||||||
                <Columns>
 | 
					                <Columns>
 | 
				
			||||||
                    <RadzenDataGridColumn Title="序号" Property="index" Width="3rem">
 | 
					                    <RadzenDataGridColumn Title="序号" 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="药品" 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>
 | 
				
			||||||
| 
						 | 
					@ -92,7 +92,7 @@
 | 
				
			||||||
                                                    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="药品编码" />
 | 
				
			||||||
                                    <RadzenDropDownDataGridColumn Property="DrugName" Title="名称" />
 | 
					                                    <RadzenDropDownDataGridColumn Property="DrugName" Width="120px" Title="名称" />
 | 
				
			||||||
                                    <RadzenDropDownDataGridColumn Property="DrugSpec" Title="规格" />
 | 
					                                    <RadzenDropDownDataGridColumn Property="DrugSpec" Title="规格" />
 | 
				
			||||||
                                </Columns>
 | 
					                                </Columns>
 | 
				
			||||||
                            </RadzenDropDownDataGrid>
 | 
					                            </RadzenDropDownDataGrid>
 | 
				
			||||||
| 
						 | 
					@ -101,13 +101,13 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                        </EditTemplate>
 | 
					                        </EditTemplate>
 | 
				
			||||||
                    </RadzenDataGridColumn>
 | 
					                    </RadzenDataGridColumn>
 | 
				
			||||||
                    <RadzenDataGridColumn Title="基数" Property="BaseQuantity" Width="7rem">
 | 
					                    <RadzenDataGridColumn Title="基数" 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="操作" 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>
 | 
				
			||||||
| 
						 | 
					@ -148,6 +148,7 @@
 | 
				
			||||||
    List<DrugInfo> drugInfos;
 | 
					    List<DrugInfo> drugInfos;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    async Task LoadData(LoadDataArgs args)
 | 
					    async Task LoadData(LoadDataArgs args)
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        isLoading = true;
 | 
					        isLoading = true;
 | 
				
			||||||
| 
						 | 
					@ -177,14 +178,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();
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    //新增套餐
 | 
					    //新增套餐
 | 
				
			||||||
| 
						 | 
					@ -408,7 +406,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;
 | 
				
			||||||
| 
						 | 
					@ -447,21 +444,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
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -18,7 +18,7 @@
 | 
				
			||||||
                                <RadzenLabel Text="¿ªÊ¼Ê±¼ä" Component="Start" />
 | 
					                                <RadzenLabel Text="¿ªÊ¼Ê±¼ä" 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">
 | 
				
			||||||
| 
						 | 
					@ -26,7 +26,7 @@
 | 
				
			||||||
                                <RadzenLabel Text="½áÊøÊ±¼ä" Component="End" />
 | 
					                                <RadzenLabel Text="½áÊøÊ±¼ä" 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>
 | 
				
			||||||
                    
 | 
					                    
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -13,7 +13,7 @@
 | 
				
			||||||
                                <RadzenLabel Text="¿ªÊ¼Ê±¼ä" Component="Start" />
 | 
					                                <RadzenLabel Text="¿ªÊ¼Ê±¼ä" 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">
 | 
				
			||||||
| 
						 | 
					@ -21,7 +21,7 @@
 | 
				
			||||||
                                <RadzenLabel Text="½áÊøÊ±¼ä" Component="End" />
 | 
					                                <RadzenLabel Text="½áÊøÊ±¼ä" 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>
 | 
				
			||||||
                    
 | 
					                    
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -23,9 +23,9 @@
 | 
				
			||||||
                                    <RadzenLabel Text="处方时间" Component="OrderDate" />
 | 
					                                    <RadzenLabel Text="处方时间" 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="请输入处方时间" Component="OrderDate" />
 | 
				
			||||||
                                </RadzenColumn>
 | 
					                                </RadzenColumn>
 | 
				
			||||||
                            </RadzenRow>
 | 
					                            </RadzenRow>
 | 
				
			||||||
| 
						 | 
					@ -289,6 +289,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);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -215,7 +215,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
 | 
				
			||||||
                    }
 | 
					                    }
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -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% {
 | 
				
			||||||
| 
						 | 
					@ -38,24 +37,14 @@
 | 
				
			||||||
        /* 你可以根据需要调整动画的持续时间和迭代次数 */
 | 
					        /* 你可以根据需要调整动画的持续时间和迭代次数 */
 | 
				
			||||||
        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="查询">
 | 
				
			||||||
            <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="开始时间" Component="Start" />
 | 
				
			||||||
                    </RadzenColumn>
 | 
					                    </RadzenColumn>
 | 
				
			||||||
| 
						 | 
					@ -83,90 +72,13 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                <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="查询" /> *@
 | 
				
			||||||
                        <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="重置" 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="StockExport" />
 | 
					                    <RadzenButton Icon="download" Text="库存导出" Variant="Variant.Outlined" Click="StockExport" />
 | 
				
			||||||
                    <RadzenButton Icon="download" Text="专用账册导出" Variant="Variant.Outlined" Click="AccountBookExport" />
 | 
					                    <RadzenButton Icon="download" Text="专用账册导出" Variant="Variant.Outlined" Click="AccountBookExport" />
 | 
				
			||||||
                </RadzenRow>*@
 | 
					 | 
				
			||||||
                <RadzenRow JustifyContent="JustifyContent.End" AlignItems="AlignItems.Center">
 | 
					 | 
				
			||||||
                    @* <RadzenButton @ref=button Icon="download" Text="库存导出" Variant="Variant.Outlined" Click="@(args => popup.ToggleAsync(button.Element))" /> *@
 | 
					 | 
				
			||||||
                    <RadzenButton @ref=button Icon="download" Text="专用账册导出" Variant="Variant.Outlined" Click="@(args => popup2.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="drug" />
 | 
					 | 
				
			||||||
                                        </RadzenColumn>
 | 
					 | 
				
			||||||
                                        <RadzenColumn Size="6">
 | 
					 | 
				
			||||||
                                            <RadzenAutoComplete Name="drug" Multiline="true" @bind-Value=@drugName Data=@drugInfo TextProperty="@nameof(DrugInfo.DrugNameSpecManufactory)"
 | 
					 | 
				
			||||||
                                                                Style="width: 100%;" InputAttributes="@(new Dictionary<string, object>() { { "aria-label", "drugInfo" } })" />
 | 
					 | 
				
			||||||
                                        </RadzenColumn>
 | 
					 | 
				
			||||||
                                    </RadzenRow>
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                                    <RadzenRow AlignItems="AlignItems.Center">
 | 
					 | 
				
			||||||
                                        <RadzenColumn Size="12">
 | 
					 | 
				
			||||||
                                            <RadzenButton Size="ButtonSize.Large" Click="reloadGrid" IsBusy="isLoading" Icon="refresh" Text="重置" ButtonStyle="ButtonStyle.Warning" />
 | 
					 | 
				
			||||||
                                        </RadzenColumn>
 | 
					 | 
				
			||||||
                                    </RadzenRow>
 | 
					 | 
				
			||||||
                                    <RadzenRow JustifyContent="JustifyContent.End" AlignItems="AlignItems.Center">
 | 
					 | 
				
			||||||
                                        <RadzenButton Icon="download" Text="导出" Variant="Variant.Outlined" Click="StockExport" />
 | 
					 | 
				
			||||||
                                    </RadzenRow>
 | 
					 | 
				
			||||||
                                </RadzenStack>
 | 
					 | 
				
			||||||
                            </RadzenFieldset>
 | 
					 | 
				
			||||||
                        </RadzenStack>
 | 
					 | 
				
			||||||
                    </Popup> *@
 | 
					 | 
				
			||||||
                    <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">
 | 
					 | 
				
			||||||
                                    <RadzenRow AlignItems="AlignItems.Center">
 | 
					 | 
				
			||||||
                                        <RadzenColumn Size="4">
 | 
					 | 
				
			||||||
                                            <RadzenLabel Text="开始" Component="Start" />
 | 
					 | 
				
			||||||
                                            <RadzenLabel Text="时间" Component="Start" />
 | 
					 | 
				
			||||||
                                        </RadzenColumn>
 | 
					 | 
				
			||||||
                                        <RadzenColumn Size="8">
 | 
					 | 
				
			||||||
                                            <RadzenDatePicker DateFormat="yyyy-MM-dd HH:mm:ss" ShowTime="true" @bind-Value="start" Style="width: 100%;" Name="Start" />
 | 
					 | 
				
			||||||
                                        </RadzenColumn>
 | 
					 | 
				
			||||||
                                    </RadzenRow>
 | 
					 | 
				
			||||||
                                    <RadzenRow AlignItems="AlignItems.Center">
 | 
					 | 
				
			||||||
                                        <RadzenColumn Size="4">
 | 
					 | 
				
			||||||
                                            <RadzenLabel Text="结束" Component="End" />
 | 
					 | 
				
			||||||
                                            <RadzenLabel Text="时间" Component="End" />
 | 
					 | 
				
			||||||
                                        </RadzenColumn>
 | 
					 | 
				
			||||||
                                        <RadzenColumn Size="8">
 | 
					 | 
				
			||||||
                                            <RadzenDatePicker DateFormat="yyyy-MM-dd HH:mm:ss" ShowTime="true" @bind-Value="end" Style="width: 100%;" Name="End" />
 | 
					 | 
				
			||||||
                                        </RadzenColumn>
 | 
					 | 
				
			||||||
                                    </RadzenRow>
 | 
					 | 
				
			||||||
                                    <RadzenRow AlignItems="AlignItems.Center">
 | 
					 | 
				
			||||||
                                        <RadzenColumn Size="5">
 | 
					 | 
				
			||||||
                                            <RadzenLabel Text="药品名称" Component="drug" />
 | 
					 | 
				
			||||||
                                            <RadzenLabel Text="拼音码" Component="drug" />
 | 
					 | 
				
			||||||
                                            <RadzenLabel Text="编码" Component="drug" />
 | 
					 | 
				
			||||||
                                        </RadzenColumn>
 | 
					 | 
				
			||||||
                                        <RadzenColumn Size="6">
 | 
					 | 
				
			||||||
                                            <RadzenAutoComplete Name="drug" Multiline="true" @bind-Value=@drugName Data=@drugInfo TextProperty="@nameof(DrugInfo.DrugNameSpecManufactory)"
 | 
					 | 
				
			||||||
                                                                Style="width: 100%;" InputAttributes="@(new Dictionary<string, object>() { { "aria-label", "drugInfo" } })" />
 | 
					 | 
				
			||||||
                                        </RadzenColumn>
 | 
					 | 
				
			||||||
                                    </RadzenRow>
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                                    <RadzenRow AlignItems="AlignItems.Center">
 | 
					 | 
				
			||||||
                                        <RadzenColumn>
 | 
					 | 
				
			||||||
                                            <RadzenButton Click="reloadGrid" Icon="refresh" Text="重置" ButtonStyle="ButtonStyle.Warning" />
 | 
					 | 
				
			||||||
                                        </RadzenColumn>
 | 
					 | 
				
			||||||
                                    </RadzenRow>
 | 
					 | 
				
			||||||
                                    <RadzenRow JustifyContent="JustifyContent.End" AlignItems="AlignItems.Center">
 | 
					 | 
				
			||||||
                                        <RadzenButton Icon="download" Text="导出" Variant="Variant.Outlined" Click="AccountBookExport" />
 | 
					 | 
				
			||||||
                                    </RadzenRow>
 | 
					 | 
				
			||||||
                                </RadzenStack>
 | 
					 | 
				
			||||||
                            </RadzenFieldset>
 | 
					 | 
				
			||||||
                        </RadzenStack>
 | 
					 | 
				
			||||||
                    </Popup>
 | 
					 | 
				
			||||||
                </RadzenRow>
 | 
					                </RadzenRow>
 | 
				
			||||||
            </RadzenStack>
 | 
					            </RadzenStack>
 | 
				
			||||||
        </RadzenFieldset>
 | 
					        </RadzenFieldset>
 | 
				
			||||||
| 
						 | 
					@ -254,9 +166,7 @@
 | 
				
			||||||
    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()
 | 
				
			||||||
| 
						 | 
					@ -289,12 +199,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,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,14 +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 string BoxName { get; set; }
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
| 
						 | 
					@ -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,7 +27,7 @@ namespace MasaBlazorApp3.Pojo
 | 
				
			||||||
        [Column("quantity")]
 | 
					        [Column("quantity")]
 | 
				
			||||||
        public int Quantity { get; set; }
 | 
					        public int Quantity { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        //药盒DrawerType为非1时表示不在库
 | 
					
 | 
				
			||||||
        [Column("drawer_type")]
 | 
					        [Column("drawer_type")]
 | 
				
			||||||
        public int DrawerType { get; set; }
 | 
					        public int DrawerType { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -62,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
 | 
				
			||||||
| 
						 | 
					@ -80,19 +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; }
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -17,11 +17,6 @@ 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; }
 | 
				
			||||||
        //存在冰箱串口
 | 
					        //存在冰箱串口
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -32,9 +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; }
 | 
				
			||||||
        //用于标识“手术室患者麻醉药品使用登记本”报表中是否导出该药品 1导出0不导
 | 
					 | 
				
			||||||
        //[Column("pack_h")]
 | 
					 | 
				
			||||||
        //public int ReportType { get; set; }
 | 
					 | 
				
			||||||
        [Column(IsColumn =false)]
 | 
					        [Column(IsColumn =false)]
 | 
				
			||||||
        public string DrugNameSpecManufactory 
 | 
					        public string DrugNameSpecManufactory 
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -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; }
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -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,8 +129,5 @@ namespace MasaBlazorApp3.Pojo
 | 
				
			||||||
        ///</summary>
 | 
					        ///</summary>
 | 
				
			||||||
        [Column("use_dosage")]
 | 
					        [Column("use_dosage")]
 | 
				
			||||||
        public string UseDosage { get; set; }
 | 
					        public string UseDosage { get; set; }
 | 
				
			||||||
 | 
					 | 
				
			||||||
        [LinqToDB.Mapping.Association(ThisKey = nameof(SetManuNo), OtherKey = nameof(DrugManuNo.ManuNo))]
 | 
					 | 
				
			||||||
        public DrugManuNo? drugManuNo { get; set; }
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -147,19 +147,15 @@ 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>
 | 
				
			||||||
        /// 是否选中
 | 
					        /// 是否选中
 | 
				
			||||||
| 
						 | 
					@ -167,15 +163,5 @@ namespace MasaBlazorApp3.Pojo
 | 
				
			||||||
        [Column(IsColumn =false)]
 | 
					        [Column(IsColumn =false)]
 | 
				
			||||||
        public bool ItemIsChecked { get; set; }
 | 
					        public bool ItemIsChecked { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        /// <summary>
 | 
					 | 
				
			||||||
        ///  麻醉师
 | 
					 | 
				
			||||||
        ///</summary>
 | 
					 | 
				
			||||||
        [Column("anaesthetist_name")]
 | 
					 | 
				
			||||||
        public string anaesthetistName { get; set; }
 | 
					 | 
				
			||||||
        /// <summary>
 | 
					 | 
				
			||||||
        ///  手术室
 | 
					 | 
				
			||||||
        ///</summary>
 | 
					 | 
				
			||||||
        [Column("op_room_name")]
 | 
					 | 
				
			||||||
        public string RoomName { 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; }
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -102,12 +102,12 @@ namespace MasaBlazorApp3.Pojo
 | 
				
			||||||
                PremissionPath = "return"
 | 
					                PremissionPath = "return"
 | 
				
			||||||
            };
 | 
					            };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            //h.AddChild(new Premission()
 | 
					            h.AddChild(new Premission()
 | 
				
			||||||
            //{
 | 
					            {
 | 
				
			||||||
            //    Id = 31,
 | 
					                Id = 31,
 | 
				
			||||||
            //    PremissionName = "归还药品(处方)",
 | 
					                PremissionName = "归还药品(处方)",
 | 
				
			||||||
            //    PremissionPath = "/return/order"
 | 
					                PremissionPath = "/return/order"
 | 
				
			||||||
            //});
 | 
					            });
 | 
				
			||||||
            h.AddChild(new Premission()
 | 
					            h.AddChild(new Premission()
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                Id = 32,
 | 
					                Id = 32,
 | 
				
			||||||
| 
						 | 
					@ -171,12 +171,12 @@ namespace MasaBlazorApp3.Pojo
 | 
				
			||||||
                PremissionName = "药品信息",
 | 
					                PremissionName = "药品信息",
 | 
				
			||||||
                PremissionPath = "/stock/drug"
 | 
					                PremissionPath = "/stock/drug"
 | 
				
			||||||
            });
 | 
					            });
 | 
				
			||||||
            //k.AddChild(new Premission()
 | 
					            k.AddChild(new Premission()
 | 
				
			||||||
            //{
 | 
					            {
 | 
				
			||||||
            //    Id = 46,
 | 
					                Id = 46,
 | 
				
			||||||
            //    PremissionName = "药品标定",
 | 
					                PremissionName = "药品标定",
 | 
				
			||||||
            //    PremissionPath = "/stock/biaoDing"
 | 
					                PremissionPath = "/stock/biaoDing"
 | 
				
			||||||
            //});
 | 
					            });
 | 
				
			||||||
            k.AddChild(new Premission()
 | 
					            k.AddChild(new Premission()
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                Id = 47,
 | 
					                Id = 47,
 | 
				
			||||||
| 
						 | 
					@ -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,7 +263,7 @@ namespace MasaBlazorApp3.Pojo
 | 
				
			||||||
            Premission b = new Premission
 | 
					            Premission b = new Premission
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                Id = 6,
 | 
					                Id = 6,
 | 
				
			||||||
                PremissionName = "药盒管理",
 | 
					                PremissionName = "药箱管理",
 | 
				
			||||||
                PremissionPath = "Box"
 | 
					                PremissionPath = "Box"
 | 
				
			||||||
            };
 | 
					            };
 | 
				
			||||||
            b.AddChild(new Premission()
 | 
					            b.AddChild(new Premission()
 | 
				
			||||||
| 
						 | 
					@ -275,33 +275,33 @@ namespace MasaBlazorApp3.Pojo
 | 
				
			||||||
            b.AddChild(new Premission()
 | 
					            b.AddChild(new Premission()
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                Id = 62,
 | 
					                Id = 62,
 | 
				
			||||||
                PremissionName = "绑定药盒",
 | 
					                PremissionName = "绑定药箱",
 | 
				
			||||||
                PremissionPath = "/Box/BoxBindings"
 | 
					                PremissionPath = "/Box/BoxBindings"
 | 
				
			||||||
            });
 | 
					            });
 | 
				
			||||||
            b.AddChild(new Premission()
 | 
					            b.AddChild(new Premission()
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                Id = 63,
 | 
					                Id = 63,
 | 
				
			||||||
                PremissionName = "药盒核对",
 | 
					                PremissionName = "药箱核对",
 | 
				
			||||||
                //PremissionName = "盘点交接",
 | 
					                //PremissionName = "盘点交接",
 | 
				
			||||||
                PremissionPath = "/Box/Check"
 | 
					                PremissionPath = "/Box/Check"
 | 
				
			||||||
            });
 | 
					            });
 | 
				
			||||||
            b.AddChild(new Premission()
 | 
					            b.AddChild(new Premission()
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                Id = 66,
 | 
					                Id = 66,
 | 
				
			||||||
                PremissionName = "药盒加药",
 | 
					                PremissionName = "药箱加药",
 | 
				
			||||||
                //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 = "药箱入库",
 | 
				
			||||||
            //    PremissionPath = "/Box/BoxAddBox"
 | 
					                PremissionPath = "/Box/BoxAddBox"
 | 
				
			||||||
            //});
 | 
					            });
 | 
				
			||||||
            b.AddChild(new Premission()
 | 
					            b.AddChild(new Premission()
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                Id = 66,
 | 
					                Id = 66,
 | 
				
			||||||
                PremissionName = "药盒库存",
 | 
					                PremissionName = "药箱库存",
 | 
				
			||||||
                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,56 +83,4 @@ namespace MasaBlazorApp3.Pojo
 | 
				
			||||||
        //数量
 | 
					        //数量
 | 
				
			||||||
        public int Quantity { get; set; }
 | 
					        public int Quantity { get; set; }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					 | 
				
			||||||
    //手术室患者麻醉药品使用登记本
 | 
					 | 
				
			||||||
    public class ReportUsageDateInfo
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
        //日期
 | 
					 | 
				
			||||||
        public DateTime portdate { get; set; }
 | 
					 | 
				
			||||||
        //手术间
 | 
					 | 
				
			||||||
        public int ShouShuJian { get; set; }
 | 
					 | 
				
			||||||
        //主麻
 | 
					 | 
				
			||||||
        public string ZhuMa { get; set; }
 | 
					 | 
				
			||||||
        //副麻
 | 
					 | 
				
			||||||
        public string FuMa { get; set; }
 | 
					 | 
				
			||||||
        //ID号
 | 
					 | 
				
			||||||
        public string IDNumber { 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 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; }
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -15,9 +15,6 @@ 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("UseStatus")]
 | 
					 | 
				
			||||||
        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();
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -29,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;
 | 
				
			||||||
| 
						 | 
					@ -69,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);
 | 
				
			||||||
| 
						 | 
					@ -101,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)
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
| 
						 | 
					@ -144,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)
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
| 
						 | 
					@ -177,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
 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
| 
						 | 
					@ -204,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;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
| 
						 | 
					@ -227,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 };
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
| 
						 | 
					@ -239,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)}");
 | 
				
			||||||
| 
						 | 
					@ -260,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;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
| 
						 | 
					@ -347,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)
 | 
				
			||||||
| 
						 | 
					@ -405,24 +330,11 @@ namespace MasaBlazorApp3.Port
 | 
				
			||||||
        // 以单支板为单位有药位置亮灯
 | 
					        // 以单支板为单位有药位置亮灯
 | 
				
			||||||
        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 };
 | 
				
			||||||
                canBusSerial.Write(buffer, 0, 8);
 | 
					                canBusSerial.Write(buffer, 0, 8);
 | 
				
			||||||
                await Task.Delay(TimeSpan.FromMilliseconds(20));
 | 
					                await Task.Delay(TimeSpan.FromMilliseconds(20));
 | 
				
			||||||
| 
						 | 
					@ -432,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));
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -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,373 +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
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
	},
 | 
					 | 
				
			||||||
	"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
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -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>
 | 
				
			||||||
| 
						 | 
					@ -97,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;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -177,20 +149,6 @@
 | 
				
			||||||
        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 }
 | 
					 | 
				
			||||||
            );
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@code
 | 
					@code
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -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,10 +7,7 @@
 | 
				
			||||||
  },
 | 
					  },
 | 
				
			||||||
  "setting": {
 | 
					  "setting": {
 | 
				
			||||||
    "machineId": "DM1",
 | 
					    "machineId": "DM1",
 | 
				
			||||||
    //药房代码,有则写无则空
 | 
					    "storage": 1,
 | 
				
			||||||
    //. 药房代码:      武昌  07010323  麻醉科小药柜 8个抽屉     
 | 
					 | 
				
			||||||
    //                  汉口  "07010363" "麻醉科 16个抽屉",
 | 
					 | 
				
			||||||
    "storage": "07010323",
 | 
					 | 
				
			||||||
    "loginMode": 1,
 | 
					    "loginMode": 1,
 | 
				
			||||||
    "opFirst": true,
 | 
					    "opFirst": true,
 | 
				
			||||||
    //自动退出登录时间,单位秒(0不自动退出)
 | 
					    //自动退出登录时间,单位秒(0不自动退出)
 | 
				
			||||||
| 
						 | 
					@ -21,19 +18,15 @@
 | 
				
			||||||
    "drawerPortPath": "COM2",
 | 
					    "drawerPortPath": "COM2",
 | 
				
			||||||
    "drawerProtocol": 485,
 | 
					    "drawerProtocol": 485,
 | 
				
			||||||
    "scanCodePortPath": "COM1",
 | 
					    "scanCodePortPath": "COM1",
 | 
				
			||||||
 | 
					    "canBusPortPath": "COM31",
 | 
				
			||||||
    "canBusExsit": true,
 | 
					    "canBusExsit": true,
 | 
				
			||||||
    "canBusPortPath": "COM5",
 | 
					 | 
				
			||||||
    "totalDrawerCount": 16,
 | 
					 | 
				
			||||||
    "canBusTwoExsit": true,
 | 
					 | 
				
			||||||
    //第二个can总线端口
 | 
					 | 
				
			||||||
    "canBusPortPathTwo": "COM31",
 | 
					 | 
				
			||||||
    "doorAddr": 0,
 | 
					    "doorAddr": 0,
 | 
				
			||||||
    "storageBoxAddr": 0,
 | 
					    "storageBoxAddr": 0,
 | 
				
			||||||
    "fridgePortExist": false,
 | 
					    "fridgePortExist": false,
 | 
				
			||||||
    "fridgePortPath": "COM3"
 | 
					    "fridgePortPath": "COM3"
 | 
				
			||||||
  },
 | 
					  },
 | 
				
			||||||
  "drawer": {
 | 
					  "drawer": {
 | 
				
			||||||
    "single": [ 1 ],
 | 
					    "single": [ 3 ],
 | 
				
			||||||
    "weigh": [ 4 ],
 | 
					    "weigh": [ 4 ],
 | 
				
			||||||
    "box": [ 4 ],
 | 
					    "box": [ 4 ],
 | 
				
			||||||
    "label": [ 4 ]
 | 
					    "label": [ 4 ]
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,50 +0,0 @@
 | 
				
			||||||
/*
 | 
					 | 
				
			||||||
 Navicat MySQL Data Transfer
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 Source Server         : 本地
 | 
					 | 
				
			||||||
 Source Server Type    : MySQL
 | 
					 | 
				
			||||||
 Source Server Version : 50740 (5.7.40-log)
 | 
					 | 
				
			||||||
 Source Host           : localhost:3306
 | 
					 | 
				
			||||||
 Source Schema         : zhongbuzhanqu
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 Target Server Type    : MySQL
 | 
					 | 
				
			||||||
 Target Server Version : 50740 (5.7.40-log)
 | 
					 | 
				
			||||||
 File Encoding         : 65001
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 Date: 25/08/2025 17:06:04
 | 
					 | 
				
			||||||
*/
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
SET NAMES utf8mb4;
 | 
					 | 
				
			||||||
SET FOREIGN_KEY_CHECKS = 0;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
-- ----------------------------
 | 
					 | 
				
			||||||
-- Table structure for account_book
 | 
					 | 
				
			||||||
-- ----------------------------
 | 
					 | 
				
			||||||
DROP TABLE IF EXISTS `account_book`;
 | 
					 | 
				
			||||||
CREATE TABLE `account_book`  (
 | 
					 | 
				
			||||||
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
 | 
					 | 
				
			||||||
  `operator` int(11) NULL DEFAULT NULL COMMENT '操作人',
 | 
					 | 
				
			||||||
  `reviewer` int(11) NULL DEFAULT NULL COMMENT '审核人',
 | 
					 | 
				
			||||||
  `date` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '日期',
 | 
					 | 
				
			||||||
  `drug_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '药品id',
 | 
					 | 
				
			||||||
  `eff_date` date NULL DEFAULT NULL COMMENT '效期',
 | 
					 | 
				
			||||||
  `manu_no` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '批次',
 | 
					 | 
				
			||||||
  `invoice_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '处方号',
 | 
					 | 
				
			||||||
  `manu_quantity` int(11) NULL DEFAULT NULL COMMENT '批次数量',
 | 
					 | 
				
			||||||
  `total_quantity` int(11) NULL DEFAULT NULL COMMENT '药品总数量',
 | 
					 | 
				
			||||||
  `opera_quantity` int(11) NULL DEFAULT NULL COMMENT '操作数量',
 | 
					 | 
				
			||||||
  `type` int(2) NULL DEFAULT NULL COMMENT '操作类型1入库2出库3还药4盘点',
 | 
					 | 
				
			||||||
  `machine_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '设备id',
 | 
					 | 
				
			||||||
  `insert_time` datetime NULL DEFAULT CURRENT_TIMESTAMP COMMENT '添加时间',
 | 
					 | 
				
			||||||
  `add_quantity` int(11) NULL DEFAULT NULL COMMENT '数量',
 | 
					 | 
				
			||||||
  `out_quantity` int(11) NULL DEFAULT NULL COMMENT '出库数量',
 | 
					 | 
				
			||||||
  `create_time` datetime NULL DEFAULT NULL,
 | 
					 | 
				
			||||||
  `yesterday_quantity` int(11) NULL DEFAULT NULL,
 | 
					 | 
				
			||||||
  `manu_stock` int(11) NULL DEFAULT NULL COMMENT '抽屉号',
 | 
					 | 
				
			||||||
  `total_stock` int(11) NULL DEFAULT NULL,
 | 
					 | 
				
			||||||
  `department` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '取药科室',
 | 
					 | 
				
			||||||
  `create_date` datetime NULL DEFAULT NULL,
 | 
					 | 
				
			||||||
  PRIMARY KEY (`id`) USING BTREE
 | 
					 | 
				
			||||||
) ENGINE = InnoDB AUTO_INCREMENT = 25 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
SET FOREIGN_KEY_CHECKS = 1;
 | 
					 | 
				
			||||||
| 
						 | 
					@ -1,47 +0,0 @@
 | 
				
			||||||
/*
 | 
					 | 
				
			||||||
 Navicat MySQL Data Transfer
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 Source Server         : 本地
 | 
					 | 
				
			||||||
 Source Server Type    : MySQL
 | 
					 | 
				
			||||||
 Source Server Version : 50740 (5.7.40-log)
 | 
					 | 
				
			||||||
 Source Host           : localhost:3306
 | 
					 | 
				
			||||||
 Source Schema         : hkcdb
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 Target Server Type    : MySQL
 | 
					 | 
				
			||||||
 Target Server Version : 50740 (5.7.40-log)
 | 
					 | 
				
			||||||
 File Encoding         : 65001
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 Date: 26/08/2025 14:39:02
 | 
					 | 
				
			||||||
*/
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
SET NAMES utf8mb4;
 | 
					 | 
				
			||||||
SET FOREIGN_KEY_CHECKS = 0;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
-- ----------------------------
 | 
					 | 
				
			||||||
-- Table structure for account_book_g2
 | 
					 | 
				
			||||||
-- ----------------------------
 | 
					 | 
				
			||||||
DROP TABLE IF EXISTS `account_book_g2`;
 | 
					 | 
				
			||||||
CREATE TABLE `account_book_g2`  (
 | 
					 | 
				
			||||||
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
 | 
					 | 
				
			||||||
  `drug_id` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
 | 
					 | 
				
			||||||
  `type` int(1) NULL DEFAULT 1 COMMENT '1领入2发出3日结4总结5转结',
 | 
					 | 
				
			||||||
  `department` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '科室',
 | 
					 | 
				
			||||||
  `invoice_no` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '设备内记录凭证',
 | 
					 | 
				
			||||||
  `order_no` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '处方号或凭证号',
 | 
					 | 
				
			||||||
  `manu_no` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '批次',
 | 
					 | 
				
			||||||
  `eff_date` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '效期',
 | 
					 | 
				
			||||||
  `yesterday_quantity` int(11) NULL DEFAULT NULL COMMENT '上日结存',
 | 
					 | 
				
			||||||
  `add_quantity` int(11) NULL DEFAULT NULL COMMENT '收入',
 | 
					 | 
				
			||||||
  `out_quantity` int(11) NULL DEFAULT NULL COMMENT '发出',
 | 
					 | 
				
			||||||
  `manu_stock` int(11) NULL DEFAULT NULL COMMENT '批次结存',
 | 
					 | 
				
			||||||
  `total_stock` int(11) NULL DEFAULT NULL COMMENT '总结村',
 | 
					 | 
				
			||||||
  `user_id1` int(11) NULL DEFAULT NULL COMMENT '发药领药人id',
 | 
					 | 
				
			||||||
  `user_id2` int(11) NULL DEFAULT NULL COMMENT '复核人id',
 | 
					 | 
				
			||||||
  `machine_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '设备id',
 | 
					 | 
				
			||||||
  `create_date` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '日期',
 | 
					 | 
				
			||||||
  `create_time` datetime NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '插入更新时间',
 | 
					 | 
				
			||||||
  `shoushuJian` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '手术间',
 | 
					 | 
				
			||||||
  PRIMARY KEY (`id`) USING BTREE
 | 
					 | 
				
			||||||
) ENGINE = InnoDB AUTO_INCREMENT = 33034 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = DYNAMIC;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
SET FOREIGN_KEY_CHECKS = 1;
 | 
					 | 
				
			||||||
| 
						 | 
					@ -1,59 +0,0 @@
 | 
				
			||||||
/*
 | 
					 | 
				
			||||||
 Navicat MySQL Data Transfer
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 Source Server         : 本地
 | 
					 | 
				
			||||||
 Source Server Type    : MySQL
 | 
					 | 
				
			||||||
 Source Server Version : 50740 (5.7.40-log)
 | 
					 | 
				
			||||||
 Source Host           : localhost:3306
 | 
					 | 
				
			||||||
 Source Schema         : zhongbuzhanqu
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 Target Server Type    : MySQL
 | 
					 | 
				
			||||||
 Target Server Version : 50740 (5.7.40-log)
 | 
					 | 
				
			||||||
 File Encoding         : 65001
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 Date: 25/08/2025 17:05:17
 | 
					 | 
				
			||||||
*/
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
SET NAMES utf8mb4;
 | 
					 | 
				
			||||||
SET FOREIGN_KEY_CHECKS = 0;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
-- ----------------------------
 | 
					 | 
				
			||||||
-- Table structure for hkc_changeshifts
 | 
					 | 
				
			||||||
-- ----------------------------
 | 
					 | 
				
			||||||
DROP TABLE IF EXISTS `hkc_changeshifts`;
 | 
					 | 
				
			||||||
CREATE TABLE `hkc_changeshifts`  (
 | 
					 | 
				
			||||||
  `id` int(11) NOT NULL AUTO_INCREMENT,
 | 
					 | 
				
			||||||
  `optDate` datetime NULL DEFAULT NULL COMMENT '操作时间',
 | 
					 | 
				
			||||||
  `FromOperator` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '交班操作人',
 | 
					 | 
				
			||||||
  `FromRviewer` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '交班审核人',
 | 
					 | 
				
			||||||
  `ToOperator` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '接班操作人',
 | 
					 | 
				
			||||||
  `ToReviewer` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '接班审核人',
 | 
					 | 
				
			||||||
  `ToDate` datetime NULL DEFAULT NULL COMMENT '接班时间',
 | 
					 | 
				
			||||||
  `State` varchar(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '当班状态(0当前值班,1已交班)',
 | 
					 | 
				
			||||||
  `optState` varchar(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '操作状态(0新增,1修改)',
 | 
					 | 
				
			||||||
  `machine_id` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
 | 
					 | 
				
			||||||
  `Remarks` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注',
 | 
					 | 
				
			||||||
  PRIMARY KEY (`id`) USING BTREE,
 | 
					 | 
				
			||||||
  INDEX `index_optdate`(`optDate`) USING BTREE,
 | 
					 | 
				
			||||||
  INDEX `index_fromOperator`(`FromOperator`) USING BTREE,
 | 
					 | 
				
			||||||
  INDEX `index_fromReviewer`(`FromRviewer`) USING BTREE,
 | 
					 | 
				
			||||||
  INDEX `index_ToDate`(`ToDate`) USING BTREE,
 | 
					 | 
				
			||||||
  INDEX `index_toOperator`(`ToOperator`) USING BTREE,
 | 
					 | 
				
			||||||
  INDEX `index_toreviewer`(`ToReviewer`) USING BTREE
 | 
					 | 
				
			||||||
) ENGINE = InnoDB AUTO_INCREMENT = 24 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = DYNAMIC;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
-- ----------------------------
 | 
					 | 
				
			||||||
-- Records of hkc_changeshifts
 | 
					 | 
				
			||||||
-- ----------------------------
 | 
					 | 
				
			||||||
INSERT INTO `hkc_changeshifts` VALUES (1, '2025-06-30 14:36:25', 'admin', NULL, '', NULL, '2025-07-01 09:21:57', '1', '0', 'DM1', NULL);
 | 
					 | 
				
			||||||
INSERT INTO `hkc_changeshifts` VALUES (2, '2025-07-01 09:21:32', 'admin', NULL, NULL, NULL, '2025-07-01 09:30:17', '1', NULL, 'DM1', NULL);
 | 
					 | 
				
			||||||
INSERT INTO `hkc_changeshifts` VALUES (3, '2025-07-01 09:29:57', 'test3', NULL, NULL, NULL, '2025-07-01 09:36:06', '1', NULL, 'DM1', NULL);
 | 
					 | 
				
			||||||
INSERT INTO `hkc_changeshifts` VALUES (4, '2025-07-01 09:36:06', 'admin', NULL, NULL, NULL, '2025-07-01 09:39:27', '1', NULL, 'DM1', NULL);
 | 
					 | 
				
			||||||
INSERT INTO `hkc_changeshifts` VALUES (5, '2025-07-01 09:39:27', 'test3', NULL, 'admin', NULL, '2025-07-01 10:26:19', '1', NULL, 'DM1', NULL);
 | 
					 | 
				
			||||||
INSERT INTO `hkc_changeshifts` VALUES (6, '2025-07-01 10:26:19', 'admin', NULL, 'test3', NULL, '2025-08-15 10:12:01', '1', NULL, 'DM1', NULL);
 | 
					 | 
				
			||||||
INSERT INTO `hkc_changeshifts` VALUES (7, '2025-08-15 10:12:01', 'test3', NULL, 'admin', NULL, '2025-08-15 10:21:54', '1', NULL, 'DM1', NULL);
 | 
					 | 
				
			||||||
INSERT INTO `hkc_changeshifts` VALUES (8, '2025-08-15 10:21:54', 'admin', NULL, 'test3', NULL, '2025-08-16 16:38:35', '1', NULL, 'DM1', NULL);
 | 
					 | 
				
			||||||
INSERT INTO `hkc_changeshifts` VALUES (9, '2025-08-16 16:38:35', 'test3', NULL, 'admin', NULL, '2025-08-16 18:37:06', '1', NULL, 'DM1', NULL);
 | 
					 | 
				
			||||||
INSERT INTO `hkc_changeshifts` VALUES (23, '2025-08-16 18:37:06', 'admin', NULL, NULL, NULL, '2025-08-16 18:37:06', '0', NULL, 'DM1', '备注');
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
SET FOREIGN_KEY_CHECKS = 1;
 | 
					 | 
				
			||||||
| 
						 | 
					@ -1,37 +0,0 @@
 | 
				
			||||||
/*
 | 
					 | 
				
			||||||
 Navicat MySQL Data Transfer
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 Source Server         : 本地
 | 
					 | 
				
			||||||
 Source Server Type    : MySQL
 | 
					 | 
				
			||||||
 Source Server Version : 50740 (5.7.40-log)
 | 
					 | 
				
			||||||
 Source Host           : localhost:3306
 | 
					 | 
				
			||||||
 Source Schema         : zhongbuzhanqu
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 Target Server Type    : MySQL
 | 
					 | 
				
			||||||
 Target Server Version : 50740 (5.7.40-log)
 | 
					 | 
				
			||||||
 File Encoding         : 65001
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 Date: 25/08/2025 17:05:31
 | 
					 | 
				
			||||||
*/
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
SET NAMES utf8mb4;
 | 
					 | 
				
			||||||
SET FOREIGN_KEY_CHECKS = 0;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
-- ----------------------------
 | 
					 | 
				
			||||||
-- Table structure for hkc_changeshifts_drug
 | 
					 | 
				
			||||||
-- ----------------------------
 | 
					 | 
				
			||||||
DROP TABLE IF EXISTS `hkc_changeshifts_drug`;
 | 
					 | 
				
			||||||
CREATE TABLE `hkc_changeshifts_drug`  (
 | 
					 | 
				
			||||||
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
 | 
					 | 
				
			||||||
  `changeShifts_id` int(11) NULL DEFAULT NULL COMMENT '交接班表主键',
 | 
					 | 
				
			||||||
  `drug_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
 | 
					 | 
				
			||||||
  `RealNumber` int(11) NULL DEFAULT NULL COMMENT '实物数',
 | 
					 | 
				
			||||||
  `orderNumber` int(11) NULL DEFAULT NULL COMMENT '处方数',
 | 
					 | 
				
			||||||
  PRIMARY KEY (`id`) USING BTREE
 | 
					 | 
				
			||||||
) ENGINE = InnoDB AUTO_INCREMENT = 13 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = DYNAMIC;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
-- ----------------------------
 | 
					 | 
				
			||||||
-- Records of hkc_changeshifts_drug
 | 
					 | 
				
			||||||
-- ----------------------------
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
SET FOREIGN_KEY_CHECKS = 1;
 | 
					 | 
				
			||||||
							
								
								
									
										37
									
								
								sql/plan.sql
								
								
								
								
							
							
						
						
									
										37
									
								
								sql/plan.sql
								
								
								
								
							| 
						 | 
					@ -1,37 +0,0 @@
 | 
				
			||||||
/*
 | 
					 | 
				
			||||||
 Navicat MySQL Data Transfer
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 Source Server         : 本地
 | 
					 | 
				
			||||||
 Source Server Type    : MySQL
 | 
					 | 
				
			||||||
 Source Server Version : 50740 (5.7.40-log)
 | 
					 | 
				
			||||||
 Source Host           : localhost:3306
 | 
					 | 
				
			||||||
 Source Schema         : zhongbuzhanqu
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 Target Server Type    : MySQL
 | 
					 | 
				
			||||||
 Target Server Version : 50740 (5.7.40-log)
 | 
					 | 
				
			||||||
 File Encoding         : 65001
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 Date: 25/08/2025 17:04:19
 | 
					 | 
				
			||||||
*/
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
SET NAMES utf8mb4;
 | 
					 | 
				
			||||||
SET FOREIGN_KEY_CHECKS = 0;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
-- ----------------------------
 | 
					 | 
				
			||||||
-- Table structure for plan
 | 
					 | 
				
			||||||
-- ----------------------------
 | 
					 | 
				
			||||||
DROP TABLE IF EXISTS `plan`;
 | 
					 | 
				
			||||||
CREATE TABLE `plan`  (
 | 
					 | 
				
			||||||
  `Id` int(11) NOT NULL AUTO_INCREMENT,
 | 
					 | 
				
			||||||
  `Name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '套餐名',
 | 
					 | 
				
			||||||
  `Description` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '套餐描述',
 | 
					 | 
				
			||||||
  `AddTime` datetime NULL DEFAULT CURRENT_TIMESTAMP COMMENT '新增时间',
 | 
					 | 
				
			||||||
  `useState` int(11) NULL DEFAULT 1 COMMENT '可用状态',
 | 
					 | 
				
			||||||
  `operatorUser` int(11) NULL DEFAULT NULL COMMENT '操作人',
 | 
					 | 
				
			||||||
  `reviewerUser` int(11) NULL DEFAULT NULL COMMENT '审核人',
 | 
					 | 
				
			||||||
  `updateTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
 | 
					 | 
				
			||||||
  `machine_id` varchar(5) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
 | 
					 | 
				
			||||||
  PRIMARY KEY (`Id`) USING BTREE
 | 
					 | 
				
			||||||
) ENGINE = InnoDB AUTO_INCREMENT = 40 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = DYNAMIC;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
SET FOREIGN_KEY_CHECKS = 1;
 | 
					 | 
				
			||||||
| 
						 | 
					@ -1,37 +0,0 @@
 | 
				
			||||||
/*
 | 
					 | 
				
			||||||
 Navicat MySQL Data Transfer
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 Source Server         : 本地
 | 
					 | 
				
			||||||
 Source Server Type    : MySQL
 | 
					 | 
				
			||||||
 Source Server Version : 50740 (5.7.40-log)
 | 
					 | 
				
			||||||
 Source Host           : localhost:3306
 | 
					 | 
				
			||||||
 Source Schema         : zhongbuzhanqu
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 Target Server Type    : MySQL
 | 
					 | 
				
			||||||
 Target Server Version : 50740 (5.7.40-log)
 | 
					 | 
				
			||||||
 File Encoding         : 65001
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 Date: 25/08/2025 17:04:29
 | 
					 | 
				
			||||||
*/
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
SET NAMES utf8mb4;
 | 
					 | 
				
			||||||
SET FOREIGN_KEY_CHECKS = 0;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
-- ----------------------------
 | 
					 | 
				
			||||||
-- Table structure for plan_details
 | 
					 | 
				
			||||||
-- ----------------------------
 | 
					 | 
				
			||||||
DROP TABLE IF EXISTS `plan_details`;
 | 
					 | 
				
			||||||
CREATE TABLE `plan_details`  (
 | 
					 | 
				
			||||||
  `Id` int(11) NOT NULL AUTO_INCREMENT,
 | 
					 | 
				
			||||||
  `Plan_Id` int(11) NULL DEFAULT NULL COMMENT '外键',
 | 
					 | 
				
			||||||
  `Base_Quantity` int(11) NULL DEFAULT NULL COMMENT '基数',
 | 
					 | 
				
			||||||
  `Drug_Id` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '药品ID',
 | 
					 | 
				
			||||||
  `AddTime` datetime NULL DEFAULT CURRENT_TIMESTAMP,
 | 
					 | 
				
			||||||
  `useState` int(11) NULL DEFAULT 1 COMMENT '可用状态',
 | 
					 | 
				
			||||||
  `operatorUser` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '操作人',
 | 
					 | 
				
			||||||
  `reviewerUser` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '审核人',
 | 
					 | 
				
			||||||
  `updateTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
 | 
					 | 
				
			||||||
  PRIMARY KEY (`Id`) USING BTREE
 | 
					 | 
				
			||||||
) ENGINE = InnoDB AUTO_INCREMENT = 146 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = DYNAMIC;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
SET FOREIGN_KEY_CHECKS = 1;
 | 
					 | 
				
			||||||
| 
						 | 
					@ -1,42 +0,0 @@
 | 
				
			||||||
/*
 | 
					 | 
				
			||||||
 Navicat MySQL Data Transfer
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 Source Server         : 本地
 | 
					 | 
				
			||||||
 Source Server Type    : MySQL
 | 
					 | 
				
			||||||
 Source Server Version : 50740 (5.7.40-log)
 | 
					 | 
				
			||||||
 Source Host           : localhost:3306
 | 
					 | 
				
			||||||
 Source Schema         : hkcdb
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 Target Server Type    : MySQL
 | 
					 | 
				
			||||||
 Target Server Version : 50740 (5.7.40-log)
 | 
					 | 
				
			||||||
 File Encoding         : 65001
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 Date: 26/08/2025 09:01:46
 | 
					 | 
				
			||||||
*/
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
SET NAMES utf8mb4;
 | 
					 | 
				
			||||||
SET FOREIGN_KEY_CHECKS = 0;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
-- ----------------------------
 | 
					 | 
				
			||||||
-- Table structure for settingmanu
 | 
					 | 
				
			||||||
-- ----------------------------
 | 
					 | 
				
			||||||
DROP TABLE IF EXISTS `settingmanu`;
 | 
					 | 
				
			||||||
CREATE TABLE `settingmanu`  (
 | 
					 | 
				
			||||||
  `ID` int(11) NOT NULL AUTO_INCREMENT,
 | 
					 | 
				
			||||||
  `Manu_Name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '菜单名',
 | 
					 | 
				
			||||||
  `Manu_Icon` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '菜单图标',
 | 
					 | 
				
			||||||
  `Path` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '菜单页面地址',
 | 
					 | 
				
			||||||
  `Culture` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '中文zh-CN;英文en',
 | 
					 | 
				
			||||||
  `UseStatus` int(11) NULL DEFAULT NULL COMMENT '可用状态0不用;1在用',
 | 
					 | 
				
			||||||
  PRIMARY KEY (`ID`) USING BTREE
 | 
					 | 
				
			||||||
) ENGINE = InnoDB AUTO_INCREMENT = 5 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = DYNAMIC;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
-- ----------------------------
 | 
					 | 
				
			||||||
-- Records of settingmanu
 | 
					 | 
				
			||||||
-- ----------------------------
 | 
					 | 
				
			||||||
INSERT INTO `settingmanu` VALUES (1, '登录设置', 'lock', '/manage/setting/login', 'zh-CN', 1);
 | 
					 | 
				
			||||||
INSERT INTO `settingmanu` VALUES (2, '冰箱设置', 'build', '/manage/setting/Fridge', 'zh-CN', 0);
 | 
					 | 
				
			||||||
INSERT INTO `settingmanu` VALUES (3, 'Login Setting', 'lock', '/manage/setting/login', 'en', 0);
 | 
					 | 
				
			||||||
INSERT INTO `settingmanu` VALUES (4, 'Fridge Setting', 'build', '/manage/setting/Fridge', 'en', 0);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
SET FOREIGN_KEY_CHECKS = 1;
 | 
					 | 
				
			||||||
							
								
								
									
										234
									
								
								sql/修改数据库信息.txt
								
								
								
								
							
							
						
						
									
										234
									
								
								sql/修改数据库信息.txt
								
								
								
								
							| 
						 | 
					@ -1,234 +0,0 @@
 | 
				
			||||||
1)修改Role表里对应的角色permissions字段值
 | 
					 | 
				
			||||||
UPDATE `role` set permissions='11,12,13,14,23,24,32,33,34,40,41,42,43,44,50,51,52,53,21,35,45,61,62,63,66,46,47,36,37,48,49,15' WHERE machine_id='DM1'
 | 
					 | 
				
			||||||
2)chan_stock表
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
DELETE from channel_stock where machine_id='DM1'
 | 
					 | 
				
			||||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_1','DM1',1,1);
 | 
					 | 
				
			||||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_2','DM1',1,2);
 | 
					 | 
				
			||||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_3','DM1',1,3);
 | 
					 | 
				
			||||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_4','DM1',1,4);
 | 
					 | 
				
			||||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_5','DM1',1,5);
 | 
					 | 
				
			||||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_6','DM1',1,6);
 | 
					 | 
				
			||||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_7','DM1',1,7);
 | 
					 | 
				
			||||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_8','DM1',1,8);
 | 
					 | 
				
			||||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_9','DM1',1,9);
 | 
					 | 
				
			||||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_10','DM1',2,1);
 | 
					 | 
				
			||||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_11','DM1',2,2);
 | 
					 | 
				
			||||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_12','DM1',2,3);
 | 
					 | 
				
			||||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_13','DM1',2,4);
 | 
					 | 
				
			||||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_14','DM1',2,5);
 | 
					 | 
				
			||||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_15','DM1',2,6);
 | 
					 | 
				
			||||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_16','DM1',2,7);
 | 
					 | 
				
			||||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_17','DM1',2,8);
 | 
					 | 
				
			||||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_18','DM1',2,9);
 | 
					 | 
				
			||||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_19','DM1',3,1);
 | 
					 | 
				
			||||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_20','DM1',3,2);
 | 
					 | 
				
			||||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_21','DM1',3,3);
 | 
					 | 
				
			||||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_22','DM1',3,4);
 | 
					 | 
				
			||||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_23','DM1',3,5);
 | 
					 | 
				
			||||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_24','DM1',3,6);
 | 
					 | 
				
			||||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_25','DM1',3,7);
 | 
					 | 
				
			||||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_26','DM1',3,8);
 | 
					 | 
				
			||||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_27','DM1',3,9);
 | 
					 | 
				
			||||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_28','DM1',4,1);
 | 
					 | 
				
			||||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_29','DM1',4,2);
 | 
					 | 
				
			||||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_30','DM1',4,3);
 | 
					 | 
				
			||||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_31','DM1',4,4);
 | 
					 | 
				
			||||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_32','DM1',4,5);
 | 
					 | 
				
			||||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_33','DM1',4,6);
 | 
					 | 
				
			||||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_34','DM1',4,7);
 | 
					 | 
				
			||||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_35','DM1',4,8);
 | 
					 | 
				
			||||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_36','DM1',4,9);
 | 
					 | 
				
			||||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_37','DM1',5,1);
 | 
					 | 
				
			||||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_38','DM1',5,2);
 | 
					 | 
				
			||||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_39','DM1',5,3);
 | 
					 | 
				
			||||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_40','DM1',5,4);
 | 
					 | 
				
			||||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_41','DM1',5,5);
 | 
					 | 
				
			||||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_42','DM1',5,6);
 | 
					 | 
				
			||||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_43','DM1',5,7);
 | 
					 | 
				
			||||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_44','DM1',5,8);
 | 
					 | 
				
			||||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_45','DM1',5,9);
 | 
					 | 
				
			||||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_46','DM1',6,1);
 | 
					 | 
				
			||||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_47','DM1',6,2);
 | 
					 | 
				
			||||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_48','DM1',6,3);
 | 
					 | 
				
			||||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_49','DM1',6,4);
 | 
					 | 
				
			||||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_50','DM1',6,5);
 | 
					 | 
				
			||||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_51','DM1',6,6);
 | 
					 | 
				
			||||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_52','DM1',6,7);
 | 
					 | 
				
			||||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_53','DM1',6,8);
 | 
					 | 
				
			||||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_54','DM1',6,9);
 | 
					 | 
				
			||||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_55','DM1',7,1);
 | 
					 | 
				
			||||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_56','DM1',7,2);
 | 
					 | 
				
			||||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_57','DM1',7,3);
 | 
					 | 
				
			||||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_58','DM1',7,4);
 | 
					 | 
				
			||||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_59','DM1',7,5);
 | 
					 | 
				
			||||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_60','DM1',7,6);
 | 
					 | 
				
			||||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_61','DM1',7,7);
 | 
					 | 
				
			||||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_62','DM1',7,8);
 | 
					 | 
				
			||||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_63','DM1',7,9);
 | 
					 | 
				
			||||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_64','DM1',8,1);
 | 
					 | 
				
			||||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_65','DM1',8,2);
 | 
					 | 
				
			||||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_66','DM1',8,3);
 | 
					 | 
				
			||||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_67','DM1',8,4);
 | 
					 | 
				
			||||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_68','DM1',8,5);
 | 
					 | 
				
			||||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_69','DM1',8,6);
 | 
					 | 
				
			||||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_70','DM1',8,7);
 | 
					 | 
				
			||||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_71','DM1',8,8);
 | 
					 | 
				
			||||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_72','DM1',8,9);
 | 
					 | 
				
			||||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_73','DM1',9,1);
 | 
					 | 
				
			||||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_74','DM1',9,2);
 | 
					 | 
				
			||||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_75','DM1',9,3);
 | 
					 | 
				
			||||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_76','DM1',9,4);
 | 
					 | 
				
			||||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_77','DM1',9,5);
 | 
					 | 
				
			||||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_78','DM1',9,6);
 | 
					 | 
				
			||||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_79','DM1',9,7);
 | 
					 | 
				
			||||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_80','DM1',9,8);
 | 
					 | 
				
			||||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_81','DM1',9,9);
 | 
					 | 
				
			||||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_82','DM1',10,1);
 | 
					 | 
				
			||||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_83','DM1',10,2);
 | 
					 | 
				
			||||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_84','DM1',10,3);
 | 
					 | 
				
			||||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_85','DM1',10,4);
 | 
					 | 
				
			||||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_86','DM1',10,5);
 | 
					 | 
				
			||||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_87','DM1',10,6);
 | 
					 | 
				
			||||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_88','DM1',10,7);
 | 
					 | 
				
			||||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_89','DM1',10,8);
 | 
					 | 
				
			||||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_90','DM1',10,9);
 | 
					 | 
				
			||||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_91','DM1',11,1);
 | 
					 | 
				
			||||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_92','DM1',11,2);
 | 
					 | 
				
			||||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_93','DM1',11,3);
 | 
					 | 
				
			||||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_94','DM1',11,4);
 | 
					 | 
				
			||||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_95','DM1',11,5);
 | 
					 | 
				
			||||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_96','DM1',11,6);
 | 
					 | 
				
			||||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_97','DM1',11,7);
 | 
					 | 
				
			||||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_98','DM1',11,8);
 | 
					 | 
				
			||||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_99','DM1',11,9);
 | 
					 | 
				
			||||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_100','DM1',12,1);
 | 
					 | 
				
			||||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_101','DM1',12,2);
 | 
					 | 
				
			||||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_102','DM1',12,3);
 | 
					 | 
				
			||||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_103','DM1',12,4);
 | 
					 | 
				
			||||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_104','DM1',12,5);
 | 
					 | 
				
			||||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_105','DM1',12,6);
 | 
					 | 
				
			||||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_106','DM1',12,7);
 | 
					 | 
				
			||||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_107','DM1',12,8);
 | 
					 | 
				
			||||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_108','DM1',12,9);
 | 
					 | 
				
			||||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_109','DM1',13,1);
 | 
					 | 
				
			||||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_110','DM1',13,2);
 | 
					 | 
				
			||||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_111','DM1',13,3);
 | 
					 | 
				
			||||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_112','DM1',13,4);
 | 
					 | 
				
			||||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_113','DM1',13,5);
 | 
					 | 
				
			||||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_114','DM1',13,6);
 | 
					 | 
				
			||||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_115','DM1',13,7);
 | 
					 | 
				
			||||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_116','DM1',13,8);
 | 
					 | 
				
			||||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_117','DM1',13,9);
 | 
					 | 
				
			||||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_118','DM1',14,1);
 | 
					 | 
				
			||||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_119','DM1',14,2);
 | 
					 | 
				
			||||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_120','DM1',14,3);
 | 
					 | 
				
			||||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_121','DM1',14,4);
 | 
					 | 
				
			||||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_122','DM1',14,5);
 | 
					 | 
				
			||||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_123','DM1',14,6);
 | 
					 | 
				
			||||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_124','DM1',14,7);
 | 
					 | 
				
			||||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_125','DM1',14,8);
 | 
					 | 
				
			||||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_126','DM1',14,9);
 | 
					 | 
				
			||||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_127','DM1',15,1);
 | 
					 | 
				
			||||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_128','DM1',15,2);
 | 
					 | 
				
			||||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_129','DM1',15,3);
 | 
					 | 
				
			||||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_130','DM1',15,4);
 | 
					 | 
				
			||||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_131','DM1',15,5);
 | 
					 | 
				
			||||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_132','DM1',15,6);
 | 
					 | 
				
			||||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_133','DM1',15,7);
 | 
					 | 
				
			||||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_134','DM1',15,8);
 | 
					 | 
				
			||||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_135','DM1',15,9);
 | 
					 | 
				
			||||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_136','DM1',16,1);
 | 
					 | 
				
			||||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_137','DM1',16,2);
 | 
					 | 
				
			||||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_138','DM1',16,3);
 | 
					 | 
				
			||||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_139','DM1',16,4);
 | 
					 | 
				
			||||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_140','DM1',16,5);
 | 
					 | 
				
			||||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_141','DM1',16,6);
 | 
					 | 
				
			||||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_142','DM1',16,7);
 | 
					 | 
				
			||||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_143','DM1',16,8);
 | 
					 | 
				
			||||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_144','DM1',16,9);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
UPDATE channel_stock set board_type=2 where  machine_id='DM1' and row_no<12;
 | 
					 | 
				
			||||||
UPDATE channel_stock set drawer_type=2 WHERE machine_id='DM1' and row_no<12 and row_no%2=0;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
delete from channel_list where machine_id='DM5';
 | 
					 | 
				
			||||||
INSERT into channel_list(chnguid,machine_id,row_no) values('DM5_CHANNEL_1','DM5',1);
 | 
					 | 
				
			||||||
INSERT into channel_list(chnguid,machine_id,row_no) values('DM5_CHANNEL_2','DM5',2);
 | 
					 | 
				
			||||||
INSERT into channel_list(chnguid,machine_id,row_no) values('DM5_CHANNEL_3','DM5',3);
 | 
					 | 
				
			||||||
INSERT into channel_list(chnguid,machine_id,row_no) values('DM5_CHANNEL_4','DM5',4);
 | 
					 | 
				
			||||||
INSERT into channel_list(chnguid,machine_id,row_no) values('DM5_CHANNEL_5','DM5',5);
 | 
					 | 
				
			||||||
INSERT into channel_list(chnguid,machine_id,row_no) values('DM5_CHANNEL_6','DM5',6);
 | 
					 | 
				
			||||||
INSERT into channel_list(chnguid,machine_id,row_no) values('DM5_CHANNEL_7','DM5',7);
 | 
					 | 
				
			||||||
INSERT into channel_list(chnguid,machine_id,row_no) values('DM5_CHANNEL_8','DM5',8);
 | 
					 | 
				
			||||||
INSERT into channel_list(chnguid,machine_id,row_no) values('DM5_CHANNEL_9','DM5',9);
 | 
					 | 
				
			||||||
INSERT into channel_list(chnguid,machine_id,row_no) values('DM5_CHANNEL_10','DM5',10);
 | 
					 | 
				
			||||||
INSERT into channel_list(chnguid,machine_id,row_no) values('DM5_CHANNEL_11','DM5',11);
 | 
					 | 
				
			||||||
INSERT into channel_list(chnguid,machine_id,row_no) values('DM5_CHANNEL_12','DM5',12);
 | 
					 | 
				
			||||||
INSERT into channel_list(chnguid,machine_id,row_no) values('DM5_CHANNEL_13','DM5',13);
 | 
					 | 
				
			||||||
INSERT into channel_list(chnguid,machine_id,row_no) values('DM5_CHANNEL_14','DM5',14);
 | 
					 | 
				
			||||||
INSERT into channel_list(chnguid,machine_id,row_no) values('DM5_CHANNEL_15','DM5',15);
 | 
					 | 
				
			||||||
INSERT into channel_list(chnguid,machine_id,row_no) values('DM5_CHANNEL_16','DM5',16);
 | 
					 | 
				
			||||||
INSERT into channel_list(chnguid,machine_id,row_no) values('DM5_CHANNEL_17','DM5',17);
 | 
					 | 
				
			||||||
INSERT into channel_list(chnguid,machine_id,row_no) values('DM5_CHANNEL_18','DM5',18);
 | 
					 | 
				
			||||||
INSERT into channel_list(chnguid,machine_id,row_no) values('DM5_CHANNEL_19','DM5',19);
 | 
					 | 
				
			||||||
INSERT into channel_list(chnguid,machine_id,row_no) values('DM5_CHANNEL_20','DM5',20);
 | 
					 | 
				
			||||||
INSERT into channel_list(chnguid,machine_id,row_no) values('DM5_CHANNEL_21','DM5',21);
 | 
					 | 
				
			||||||
INSERT into channel_list(chnguid,machine_id,row_no) values('DM5_CHANNEL_22','DM5',22);
 | 
					 | 
				
			||||||
INSERT into channel_list(chnguid,machine_id,row_no) values('DM5_CHANNEL_23','DM5',23);
 | 
					 | 
				
			||||||
INSERT into channel_list(chnguid,machine_id,row_no) values('DM5_CHANNEL_24','DM5',24);
 | 
					 | 
				
			||||||
INSERT into channel_list(chnguid,machine_id,row_no) values('DM5_CHANNEL_25','DM5',25);
 | 
					 | 
				
			||||||
INSERT into channel_list(chnguid,machine_id,row_no) values('DM5_CHANNEL_26','DM5',26);
 | 
					 | 
				
			||||||
INSERT into channel_list(chnguid,machine_id,row_no) values('DM5_CHANNEL_27','DM5',27);
 | 
					 | 
				
			||||||
INSERT into channel_list(chnguid,machine_id,row_no) values('DM5_CHANNEL_28','DM5',28);
 | 
					 | 
				
			||||||
INSERT into channel_list(chnguid,machine_id,row_no) values('DM5_CHANNEL_29','DM5',29);
 | 
					 | 
				
			||||||
INSERT into channel_list(chnguid,machine_id,row_no) values('DM5_CHANNEL_30','DM5',30);
 | 
					 | 
				
			||||||
INSERT into channel_list(chnguid,machine_id,row_no) values('DM5_CHANNEL_31','DM5',31);
 | 
					 | 
				
			||||||
INSERT into channel_list(chnguid,machine_id,row_no) values('DM5_CHANNEL_32','DM5',32);
 | 
					 | 
				
			||||||
INSERT into channel_list(chnguid,machine_id,row_no) values('DM5_CHANNEL_33','DM5',33);
 | 
					 | 
				
			||||||
INSERT into channel_list(chnguid,machine_id,row_no) values('DM5_CHANNEL_34','DM5',34);
 | 
					 | 
				
			||||||
INSERT into channel_list(chnguid,machine_id,row_no) values('DM5_CHANNEL_35','DM5',35);
 | 
					 | 
				
			||||||
INSERT into channel_list(chnguid,machine_id,row_no) values('DM5_CHANNEL_36','DM5',36);
 | 
					 | 
				
			||||||
INSERT into channel_list(chnguid,machine_id,row_no) values('DM5_CHANNEL_37','DM5',37);
 | 
					 | 
				
			||||||
INSERT into channel_list(chnguid,machine_id,row_no) values('DM5_CHANNEL_38','DM5',38);
 | 
					 | 
				
			||||||
INSERT into channel_list(chnguid,machine_id,row_no) values('DM5_CHANNEL_39','DM5',39);
 | 
					 | 
				
			||||||
INSERT into channel_list(chnguid,machine_id,row_no) values('DM5_CHANNEL_40','DM5',40);
 | 
					 | 
				
			||||||
INSERT into channel_list(chnguid,machine_id,row_no) values('DM5_CHANNEL_41','DM5',41);
 | 
					 | 
				
			||||||
INSERT into channel_list(chnguid,machine_id,row_no) values('DM5_CHANNEL_42','DM5',42);
 | 
					 | 
				
			||||||
INSERT into channel_list(chnguid,machine_id,row_no) values('DM5_CHANNEL_43','DM5',43);
 | 
					 | 
				
			||||||
INSERT into channel_list(chnguid,machine_id,row_no) values('DM5_CHANNEL_44','DM5',44);
 | 
					 | 
				
			||||||
INSERT into channel_list(chnguid,machine_id,row_no) values('DM5_CHANNEL_45','DM5',45);
 | 
					 | 
				
			||||||
INSERT into channel_list(chnguid,machine_id,row_no) values('DM5_CHANNEL_46','DM5',46);
 | 
					 | 
				
			||||||
INSERT into channel_list(chnguid,machine_id,row_no) values('DM5_CHANNEL_47','DM5',47);
 | 
					 | 
				
			||||||
INSERT into channel_list(chnguid,machine_id,row_no) values('DM5_CHANNEL_48','DM5',48);
 | 
					 | 
				
			||||||
INSERT into channel_list(chnguid,machine_id,row_no) values('DM5_CHANNEL_49','DM5',49);
 | 
					 | 
				
			||||||
INSERT into channel_list(chnguid,machine_id,row_no) values('DM5_CHANNEL_50','DM5',50);
 | 
					 | 
				
			||||||
INSERT into channel_list(chnguid,machine_id,row_no) values('DM5_CHANNEL_51','DM5',51);
 | 
					 | 
				
			||||||
INSERT into channel_list(chnguid,machine_id,row_no) values('DM5_CHANNEL_52','DM5',52);
 | 
					 | 
				
			||||||
INSERT into channel_list(chnguid,machine_id,row_no) values('DM5_CHANNEL_53','DM5',53);
 | 
					 | 
				
			||||||
INSERT into channel_list(chnguid,machine_id,row_no) values('DM5_CHANNEL_54','DM5',54);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
3)修改drug_manu_no表中eff_date字段长度为20
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
4)account_book表添加字段
 | 
					 | 
				
			||||||
add_quantity	int	11	0	True	False	False	0				数量					0	False	False	False	False	False	False
 | 
					 | 
				
			||||||
out_quantity	int	11	0	True	False	False	0				出库数量					0	False	False	False	False	False	False
 | 
					 | 
				
			||||||
create_time	datetime	0	0	True	False	False	0									0	False	False	False	False	False	False
 | 
					 | 
				
			||||||
yesterday_quantity	int	11	0	True	False	False	0									0	False	False	False	False	False	False
 | 
					 | 
				
			||||||
manu_stock	int	11	0	True	False	False	0				抽屉号					0	False	False	False	False	False	False
 | 
					 | 
				
			||||||
total_stock	int	11	0	True	False	False	0									0	False	False	False	False	False	False
 | 
					 | 
				
			||||||
department	varchar	255	0	True	False	False	0				取药科室			utf8mb4	utf8mb4_general_ci	0	False	False	False	False	False	False
 | 
					 | 
				
			||||||
create_date	datetime	0	0	True	False	False	0									0	False	False	False	False	False	False
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
5)dm_machine_record表添加字段
 | 
					 | 
				
			||||||
stock_quantity	float	0	0	True	False	False	0				操作后的库存					0	False	False	False	False	False	False
 | 
					 | 
				
			||||||
check_quantity	float	0	0	True	False	False	0				盘点库存					0	False	False	False	False	False	False
 | 
					 | 
				
			||||||
manunoQuantity	float	0	0	True	False	False	0				批号库存					0	False	False	False	False	False	False
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
6)hkc_order_finish表添加字段
 | 
					 | 
				
			||||||
operator	 varchar	50	0	True	False	False	0							 
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
		Loading…
	
		Reference in New Issue