添加多处方取药
This commit is contained in:
parent
217dd11512
commit
c7254d66c6
|
@ -154,6 +154,9 @@ namespace DM_Weight
|
||||||
|
|
||||||
|
|
||||||
#region 取药
|
#region 取药
|
||||||
|
// 多处方取药页面
|
||||||
|
containerRegistry.RegisterForNavigation<MultiOrderTakeDrugWindow, MultiOrderTakeDrugWindowViewModel>();
|
||||||
|
containerRegistry.RegisterForNavigation<MultiOrderTakeDialog, MultiOrderTakeDialogViewModel>();
|
||||||
// 处方取药页面
|
// 处方取药页面
|
||||||
containerRegistry.RegisterForNavigation<OrderTakeDrugWindow, OrderTakeDrugWindowViewModel>();
|
containerRegistry.RegisterForNavigation<OrderTakeDrugWindow, OrderTakeDrugWindowViewModel>();
|
||||||
// 处方取药模态框
|
// 处方取药模态框
|
||||||
|
|
|
@ -0,0 +1,16 @@
|
||||||
|
using Prism.Mvvm;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace DM_Weight.Models
|
||||||
|
{
|
||||||
|
public class OrderDepartment : BindableBase
|
||||||
|
{
|
||||||
|
//科室
|
||||||
|
public string _deptName = "全部";
|
||||||
|
public string DeptName { get => _deptName; set { SetProperty(ref _deptName, value); } }
|
||||||
|
}
|
||||||
|
}
|
|
@ -10,6 +10,11 @@ namespace DM_Weight.Models
|
||||||
[SugarTable("order_info")]
|
[SugarTable("order_info")]
|
||||||
public class OrderInfo
|
public class OrderInfo
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 是否选中
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(IsIgnore = true)]
|
||||||
|
public bool ItemIsChecked { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/////</summary>
|
/////</summary>
|
||||||
|
|
|
@ -0,0 +1,488 @@
|
||||||
|
using DM_Weight.Models;
|
||||||
|
using DM_Weight.msg;
|
||||||
|
using DM_Weight.Port;
|
||||||
|
using DM_Weight.util;
|
||||||
|
using log4net;
|
||||||
|
using Prism.Commands;
|
||||||
|
using Prism.Events;
|
||||||
|
using Prism.Mvvm;
|
||||||
|
using Prism.Regions;
|
||||||
|
using Prism.Services.Dialogs;
|
||||||
|
using SqlSugar;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Collections.ObjectModel;
|
||||||
|
using System.Configuration;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace DM_Weight.ViewModels
|
||||||
|
{
|
||||||
|
public class MultiOrderTakeDialogViewModel : BindableBase, IDialogAware, IRegionMemberLifetime
|
||||||
|
{
|
||||||
|
private readonly ILog logger = LogManager.GetLogger(typeof(OrderTakeDialogViewModel));
|
||||||
|
public string Title => "多处方取药";
|
||||||
|
|
||||||
|
|
||||||
|
public event Action<IDialogResult> RequestClose;
|
||||||
|
|
||||||
|
private static readonly DateTime Jan1st1970 = new DateTime
|
||||||
|
(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc);
|
||||||
|
|
||||||
|
private PortUtil _portUtil;
|
||||||
|
IEventAggregator _eventAggregator;
|
||||||
|
IDialogService _dialogService;
|
||||||
|
public MultiOrderTakeDialogViewModel(PortUtil portUtil, IEventAggregator eventAggregator, IDialogService DialogService)
|
||||||
|
{
|
||||||
|
_dialogService = DialogService;
|
||||||
|
_portUtil = portUtil;
|
||||||
|
_eventAggregator = eventAggregator;
|
||||||
|
}
|
||||||
|
|
||||||
|
void DoMyPrismEvent(DeviceMsg msg)
|
||||||
|
{
|
||||||
|
|
||||||
|
if (msg.WindowName == "OrderTakeDrugWindow")
|
||||||
|
{
|
||||||
|
IGrouping<int, ChannelStock> grouping = enumerator.Current;
|
||||||
|
int DrawerNo = grouping.Key;
|
||||||
|
List<ChannelStock> channelStocks = grouping.ToList();
|
||||||
|
|
||||||
|
switch (msg.EventType)
|
||||||
|
{
|
||||||
|
// 抽屉打开
|
||||||
|
case EventType.DRAWEROPEN:
|
||||||
|
|
||||||
|
|
||||||
|
if (Status == 1)
|
||||||
|
{
|
||||||
|
if (channelStocks[0].process == 1)
|
||||||
|
{
|
||||||
|
channelStocks.ForEach(it => it.process = 2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
// 抽屉关闭
|
||||||
|
case EventType.DRAWERCLOSE:
|
||||||
|
if (Status == 1)
|
||||||
|
{
|
||||||
|
if (channelStocks[0].process == 2)
|
||||||
|
{
|
||||||
|
channelStocks.ForEach(it => it.process = 3);
|
||||||
|
}
|
||||||
|
IGrouping<int, ChannelStock> groupingBefore = enumerator.Current;
|
||||||
|
int DrawerNoBefore = groupingBefore.Key;
|
||||||
|
if (enumerator.MoveNext())
|
||||||
|
{
|
||||||
|
IGrouping<int, ChannelStock> groupingAfter = enumerator.Current;
|
||||||
|
int DrawerNoAfter = groupingAfter.Key;
|
||||||
|
if (DrawerNoBefore < 9 && DrawerNoAfter > 8)
|
||||||
|
{
|
||||||
|
Thread.Sleep(50);
|
||||||
|
}
|
||||||
|
OpenOneByOne();
|
||||||
|
}
|
||||||
|
// 已经全部取出
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Status = 3;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
// 数量变化
|
||||||
|
case EventType.UPDATEQUANTITY:
|
||||||
|
if (Status == 1)
|
||||||
|
{
|
||||||
|
logger.Info($"抽屉【{DrawerNo}】库位取药数量【{msg.Quantitys}】");
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
// 打开失败
|
||||||
|
case EventType.OPENERROR:
|
||||||
|
AlertMsg alertMsg = new AlertMsg
|
||||||
|
{
|
||||||
|
Message = msg.Message,
|
||||||
|
Type = MsgType.ERROR,
|
||||||
|
};
|
||||||
|
_eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg);
|
||||||
|
Status = 0;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private int _status = 0;
|
||||||
|
|
||||||
|
public int Status
|
||||||
|
{
|
||||||
|
get => _status; set => SetProperty(ref _status, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
//多处方的处方号
|
||||||
|
private string _multiOrderNo = "处方号:";
|
||||||
|
public string MultiOrderNo
|
||||||
|
{
|
||||||
|
get => _multiOrderNo;
|
||||||
|
set => SetProperty(ref _multiOrderNo, value);
|
||||||
|
}
|
||||||
|
private ObservableCollection<OrderInfo>? _orderInfo;
|
||||||
|
|
||||||
|
|
||||||
|
public ObservableCollection<OrderInfo>? OrderInfo
|
||||||
|
{
|
||||||
|
get => _orderInfo;
|
||||||
|
set => SetProperty(ref _orderInfo, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
private List<OrderDetail> orderDetails { get; set; }
|
||||||
|
|
||||||
|
private List<ChannelStock> _channelStocks;
|
||||||
|
|
||||||
|
public List<ChannelStock> ChannelStocks
|
||||||
|
{
|
||||||
|
get => _channelStocks;
|
||||||
|
set => SetProperty(ref _channelStocks, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
private IEnumerable<IGrouping<int, ChannelStock>> enumerable;
|
||||||
|
private IEnumerator<IGrouping<int, ChannelStock>> enumerator;
|
||||||
|
|
||||||
|
|
||||||
|
public bool CanCloseDialog()
|
||||||
|
{
|
||||||
|
return Status == 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void OnDialogClosed()
|
||||||
|
{
|
||||||
|
// 取消消息订阅
|
||||||
|
_eventAggregator.GetEvent<PortUtilEvent>().Unsubscribe(DoMyPrismEvent);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void OnDialogOpened(IDialogParameters parameters)
|
||||||
|
{
|
||||||
|
_eventAggregator.GetEvent<PortUtilEvent>().Subscribe(DoMyPrismEvent);
|
||||||
|
OrderInfo = parameters.GetValue<ObservableCollection<OrderInfo>>("orderInfo");
|
||||||
|
MultiOrderNo += string.Join(", ", OrderInfo.Select(o => o.OrderNo));
|
||||||
|
RequestData();
|
||||||
|
}
|
||||||
|
|
||||||
|
public async void RequestData()
|
||||||
|
{
|
||||||
|
orderDetails = SqlSugarHelper.Db.Queryable<OrderDetail>()
|
||||||
|
//.Includes<DrugInfo>(od => od.DrugInfo)
|
||||||
|
.InnerJoin(SqlSugarHelper.Db.Queryable<ChannelStock>().Where(cs => cs.DrawerType == 1).Where(cs => cs.MachineId.Equals(ConfigurationManager.AppSettings["machineId"] ?? "DM1")).GroupBy(cs => cs.DrugId), (od, t) => od.DrugId == t.DrugId)
|
||||||
|
.Where(od => OrderInfo.Select(o => o.OrderNo).Contains(od.OrderNo)).GroupBy(od => od.DrugId)
|
||||||
|
|
||||||
|
.Select(od => new OrderDetail { DrugId = od.DrugId, SetEffDate = od.SetEffDate, SetManuNo = od.SetManuNo, Quantity = SqlFunc.AggregateSum(od.Quantity) })
|
||||||
|
|
||||||
|
//.Where(od => od.OrderNo. OrderInfo.OrderNo)
|
||||||
|
.ToList();
|
||||||
|
|
||||||
|
|
||||||
|
List<ChannelStock> channelStocks = new List<ChannelStock>();
|
||||||
|
List<string> msg = new List<string>();
|
||||||
|
for (int i = 0; i < orderDetails.Count; i++)
|
||||||
|
{
|
||||||
|
OrderDetail orderDetail = orderDetails[i];
|
||||||
|
|
||||||
|
List<ChannelStock> HasQChannels = SqlSugarHelper.Db.Queryable<ChannelStock>()
|
||||||
|
.Includes<DrugInfo>(cs => cs.DrugInfo)
|
||||||
|
.Where(cs => cs.Quantity > 0)
|
||||||
|
.Where(cs => cs.DrawerType == 1)
|
||||||
|
.Where(cs => cs.MachineId.Equals(ConfigurationManager.AppSettings["machineId"] ?? "DM1"))
|
||||||
|
.WhereIF(!string.IsNullOrEmpty(orderDetail.SetEffDate), cs => cs.EffDate.Equals(orderDetail.SetEffDate))
|
||||||
|
.WhereIF(!string.IsNullOrEmpty(orderDetail.SetManuNo), cs => cs.ManuNo.Equals(orderDetail.SetManuNo))
|
||||||
|
.Where(cs => cs.DrugId == orderDetail.DrugId)
|
||||||
|
.OrderBy(cs => cs.EffDate)
|
||||||
|
.OrderBy(cs => cs.DrawerNo)
|
||||||
|
.ToList();
|
||||||
|
int total = HasQChannels.Sum(it => it.Quantity);
|
||||||
|
int TakeQ = orderDetail.Quantity;
|
||||||
|
int multiTakeQ = orderDetail.Quantity;
|
||||||
|
List<ChannelStock> multiTake = new List<ChannelStock>();
|
||||||
|
//multiTakeQ = orderDetails.Where(c => c.DrugId == orderDetail.DrugId).Sum(c => c.Quantity);
|
||||||
|
// 说明数量足够
|
||||||
|
if (total >= multiTakeQ)
|
||||||
|
{
|
||||||
|
for (int j = 0; TakeQ > 0; j++)
|
||||||
|
{
|
||||||
|
ChannelStock stock = HasQChannels[j];
|
||||||
|
|
||||||
|
if (TakeQ > stock.Quantity)
|
||||||
|
{
|
||||||
|
|
||||||
|
//#region 存在该库存且库存数量大于待取数量则把取药数量加上
|
||||||
|
//var varChannelStock = channelStocks.Where(c => c.Location == stock.Location && c.Quantity > c.TakeQuantity + TakeQ).ToList();
|
||||||
|
//if (varChannelStock != null && varChannelStock.Count > 0)
|
||||||
|
//{
|
||||||
|
// channelStocks.Where(c => c.Location == stock.Location).Select(c => c.TakeQuantity += TakeQ).ToList();
|
||||||
|
// break;
|
||||||
|
//}
|
||||||
|
//#endregion
|
||||||
|
stock.TakeQuantity = stock.Quantity;
|
||||||
|
channelStocks.Add(stock);
|
||||||
|
TakeQ -= stock.Quantity;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
|
||||||
|
//#region 存在该库存且库存数量大于待取数量则把取药数量加上
|
||||||
|
//var varChannelStock = channelStocks.Where(c => c.Location == stock.Location && c.Quantity > c.TakeQuantity + TakeQ).ToList();
|
||||||
|
//if (varChannelStock != null && varChannelStock.Count > 0)
|
||||||
|
//{
|
||||||
|
// channelStocks.Where(c => c.Location == stock.Location).Select(c => c.TakeQuantity += TakeQ).ToList();
|
||||||
|
// break;
|
||||||
|
//}
|
||||||
|
//#endregion
|
||||||
|
stock.TakeQuantity = TakeQ;
|
||||||
|
channelStocks.Add(stock);
|
||||||
|
TakeQ = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
//msg.Add($"药品【{orderDetail.DrugInfo.DrugName}】库存不足,应取【{TakeQ}】库存【{total}】");
|
||||||
|
msg.Add($"药品【{HasQChannels[0].DrugInfo.DrugName}】库存不足,应取【{TakeQ}】库存【{total}】");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (msg.Count > 0)
|
||||||
|
{
|
||||||
|
RequestClose?.Invoke(new DialogResult(ButtonResult.Cancel));
|
||||||
|
//MessageBox.Show(string.Join("\n", msg));
|
||||||
|
DialogParameters dialogParameters = new DialogParameters();
|
||||||
|
dialogParameters.Add("msgInfo", msg);
|
||||||
|
DialogServiceExtensions.ShowDialogHost(_dialogService, "ShowMessageDialog", dialogParameters, "RootDialog");
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
channelStocks.Sort((a, b) =>
|
||||||
|
{
|
||||||
|
if ((a.DrawerNo - b.DrawerNo) == 0)
|
||||||
|
{
|
||||||
|
return a.ColNo - b.ColNo;
|
||||||
|
}
|
||||||
|
return a.DrawerNo - b.DrawerNo;
|
||||||
|
});
|
||||||
|
ChannelStocks = channelStocks;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public DelegateCommand OpenDrawer
|
||||||
|
{
|
||||||
|
get => new DelegateCommand(async () =>
|
||||||
|
{
|
||||||
|
if (Status == 0)
|
||||||
|
{
|
||||||
|
enumerable = ChannelStocks.GroupBy(cs => cs.DrawerNo, cs => cs);
|
||||||
|
enumerator = enumerable.GetEnumerator();
|
||||||
|
enumerator.MoveNext();
|
||||||
|
Status = 1;
|
||||||
|
OpenOneByOne();
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OpenOneByOne()
|
||||||
|
{
|
||||||
|
IGrouping<int, ChannelStock> grouping = enumerator.Current;
|
||||||
|
int DrawerNo = grouping.Key;
|
||||||
|
List<ChannelStock> channelStocks = grouping.ToList();
|
||||||
|
channelStocks.ForEach(it => it.process = 1);
|
||||||
|
_portUtil.SpeakAsync("正在打开" + DrawerNo + "号抽屉");
|
||||||
|
|
||||||
|
|
||||||
|
List<ChannelStock> singleChannels = channelStocks.FindAll(it => it.BoardType != 1);
|
||||||
|
|
||||||
|
// 发送取药数量
|
||||||
|
singleChannels.ForEach(it =>
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
|
||||||
|
_portUtil.TakeQuantity(DrawerNo, it.ColNo, it.TakeQuantity, it.Quantity - it.TakeQuantity);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
AlertMsg alertMsg = new AlertMsg
|
||||||
|
{
|
||||||
|
Message = $"打开抽屉异常{ex.Message}",
|
||||||
|
Type = MsgType.ERROR,
|
||||||
|
};
|
||||||
|
_eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
_portUtil.WindowName = "OrderTakeDrugWindow";
|
||||||
|
_portUtil.BoardType = singleChannels.Count > 0 ? singleChannels[0].BoardType : 1;
|
||||||
|
_portUtil.ColNos = singleChannels.Select(it => it.ColNo).ToArray();
|
||||||
|
_portUtil.DrawerNo = DrawerNo;
|
||||||
|
_portUtil.Start();
|
||||||
|
}
|
||||||
|
|
||||||
|
private bool _isFinishClick = false;
|
||||||
|
// 完成按钮
|
||||||
|
public DelegateCommand TakeFinish
|
||||||
|
{
|
||||||
|
get => new DelegateCommand(() =>
|
||||||
|
{
|
||||||
|
if (!_isFinishClick)
|
||||||
|
{
|
||||||
|
_isFinishClick = true;
|
||||||
|
List<ChannelStock> record = ChannelStocks.FindAll(it => it.TakeQuantity > 0).ToList();
|
||||||
|
|
||||||
|
//根据处方单数量分别更新处方状态、写记录信息
|
||||||
|
if (OrderInfo.Count > 0)
|
||||||
|
{
|
||||||
|
|
||||||
|
for (int j = 0; j < OrderInfo.Count; j++)
|
||||||
|
{
|
||||||
|
string InvoiceId = OrderInfo[j].OrderNo;
|
||||||
|
var f = SqlSugarHelper.Db.UseTran(() =>
|
||||||
|
{
|
||||||
|
//SqlSugarHelper.Db.Updateable(new OrderInfo()
|
||||||
|
//{
|
||||||
|
// DmStatus = 1,
|
||||||
|
// OrderNo = OrderInfo[j].OrderNo
|
||||||
|
//}).UpdateColumns(it => new { it.DmStatus }).WhereColumns(it => new { it.OrderNo }).ExecuteCommand();
|
||||||
|
|
||||||
|
SqlSugarHelper.Db.Insertable(new OrderFinish()
|
||||||
|
{
|
||||||
|
OrderNo = OrderInfo[j].OrderNo,
|
||||||
|
PatientId = OrderInfo[j].PatientId,
|
||||||
|
Pharmacy = OrderInfo[j].Pharmacy,
|
||||||
|
State = 1,
|
||||||
|
Operator = HomeWindowViewModel.Operator?.Nickname,
|
||||||
|
});
|
||||||
|
for (int i = 0; i < record.Count; i++)
|
||||||
|
{
|
||||||
|
|
||||||
|
List<OrderDetail> orderDet = SqlSugarHelper.Db.Queryable<OrderDetail>().Where(od => od.OrderNo == OrderInfo[j].OrderNo && od.DrugId == record[i].DrugId).ToList();
|
||||||
|
//该对方没有这个药,跳出循环
|
||||||
|
if (orderDet == null || orderDet.Count <= 0)
|
||||||
|
continue;
|
||||||
|
int orderTakeQuantity = orderDet[0].Quantity;
|
||||||
|
ChannelStock it = record[i];
|
||||||
|
// 更新数据 库存信息
|
||||||
|
SqlSugarHelper.Db.Updateable(new ChannelStock()
|
||||||
|
{
|
||||||
|
Quantity = it.Quantity - it.TakeQuantity,
|
||||||
|
ManuNo = it.ManuNo,
|
||||||
|
EffDate = it.EffDate,
|
||||||
|
Id = it.Id,
|
||||||
|
}).UpdateColumns(it => new { it.Quantity, it.ManuNo, it.EffDate }).ExecuteCommand();
|
||||||
|
// 获取更新完库存后的药品库存
|
||||||
|
List<ChannelStock> nowChannels = SqlSugarHelper.Db.Queryable<ChannelStock>()
|
||||||
|
.Where(cs => cs.MachineId.Equals(it.MachineId))
|
||||||
|
.Where(cs => cs.DrugId.Equals(it.DrugId))
|
||||||
|
.Where(cs => cs.DrawerType == 1)
|
||||||
|
.ToList();
|
||||||
|
|
||||||
|
// 保存数据 出库记录
|
||||||
|
SqlSugarHelper.Db.Insertable(new MachineRecord()
|
||||||
|
{
|
||||||
|
MachineId = it.MachineId,
|
||||||
|
DrawerNo = it.DrawerNo,
|
||||||
|
ColNo = it.ColNo,
|
||||||
|
DrugId = it.DrugId,
|
||||||
|
ManuNo = it.ManuNo,
|
||||||
|
EffDate = !String.IsNullOrEmpty(it.EffDate) ? DateTime.ParseExact(it.EffDate, "yyyy-MM-dd", System.Globalization.CultureInfo.CurrentCulture) : null,
|
||||||
|
Operator = HomeWindowViewModel.Operator?.Id,
|
||||||
|
Reviewer = HomeWindowViewModel.Reviewer?.Id,
|
||||||
|
OperationTime = DateTime.Now,
|
||||||
|
Quantity = orderTakeQuantity,
|
||||||
|
Type = 2,
|
||||||
|
InvoiceId = InvoiceId
|
||||||
|
//,StockQuantity = nowChannels.Sum(it => it.Quantity)
|
||||||
|
}).ExecuteCommand();
|
||||||
|
}
|
||||||
|
//更新处方状态
|
||||||
|
SqlSugarHelper.Db.Updateable(new OrderInfo()
|
||||||
|
{
|
||||||
|
DmStatus = 1,
|
||||||
|
OrderNo = OrderInfo[j].OrderNo
|
||||||
|
}).UpdateColumns(it => new { it.DmStatus }).WhereColumns(it => new { it.OrderNo }).ExecuteCommand();
|
||||||
|
return true;
|
||||||
|
});
|
||||||
|
if (f.Data)
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
//});
|
||||||
|
// 更新屏显库存
|
||||||
|
List<ChannelStock> singleChannels = record.FindAll(it => it.BoardType != 1);
|
||||||
|
if ((singleChannels.Count > 0 ? singleChannels[0].BoardType : 1) == 5)
|
||||||
|
{
|
||||||
|
singleChannels.ForEach(it =>
|
||||||
|
{
|
||||||
|
_portUtil.WriteQuantity(it.DrawerNo, it.ColNo, it.Quantity - it.TakeQuantity);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
AlertMsg alertMsg = new AlertMsg
|
||||||
|
{
|
||||||
|
Message = "抽屉取药完成,库存已更新",
|
||||||
|
Type = MsgType.SUCCESS,
|
||||||
|
};
|
||||||
|
_eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg);
|
||||||
|
}
|
||||||
|
if (!f.IsSuccess)
|
||||||
|
{
|
||||||
|
AlertMsg alertMsg = new AlertMsg
|
||||||
|
{
|
||||||
|
Message = "抽屉取药完成,库存更新失败!",
|
||||||
|
Type = MsgType.ERROR,
|
||||||
|
};
|
||||||
|
_eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Status = 0;
|
||||||
|
_isFinishClick = false;
|
||||||
|
//RequestClose?.Invoke(new DialogResult(ButtonResult.Cancel));
|
||||||
|
RequestClose?.Invoke(new DialogResult(ButtonResult.OK));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public long CurrentTimeMillis()
|
||||||
|
{
|
||||||
|
return (long)(DateTime.UtcNow - Jan1st1970).TotalMilliseconds;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 取消按钮
|
||||||
|
public DelegateCommand CancleTake
|
||||||
|
{
|
||||||
|
get => new DelegateCommand(() =>
|
||||||
|
{
|
||||||
|
_portUtil.ResetData();
|
||||||
|
Status = 0;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public DelegateCommand BtnCloseCommand
|
||||||
|
{
|
||||||
|
get => new DelegateCommand(() =>
|
||||||
|
{
|
||||||
|
if (Status != 0)
|
||||||
|
{
|
||||||
|
_portUtil.ResetData();
|
||||||
|
Status = 0;
|
||||||
|
}
|
||||||
|
//DialogParameters parameters = new DialogParameters();
|
||||||
|
//parameters.Add("",);
|
||||||
|
// 关闭当前窗口
|
||||||
|
RequestClose?.Invoke(new DialogResult(ButtonResult.Cancel));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool KeepAlive => false;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,379 @@
|
||||||
|
using DM_Weight.Models;
|
||||||
|
using DM_Weight.msg;
|
||||||
|
using DM_Weight.util;
|
||||||
|
using Prism.Commands;
|
||||||
|
using Prism.Events;
|
||||||
|
using Prism.Mvvm;
|
||||||
|
using Prism.Regions;
|
||||||
|
using Prism.Services.Dialogs;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Collections.ObjectModel;
|
||||||
|
using System.Configuration;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace DM_Weight.ViewModels
|
||||||
|
{
|
||||||
|
public class MultiOrderTakeDrugWindowViewModel : BindableBase, IConfirmNavigationRequest, IRegionMemberLifetime
|
||||||
|
{
|
||||||
|
public static MultiOrderTakeDrugWindowViewModel vm;
|
||||||
|
private int _pageNum = 1;
|
||||||
|
public int PageNum
|
||||||
|
{
|
||||||
|
get => _pageNum;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
SetProperty(ref _pageNum, value);
|
||||||
|
RequestData();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private int _pageCount = 1;
|
||||||
|
public int PageCount
|
||||||
|
{
|
||||||
|
get => _pageCount;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
SetProperty(ref _pageCount, value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private int _pageSize = 8;
|
||||||
|
public int PageSize
|
||||||
|
{
|
||||||
|
get => _pageSize;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
SetProperty(ref _pageSize, value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private int _totalCount = 0;
|
||||||
|
public int TotalCount
|
||||||
|
{
|
||||||
|
get => _totalCount;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
SetProperty(ref _totalCount, value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
IDialogService _dialogService;
|
||||||
|
IEventAggregator _eventAggregator;
|
||||||
|
|
||||||
|
|
||||||
|
public MultiOrderTakeDrugWindowViewModel(IDialogService DialogService, IEventAggregator eventAggregator)
|
||||||
|
{
|
||||||
|
_dialogService = DialogService;
|
||||||
|
_eventAggregator = eventAggregator;
|
||||||
|
vm = this;
|
||||||
|
}
|
||||||
|
|
||||||
|
//public static ObservableCollection<OrderTakeSelect> StaticOrderTakeSelects = new()
|
||||||
|
//{
|
||||||
|
// new OrderTakeSelect
|
||||||
|
// {
|
||||||
|
// Code = "OrderNo",
|
||||||
|
// Name = "处方号"
|
||||||
|
// },
|
||||||
|
// new OrderTakeSelect
|
||||||
|
// {
|
||||||
|
// Code = "PatientId",
|
||||||
|
// Name = "患者编号"
|
||||||
|
// }
|
||||||
|
//};
|
||||||
|
|
||||||
|
//private ObservableCollection<OrderTakeSelect> _orderTakeSelects = StaticOrderTakeSelects;
|
||||||
|
|
||||||
|
//public ObservableCollection<OrderTakeSelect> OrderTakeSelects
|
||||||
|
//{
|
||||||
|
// get { return _orderTakeSelects; }
|
||||||
|
// set
|
||||||
|
// {
|
||||||
|
// SetProperty(ref _orderTakeSelects, value);
|
||||||
|
// }
|
||||||
|
//}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//private OrderTakeSelect _selectedItem = StaticOrderTakeSelects[0];
|
||||||
|
///// <summary>
|
||||||
|
///// 查询条件 查询字段
|
||||||
|
///// </summary>
|
||||||
|
//public OrderTakeSelect SelectedItem
|
||||||
|
//{
|
||||||
|
// get { return _selectedItem; }
|
||||||
|
// set
|
||||||
|
// {
|
||||||
|
// SetProperty(ref _selectedItem, value);
|
||||||
|
// RequestData();
|
||||||
|
// }
|
||||||
|
//}
|
||||||
|
|
||||||
|
//private OrderInfo? _selectedOrder;
|
||||||
|
|
||||||
|
//public OrderInfo? SelectedOrder
|
||||||
|
//{
|
||||||
|
// get { return _selectedOrder; }
|
||||||
|
// set
|
||||||
|
// {
|
||||||
|
// SetProperty(ref _selectedOrder, value);
|
||||||
|
|
||||||
|
// //OpenOrderDialog();
|
||||||
|
// }
|
||||||
|
//}
|
||||||
|
|
||||||
|
|
||||||
|
private string _orderDate = DateTime.Now.ToString("yyyy-MM-dd");
|
||||||
|
/// <summary>
|
||||||
|
/// 查询条件 处方日期
|
||||||
|
/// </summary>
|
||||||
|
public string OrderDate
|
||||||
|
{
|
||||||
|
get { return _orderDate; }
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (!String.IsNullOrEmpty(value))
|
||||||
|
{
|
||||||
|
SetProperty(ref _orderDate, DateTime.Parse(value).ToString("yyyy-MM-dd"));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
SetProperty(ref _orderDate, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
RequestData();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//private string? _searchValue;
|
||||||
|
|
||||||
|
///// <summary>
|
||||||
|
///// 查询条件 查询字段值
|
||||||
|
///// </summary>
|
||||||
|
//public string? SearchValue
|
||||||
|
//{
|
||||||
|
// get { return _searchValue; }
|
||||||
|
// set
|
||||||
|
// {
|
||||||
|
// SetProperty(ref _searchValue, value);
|
||||||
|
// RequestData();
|
||||||
|
// }
|
||||||
|
//}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///全选
|
||||||
|
/// </summary>
|
||||||
|
private bool _allChecked = false;
|
||||||
|
public bool IsAllChecked
|
||||||
|
{
|
||||||
|
get { return _allChecked; }
|
||||||
|
set
|
||||||
|
{
|
||||||
|
SetProperty(ref _allChecked, value);
|
||||||
|
if (!IsItemCheck)
|
||||||
|
{
|
||||||
|
RequestData();
|
||||||
|
//根据全选或反选设置其后的选中状态
|
||||||
|
OrderInfos.ToList().ForEach(oi => oi.ItemIsChecked = _allChecked);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
IsItemCheck = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool _isItemCheck = false;
|
||||||
|
public bool IsItemCheck
|
||||||
|
{
|
||||||
|
get => _isItemCheck;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
SetProperty(ref _isItemCheck, value);
|
||||||
|
if (OrderInfos.ToList().Where(od => od.ItemIsChecked == false).Count() <= 0)
|
||||||
|
{
|
||||||
|
IsAllChecked = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//private bool _itemIsChecked = false;
|
||||||
|
//public bool ItemIsChecked
|
||||||
|
//{
|
||||||
|
// get => _itemIsChecked;
|
||||||
|
// set
|
||||||
|
// {
|
||||||
|
// SetProperty(ref _itemIsChecked, value);
|
||||||
|
// }
|
||||||
|
//}
|
||||||
|
//多处方取药
|
||||||
|
public DelegateCommand BtnTakeOrder { get => new DelegateCommand(TakeByMultiOrder); }
|
||||||
|
private void TakeByMultiOrder()
|
||||||
|
{
|
||||||
|
OrderInfos = new ObservableCollection<OrderInfo>(OrderInfos.Where(o => o.ItemIsChecked == true).ToList());
|
||||||
|
if (OrderInfos != null && OrderInfos.Count() > 0)
|
||||||
|
{
|
||||||
|
// 此处延时1毫秒,等待页面渲染
|
||||||
|
//await Task.Delay(TimeSpan.FromMilliseconds(1));
|
||||||
|
DialogParameters dialogParameters = new DialogParameters();
|
||||||
|
dialogParameters.Add("orderInfo", OrderInfos);
|
||||||
|
DialogServiceExtensions.ShowDialogHost(_dialogService, "MultiOrderTakeDialog", dialogParameters, DoDialogResult, "RootDialog");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
//请勾选要取药的处方信息
|
||||||
|
AlertMsg alertMsg = new AlertMsg
|
||||||
|
{
|
||||||
|
Message = "请勾选要取药的处方信息",
|
||||||
|
Type = MsgType.ERROR,
|
||||||
|
};
|
||||||
|
_eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg);
|
||||||
|
}
|
||||||
|
IsAllChecked = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
private ObservableCollection<OrderInfo> _orderInfos = new();
|
||||||
|
|
||||||
|
public ObservableCollection<OrderInfo> OrderInfos
|
||||||
|
{
|
||||||
|
get { return _orderInfos; }
|
||||||
|
set
|
||||||
|
{
|
||||||
|
SetProperty(ref _orderInfos, value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//部门
|
||||||
|
private ObservableCollection<OrderDepartment> _orderDepartments = new ObservableCollection<OrderDepartment>();
|
||||||
|
public ObservableCollection<OrderDepartment> OrderDepartments
|
||||||
|
{
|
||||||
|
get => _orderDepartments;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
SetProperty(ref _orderDepartments, value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private OrderDepartment _orderDepartment = new OrderDepartment();
|
||||||
|
public OrderDepartment OrderDepartment
|
||||||
|
{
|
||||||
|
get => _orderDepartment;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
SetProperty(ref _orderDepartment, value);
|
||||||
|
RequestData();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public bool KeepAlive => false;
|
||||||
|
|
||||||
|
private void DoDialogResult(IDialogResult dialogResult)
|
||||||
|
{
|
||||||
|
// 委托 被动执行 被子窗口执行
|
||||||
|
// dialogResult 第一方面可以拿到任意参数 第二方面 可判断关闭状态
|
||||||
|
//if(dialogResult.Result == ButtonResult.OK)
|
||||||
|
//{
|
||||||
|
//SelectedOrder = null;
|
||||||
|
RequestData();
|
||||||
|
//}
|
||||||
|
//MessageBox.Show("返回值:" + dialogResult.Result.ToString());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//这个方法用于拦截请求,continuationCallback(true)就是不拦截,continuationCallback(false)拦截本次操作
|
||||||
|
public void ConfirmNavigationRequest(NavigationContext navigationContext, Action<bool> continuationCallback)
|
||||||
|
{
|
||||||
|
continuationCallback(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
public DelegateCommand QueryCommand
|
||||||
|
{
|
||||||
|
get => new DelegateCommand(() =>
|
||||||
|
{
|
||||||
|
RequestData();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public void RequestData()
|
||||||
|
{
|
||||||
|
OrderInfos.Clear();
|
||||||
|
int totalCount = 0;
|
||||||
|
//string SearchValue = null;
|
||||||
|
//if (SearchValue != null)
|
||||||
|
//{
|
||||||
|
// strSearchValue = SearchValue.Trim().Replace("\r", "");
|
||||||
|
//}
|
||||||
|
List<OrderInfo> queryData = SqlSugarHelper.Db.Queryable<OrderInfo>()
|
||||||
|
.InnerJoin<OrderDetail>((oi, od) => oi.OrderNo == od.OrderNo)
|
||||||
|
.InnerJoin(SqlSugarHelper.Db.Queryable<ChannelStock>().Where(cs => cs.DrawerType == 1).Where(cs => cs.MachineId.Equals(ConfigurationManager.AppSettings["machineId"] ?? "DM3")).GroupBy(cs => cs.DrugId), (oi, od, t) => od.DrugId == t.DrugId)
|
||||||
|
.WhereIF(OrderDate != null, oi => oi.OrderDate.ToString("yyyy-MM-dd") == OrderDate)
|
||||||
|
.WhereIF(!(OrderDepartment.DeptName.Equals("全部")), oi => oi.DeptName == OrderDepartment.DeptName)
|
||||||
|
//.WhereIF(!String.IsNullOrEmpty(SearchValue) && SelectedItem.Code.Equals("PatientId"), oi => oi.PatientId == SearchValue)
|
||||||
|
.WhereIF(!String.IsNullOrEmpty(ConfigurationManager.AppSettings["storage"]), oi => oi.Pharmacy == ConfigurationManager.AppSettings["storage"])
|
||||||
|
.Where(oi => oi.DmStatus == 0)
|
||||||
|
.Where(oi => oi.HisDispFlag == 0)
|
||||||
|
.Where(oi => oi.CancelFlag == 0)
|
||||||
|
.GroupBy(oi => oi.OrderDate)
|
||||||
|
.Select(oi => oi)
|
||||||
|
.ToPageList(PageNum, PageSize, ref totalCount);
|
||||||
|
//.ToList();
|
||||||
|
OrderInfos = new ObservableCollection<OrderInfo>(queryData);
|
||||||
|
|
||||||
|
if (OrderDepartments.Where(d => d.DeptName == "全部").ToList().Count <= 0)
|
||||||
|
{
|
||||||
|
OrderDepartment deptDefault = new OrderDepartment();
|
||||||
|
deptDefault.DeptName = "全部";
|
||||||
|
OrderDepartments.Add(deptDefault);
|
||||||
|
|
||||||
|
}
|
||||||
|
var orderDeparts = queryData.GroupBy(o => o.DeptName).ToList();
|
||||||
|
for (int i = 0; i < orderDeparts.Count; i++)
|
||||||
|
{
|
||||||
|
OrderDepartment dept = new OrderDepartment();
|
||||||
|
if (orderDeparts[i].Key != null && orderDeparts[i].Key != string.Empty && OrderDepartments.Where(d => d.DeptName == orderDeparts[i].Key).ToList().Count <= 0)
|
||||||
|
{
|
||||||
|
dept.DeptName = orderDeparts[i].Key;
|
||||||
|
OrderDepartments.Add(dept);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
TotalCount = totalCount;
|
||||||
|
PageCount = (int)Math.Ceiling((double)TotalCount / PageSize);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
//接收导航传过来的参数 现在是在此处初始化了表格数据
|
||||||
|
public void OnNavigatedTo(NavigationContext navigationContext)
|
||||||
|
{
|
||||||
|
//_eventAggregator.GetEvent<PortUtilEvent>().Subscribe(DoMyPrismEvent);
|
||||||
|
RequestData();
|
||||||
|
}
|
||||||
|
|
||||||
|
//每次导航的时候,该实列用不用重新创建,true是不重新创建,false是重新创建
|
||||||
|
public bool IsNavigationTarget(NavigationContext navigationContext)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
//这个方法用于拦截请求
|
||||||
|
public void OnNavigatedFrom(NavigationContext navigationContext)
|
||||||
|
{
|
||||||
|
|
||||||
|
// 取消消息订阅
|
||||||
|
//_eventAggregator.GetEvent<PortUtilEvent>().Unsubscribe(DoMyPrismEvent);
|
||||||
|
}
|
||||||
|
|
||||||
|
void DoMyPrismEvent(DeviceMsg msg)
|
||||||
|
{
|
||||||
|
//if (msg.EventType == EventType.CODESCAN)
|
||||||
|
//{
|
||||||
|
// SearchValue = msg.Code;
|
||||||
|
//}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -227,7 +227,7 @@ namespace DM_Weight.ViewModels
|
||||||
int totalCount = 0;
|
int totalCount = 0;
|
||||||
List<OrderInfo> queryData = SqlSugarHelper.Db.Queryable<OrderInfo>()
|
List<OrderInfo> queryData = SqlSugarHelper.Db.Queryable<OrderInfo>()
|
||||||
.InnerJoin<OrderDetail>((oi, od) => oi.OrderNo == od.OrderNo)
|
.InnerJoin<OrderDetail>((oi, od) => oi.OrderNo == od.OrderNo)
|
||||||
.InnerJoin(SqlSugarHelper.Db.Queryable<ChannelList>().Where(cs => cs.DrawerType == 1).Where(cs => cs.MachineId.Equals(ConfigurationManager.AppSettings["machineId"] ?? "DM1")).GroupBy(cs => cs.DrugId), (oi, od, t) => od.DrugId == t.DrugId)
|
.InnerJoin(SqlSugarHelper.Db.Queryable<ChannelStock>().Where(cs => cs.DrawerType == 1).Where(cs => cs.MachineId.Equals(ConfigurationManager.AppSettings["machineId"] ?? "DM1")).GroupBy(cs => cs.DrugId), (oi, od, t) => od.DrugId == t.DrugId)
|
||||||
.WhereIF(OrderDate != null, oi => oi.RecvDate.ToString("yyyy-MM-dd") == OrderDate)
|
.WhereIF(OrderDate != null, oi => oi.RecvDate.ToString("yyyy-MM-dd") == OrderDate)
|
||||||
.WhereIF(!String.IsNullOrEmpty(SearchValue) && SelectedItem.Code.Equals("OrderNo"), oi => oi.OrderNo == SearchValue)
|
.WhereIF(!String.IsNullOrEmpty(SearchValue) && SelectedItem.Code.Equals("OrderNo"), oi => oi.OrderNo == SearchValue)
|
||||||
.WhereIF(!String.IsNullOrEmpty(SearchValue) && SelectedItem.Code.Equals("PatientId"), oi => oi.PatientId == SearchValue)
|
.WhereIF(!String.IsNullOrEmpty(SearchValue) && SelectedItem.Code.Equals("PatientId"), oi => oi.PatientId == SearchValue)
|
||||||
|
@ -235,7 +235,7 @@ namespace DM_Weight.ViewModels
|
||||||
.Where(oi => oi.DmStatus == 0)
|
.Where(oi => oi.DmStatus == 0)
|
||||||
.Where(oi => oi.HisDispFlag == 0)
|
.Where(oi => oi.HisDispFlag == 0)
|
||||||
.Where(oi => oi.CancelFlag == 0)
|
.Where(oi => oi.CancelFlag == 0)
|
||||||
.GroupBy(oi => oi.OrderNo)
|
.GroupBy(oi => oi.OrderDate)
|
||||||
.Select(oi => oi)
|
.Select(oi => oi)
|
||||||
.ToPageList(PageNum, PageSize, ref totalCount);
|
.ToPageList(PageNum, PageSize, ref totalCount);
|
||||||
//.ToList();
|
//.ToList();
|
||||||
|
|
|
@ -199,7 +199,16 @@ namespace DM_Weight.ViewModels
|
||||||
PremissionName = "取药记录",
|
PremissionName = "取药记录",
|
||||||
PremissionPath = "TakeRecordWindow",
|
PremissionPath = "TakeRecordWindow",
|
||||||
};
|
};
|
||||||
|
if (ConfigurationManager.AppSettings["MultiOrder"].ToString().Equals("1"))
|
||||||
|
{
|
||||||
|
PremissionDm mulityOrder = new PremissionDm
|
||||||
|
{
|
||||||
|
Id = 16,
|
||||||
|
PremissionName = "多处方取药",
|
||||||
|
PremissionPath = "MultiOrderTakeDrugWindow",
|
||||||
|
};
|
||||||
|
quyaoChild.Add(mulityOrder);
|
||||||
|
}
|
||||||
quyaoChild.Add(quyao1);
|
quyaoChild.Add(quyao1);
|
||||||
quyaoChild.Add(quyao2);
|
quyaoChild.Add(quyao2);
|
||||||
quyaoChild.Add(quyao3);
|
quyaoChild.Add(quyao3);
|
||||||
|
|
|
@ -0,0 +1,180 @@
|
||||||
|
<!--处方取药弹窗-->
|
||||||
|
<UserControl x:Class="DM_Weight.Views.Dialog.MultiOrderTakeDialog"
|
||||||
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
|
xmlns:local="clr-namespace:DM_Weight.Views.Dialog"
|
||||||
|
xmlns:prism="http://prismlibrary.com/"
|
||||||
|
prism:ViewModelLocator.AutoWireViewModel="True"
|
||||||
|
xmlns:convert="clr-namespace:DM_Weight.Converter"
|
||||||
|
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
|
||||||
|
MinWidth="880"
|
||||||
|
Width="Auto"
|
||||||
|
Height="Auto"
|
||||||
|
mc:Ignorable="d" >
|
||||||
|
<UserControl.Resources>
|
||||||
|
<convert:StatusConverter x:Key="StatusConverter" />
|
||||||
|
</UserControl.Resources>
|
||||||
|
<materialDesign:Card Padding="0">
|
||||||
|
<Grid>
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="Auto" />
|
||||||
|
<RowDefinition Height="50" />
|
||||||
|
<RowDefinition Height="Auto" />
|
||||||
|
<RowDefinition Height="Auto" />
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
<Grid Background="#03a9f4" Grid.Row="0">
|
||||||
|
<TextBlock VerticalAlignment="Center" Foreground="{DynamicResource PrimaryHueDarkForegroundBrush}" Margin="16 4 16 4" Style="{StaticResource MaterialDesignHeadline5TextBlock}" Text="多处方取药" />
|
||||||
|
<Button
|
||||||
|
Style="{StaticResource MaterialDesignIconForegroundButton}"
|
||||||
|
Foreground="{DynamicResource PrimaryHueDarkForegroundBrush}"
|
||||||
|
HorizontalAlignment="Right"
|
||||||
|
Command="{Binding BtnCloseCommand}"
|
||||||
|
IsEnabled="{Binding Status, Converter={StaticResource StatusConverter}, ConverterParameter=CloseBtn}"
|
||||||
|
ToolTip="关闭"
|
||||||
|
>
|
||||||
|
<materialDesign:PackIcon Kind="Close" Width="34" Height="34" />
|
||||||
|
</Button>
|
||||||
|
</Grid>
|
||||||
|
<Grid Grid.Row="1">
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="*" />
|
||||||
|
<ColumnDefinition Width="*" />
|
||||||
|
<!--<ColumnDefinition Width="2*" />
|
||||||
|
<ColumnDefinition Width="2*" />
|
||||||
|
<ColumnDefinition Width="2*" />
|
||||||
|
<ColumnDefinition Width="*" />
|
||||||
|
<ColumnDefinition Width="2*" />
|
||||||
|
<ColumnDefinition Width="*" />-->
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
|
<TextBlock
|
||||||
|
Grid.Column="0"
|
||||||
|
Margin="16 0 0 8"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
HorizontalAlignment="Left"
|
||||||
|
Style="{StaticResource MaterialDesignBody2TextBlock}"
|
||||||
|
Text="{Binding MultiOrderNo}" />
|
||||||
|
<TextBlock
|
||||||
|
Grid.Column="1"
|
||||||
|
Margin="0 0 16 8"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
HorizontalAlignment="Left"
|
||||||
|
Style="{StaticResource MaterialDesignBody2TextBlock}"
|
||||||
|
Text="{Binding OrderInfo.OrderNo}" />
|
||||||
|
</Grid>
|
||||||
|
<DataGrid Grid.Row="2" ItemsSource="{Binding ChannelStocks}" AutoGenerateColumns="False" CanUserAddRows="False">
|
||||||
|
<DataGrid.Resources>
|
||||||
|
<Style TargetType="{x:Type DataGridColumnHeader}" BasedOn="{StaticResource MaterialDesignDataGridColumnHeader}">
|
||||||
|
<Setter Property="HorizontalContentAlignment" Value="Center" />
|
||||||
|
<Setter Property="Background" Value="#31ccec" />
|
||||||
|
<Setter Property="Foreground" Value="white" />
|
||||||
|
<Setter Property="Height" Value="48" />
|
||||||
|
<Setter Property="BorderBrush" Value="white"/>
|
||||||
|
<Setter Property="BorderThickness" Value="0.6"/>
|
||||||
|
</Style>
|
||||||
|
<Style TargetType="{x:Type DataGridCell}" BasedOn="{StaticResource MaterialDesignDataGridCell}">
|
||||||
|
<Setter Property="HorizontalAlignment" Value="left" />
|
||||||
|
<Setter Property="Padding" Value="13" />
|
||||||
|
</Style>
|
||||||
|
</DataGrid.Resources>
|
||||||
|
<DataGrid.Columns>
|
||||||
|
|
||||||
|
<DataGridTextColumn Width="100"
|
||||||
|
Header="库位"
|
||||||
|
IsReadOnly="True"
|
||||||
|
Binding="{Binding Location}"
|
||||||
|
ElementStyle="{StaticResource MaterialDesignDataGridTextColumnStyle}"
|
||||||
|
EditingElementStyle="{StaticResource MaterialDesignDataGridTextColumnEditingStyle}"
|
||||||
|
/>
|
||||||
|
<DataGridTextColumn Width="180"
|
||||||
|
Header="药品名称"
|
||||||
|
IsReadOnly="True"
|
||||||
|
Binding="{Binding DrugInfo.DrugName}"
|
||||||
|
ElementStyle="{StaticResource MaterialDesignDataGridTextColumnStyle}"
|
||||||
|
EditingElementStyle="{StaticResource MaterialDesignDataGridTextColumnEditingStyle}"
|
||||||
|
/>
|
||||||
|
<DataGridTextColumn Width="180"
|
||||||
|
Header="规格"
|
||||||
|
IsReadOnly="True"
|
||||||
|
Binding="{Binding DrugInfo.DrugSpec}"
|
||||||
|
ElementStyle="{StaticResource MaterialDesignDataGridTextColumnStyle}"
|
||||||
|
EditingElementStyle="{StaticResource MaterialDesignDataGridTextColumnEditingStyle}"
|
||||||
|
/>
|
||||||
|
<DataGridTextColumn Width="100"
|
||||||
|
Header="数量"
|
||||||
|
IsReadOnly="True"
|
||||||
|
Binding="{Binding Quantity}"
|
||||||
|
ElementStyle="{StaticResource MaterialDesignDataGridTextColumnStyle}"
|
||||||
|
EditingElementStyle="{StaticResource MaterialDesignDataGridTextColumnEditingStyle}"
|
||||||
|
/>
|
||||||
|
<DataGridTextColumn Width="130"
|
||||||
|
Header="批次"
|
||||||
|
IsReadOnly="True"
|
||||||
|
Binding="{Binding ManuNo}"
|
||||||
|
ElementStyle="{StaticResource MaterialDesignDataGridTextColumnStyle}"
|
||||||
|
EditingElementStyle="{StaticResource MaterialDesignDataGridTextColumnEditingStyle}"
|
||||||
|
/>
|
||||||
|
<DataGridTextColumn Width="130"
|
||||||
|
Header="效期"
|
||||||
|
IsReadOnly="True"
|
||||||
|
Binding="{Binding EffDate}"
|
||||||
|
ElementStyle="{StaticResource MaterialDesignDataGridTextColumnStyle}"
|
||||||
|
EditingElementStyle="{StaticResource MaterialDesignDataGridTextColumnEditingStyle}"
|
||||||
|
/>
|
||||||
|
<DataGridTextColumn Width="100"
|
||||||
|
Header="取出数量"
|
||||||
|
IsReadOnly="True"
|
||||||
|
Binding="{Binding TakeQuantity}"
|
||||||
|
ElementStyle="{StaticResource MaterialDesignDataGridTextColumnStyle}"
|
||||||
|
EditingElementStyle="{StaticResource MaterialDesignDataGridTextColumnEditingStyle}"
|
||||||
|
/>
|
||||||
|
</DataGrid.Columns>
|
||||||
|
</DataGrid>
|
||||||
|
<Grid Grid.Row="3">
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition />
|
||||||
|
<ColumnDefinition />
|
||||||
|
<ColumnDefinition />
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<StackPanel Orientation="Horizontal" Grid.Column="1" HorizontalAlignment="Center">
|
||||||
|
|
||||||
|
<!--<Button
|
||||||
|
Margin="2"
|
||||||
|
Style="{StaticResource MaterialDesignRaisedAccentButton}"
|
||||||
|
Visibility="{Binding Status,Converter={StaticResource StatusConverter}, ConverterParameter=opearBtnVisible}"
|
||||||
|
materialDesign:ButtonProgressAssist.IsIndicatorVisible="{Binding Status, Converter={StaticResource StatusConverter}, ConverterParameter=opearBtnLoading}"
|
||||||
|
materialDesign:ButtonProgressAssist.IsIndeterminate="{Binding Status, Converter={StaticResource StatusConverter}, ConverterParameter=opearBtnLoading}"
|
||||||
|
Content="取药"
|
||||||
|
Command="{Binding OpenDrawer}">
|
||||||
|
</Button>-->
|
||||||
|
<Button
|
||||||
|
Margin="2"
|
||||||
|
Style="{StaticResource MaterialDesignRaisedAccentButton}"
|
||||||
|
Visibility="{Binding Status,Converter={StaticResource StatusConverter}, ConverterParameter=opearBtnVisible}"
|
||||||
|
materialDesign:ButtonProgressAssist.IsIndicatorVisible="{Binding Status, Converter={StaticResource StatusConverter}, ConverterParameter=opearBtnLoading}"
|
||||||
|
materialDesign:ButtonProgressAssist.IsIndeterminate="{Binding Status, Converter={StaticResource StatusConverter}, ConverterParameter=opearBtnLoading}"
|
||||||
|
Content="取药"
|
||||||
|
Command="{Binding OpenDrawer}">
|
||||||
|
</Button>
|
||||||
|
<Button
|
||||||
|
Margin="2"
|
||||||
|
Visibility="{Binding Status, Converter={StaticResource StatusConverter}, ConverterParameter=CompleteBtn}"
|
||||||
|
Style="{StaticResource MaterialDesignRaisedAccentButton}"
|
||||||
|
Content="完成"
|
||||||
|
Command="{Binding TakeFinish}"/>
|
||||||
|
<Button
|
||||||
|
Margin="2"
|
||||||
|
Visibility="{Binding Status, Converter={StaticResource StatusConverter}, ConverterParameter=CancelBtn}"
|
||||||
|
Style="{StaticResource MaterialDesignRaisedButton}"
|
||||||
|
Background="Orange"
|
||||||
|
BorderBrush="Orange"
|
||||||
|
Content="取消"
|
||||||
|
Command="{Binding CancleTake}" />
|
||||||
|
</StackPanel>
|
||||||
|
|
||||||
|
</Grid>
|
||||||
|
</Grid>
|
||||||
|
</materialDesign:Card>
|
||||||
|
</UserControl>
|
|
@ -0,0 +1,28 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Windows;
|
||||||
|
using System.Windows.Controls;
|
||||||
|
using System.Windows.Data;
|
||||||
|
using System.Windows.Documents;
|
||||||
|
using System.Windows.Input;
|
||||||
|
using System.Windows.Media;
|
||||||
|
using System.Windows.Media.Imaging;
|
||||||
|
using System.Windows.Navigation;
|
||||||
|
using System.Windows.Shapes;
|
||||||
|
|
||||||
|
namespace DM_Weight.Views.Dialog
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// MultiOrderTakeDialog.xaml 的交互逻辑
|
||||||
|
/// </summary>
|
||||||
|
public partial class MultiOrderTakeDialog : UserControl
|
||||||
|
{
|
||||||
|
public MultiOrderTakeDialog()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -27,7 +27,7 @@
|
||||||
<ColumnDefinition />
|
<ColumnDefinition />
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
<!--<Image Grid.Column="0" Margin="30 0 30 0" HorizontalAlignment="Left" Width="Auto" Height="26" Source="/Images/logo.png" />-->
|
<!--<Image Grid.Column="0" Margin="30 0 30 0" HorizontalAlignment="Left" Width="Auto" Height="26" Source="/Images/logo.png" />-->
|
||||||
<TextBlock Text="毒麻药品管理系统" Grid.Column="0" Margin="30 0 30 0" HorizontalAlignment="Left" Width="Auto" Height="26" Foreground="White" FontSize="20" FontWeight="Bold" />
|
<TextBlock Text="麻精药品管理系统" Grid.Column="0" Margin="30 0 30 0" HorizontalAlignment="Left" Width="Auto" Height="26" Foreground="White" FontSize="20" FontWeight="Bold" />
|
||||||
|
|
||||||
<ListBox Name="ListBoxName" Grid.Column="1" SelectedItem="{Binding SelectedMenu}" ItemsSource="{Binding PremissionDmList}" HorizontalAlignment="Right">
|
<ListBox Name="ListBoxName" Grid.Column="1" SelectedItem="{Binding SelectedMenu}" ItemsSource="{Binding PremissionDmList}" HorizontalAlignment="Right">
|
||||||
<i:Interaction.Triggers>
|
<i:Interaction.Triggers>
|
||||||
|
|
|
@ -0,0 +1,151 @@
|
||||||
|
<!--处方取药界面-->
|
||||||
|
<UserControl x:Class="DM_Weight.Views.MultiOrderTakeDrugWindow"
|
||||||
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
|
||||||
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
|
||||||
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
xmlns:pagination="clr-namespace:DM_Weight.Components.pagination"
|
||||||
|
xmlns:convert="clr-namespace:DM_Weight.Converter"
|
||||||
|
mc:Ignorable="d" Loaded="UserControl_Loaded">
|
||||||
|
<UserControl.Resources>
|
||||||
|
<convert:OrderStatusConverter x:Key="OrderStatusConverter" />
|
||||||
|
<Style x:Key="st" TargetType="GridViewColumnHeader">
|
||||||
|
<Style.Setters>
|
||||||
|
<Setter Property="Height">
|
||||||
|
<Setter.Value>55</Setter.Value>
|
||||||
|
</Setter>
|
||||||
|
<Setter Property="Background">
|
||||||
|
<Setter.Value>#31ccec</Setter.Value>
|
||||||
|
</Setter>
|
||||||
|
<Setter Property="Foreground">
|
||||||
|
<Setter.Value>white</Setter.Value>
|
||||||
|
</Setter>
|
||||||
|
</Style.Setters>
|
||||||
|
</Style>
|
||||||
|
</UserControl.Resources>
|
||||||
|
<Grid>
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="Auto" />
|
||||||
|
<RowDefinition />
|
||||||
|
<RowDefinition Height="Auto" />
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
<Grid Margin="0 6 0 6" Grid.Row="0">
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="1.5*" />
|
||||||
|
<ColumnDefinition Width="2*" />
|
||||||
|
<ColumnDefinition Width="5.5*" />
|
||||||
|
<ColumnDefinition Width="1*"/>
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<ComboBox
|
||||||
|
Grid.Column="0"
|
||||||
|
Margin="6 0 0 0"
|
||||||
|
Style="{StaticResource MaterialDesignOutlinedComboBox}"
|
||||||
|
SelectedItem="{Binding OrderDepartment}"
|
||||||
|
DisplayMemberPath="DeptName"
|
||||||
|
ItemsSource="{Binding OrderDepartments}" materialDesign:HintAssist.Hint="科室"
|
||||||
|
/>
|
||||||
|
<!--<TextBox
|
||||||
|
Grid.Column="1"
|
||||||
|
Text="{Binding SearchValue, UpdateSourceTrigger=PropertyChanged}"
|
||||||
|
materialDesign:HintAssist.Hint="{Binding SelectedItem.Name}"
|
||||||
|
materialDesign:HintAssist.IsFloating="True"
|
||||||
|
Margin="6 0 0 0"
|
||||||
|
Style="{StaticResource MaterialDesignOutlinedTextBox}"/>-->
|
||||||
|
<DatePicker
|
||||||
|
Grid.Column="1"
|
||||||
|
SelectedDate="{Binding OrderDate, StringFormat=yyyy-MM-dd, TargetNullValue='',UpdateSourceTrigger=PropertyChanged}"
|
||||||
|
SelectedDateFormat="Short"
|
||||||
|
Margin="6 0 0 0"
|
||||||
|
materialDesign:HintAssist.Hint="开方日期"
|
||||||
|
Style="{StaticResource MaterialDesignOutlinedDatePicker}" />
|
||||||
|
<Button Grid.Column="2"
|
||||||
|
HorizontalAlignment="Right"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Style="{StaticResource MaterialDesignOutlinedLightButton}"
|
||||||
|
ToolTip="取药" Cursor="Hand"
|
||||||
|
Command="{Binding BtnTakeOrder}" Content="取药">
|
||||||
|
</Button>
|
||||||
|
<Grid
|
||||||
|
Grid.Column="3">
|
||||||
|
<Button
|
||||||
|
HorizontalAlignment="Right"
|
||||||
|
Margin="0 0 6 0"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Command="{Binding QueryCommand}"
|
||||||
|
Style="{StaticResource MaterialDesignOutlinedLightButton}"
|
||||||
|
ToolTip="刷新" Cursor="Hand">
|
||||||
|
<materialDesign:PackIcon
|
||||||
|
Kind="Refresh" />
|
||||||
|
</Button>
|
||||||
|
</Grid>
|
||||||
|
</Grid>
|
||||||
|
<ListView
|
||||||
|
Grid.Row="1" Grid.ColumnSpan="3"
|
||||||
|
ItemsSource="{Binding OrderInfos,UpdateSourceTrigger=PropertyChanged}"
|
||||||
|
materialDesign:ListViewAssist.HeaderRowBackground="#31ccec">
|
||||||
|
<!--<ListView.Resources>
|
||||||
|
<Style TargetType="{x:Type GridViewColumnHeader}" BasedOn="{StaticResource {x:Type GridViewColumnHeader}}">
|
||||||
|
<Setter Property="Foreground" Value="White" />
|
||||||
|
</Style>
|
||||||
|
</ListView.Resources>-->
|
||||||
|
<!--<i:Interaction.Triggers>
|
||||||
|
<i:EventTrigger EventName="SelectionChanged">
|
||||||
|
<i:InvokeCommandAction Command="{Binding RowSelected}" />
|
||||||
|
</i:EventTrigger>
|
||||||
|
</i:Interaction.Triggers>-->
|
||||||
|
<ListView.ItemContainerStyle>
|
||||||
|
<Style TargetType="ListViewItem" BasedOn="{StaticResource MaterialDesignGridViewItem}">
|
||||||
|
<Setter Property="ListView.Height" Value="50"/>
|
||||||
|
</Style>
|
||||||
|
</ListView.ItemContainerStyle>
|
||||||
|
<ListView.View>
|
||||||
|
|
||||||
|
<GridView ColumnHeaderContainerStyle="{StaticResource st}" >
|
||||||
|
<GridViewColumn Width="50">
|
||||||
|
<GridViewColumnHeader>
|
||||||
|
<CheckBox x:Name="allCheck" IsChecked="{Binding IsAllChecked,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"/>
|
||||||
|
</GridViewColumnHeader>
|
||||||
|
<GridViewColumn.CellTemplate>
|
||||||
|
<DataTemplate>
|
||||||
|
<CheckBox x:Name="check_1" IsChecked="{Binding ItemIsChecked,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Click="Item_Checked"/>
|
||||||
|
<!--<CheckBox x:Name="check_1" IsChecked="{Binding IsCheck}" ToolTip="{Binding BookId}" Click="Check_bool_Select_Click"/>-->
|
||||||
|
</DataTemplate>
|
||||||
|
</GridViewColumn.CellTemplate>
|
||||||
|
</GridViewColumn>
|
||||||
|
<GridViewColumn Width="153"
|
||||||
|
Header="患者ID"
|
||||||
|
DisplayMemberBinding="{Binding PatientId}"/>
|
||||||
|
<GridViewColumn Width="153"
|
||||||
|
Header="姓名"
|
||||||
|
DisplayMemberBinding="{Binding PName}" />
|
||||||
|
<GridViewColumn Width="80"
|
||||||
|
DisplayMemberBinding="{Binding Sex}"
|
||||||
|
Header="性别"/>
|
||||||
|
<GridViewColumn Width="80"
|
||||||
|
DisplayMemberBinding="{Binding Age}"
|
||||||
|
Header="年龄"/>
|
||||||
|
<GridViewColumn Width="153"
|
||||||
|
DisplayMemberBinding="{Binding IdNumber}"
|
||||||
|
Header="身份证"/>
|
||||||
|
<GridViewColumn Width="153"
|
||||||
|
DisplayMemberBinding="{Binding OrderNo}"
|
||||||
|
Header="处方号"/>
|
||||||
|
<GridViewColumn Width="153"
|
||||||
|
DisplayMemberBinding="{Binding DeptName}"
|
||||||
|
Header="科室"/>
|
||||||
|
<GridViewColumn Width="80"
|
||||||
|
DisplayMemberBinding="{Binding DmStatus, Converter={StaticResource OrderStatusConverter}}"
|
||||||
|
Header="状态"/>
|
||||||
|
</GridView>
|
||||||
|
</ListView.View>
|
||||||
|
</ListView>
|
||||||
|
<pagination:Pagination Grid.Row="2" Grid.ColumnSpan="3"
|
||||||
|
CurrentPage="{Binding PageNum}"
|
||||||
|
PageSize="{Binding PageSize}"
|
||||||
|
TotalPages="{Binding TotalCount}"
|
||||||
|
InfoTextIsEnabel="True"
|
||||||
|
/>
|
||||||
|
</Grid>
|
||||||
|
</UserControl>
|
|
@ -0,0 +1,54 @@
|
||||||
|
using DM_Weight.ViewModels;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Windows;
|
||||||
|
using System.Windows.Controls;
|
||||||
|
using System.Windows.Data;
|
||||||
|
using System.Windows.Documents;
|
||||||
|
using System.Windows.Input;
|
||||||
|
using System.Windows.Media;
|
||||||
|
using System.Windows.Media.Imaging;
|
||||||
|
using System.Windows.Navigation;
|
||||||
|
using System.Windows.Shapes;
|
||||||
|
|
||||||
|
namespace DM_Weight.Views
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// MultiOrderTakeDrugWindow.xaml 的交互逻辑
|
||||||
|
/// </summary>
|
||||||
|
public partial class MultiOrderTakeDrugWindow : UserControl
|
||||||
|
{
|
||||||
|
MultiOrderTakeDrugWindowViewModel vms;
|
||||||
|
public MultiOrderTakeDrugWindow()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
private void CheckBox_Checked_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
//某项被选中
|
||||||
|
private void Item_Checked(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
CheckBox cbx = (CheckBox)sender;
|
||||||
|
if (!(bool)cbx.IsChecked)
|
||||||
|
{
|
||||||
|
vms.IsItemCheck = true;
|
||||||
|
vms.IsAllChecked = false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
vms.IsItemCheck = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void UserControl_Loaded(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
vms = MultiOrderTakeDrugWindowViewModel.vm;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue