交接柜补药添加批次信息;开药箱流程调整;添加登录设置
This commit is contained in:
parent
a60c914fc5
commit
fe12169e25
|
@ -30,10 +30,14 @@ namespace DM_Weight.Converter
|
||||||
{
|
{
|
||||||
return "未取药";
|
return "未取药";
|
||||||
}
|
}
|
||||||
else
|
if(status == 1)
|
||||||
{
|
{
|
||||||
return "已取药待入库";
|
return "已取药待入库";
|
||||||
}
|
}
|
||||||
|
if(status==2)
|
||||||
|
{
|
||||||
|
return "正在入库";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
|
@ -85,12 +85,17 @@ namespace DM_Weight.Models
|
||||||
///</summary>
|
///</summary>
|
||||||
[SugarColumn(ColumnName = "board_type")]
|
[SugarColumn(ColumnName = "board_type")]
|
||||||
public int BoardType { get; set; }
|
public int BoardType { get; set; }
|
||||||
|
private int? _state = 0;
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// 默认值: 1(用于标识毒麻柜是否给交接柜补药:0未补,1已补)
|
/// 默认值: 1(用于标识毒麻柜是否给交接柜补药:0未补,1已补)
|
||||||
///</summary>
|
///</summary>
|
||||||
[SugarColumn(ColumnName = "state")]
|
[SugarColumn(ColumnName = "state")]
|
||||||
public int? State { get; set; }
|
public int? State
|
||||||
|
{
|
||||||
|
get => _state;
|
||||||
|
set { SetProperty(ref _state, value); }
|
||||||
|
}
|
||||||
|
|
||||||
[SugarColumn(IsIgnore = true)]
|
[SugarColumn(IsIgnore = true)]
|
||||||
public bool IsSelected { get; set; }
|
public bool IsSelected { get; set; }
|
||||||
|
@ -208,5 +213,11 @@ namespace DM_Weight.Models
|
||||||
[SugarColumn(IsIgnore =true)]
|
[SugarColumn(IsIgnore =true)]
|
||||||
public string OrderNos { get; set; }
|
public string OrderNos { get; set; }
|
||||||
|
|
||||||
|
//交接柜加药数量
|
||||||
|
[SugarColumn(ColumnName = "col_no1")]
|
||||||
|
public int AddToJJNum { get; set; }
|
||||||
|
//需要加药数量
|
||||||
|
[SugarColumn(ColumnName = "col_no2")]
|
||||||
|
public int NeedNum { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -11,46 +11,45 @@ using System.Linq;
|
||||||
using System.Net;
|
using System.Net;
|
||||||
using System.Net.Sockets;
|
using System.Net.Sockets;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
|
using System.Speech.Synthesis;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
using System.Threading;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace DM_Weight.Port
|
namespace DM_Weight.Port
|
||||||
{
|
{
|
||||||
public class ModbusHelper
|
public class ModbusHelper
|
||||||
{
|
{
|
||||||
|
private static ModbusHelper instance;
|
||||||
private ModbusIpMaster master;
|
private ModbusIpMaster master;
|
||||||
private Socket socket;
|
private Socket socket;
|
||||||
private TcpClient client;
|
private TcpClient client;
|
||||||
private static ModbusHelper instance;
|
|
||||||
private static readonly object objLock = new object();
|
|
||||||
private readonly ILog logger = LogManager.GetLogger(typeof(CheckOrderNewWindowViewModel));
|
private readonly ILog logger = LogManager.GetLogger(typeof(CheckOrderNewWindowViewModel));
|
||||||
|
public static bool BoxOperate { get; set; }
|
||||||
public ModbusHelper()
|
public ModbusHelper()
|
||||||
{
|
|
||||||
if (ConfigurationManager.AppSettings["test"] == null || !(ConfigurationManager.AppSettings["test"].ToString().Equals("Y")))
|
|
||||||
{
|
{
|
||||||
socket = MakeKeepALiveSocket();
|
socket = MakeKeepALiveSocket();
|
||||||
client = new TcpClient();
|
client = new TcpClient();
|
||||||
client.Client = socket;
|
client.Client = socket;
|
||||||
master = ModbusIpMaster.CreateIp(client);
|
master = ModbusIpMaster.CreateIp(client);
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
public static ModbusHelper GetInstance()
|
public static ModbusHelper GetInstance()
|
||||||
{
|
{
|
||||||
if (instance == null)
|
if (instance == null)
|
||||||
{
|
{
|
||||||
lock (objLock)
|
//lock (objLock)
|
||||||
{
|
//{
|
||||||
if (instance == null)
|
// if (instance == null)
|
||||||
instance = new ModbusHelper();
|
instance = new ModbusHelper();
|
||||||
}
|
//}
|
||||||
}
|
}
|
||||||
|
|
||||||
return instance;
|
return instance;
|
||||||
}
|
}
|
||||||
private void SetModusIpMaster()
|
private void SetModusIpMaster()
|
||||||
{
|
{
|
||||||
Debug.WriteLine("SetModusIpMaster");
|
logger.Info("SetModusIpMaster");
|
||||||
socket = MakeKeepALiveSocket();
|
socket = MakeKeepALiveSocket();
|
||||||
client = new TcpClient();
|
client = new TcpClient();
|
||||||
client.Client = socket;
|
client.Client = socket;
|
||||||
|
@ -59,25 +58,28 @@ namespace DM_Weight.Port
|
||||||
|
|
||||||
public bool[] GetAllBoxState()
|
public bool[] GetAllBoxState()
|
||||||
{
|
{
|
||||||
if (ConfigurationManager.AppSettings["test"] != null && ConfigurationManager.AppSettings["test"].ToString().Equals("Y"))
|
|
||||||
{
|
|
||||||
return new bool[] { false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false };
|
|
||||||
}
|
|
||||||
bool[] bools = Policy.Handle<Exception>()
|
bool[] bools = Policy.Handle<Exception>()
|
||||||
.Retry(3, (exception, retryCount) =>
|
.Retry(3, (exception, retryCount) =>
|
||||||
{
|
{
|
||||||
this.Dispose();
|
this.Dispose();
|
||||||
//Debug.WriteLine($"获取所有箱子门状态出错,第{retryCount}次重试", exception);
|
//Debug.WriteLine($"获取所有箱子门状态出错,第{retryCount}次重试", exception);
|
||||||
logger.Info($"获取所有箱子门状态出错,第{retryCount}次重试, 异常信息{exception}");
|
logger.Info($"获取所有箱子门状态出错,第{retryCount}次重试, 异常信息{exception}");
|
||||||
|
|
||||||
|
Thread.Sleep(50);
|
||||||
|
BoxOperate = false;
|
||||||
this.SetModusIpMaster();
|
this.SetModusIpMaster();
|
||||||
// return TimeSpan.FromSeconds (1);
|
// return TimeSpan.FromSeconds (1);
|
||||||
}).Execute<bool[]>(() =>
|
}).Execute<bool[]>(() =>
|
||||||
{
|
{
|
||||||
bool[] flags = new bool[18];
|
bool[] flags = new bool[18];
|
||||||
|
if (master == null)
|
||||||
|
{
|
||||||
|
this.SetModusIpMaster();
|
||||||
|
}
|
||||||
var result = master.ReadInputRegisters(1, 0x0033, 2);
|
var result = master.ReadInputRegisters(1, 0x0033, 2);
|
||||||
var r1 = Convert.ToString(((int)result[0] >> 14) | ((int)result[1] << 2), 2).PadLeft(18, '0');
|
var r1 = Convert.ToString(((int)result[0] >> 14) | ((int)result[1] << 2), 2).PadLeft(18, '0');
|
||||||
var r2 = r1.ToCharArray();
|
var r2 = r1.ToCharArray();
|
||||||
Debug.WriteLine("r2=>" + string.Join(", ", r2));
|
logger.Info("r2=>" + string.Join(", ", r2));
|
||||||
for (int i = 0; i < 18; i++)
|
for (int i = 0; i < 18; i++)
|
||||||
{
|
{
|
||||||
flags[i] = r2[17 - i] == '1' ? true : false;
|
flags[i] = r2[17 - i] == '1' ? true : false;
|
||||||
|
@ -89,16 +91,15 @@ namespace DM_Weight.Port
|
||||||
}
|
}
|
||||||
public bool OpenBoxDoor(int boxNum)
|
public bool OpenBoxDoor(int boxNum)
|
||||||
{
|
{
|
||||||
if (ConfigurationManager.AppSettings["test"] != null && ConfigurationManager.AppSettings["test"].ToString().Equals("Y"))
|
BoxOperate = true;
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
bool bFlag = false;
|
bool bFlag = false;
|
||||||
|
Thread.Sleep(50);
|
||||||
Policy.Handle<Exception>().Retry(3, ((exception, retryCount) =>
|
Policy.Handle<Exception>().Retry(3, ((exception, retryCount) =>
|
||||||
{
|
{
|
||||||
this.Dispose();
|
this.Dispose();
|
||||||
//Debug.WriteLine($"打开箱子出错,第{retryCount}次重试", exception);
|
//Debug.WriteLine($"打开箱子出错,第{retryCount}次重试", exception);
|
||||||
logger.Info($"打开箱子出错,第{retryCount}次重试,异常信息{exception}");
|
logger.Info($"打开箱子出错,第{retryCount}次重试,异常信息{exception}");
|
||||||
|
Thread.Sleep(50);
|
||||||
this.SetModusIpMaster();
|
this.SetModusIpMaster();
|
||||||
//return TimeSpan.FromSeconds (1);
|
//return TimeSpan.FromSeconds (1);
|
||||||
})).Execute(() =>
|
})).Execute(() =>
|
||||||
|
@ -145,5 +146,10 @@ namespace DM_Weight.Port
|
||||||
});
|
});
|
||||||
return _socket;
|
return _socket;
|
||||||
}
|
}
|
||||||
|
private static SpeechSynthesizer speechSynthesizer = new SpeechSynthesizer();
|
||||||
|
public static void SpeakAsync(string textinfo)
|
||||||
|
{
|
||||||
|
speechSynthesizer.SpeakAsync(textinfo);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -71,18 +71,19 @@ namespace DM_Weight.ViewModels
|
||||||
ChannelStocks = SqlSugarHelper.Db.Queryable<ChannelStock>()
|
ChannelStocks = SqlSugarHelper.Db.Queryable<ChannelStock>()
|
||||||
.Includes<ChannelList>(cs => cs.ChannelLst)
|
.Includes<ChannelList>(cs => cs.ChannelLst)
|
||||||
.Includes<DrugInfo>(cs => cs.DrugInfo)
|
.Includes<DrugInfo>(cs => cs.DrugInfo)
|
||||||
.Where(cs => cs.MachineId == (ConfigurationManager.AppSettings["machineId"] ?? "DM5") && cs.BaseQuantity > cs.Quantity)
|
.Where(cs => cs.MachineId == (ConfigurationManager.AppSettings["machineId"] ?? "DM5") && cs.AddToJJNum > 0)
|
||||||
.OrderBy(cs => cs.Chnguid)
|
|
||||||
.OrderBy(cs => cs.DrawerNo)
|
.OrderBy(cs => cs.DrawerNo)
|
||||||
|
.OrderBy(cs => cs.DrugId)
|
||||||
.ToList();
|
.ToList();
|
||||||
ChannelStocks= ChannelStocks.GroupBy(it=>new {it.DrawerNo,it.DrugId})
|
//ChannelStocks= ChannelStocks.GroupBy(it=>new {it.DrawerNo,it.DrugId})
|
||||||
.Select(it=>
|
// .Select(it=>
|
||||||
{
|
// {
|
||||||
var ret = it.First();
|
// var ret = it.First();
|
||||||
ret.Quantity = it.Sum(itx => itx.Quantity);
|
// ret.Quantity = it.Sum(itx => itx.Quantity);
|
||||||
return ret;
|
// return ret;
|
||||||
}).ToList();
|
// }).ToList();
|
||||||
ChannelStocks.ForEach(cs => cs.AddQuantity = cs.BaseQuantity - cs.Quantity);
|
//ChannelStocks.ForEach(cs => cs.AddQuantity = cs.BaseQuantity - cs.Quantity);
|
||||||
}
|
}
|
||||||
//开药箱放入药品
|
//开药箱放入药品
|
||||||
public DelegateCommand OpenBoxCommand
|
public DelegateCommand OpenBoxCommand
|
||||||
|
@ -92,12 +93,25 @@ namespace DM_Weight.ViewModels
|
||||||
selectedStock = ChannelStocks.FindAll(cs => cs.ChannelLst.IsSelected).ToList();
|
selectedStock = ChannelStocks.FindAll(cs => cs.ChannelLst.IsSelected).ToList();
|
||||||
if (selectedStock != null && selectedStock.Count > 0)
|
if (selectedStock != null && selectedStock.Count > 0)
|
||||||
{
|
{
|
||||||
|
selectedStock.ForEach(cs => cs.ChannelLst.State = 2);
|
||||||
|
|
||||||
int drawerNo = 0;
|
int drawerNo = 0;
|
||||||
for (int i = 0; i < selectedStock.Count; i++)
|
for (int i = 0; i < selectedStock.Count; i++)
|
||||||
{
|
{
|
||||||
if (!(drawerNo == selectedStock[i].DrawerNo))
|
if (!(drawerNo == selectedStock[i].DrawerNo))
|
||||||
{
|
{
|
||||||
drawerNo = selectedStock[i].DrawerNo;
|
drawerNo = selectedStock[i].DrawerNo;
|
||||||
|
|
||||||
|
// 保存数据 入库记录
|
||||||
|
SqlSugarHelper.Db.Insertable(new MachineRecord()
|
||||||
|
{
|
||||||
|
MachineId = "DM5",
|
||||||
|
DrawerNo = drawerNo,
|
||||||
|
Operator = HomeWindowViewModel.Operator?.Id,
|
||||||
|
OperationTime = DateTime.Now,
|
||||||
|
Type = 55,
|
||||||
|
InvoiceId = "药箱补药",
|
||||||
|
}).ExecuteCommand();
|
||||||
_portUtil.SpeakAsync($"正在打开{selectedStock[i].DrawerNo}号药箱");
|
_portUtil.SpeakAsync($"正在打开{selectedStock[i].DrawerNo}号药箱");
|
||||||
}
|
}
|
||||||
ModbusHelper.GetInstance().OpenBoxDoor(selectedStock[i].DrawerNo - 1);
|
ModbusHelper.GetInstance().OpenBoxDoor(selectedStock[i].DrawerNo - 1);
|
||||||
|
@ -127,21 +141,32 @@ namespace DM_Weight.ViewModels
|
||||||
//更新 交接柜 库存信息
|
//更新 交接柜 库存信息
|
||||||
if (selectedStock != null && selectedStock.Count > 0)
|
if (selectedStock != null && selectedStock.Count > 0)
|
||||||
{
|
{
|
||||||
for (int j = 0; j < selectedStock.Count; j++)
|
//for (int j = 0; j < selectedStock.Count; j++)
|
||||||
|
//{
|
||||||
|
|
||||||
|
// // 更新数据 交接柜 库存信息
|
||||||
|
// ChannelStock jiaojie_it = selectedStock[j];
|
||||||
|
// jiaojie_it.Quantity = jiaojie_it.AddToJJNum;
|
||||||
|
// jiaojie_it.NeedNum = 0;
|
||||||
|
// jiaojie_it.AddToJJNum = 0;
|
||||||
|
//SqlSugarHelper.Db.Updateable(new ChannelStock()
|
||||||
|
//{
|
||||||
|
// Quantity = jiaojie_it.AddToJJNum,
|
||||||
|
// ManuNo = jiaojie_it.ManuNo,
|
||||||
|
// //EffDate = it.EffDate,
|
||||||
|
// //Id = jiaojie_it.Id,
|
||||||
|
// DrugId=jiaojie_it.DrugId,
|
||||||
|
// DrawerNo=jiaojie_it.DrawerNo,
|
||||||
|
// MachineId=jiaojie_it.MachineId,
|
||||||
|
//}).UpdateColumns(jiaojie_it => new { jiaojie_it.Quantity }).WhereColumns(jiaojie_it=>new { jiaojie_it.DrugId, jiaojie_it.DrawerNo, jiaojie_it.MachineId }).ExecuteCommand();
|
||||||
|
//}
|
||||||
|
selectedStock.ForEach(cs =>
|
||||||
{
|
{
|
||||||
// 更新数据 交接柜 库存信息
|
cs.Quantity = cs.AddToJJNum;
|
||||||
ChannelStock jiaojie_it = selectedStock[j];
|
cs.NeedNum= 0;
|
||||||
SqlSugarHelper.Db.Updateable(new ChannelStock()
|
cs.AddToJJNum = 0;
|
||||||
{
|
});
|
||||||
Quantity = jiaojie_it.BaseQuantity,
|
SqlSugarHelper.Db.Updateable(selectedStock).ExecuteCommand();
|
||||||
//ManuNo = it.ManuNo,
|
|
||||||
//EffDate = it.EffDate,
|
|
||||||
//Id = jiaojie_it.Id,
|
|
||||||
DrugId=jiaojie_it.DrugId,
|
|
||||||
DrawerNo=jiaojie_it.DrawerNo,
|
|
||||||
MachineId=jiaojie_it.MachineId,
|
|
||||||
}).UpdateColumns(jiaojie_it => new { jiaojie_it.Quantity }).WhereColumns(jiaojie_it=>new { jiaojie_it.DrugId, jiaojie_it.DrawerNo, jiaojie_it.MachineId }).ExecuteCommand();
|
|
||||||
}
|
|
||||||
|
|
||||||
List<ChannelStock> jiaojie = selectedStock.GroupBy(cs => cs.DrawerNo).Select(cs => cs.FirstOrDefault()).ToList();
|
List<ChannelStock> jiaojie = selectedStock.GroupBy(cs => cs.DrawerNo).Select(cs => cs.FirstOrDefault()).ToList();
|
||||||
if (jiaojie != null && jiaojie.Count > 0)
|
if (jiaojie != null && jiaojie.Count > 0)
|
||||||
|
@ -152,7 +177,7 @@ namespace DM_Weight.ViewModels
|
||||||
ChannelList jiaojieList = new ChannelList();
|
ChannelList jiaojieList = new ChannelList();
|
||||||
jiaojieList.State = 0;
|
jiaojieList.State = 0;
|
||||||
jiaojieList.Id = jiaojie_it.ChannelLst.Id;
|
jiaojieList.Id = jiaojie_it.ChannelLst.Id;
|
||||||
//更新交接柜状态为 已取药未入库
|
//更新交接柜状态为0
|
||||||
var result = SqlSugarHelper.Db.Updateable(jiaojieList)
|
var result = SqlSugarHelper.Db.Updateable(jiaojieList)
|
||||||
.UpdateColumns(it => new { it.State, it.Id }).ExecuteCommand();
|
.UpdateColumns(it => new { it.State, it.Id }).ExecuteCommand();
|
||||||
}
|
}
|
||||||
|
|
|
@ -124,9 +124,15 @@ namespace DM_Weight.ViewModels
|
||||||
.Includes(cs => cs.DrugInfo)
|
.Includes(cs => cs.DrugInfo)
|
||||||
.Where(cs => cs.MachineId.Equals("DM5"))
|
.Where(cs => cs.MachineId.Equals("DM5"))
|
||||||
.Where(cs => cs.DrawerNo == DrawerNo).ToList();
|
.Where(cs => cs.DrawerNo == DrawerNo).ToList();
|
||||||
|
|
||||||
if (list != null && list.Count > 0)
|
if (list != null && list.Count > 0)
|
||||||
{
|
{
|
||||||
Channels = list;
|
Channels=list.GroupBy(cs =>cs.DrugId).Select(cs =>
|
||||||
|
{
|
||||||
|
var ret = cs.First();
|
||||||
|
ret.Quantity = cs.Sum(itx => itx.Quantity);
|
||||||
|
return ret;
|
||||||
|
}).ToList();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -212,7 +218,9 @@ namespace DM_Weight.ViewModels
|
||||||
DrugId = DrugInfo.DrugId.ToString(),
|
DrugId = DrugInfo.DrugId.ToString(),
|
||||||
BaseQuantity = baseQuantity,
|
BaseQuantity = baseQuantity,
|
||||||
Id = Guid.NewGuid().ToString(),
|
Id = Guid.NewGuid().ToString(),
|
||||||
MachineId = "DM5"
|
MachineId = "DM5",
|
||||||
|
AddToJJNum=0,
|
||||||
|
NeedNum=baseQuantity
|
||||||
}).ExecuteCommand();
|
}).ExecuteCommand();
|
||||||
// 保存数据 入库记录
|
// 保存数据 入库记录
|
||||||
SqlSugarHelper.Db.Insertable(new MachineRecord()
|
SqlSugarHelper.Db.Insertable(new MachineRecord()
|
||||||
|
|
|
@ -27,7 +27,7 @@ namespace DM_Weight.ViewModels
|
||||||
public class CheckOrderNewWindowViewModel : BindableBase, INavigationAware, IRegionMemberLifetime
|
public class CheckOrderNewWindowViewModel : BindableBase, INavigationAware, IRegionMemberLifetime
|
||||||
{
|
{
|
||||||
private readonly ILog logger = LogManager.GetLogger(typeof(CheckOrderNewWindowViewModel));
|
private readonly ILog logger = LogManager.GetLogger(typeof(CheckOrderNewWindowViewModel));
|
||||||
System.Timers.Timer CheckBoxStatusTimer;
|
// System.Timers.Timer CheckBoxStatusTimer;
|
||||||
|
|
||||||
private int _pageNum = 1;
|
private int _pageNum = 1;
|
||||||
public int PageNum
|
public int PageNum
|
||||||
|
@ -50,7 +50,7 @@ namespace DM_Weight.ViewModels
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private int _pageSize = 10;
|
private int _pageSize = 8;
|
||||||
public int PageSize
|
public int PageSize
|
||||||
{
|
{
|
||||||
get => _pageSize;
|
get => _pageSize;
|
||||||
|
@ -334,7 +334,7 @@ namespace DM_Weight.ViewModels
|
||||||
PageCount = (int)Math.Ceiling((double)TotalCount / PageSize);
|
PageCount = (int)Math.Ceiling((double)TotalCount / PageSize);
|
||||||
if (Convert.ToDateTime(currentList.EffDate).ToString("yyyy-MM-dd") == DateTime.Now.ToString("yyyy-MM-dd"))
|
if (Convert.ToDateTime(currentList.EffDate).ToString("yyyy-MM-dd") == DateTime.Now.ToString("yyyy-MM-dd"))
|
||||||
{
|
{
|
||||||
switch (DrawerNo)
|
switch (DrawerNo+1)
|
||||||
{
|
{
|
||||||
case 1:
|
case 1:
|
||||||
_button1Color = Brushes.Yellow;
|
_button1Color = Brushes.Yellow;
|
||||||
|
@ -560,8 +560,9 @@ namespace DM_Weight.ViewModels
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
cs.Quantity = cs.Quantity - oi._OrderDetail.Quantity;
|
cs.Quantity = cs.Quantity - oi._OrderDetail.Quantity;
|
||||||
|
cs.NeedNum =cs.NeedNum + oi._OrderDetail.Quantity;
|
||||||
// 更新数据 库存信息
|
// 更新数据 库存信息
|
||||||
SqlSugarHelper.Db.Updateable(cs).UpdateColumns(it => new { it.Quantity }).ExecuteCommand();
|
SqlSugarHelper.Db.Updateable(cs).UpdateColumns(it => new { it.Quantity,it.NeedNum }).ExecuteCommand();
|
||||||
|
|
||||||
if (cs != null)
|
if (cs != null)
|
||||||
{
|
{
|
||||||
|
@ -710,11 +711,11 @@ namespace DM_Weight.ViewModels
|
||||||
{
|
{
|
||||||
AlertMsg alertMsg = new AlertMsg
|
AlertMsg alertMsg = new AlertMsg
|
||||||
{
|
{
|
||||||
Message = $"所选单子中对应药品批次效期无效{empChannelStock}",
|
Message = $"所选单子中对应药品批次无效{empChannelStock}",
|
||||||
Type = MsgType.ERROR,
|
Type = MsgType.ERROR,
|
||||||
};
|
};
|
||||||
_eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg);
|
_eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg);
|
||||||
logger.Info($"所选单子对应药品批次效期无效{empChannelStock}");
|
logger.Info($"所选单子对应药品批次无效{empChannelStock}");
|
||||||
throw new Exception("事务回滚");
|
throw new Exception("事务回滚");
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
@ -762,8 +763,13 @@ namespace DM_Weight.ViewModels
|
||||||
|
|
||||||
public bool KeepAlive => false;
|
public bool KeepAlive => false;
|
||||||
|
|
||||||
public async void OpenBoxAction(string strDrawerNo)
|
public void OpenBoxAction(string strDrawerNo)
|
||||||
{
|
{
|
||||||
|
if (ModbusHelper.BoxOperate)
|
||||||
|
{
|
||||||
|
Task.Factory.StartNew(() => { ModbusHelper.SpeakAsync("请关闭药箱后再打开"); });
|
||||||
|
return;
|
||||||
|
}
|
||||||
DrawerNo = Convert.ToInt32(strDrawerNo);
|
DrawerNo = Convert.ToInt32(strDrawerNo);
|
||||||
MachineRecord machineRecord = new MachineRecord();
|
MachineRecord machineRecord = new MachineRecord();
|
||||||
machineRecord.MachineId = "DM5";
|
machineRecord.MachineId = "DM5";
|
||||||
|
@ -774,28 +780,38 @@ namespace DM_Weight.ViewModels
|
||||||
machineRecord.InvoiceId = $"打开{DrawerNo + 1}号药箱";
|
machineRecord.InvoiceId = $"打开{DrawerNo + 1}号药箱";
|
||||||
|
|
||||||
|
|
||||||
if (DrawerNo > 0)
|
if (DrawerNo >= 0)
|
||||||
{
|
{
|
||||||
RequestData();
|
RequestData();
|
||||||
Status = 1;
|
Status = 1;
|
||||||
_portUtil.SpeakAsync($"正在打开{DrawerNo + 1}号药箱");
|
ModbusHelper.SpeakAsync($"正在打开{DrawerNo + 1}号药箱");
|
||||||
//logger.Info($"正在打开{DrawerNo + 1}号药箱");
|
//logger.Info($"正在打开{DrawerNo + 1}号药箱");
|
||||||
//记录开药箱日志
|
//记录开药箱日志
|
||||||
SqlSugarHelper.Db.Insertable(machineRecord).ExecuteCommand();
|
SqlSugarHelper.Db.Insertable(machineRecord).ExecuteCommand();
|
||||||
ModbusHelper.GetInstance().OpenBoxDoor(DrawerNo);
|
ModbusHelper.GetInstance().OpenBoxDoor(DrawerNo);
|
||||||
//设置对应药箱按钮可用状态
|
//设置对应药箱按钮可用状态
|
||||||
SetIsEnableStatus(DrawerNo, false);
|
//SetIsEnableStatus(DrawerNo, false);
|
||||||
//_eventAggregator.GetEvent<BoxOpenStatusEvent>().Publish();
|
//_eventAggregator.GetEvent<BoxOpenStatusEvent>().Publish();
|
||||||
if (CheckBoxStatusTimer is null)
|
Task.Factory.StartNew(async () =>
|
||||||
{
|
{
|
||||||
CheckBoxStatusTimer = new System.Timers.Timer();
|
bool loop = true;
|
||||||
}
|
while (loop)
|
||||||
if (!CheckBoxStatusTimer.Enabled)
|
|
||||||
{
|
{
|
||||||
CheckBoxStatusTimer.Elapsed += new System.Timers.ElapsedEventHandler(GetAllBoxState);
|
await Task.Delay(9000);
|
||||||
CheckBoxStatusTimer.Interval = 3000;
|
bool[] boolsl = ModbusHelper.GetInstance().GetAllBoxState();
|
||||||
CheckBoxStatusTimer.Start();
|
bool state = Array.TrueForAll(boolsl, b => b == false);
|
||||||
|
if (state)
|
||||||
|
{
|
||||||
|
loop = false;
|
||||||
|
ModbusHelper.BoxOperate = false;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ModbusHelper.BoxOperate = true;
|
||||||
|
ModbusHelper.SpeakAsync("药箱已打开,请及时关闭");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
//设置对应药箱按钮可用状态
|
//设置对应药箱按钮可用状态
|
||||||
//SetIsEnableStatus(DrawerNo, false);
|
//SetIsEnableStatus(DrawerNo, false);
|
||||||
}
|
}
|
||||||
|
@ -874,27 +890,6 @@ namespace DM_Weight.ViewModels
|
||||||
public void OnNavigatedFrom(NavigationContext navigationContext)
|
public void OnNavigatedFrom(NavigationContext navigationContext)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
private void GetAllBoxState(object sender, ElapsedEventArgs e)
|
|
||||||
{
|
|
||||||
//查询药箱是否关闭,如果已经关闭则按钮可用,可继续开该编号的药箱
|
|
||||||
if (DrawerNo >= 0)
|
|
||||||
{
|
|
||||||
bool[] boolArrs = ModbusHelper.GetInstance().GetAllBoxState();
|
|
||||||
bool allFalse = Array.TrueForAll(boolArrs, b => b == false);
|
|
||||||
if (allFalse)
|
|
||||||
{
|
|
||||||
if (CheckBoxStatusTimer.Enabled)
|
|
||||||
{
|
|
||||||
CheckBoxStatusTimer.Stop();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
for (int i = 0; i < boolArrs.Length; i++)
|
|
||||||
{
|
|
||||||
//设置对应药箱按钮可用状态
|
|
||||||
SetIsEnableStatus(i, !boolArrs[i]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//void DoMyPrismEvent(DeviceMsg msg)
|
//void DoMyPrismEvent(DeviceMsg msg)
|
||||||
//{
|
//{
|
||||||
|
|
|
@ -1184,6 +1184,11 @@ namespace DM_Weight.ViewModels
|
||||||
public void OnNavigatedTo(NavigationContext navigationContext)
|
public void OnNavigatedTo(NavigationContext navigationContext)
|
||||||
{
|
{
|
||||||
RequestData();
|
RequestData();
|
||||||
|
if(ModbusHelper.BoxOperate)
|
||||||
|
{
|
||||||
|
Task.Factory.StartNew(() => { ModbusHelper.SpeakAsync("请关闭药箱后再打开"); });
|
||||||
|
return;
|
||||||
|
}
|
||||||
//查询当前药师的第一个药箱号并打开该药箱
|
//查询当前药师的第一个药箱号并打开该药箱
|
||||||
int drawerNo = SqlSugarHelper.Db.Queryable<ChannelList>().Where(cl => cl.MachineId == "DM5" && cl.BelongUser == HomeWindowViewModel.Operator.UserBarcode).Select(cl => cl.DrawerNo).First();
|
int drawerNo = SqlSugarHelper.Db.Queryable<ChannelList>().Where(cl => cl.MachineId == "DM5" && cl.BelongUser == HomeWindowViewModel.Operator.UserBarcode).Select(cl => cl.DrawerNo).First();
|
||||||
if (drawerNo > 0)
|
if (drawerNo > 0)
|
||||||
|
@ -1206,7 +1211,7 @@ namespace DM_Weight.ViewModels
|
||||||
_portUtil.SpeakAsync($"正在打开{drawerNo}号药箱");
|
_portUtil.SpeakAsync($"正在打开{drawerNo}号药箱");
|
||||||
logger.Info($"正在打开{drawerNo}号药箱");
|
logger.Info($"正在打开{drawerNo}号药箱");
|
||||||
ModbusHelper.GetInstance().OpenBoxDoor(drawerNo - 1);
|
ModbusHelper.GetInstance().OpenBoxDoor(drawerNo - 1);
|
||||||
SetBtnEnable(drawerNo, false);
|
//SetBtnEnable(drawerNo, false);
|
||||||
//if (CheckBoxStatusTimer is null)
|
//if (CheckBoxStatusTimer is null)
|
||||||
//{
|
//{
|
||||||
// CheckBoxStatusTimer = new System.Timers.Timer();
|
// CheckBoxStatusTimer = new System.Timers.Timer();
|
||||||
|
@ -1225,7 +1230,26 @@ namespace DM_Weight.ViewModels
|
||||||
channelList.EffDate = DateTime.Now.ToString();
|
channelList.EffDate = DateTime.Now.ToString();
|
||||||
SqlSugarHelper.Db.Updateable(channelList).UpdateColumns(it => new { it.EffDate }).ExecuteCommand();
|
SqlSugarHelper.Db.Updateable(channelList).UpdateColumns(it => new { it.EffDate }).ExecuteCommand();
|
||||||
}
|
}
|
||||||
|
Task.Factory.StartNew(async () =>
|
||||||
|
{
|
||||||
|
bool loop = true;
|
||||||
|
while (loop)
|
||||||
|
{
|
||||||
|
await Task.Delay(9000);
|
||||||
|
bool[] boolsl = ModbusHelper.GetInstance().GetAllBoxState();
|
||||||
|
bool state = Array.TrueForAll(boolsl, b => b == false);
|
||||||
|
if (state)
|
||||||
|
{
|
||||||
|
loop = false;
|
||||||
|
ModbusHelper.BoxOperate = false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ModbusHelper.BoxOperate = true;
|
||||||
|
ModbusHelper.SpeakAsync("药箱已打开,请及时关闭");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//private void GetAllBoxState(object sender, ElapsedEventArgs e)
|
//private void GetAllBoxState(object sender, ElapsedEventArgs e)
|
||||||
|
|
|
@ -40,11 +40,11 @@ namespace DM_Weight.ViewModels
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 冰箱温度
|
/// 冰箱温度
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private string _wd = "恒温冷藏抽屉当前温度2.8(非真实数据)";
|
//private string _wd = "恒温冷藏抽屉当前温度2.8(非真实数据)";
|
||||||
public string WD { get => _wd; set => SetProperty(ref _wd, value); }
|
//public string WD { get => _wd; set => SetProperty(ref _wd, value); }
|
||||||
System.Timers.Timer WDTimer;
|
//System.Timers.Timer WDTimer;
|
||||||
|
|
||||||
System.Timers.Timer WSDTimer;
|
//System.Timers.Timer WSDTimer;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 是否有冰箱抽屉
|
/// 是否有冰箱抽屉
|
||||||
|
@ -287,10 +287,8 @@ namespace DM_Weight.ViewModels
|
||||||
//}
|
//}
|
||||||
if (SelectedMenu != null && SelectedMenu.PremissionName == "退出")
|
if (SelectedMenu != null && SelectedMenu.PremissionName == "退出")
|
||||||
{
|
{
|
||||||
bool[] boolArrs = ModbusHelper.GetInstance().GetAllBoxState();
|
|
||||||
bool allTrue = Array.TrueForAll(boolArrs, b => b);
|
|
||||||
//false是关着,true是开着
|
//false是关着,true是开着
|
||||||
if (!allTrue)
|
if (!ModbusHelper.BoxOperate)
|
||||||
{
|
{
|
||||||
logger.Info($"用户【{Operator?.Nickname}】退出登录");
|
logger.Info($"用户【{Operator?.Nickname}】退出登录");
|
||||||
Operator = null;
|
Operator = null;
|
||||||
|
@ -300,12 +298,8 @@ namespace DM_Weight.ViewModels
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
//还有药箱开着不能退出
|
//还有药箱开着不能退出
|
||||||
AlertMsg alertMsg = new AlertMsg
|
_portUtil.SpeakAsync("请关闭药箱后再退出");
|
||||||
{
|
SelectedMenu = _premissionDmList[0];
|
||||||
Message = "请关闭药箱后再退出系统",
|
|
||||||
Type = MsgType.ERROR
|
|
||||||
};
|
|
||||||
_eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -611,17 +605,40 @@ namespace DM_Weight.ViewModels
|
||||||
// timer.Start();
|
// timer.Start();
|
||||||
//}
|
//}
|
||||||
#region 温度查询定时
|
#region 温度查询定时
|
||||||
int interval = Convert.ToInt32(ConfigurationManager.AppSettings["Interval"]);
|
//int interval = Convert.ToInt32(ConfigurationManager.AppSettings["Interval"]);
|
||||||
if (interval > 0)
|
//if (interval > 0)
|
||||||
{
|
//{
|
||||||
WSDTimer = new System.Timers.Timer();
|
// WSDTimer = new System.Timers.Timer();
|
||||||
|
|
||||||
WSDTimer.Elapsed += new System.Timers.ElapsedEventHandler(GetWSD);
|
// WSDTimer.Elapsed += new System.Timers.ElapsedEventHandler(GetWSD);
|
||||||
WSDTimer.Interval = interval;
|
// WSDTimer.Interval = interval;
|
||||||
WSDTimer.Start();
|
// WSDTimer.Start();
|
||||||
//WDTimer.AutoReset = true;
|
// //WDTimer.AutoReset = true;
|
||||||
//WDTimer.Enabled = true;
|
// //WDTimer.Enabled = true;
|
||||||
|
//}
|
||||||
|
Task.Factory.StartNew(async () =>
|
||||||
|
{
|
||||||
|
while (true)
|
||||||
|
{
|
||||||
|
TemperatureHumidityInfo temp = _portUtil.GetWSD();
|
||||||
|
if (temp != null)
|
||||||
|
{
|
||||||
|
SqlSugarHelper.Db.Insertable(new TemperatureHumidityInfo()
|
||||||
|
{
|
||||||
|
GroupNo = temp.GroupNo,
|
||||||
|
Temp = temp.Temp,
|
||||||
|
Humi = temp.Humi,
|
||||||
|
AddTime = DateTime.Now
|
||||||
|
}).ExecuteCommand();
|
||||||
|
logger.Info($"保存温湿度信息:{temp.Temp},{temp.Humi}");
|
||||||
|
await Task.Delay(1200000);//20分钟查一次
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
logger.Info("温湿度信息返回空");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
#endregion
|
#endregion
|
||||||
//if (stopRecord > 0)
|
//if (stopRecord > 0)
|
||||||
//{
|
//{
|
||||||
|
|
|
@ -483,13 +483,13 @@ namespace DM_Weight.ViewModels
|
||||||
};
|
};
|
||||||
PremissionDm machineRecord= new PremissionDm
|
PremissionDm machineRecord= new PremissionDm
|
||||||
{
|
{
|
||||||
Id = 54,
|
Id = 55,
|
||||||
PremissionName = "操作记录",
|
PremissionName = "操作记录",
|
||||||
PremissionPath = "MachineRecordWindow",
|
PremissionPath = "MachineRecordWindow",
|
||||||
};
|
};
|
||||||
PremissionDm wSDRecord= new PremissionDm
|
PremissionDm wSDRecord= new PremissionDm
|
||||||
{
|
{
|
||||||
Id = 54,
|
Id = 56,
|
||||||
PremissionName = "温湿度记录",
|
PremissionName = "温湿度记录",
|
||||||
PremissionPath = "WSDRecordWindow",
|
PremissionPath = "WSDRecordWindow",
|
||||||
};
|
};
|
||||||
|
@ -514,13 +514,18 @@ namespace DM_Weight.ViewModels
|
||||||
// PremissionPath = "SettingWindow",
|
// PremissionPath = "SettingWindow",
|
||||||
// };
|
// };
|
||||||
//}
|
//}
|
||||||
|
sysset3 = new PremissionDm
|
||||||
|
{
|
||||||
|
Id = 57,
|
||||||
|
PremissionName = "登录设置",
|
||||||
|
PremissionPath = "SettingWindow",
|
||||||
|
};
|
||||||
syssetChild.Add(sysset1);
|
syssetChild.Add(sysset1);
|
||||||
syssetChild.Add(sysset2);
|
syssetChild.Add(sysset2);
|
||||||
syssetChild.Add(sysset3);
|
|
||||||
syssetChild.Add(settingBox);
|
syssetChild.Add(settingBox);
|
||||||
syssetChild.Add(machineRecord);
|
syssetChild.Add(machineRecord);
|
||||||
syssetChild.Add(wSDRecord);
|
syssetChild.Add(wSDRecord);
|
||||||
|
syssetChild.Add(sysset3);
|
||||||
sysset.Children = syssetChild;
|
sysset.Children = syssetChild;
|
||||||
defaultAll.Add(sysset);
|
defaultAll.Add(sysset);
|
||||||
#endregion
|
#endregion
|
||||||
|
|
|
@ -198,6 +198,12 @@ namespace DM_Weight.ViewModels
|
||||||
{
|
{
|
||||||
if (DrawerNo > 0)
|
if (DrawerNo > 0)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
if (ModbusHelper.BoxOperate)
|
||||||
|
{
|
||||||
|
Task.Factory.StartNew(() => { ModbusHelper.SpeakAsync("请关闭药箱后再打开"); });
|
||||||
|
return;
|
||||||
|
}
|
||||||
IsEnable = false;
|
IsEnable = false;
|
||||||
Status = 1;
|
Status = 1;
|
||||||
//_portUtil.SpeakAsync("正在打开药箱");
|
//_portUtil.SpeakAsync("正在打开药箱");
|
||||||
|
@ -219,6 +225,26 @@ namespace DM_Weight.ViewModels
|
||||||
IsEnable = true;
|
IsEnable = true;
|
||||||
Status = 0;
|
Status = 0;
|
||||||
}
|
}
|
||||||
|
Task.Factory.StartNew(async () =>
|
||||||
|
{
|
||||||
|
bool loop = true;
|
||||||
|
while (loop)
|
||||||
|
{
|
||||||
|
await Task.Delay(9000);
|
||||||
|
bool[] boolsl = ModbusHelper.GetInstance().GetAllBoxState();
|
||||||
|
bool state = Array.TrueForAll(boolsl, b => b == false);
|
||||||
|
if (state)
|
||||||
|
{
|
||||||
|
loop = false;
|
||||||
|
ModbusHelper.BoxOperate = false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ModbusHelper.BoxOperate = true;
|
||||||
|
ModbusHelper.SpeakAsync("药箱已打开,请及时关闭");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -160,8 +160,8 @@
|
||||||
<DataGridTextColumn IsReadOnly="True" Header="批次" Binding="{Binding ManuNo}"/>
|
<DataGridTextColumn IsReadOnly="True" Header="批次" Binding="{Binding ManuNo}"/>
|
||||||
<DataGridTextColumn IsReadOnly="True" Header="效期" Binding="{Binding EffDate}"/>
|
<DataGridTextColumn IsReadOnly="True" Header="效期" Binding="{Binding EffDate}"/>
|
||||||
<DataGridTextColumn IsReadOnly="True" Header="厂家" Binding="{Binding DrugInfo.Manufactory}"/>
|
<DataGridTextColumn IsReadOnly="True" Header="厂家" Binding="{Binding DrugInfo.Manufactory}"/>
|
||||||
<DataGridTextColumn IsReadOnly="True" Header="药品基数" Binding="{Binding BaseQuantity}"/>
|
<!--<DataGridTextColumn IsReadOnly="True" Header="药品基数" Binding="{Binding BaseQuantity}"/>-->
|
||||||
<DataGridTextColumn IsReadOnly="True" Header="需补药数量" Binding="{Binding AddQuantity}"/>
|
<DataGridTextColumn IsReadOnly="True" Header="需补药数量" Binding="{Binding AddToJJNum}"/>
|
||||||
<DataGridTextColumn IsReadOnly="True" Header="状态" Binding="{Binding ChannelLst.State,Converter={StaticResource StockStatusConverter},ConverterParameter=TextState}"/>
|
<DataGridTextColumn IsReadOnly="True" Header="状态" Binding="{Binding ChannelLst.State,Converter={StaticResource StockStatusConverter},ConverterParameter=TextState}"/>
|
||||||
</DataGrid.Columns>
|
</DataGrid.Columns>
|
||||||
</DataGrid>
|
</DataGrid>
|
||||||
|
|
|
@ -29,6 +29,7 @@
|
||||||
</Setter>
|
</Setter>
|
||||||
</Style.Setters>
|
</Style.Setters>
|
||||||
</Style>
|
</Style>
|
||||||
|
|
||||||
</UserControl.Resources>
|
</UserControl.Resources>
|
||||||
<Grid>
|
<Grid>
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
|
@ -141,12 +142,11 @@
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Grid>
|
</Grid>
|
||||||
<!--<Grid Grid.Row="1" Grid.Column="0" Margin="0 0 -100 0">-->
|
<!--<Grid Grid.Row="1" Grid.Column="0" Margin="0 0 -100 0">-->
|
||||||
<ListView Grid.Row="1" Grid.Column="0" Margin="0 0 6 0"
|
<ListView Grid.Row="1" Grid.Column="0" Margin="0"
|
||||||
ItemsSource="{Binding OrderInfoList, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}"
|
ItemsSource="{Binding OrderInfoList, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}"
|
||||||
SelectedItem="{Binding selectOrderInfo}"
|
SelectedItem="{Binding selectOrderInfo}"
|
||||||
materialDesign:ListViewAssist.HeaderRowBackground="#31ccec"
|
materialDesign:ListViewAssist.HeaderRowBackground="#31ccec"
|
||||||
materialDesign:DataGridAssist.ColumnHeaderPadding="10"
|
materialDesign:ListViewAssist.ListViewItemPadding="0 15 0 0">
|
||||||
materialDesign:ListViewAssist.ListViewItemPadding="13">
|
|
||||||
<ListView.Resources>
|
<ListView.Resources>
|
||||||
<Style TargetType="{x:Type GridViewColumnHeader}" BasedOn="{StaticResource {x:Type GridViewColumnHeader}}">
|
<Style TargetType="{x:Type GridViewColumnHeader}" BasedOn="{StaticResource {x:Type GridViewColumnHeader}}">
|
||||||
<Setter Property="Foreground" Value="White" />
|
<Setter Property="Foreground" Value="White" />
|
||||||
|
@ -166,13 +166,13 @@
|
||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
</GridViewColumn.CellTemplate>
|
</GridViewColumn.CellTemplate>
|
||||||
</GridViewColumn>
|
</GridViewColumn>
|
||||||
<GridViewColumn Width="60"
|
<GridViewColumn Width="80"
|
||||||
Header="姓名"
|
Header="姓名"
|
||||||
DisplayMemberBinding="{Binding PName}" />
|
DisplayMemberBinding="{Binding PName}" />
|
||||||
<GridViewColumn Width="30"
|
<GridViewColumn Width="30"
|
||||||
DisplayMemberBinding="{Binding Sex}"
|
DisplayMemberBinding="{Binding Sex}"
|
||||||
Header="性别"/>
|
Header="性别"/>
|
||||||
<GridViewColumn Width="80"
|
<GridViewColumn Width="60"
|
||||||
DisplayMemberBinding="{Binding OrderNo}"
|
DisplayMemberBinding="{Binding OrderNo}"
|
||||||
Header="单号"/>
|
Header="单号"/>
|
||||||
<!--<GridViewColumn Width="240"
|
<!--<GridViewColumn Width="240"
|
||||||
|
@ -191,7 +191,7 @@
|
||||||
DisplayMemberBinding="{Binding _OrderDetail.Quantity}"
|
DisplayMemberBinding="{Binding _OrderDetail.Quantity}"
|
||||||
Header="数量"/>-->
|
Header="数量"/>-->
|
||||||
|
|
||||||
<GridViewColumn Width="100" Header="药品名称">
|
<GridViewColumn Width="180" Header="药品名称">
|
||||||
<GridViewColumn.CellTemplate>
|
<GridViewColumn.CellTemplate>
|
||||||
<DataTemplate>
|
<DataTemplate>
|
||||||
<ListBox ItemsSource="{Binding OrderDetailList}" DisplayMemberPath="DrugInfo.DrugName" materialDesign:ListBoxItemAssist.ShowSelection="False"></ListBox>
|
<ListBox ItemsSource="{Binding OrderDetailList}" DisplayMemberPath="DrugInfo.DrugName" materialDesign:ListBoxItemAssist.ShowSelection="False"></ListBox>
|
||||||
|
@ -212,7 +212,7 @@
|
||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
</GridViewColumn.CellTemplate>
|
</GridViewColumn.CellTemplate>
|
||||||
</GridViewColumn>-->
|
</GridViewColumn>-->
|
||||||
<GridViewColumn Width="30" Header="数量">
|
<GridViewColumn Width="42" Header="数量">
|
||||||
<GridViewColumn.CellTemplate>
|
<GridViewColumn.CellTemplate>
|
||||||
<DataTemplate>
|
<DataTemplate>
|
||||||
<ListBox ItemsSource="{Binding OrderDetailList}" DisplayMemberPath="Quantity" materialDesign:ListBoxItemAssist.ShowSelection="False"></ListBox>
|
<ListBox ItemsSource="{Binding OrderDetailList}" DisplayMemberPath="Quantity" materialDesign:ListBoxItemAssist.ShowSelection="False"></ListBox>
|
||||||
|
@ -224,11 +224,10 @@
|
||||||
</ListView>
|
</ListView>
|
||||||
<!--</Grid>-->
|
<!--</Grid>-->
|
||||||
<!--<Grid Grid.Column="1" Grid.Row="1" Margin="0 0 0 0" HorizontalAlignment="Right">-->
|
<!--<Grid Grid.Column="1" Grid.Row="1" Margin="0 0 0 0" HorizontalAlignment="Right">-->
|
||||||
<ListView Grid.Column="1" Grid.Row="1" Margin="0 0 0 0"
|
<ListView Grid.Column="1" Grid.Row="1" Margin="0 0 3 0"
|
||||||
ItemsSource="{Binding TotalDrugList,UpdateSourceTrigger=PropertyChanged,Mode=TwoWay}"
|
ItemsSource="{Binding TotalDrugList,UpdateSourceTrigger=PropertyChanged,Mode=TwoWay}"
|
||||||
materialDesign:ListViewAssist.HeaderRowBackground="#31ccec"
|
materialDesign:ListViewAssist.HeaderRowBackground="#31ccec"
|
||||||
materialDesign:DataGridAssist.ColumnHeaderPadding="10"
|
materialDesign:ListViewAssist.ListViewItemPadding="0 16 0 15">
|
||||||
materialDesign:ListViewAssist.ListViewItemPadding="13">
|
|
||||||
<ListView.Resources>
|
<ListView.Resources>
|
||||||
<Style TargetType="{x:Type GridViewColumnHeader}" BasedOn="{StaticResource {x:Type GridViewColumnHeader}}">
|
<Style TargetType="{x:Type GridViewColumnHeader}" BasedOn="{StaticResource {x:Type GridViewColumnHeader}}">
|
||||||
<Setter Property="Foreground" Value="White" />
|
<Setter Property="Foreground" Value="White" />
|
||||||
|
@ -236,12 +235,12 @@
|
||||||
</ListView.Resources>
|
</ListView.Resources>
|
||||||
<ListView.View>
|
<ListView.View>
|
||||||
<GridView ColumnHeaderContainerStyle="{StaticResource st}">
|
<GridView ColumnHeaderContainerStyle="{StaticResource st}">
|
||||||
<GridViewColumn Width="100"
|
<GridViewColumn Width="180"
|
||||||
DisplayMemberBinding="{Binding DrugName}"
|
DisplayMemberBinding="{Binding DrugName}"
|
||||||
Header="药品名称"/>
|
Header="药品名称"/>
|
||||||
<GridViewColumn Width="30"
|
<GridViewColumn Width="40"
|
||||||
DisplayMemberBinding="{Binding TotalCount}"
|
DisplayMemberBinding="{Binding TotalCount}"
|
||||||
Header="合计数量"/>
|
Header="合计"/>
|
||||||
</GridView>
|
</GridView>
|
||||||
</ListView.View>
|
</ListView.View>
|
||||||
</ListView>
|
</ListView>
|
||||||
|
|
|
@ -151,12 +151,11 @@
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Grid>
|
</Grid>
|
||||||
<!--<Grid Grid.Row="1" Grid.Column="0" Margin="0 0 -100 0">-->
|
<!--<Grid Grid.Row="1" Grid.Column="0" Margin="0 0 -100 0">-->
|
||||||
<ListView Grid.Row="1" Grid.Column="0" Margin="0 0 6 0"
|
<ListView Grid.Row="1" Grid.Column="0" Margin="0"
|
||||||
ItemsSource="{Binding OrderInfoList, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}"
|
ItemsSource="{Binding OrderInfoList, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}"
|
||||||
SelectedItem="{Binding selectOrderInfo}"
|
SelectedItem="{Binding selectOrderInfo}"
|
||||||
materialDesign:ListViewAssist.HeaderRowBackground="#31ccec"
|
materialDesign:ListViewAssist.HeaderRowBackground="#31ccec"
|
||||||
materialDesign:DataGridAssist.ColumnHeaderPadding="10"
|
materialDesign:ListViewAssist.ListViewItemPadding="0 15 0 0">
|
||||||
materialDesign:ListViewAssist.ListViewItemPadding="3">
|
|
||||||
<ListView.Resources>
|
<ListView.Resources>
|
||||||
<Style TargetType="{x:Type GridViewColumnHeader}" BasedOn="{StaticResource {x:Type GridViewColumnHeader}}">
|
<Style TargetType="{x:Type GridViewColumnHeader}" BasedOn="{StaticResource {x:Type GridViewColumnHeader}}">
|
||||||
<Setter Property="Foreground" Value="White" />
|
<Setter Property="Foreground" Value="White" />
|
||||||
|
@ -176,13 +175,13 @@
|
||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
</GridViewColumn.CellTemplate>
|
</GridViewColumn.CellTemplate>
|
||||||
</GridViewColumn>
|
</GridViewColumn>
|
||||||
<GridViewColumn Width="60"
|
<GridViewColumn Width="80"
|
||||||
Header="姓名"
|
Header="姓名"
|
||||||
DisplayMemberBinding="{Binding PName}" />
|
DisplayMemberBinding="{Binding PName}" />
|
||||||
<GridViewColumn Width="30"
|
<GridViewColumn Width="30"
|
||||||
DisplayMemberBinding="{Binding Sex}"
|
DisplayMemberBinding="{Binding Sex}"
|
||||||
Header="性别"/>
|
Header="性别"/>
|
||||||
<GridViewColumn Width="80"
|
<GridViewColumn Width="60"
|
||||||
DisplayMemberBinding="{Binding OrderNo}"
|
DisplayMemberBinding="{Binding OrderNo}"
|
||||||
Header="单号"/>
|
Header="单号"/>
|
||||||
<!--<GridViewColumn Width="240"
|
<!--<GridViewColumn Width="240"
|
||||||
|
@ -201,7 +200,7 @@
|
||||||
DisplayMemberBinding="{Binding _OrderDetail.Quantity}"
|
DisplayMemberBinding="{Binding _OrderDetail.Quantity}"
|
||||||
Header="数量"/>-->
|
Header="数量"/>-->
|
||||||
|
|
||||||
<GridViewColumn Width="100" Header="药品名称">
|
<GridViewColumn Width="180" Header="药品名称">
|
||||||
<GridViewColumn.CellTemplate>
|
<GridViewColumn.CellTemplate>
|
||||||
<DataTemplate>
|
<DataTemplate>
|
||||||
<ListBox ItemsSource="{Binding OrderDetailList}" DisplayMemberPath="DrugInfo.DrugName" materialDesign:ListBoxItemAssist.ShowSelection="False"></ListBox>
|
<ListBox ItemsSource="{Binding OrderDetailList}" DisplayMemberPath="DrugInfo.DrugName" materialDesign:ListBoxItemAssist.ShowSelection="False"></ListBox>
|
||||||
|
@ -222,7 +221,7 @@
|
||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
</GridViewColumn.CellTemplate>
|
</GridViewColumn.CellTemplate>
|
||||||
</GridViewColumn>-->
|
</GridViewColumn>-->
|
||||||
<GridViewColumn Width="30" Header="数量">
|
<GridViewColumn Width="42" Header="数量">
|
||||||
<GridViewColumn.CellTemplate>
|
<GridViewColumn.CellTemplate>
|
||||||
<DataTemplate>
|
<DataTemplate>
|
||||||
<ListBox ItemsSource="{Binding OrderDetailList}" DisplayMemberPath="Quantity" materialDesign:ListBoxItemAssist.ShowSelection="False"></ListBox>
|
<ListBox ItemsSource="{Binding OrderDetailList}" DisplayMemberPath="Quantity" materialDesign:ListBoxItemAssist.ShowSelection="False"></ListBox>
|
||||||
|
@ -234,11 +233,10 @@
|
||||||
</ListView>
|
</ListView>
|
||||||
<!--</Grid>-->
|
<!--</Grid>-->
|
||||||
<!--<Grid Grid.Column="1" Grid.Row="1" Margin="0 0 0 0" HorizontalAlignment="Right">-->
|
<!--<Grid Grid.Column="1" Grid.Row="1" Margin="0 0 0 0" HorizontalAlignment="Right">-->
|
||||||
<ListView Grid.Column="1" Grid.Row="1" Margin="0 0 0 0"
|
<ListView Grid.Column="1" Grid.Row="1" Margin="0 0 3 0"
|
||||||
ItemsSource="{Binding TotalDrugList,UpdateSourceTrigger=PropertyChanged,Mode=TwoWay}"
|
ItemsSource="{Binding TotalDrugList,UpdateSourceTrigger=PropertyChanged,Mode=TwoWay}"
|
||||||
materialDesign:ListViewAssist.HeaderRowBackground="#31ccec"
|
materialDesign:ListViewAssist.HeaderRowBackground="#31ccec"
|
||||||
materialDesign:DataGridAssist.ColumnHeaderPadding="10"
|
materialDesign:ListViewAssist.ListViewItemPadding="0 16 0 15">
|
||||||
materialDesign:ListViewAssist.ListViewItemPadding="13">
|
|
||||||
<ListView.Resources>
|
<ListView.Resources>
|
||||||
<Style TargetType="{x:Type GridViewColumnHeader}" BasedOn="{StaticResource {x:Type GridViewColumnHeader}}">
|
<Style TargetType="{x:Type GridViewColumnHeader}" BasedOn="{StaticResource {x:Type GridViewColumnHeader}}">
|
||||||
<Setter Property="Foreground" Value="White" />
|
<Setter Property="Foreground" Value="White" />
|
||||||
|
@ -246,12 +244,12 @@
|
||||||
</ListView.Resources>
|
</ListView.Resources>
|
||||||
<ListView.View>
|
<ListView.View>
|
||||||
<GridView ColumnHeaderContainerStyle="{StaticResource st}">
|
<GridView ColumnHeaderContainerStyle="{StaticResource st}">
|
||||||
<GridViewColumn Width="100"
|
<GridViewColumn Width="180"
|
||||||
DisplayMemberBinding="{Binding DrugName}"
|
DisplayMemberBinding="{Binding DrugName}"
|
||||||
Header="药品名称"/>
|
Header="药品名称"/>
|
||||||
<GridViewColumn Width="30"
|
<GridViewColumn Width="40"
|
||||||
DisplayMemberBinding="{Binding TotalCount}"
|
DisplayMemberBinding="{Binding TotalCount}"
|
||||||
Header="合计数量"/>
|
Header="合计"/>
|
||||||
</GridView>
|
</GridView>
|
||||||
</ListView.View>
|
</ListView.View>
|
||||||
</ListView>
|
</ListView>
|
||||||
|
|
Loading…
Reference in New Issue