parent
cad28e30f1
commit
3e808f3806
|
@ -3,7 +3,8 @@
|
||||||
<connectionStrings>
|
<connectionStrings>
|
||||||
<!-- 数据库连接字符串 -->
|
<!-- 数据库连接字符串 -->
|
||||||
<!--<add name="database" connectionString="server=127.0.0.1;database=wpf_dm_program;userid=root;password=qq1223" />-->
|
<!--<add name="database" connectionString="server=127.0.0.1;database=wpf_dm_program;userid=root;password=qq1223" />-->
|
||||||
<add name="database" connectionString="server=127.0.0.1;port=3306;database=hkcdb;userid=root;password=root" />
|
<add name="database" connectionString="server=127.0.0.1;port=3306;database=wuhanxianchang_db;userid=root;password=root" />
|
||||||
|
<!--<add name="database" connectionString="server=127.0.0.1;port=3306;database=wuhan_db;userid=root;password=root" />-->
|
||||||
</connectionStrings>
|
</connectionStrings>
|
||||||
<!--<runtime>
|
<!--<runtime>
|
||||||
--><!--配置之后,Appdomain.CurrentDomain.UnhandledException 事件的 IsTerminating 就变成了 false 啦!也就是说,程序并不会因为这次的异常而崩溃退出。--><!--
|
--><!--配置之后,Appdomain.CurrentDomain.UnhandledException 事件的 IsTerminating 就变成了 false 啦!也就是说,程序并不会因为这次的异常而崩溃退出。--><!--
|
||||||
|
@ -20,7 +21,7 @@
|
||||||
<!-- 登录顺序,指定先登录的人的名称有效值,只有在登录模式等于2时才会生效; 发药人:【operator】审核人:【reviewer】 -->
|
<!-- 登录顺序,指定先登录的人的名称有效值,只有在登录模式等于2时才会生效; 发药人:【operator】审核人:【reviewer】 -->
|
||||||
<add key="firstLogin" value="operator" />
|
<add key="firstLogin" value="operator" />
|
||||||
<!-- 按处方还药或者按取药记录还药 1:处方(ReturnDrugWindow2)2:药品(ReturnDrugWindow)-->
|
<!-- 按处方还药或者按取药记录还药 1:处方(ReturnDrugWindow2)2:药品(ReturnDrugWindow)-->
|
||||||
<add key="returnDrugMode" value="1" />
|
<add key="returnDrugMode" value="2" />
|
||||||
<!-- 自动退出时间,单位秒,为0时不自动退出 -->
|
<!-- 自动退出时间,单位秒,为0时不自动退出 -->
|
||||||
<add key="autoExit" value="0"/>
|
<add key="autoExit" value="0"/>
|
||||||
|
|
||||||
|
@ -36,9 +37,9 @@
|
||||||
<!-- 抽屉串口使用的协议232或者485 -->
|
<!-- 抽屉串口使用的协议232或者485 -->
|
||||||
<add key="DrawerProtocol" value="485" />
|
<add key="DrawerProtocol" value="485" />
|
||||||
<!-- 抽屉串口的串口号 -->
|
<!-- 抽屉串口的串口号 -->
|
||||||
<add key="DrawerPortPath" value="COM4" />
|
<add key="DrawerPortPath" value="COM1" />
|
||||||
<!-- can总线串口的串口号 -->
|
<!-- can总线串口的串口号 -->
|
||||||
<add key="CanBusPortPath" value="COM13" />
|
<add key="CanBusPortPath" value="COM6" />
|
||||||
<!-- 条码枪串口的串口号 -->
|
<!-- 条码枪串口的串口号 -->
|
||||||
<add key="ScanCodePortPath" value="COM8" />
|
<add key="ScanCodePortPath" value="COM8" />
|
||||||
<!-- 抽屉串口的串口号 --><!--
|
<!-- 抽屉串口的串口号 --><!--
|
||||||
|
|
|
@ -204,6 +204,7 @@ namespace DM_Weight
|
||||||
containerRegistry.RegisterForNavigation<MachineRecordWindow, MachineRecordWindowViewModel>();
|
containerRegistry.RegisterForNavigation<MachineRecordWindow, MachineRecordWindowViewModel>();
|
||||||
|
|
||||||
containerRegistry.RegisterForNavigation<ShowMessageDialog, ShowMessageDialogViewModel>();
|
containerRegistry.RegisterForNavigation<ShowMessageDialog, ShowMessageDialogViewModel>();
|
||||||
|
containerRegistry.RegisterForNavigation<ConfirmMessageDialog, ConfirmMessageDialogViewModel>();
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -88,7 +88,6 @@ namespace DM_Weight.Models
|
||||||
///</summary>
|
///</summary>
|
||||||
[SugarColumn(ColumnName = "state")]
|
[SugarColumn(ColumnName = "state")]
|
||||||
public int? State { get; set; }
|
public int? State { get; set; }
|
||||||
|
|
||||||
[SugarColumn(IsIgnore = true)]
|
[SugarColumn(IsIgnore = true)]
|
||||||
public bool IsSelected { get; set; }
|
public bool IsSelected { get; set; }
|
||||||
|
|
||||||
|
|
|
@ -480,6 +480,7 @@ namespace DM_Weight.Port
|
||||||
byte[] bytes = await CheckRecoverQuantity();
|
byte[] bytes = await CheckRecoverQuantity();
|
||||||
|
|
||||||
int[] r1 = bytes.Select(it => Convert.ToInt32(it)).ToArray();
|
int[] r1 = bytes.Select(it => Convert.ToInt32(it)).ToArray();
|
||||||
|
logger.Info($"回收箱查数返回{string.Join(",",r1)}");
|
||||||
// 返回消息库位关闭,放入空瓶数量
|
// 返回消息库位关闭,放入空瓶数量
|
||||||
int[] quantitys = r1.Skip(3).Take(3).ToArray();
|
int[] quantitys = r1.Skip(3).Take(3).ToArray();
|
||||||
int index = ColNos[0] % 3 > 0 ? ColNos[0] % 3 - 1 : 2;
|
int index = ColNos[0] % 3 > 0 ? ColNos[0] % 3 - 1 : 2;
|
||||||
|
@ -492,8 +493,8 @@ namespace DM_Weight.Port
|
||||||
_eventAggregator.GetEvent<PortUtilEvent>().Publish(new util.DeviceMsg()
|
_eventAggregator.GetEvent<PortUtilEvent>().Publish(new util.DeviceMsg()
|
||||||
{
|
{
|
||||||
EventType = util.EventType.DRAWERCLOSE,
|
EventType = util.EventType.DRAWERCLOSE,
|
||||||
//Quantitys = new int[] { InCount },
|
Quantitys = new int[] { InCount },
|
||||||
Quantitys = quantitys,
|
//Quantitys = quantitys,
|
||||||
WindowName = _WindowName,
|
WindowName = _WindowName,
|
||||||
});
|
});
|
||||||
//// 重新初始化数据
|
//// 重新初始化数据
|
||||||
|
@ -648,8 +649,8 @@ namespace DM_Weight.Port
|
||||||
private byte[] GetBufferByPort(SerialPort serialPort, int length, int timeout)
|
private byte[] GetBufferByPort(SerialPort serialPort, int length, int timeout)
|
||||||
{
|
{
|
||||||
byte[] buffer = new byte[length];
|
byte[] buffer = new byte[length];
|
||||||
try
|
//try
|
||||||
{
|
//{
|
||||||
int _length = 0;
|
int _length = 0;
|
||||||
DateTime start = DateTime.Now;
|
DateTime start = DateTime.Now;
|
||||||
DateTime end = DateTime.Now;
|
DateTime end = DateTime.Now;
|
||||||
|
@ -663,11 +664,11 @@ namespace DM_Weight.Port
|
||||||
throw new TimeoutException($"串口【{serialPort.PortName}】交互超时");
|
throw new TimeoutException($"串口【{serialPort.PortName}】交互超时");
|
||||||
}
|
}
|
||||||
serialPort.Read(buffer, 0, length);
|
serialPort.Read(buffer, 0, length);
|
||||||
}
|
//}
|
||||||
catch (Exception ex)
|
//catch (Exception ex)
|
||||||
{
|
//{
|
||||||
logger.Error($"GetBufferByPort:{ex.Message}");
|
// logger.Error($"GetBufferByPort:{ex.Message}");
|
||||||
}
|
//}
|
||||||
return buffer;
|
return buffer;
|
||||||
}
|
}
|
||||||
private Task<byte[]> GetBufferByPort(SerialPort serialPort, int length)
|
private Task<byte[]> GetBufferByPort(SerialPort serialPort, int length)
|
||||||
|
@ -1150,10 +1151,10 @@ namespace DM_Weight.Port
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
canBusSerial.DiscardInBuffer();
|
canBusSerial.DiscardInBuffer();
|
||||||
//byte[] buffer = new byte[] { 0xAA, 0x9A, (byte)(ColNos[0] > 3 ? 2 : 1), 0x00, 0x00, 0x00, 0x00, 0xEE };
|
byte[] buffer = new byte[] { 0xAA, 0x9A, (byte)(ColNos[0] > 3 ? 2 : 1), 0x00, 0x00, 0x00, 0x00, 0xEE };
|
||||||
byte[] buffer = new byte[] { 0xAA, 0x9A, 01,(byte)(ColNos[0] > 3 ? 2 : 1), 0x00, 0x00, 0x00,0xEE };
|
//byte[] buffer = new byte[] { 0xAA, 0x9A, 01,(byte)(ColNos[0] > 3 ? 2 : 1), 0x00, 0x00, 0x00,0xEE };
|
||||||
canBusSerial.Write(buffer, 0, 8);
|
canBusSerial.Write(buffer, 0, 8);
|
||||||
|
logger.Info($"回收箱数量查询发{string.Join(",",buffer)}");
|
||||||
return await GetBufferByPort(canBusSerial, 8);
|
return await GetBufferByPort(canBusSerial, 8);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,51 @@
|
||||||
|
using Prism.Commands;
|
||||||
|
using Prism.Mvvm;
|
||||||
|
using Prism.Services.Dialogs;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel;
|
||||||
|
using System.DirectoryServices.Protocols;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Windows.Interop;
|
||||||
|
|
||||||
|
namespace DM_Weight.ViewModels
|
||||||
|
{
|
||||||
|
internal class ConfirmMessageDialogViewModel :BindableBase, IDialogAware
|
||||||
|
{
|
||||||
|
public string Title => "确认";
|
||||||
|
|
||||||
|
private string _msg;
|
||||||
|
public string Msg { get => _msg; set { SetProperty(ref _msg, value); } }
|
||||||
|
public event Action<IDialogResult> RequestClose;
|
||||||
|
|
||||||
|
public bool CanCloseDialog()
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void OnDialogClosed()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
public void OnDialogOpened(IDialogParameters parameters)
|
||||||
|
{
|
||||||
|
if (parameters.ContainsKey("msgInfo"))
|
||||||
|
{
|
||||||
|
List<string> strPara = parameters.GetValue<List<string>>("msgInfo");
|
||||||
|
Msg = strPara[0];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public DelegateCommand NoCommand { get => new DelegateCommand(NoAction);}
|
||||||
|
public DelegateCommand YesCommand { get => new DelegateCommand(YesAction); }
|
||||||
|
private void NoAction()
|
||||||
|
{
|
||||||
|
RequestClose?.Invoke(new DialogResult(ButtonResult.No));
|
||||||
|
}
|
||||||
|
private void YesAction()
|
||||||
|
{
|
||||||
|
RequestClose?.Invoke(new DialogResult(ButtonResult.Yes));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -145,8 +145,7 @@ namespace DM_Weight.ViewModels
|
||||||
_portUtil.BoardType = singleChannels.Count > 0 ? singleChannels[0].BoardType : 1;
|
_portUtil.BoardType = singleChannels.Count > 0 ? singleChannels[0].BoardType : 1;
|
||||||
_portUtil.ColNos = singleChannels.Select(it => it.ColNo).ToArray();
|
_portUtil.ColNos = singleChannels.Select(it => it.ColNo).ToArray();
|
||||||
_portUtil.DrawerNo = DrawerNo;
|
_portUtil.DrawerNo = DrawerNo;
|
||||||
Dispatcher.CurrentDispatcher.BeginInvoke(DispatcherPriority.Normal, () => _portUtil.Start())
|
Dispatcher.CurrentDispatcher.BeginInvoke(DispatcherPriority.Normal, () => _portUtil.Start());
|
||||||
;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
|
@ -127,20 +127,20 @@ namespace DM_Weight.ViewModels
|
||||||
get { return _selectedMenu; }
|
get { return _selectedMenu; }
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
if (value != null)
|
//if (value != null)
|
||||||
{
|
//{
|
||||||
if (value.PremissionName == "退出")
|
// if (value.PremissionName == "退出")
|
||||||
{
|
// {
|
||||||
logger.Info($"用户【{Operator?.Nickname}】退出登录");
|
// logger.Info($"用户【{Operator?.Nickname}】退出登录");
|
||||||
Operator = null;
|
// Operator = null;
|
||||||
Reviewer = null;
|
// Reviewer = null;
|
||||||
_regionManager.RequestNavigate("MainRegion", "LoginWindow");
|
// _regionManager.RequestNavigate("MainRegion", "LoginWindow");
|
||||||
}
|
// }
|
||||||
else
|
// else
|
||||||
{
|
// {
|
||||||
SelectedChildMenu = value.Children[0];
|
// SelectedChildMenu = value.Children[0];
|
||||||
}
|
// }
|
||||||
}
|
//}
|
||||||
SetProperty(ref _selectedMenu, value);
|
SetProperty(ref _selectedMenu, value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -162,7 +162,7 @@ namespace DM_Weight.ViewModels
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
SelectedMenu.Children = SelectedMenu.Children;
|
//SelectedMenu.Children = SelectedMenu.Children;
|
||||||
SelectedChildMenu = SelectedMenu.Children[0];
|
SelectedChildMenu = SelectedMenu.Children[0];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -275,6 +275,7 @@ namespace DM_Weight.ViewModels
|
||||||
//.ToTree(pd => pd.Children, pd => pd.ParentId, 0);
|
//.ToTree(pd => pd.Children, pd => pd.ParentId, 0);
|
||||||
PremissionDmList = premissions;
|
PremissionDmList = premissions;
|
||||||
SelectedMenu = premissions[0];
|
SelectedMenu = premissions[0];
|
||||||
|
SelectedChildMenu = SelectedMenu.Children[0];
|
||||||
FindDrawerCount();
|
FindDrawerCount();
|
||||||
|
|
||||||
int autoExit = Convert.ToInt32(ConfigurationManager.AppSettings["autoExit"] ?? "0");
|
int autoExit = Convert.ToInt32(ConfigurationManager.AppSettings["autoExit"] ?? "0");
|
||||||
|
|
|
@ -51,7 +51,7 @@ namespace DM_Weight.ViewModels
|
||||||
//get => loginMode == 2;
|
//get => loginMode == 2;
|
||||||
get => ReadAppSetting("loginMode") == "2";
|
get => ReadAppSetting("loginMode") == "2";
|
||||||
}
|
}
|
||||||
private FingerprintUtil _fingerprintUtil;
|
//private FingerprintUtil _fingerprintUtil;
|
||||||
|
|
||||||
private PortUtil _portUtil;
|
private PortUtil _portUtil;
|
||||||
|
|
||||||
|
@ -105,7 +105,7 @@ _exitCommand ??= new DelegateCommand(Exit);
|
||||||
|
|
||||||
public bool KeepAlive => false;
|
public bool KeepAlive => false;
|
||||||
|
|
||||||
void Login()
|
void Login()
|
||||||
{
|
{
|
||||||
LoginBtnEnable = false;
|
LoginBtnEnable = false;
|
||||||
if (!string.IsNullOrEmpty(Username) && !string.IsNullOrEmpty(Password))
|
if (!string.IsNullOrEmpty(Username) && !string.IsNullOrEmpty(Password))
|
||||||
|
@ -278,7 +278,7 @@ _exitCommand ??= new DelegateCommand(Exit);
|
||||||
RaisePropertyChanged("Reviewer");
|
RaisePropertyChanged("Reviewer");
|
||||||
}
|
}
|
||||||
Username = string.Empty;
|
Username = string.Empty;
|
||||||
Password =string.Empty;
|
Password = string.Empty;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -183,9 +183,10 @@ namespace DM_Weight.ViewModels
|
||||||
.Includes<DrugInfo>(mr => mr.DrugInfo)
|
.Includes<DrugInfo>(mr => mr.DrugInfo)
|
||||||
.Includes<UserList>(mr => mr.User)
|
.Includes<UserList>(mr => mr.User)
|
||||||
.WhereIF(Type == 3, (mr) => new int[] { 31, 32 }.Contains(mr.Type))
|
.WhereIF(Type == 3, (mr) => new int[] { 31, 32 }.Contains(mr.Type))
|
||||||
.WhereIF(Type != 3, (mr) => mr.Type == Type )
|
.WhereIF(Type != 3, (mr) => mr.Type == Type)
|
||||||
.WhereIF(StartDate !=null, (mr) => mr.OperationTime > StartDate)
|
.WhereIF(StartDate != null, (mr) => mr.OperationTime > StartDate)
|
||||||
.WhereIF(EndDate!=null, (mr) => mr.OperationTime < EndDate)
|
.WhereIF(EndDate != null, (mr) => mr.OperationTime < EndDate)
|
||||||
|
.OrderBy(mr => mr.OperationTime, OrderByType.Desc)
|
||||||
//.Select(mr => mr)
|
//.Select(mr => mr)
|
||||||
.ToPageList(PageNum, PageSize, ref totalCount);
|
.ToPageList(PageNum, PageSize, ref totalCount);
|
||||||
//.ToList();
|
//.ToList();
|
||||||
|
|
|
@ -11,6 +11,7 @@ using System.Threading.Tasks;
|
||||||
using DM_Weight.Models;
|
using DM_Weight.Models;
|
||||||
using DM_Weight.select;
|
using DM_Weight.select;
|
||||||
using DM_Weight.util;
|
using DM_Weight.util;
|
||||||
|
using SqlSugar;
|
||||||
|
|
||||||
namespace DM_Weight.ViewModels
|
namespace DM_Weight.ViewModels
|
||||||
{
|
{
|
||||||
|
@ -190,7 +191,7 @@ namespace DM_Weight.ViewModels
|
||||||
.WhereIF(!String.IsNullOrEmpty(SearchValue) && SelectedItem.Code.Equals("DrugName"), (mr) => mr.DrugInfo.DrugName.Contains(SearchValue))
|
.WhereIF(!String.IsNullOrEmpty(SearchValue) && SelectedItem.Code.Equals("DrugName"), (mr) => mr.DrugInfo.DrugName.Contains(SearchValue))
|
||||||
.WhereIF(!String.IsNullOrEmpty(SearchValue) && SelectedItem.Code.Equals("PyCode"), (mr) => mr.DrugInfo.PyCode.Contains(SearchValue))
|
.WhereIF(!String.IsNullOrEmpty(SearchValue) && SelectedItem.Code.Equals("PyCode"), (mr) => mr.DrugInfo.PyCode.Contains(SearchValue))
|
||||||
.WhereIF(!String.IsNullOrEmpty(SearchValue) && SelectedItem.Code.Equals("DrugBarcode"), (mr) => mr.DrugInfo.DrugBarcode.Contains(SearchValue))
|
.WhereIF(!String.IsNullOrEmpty(SearchValue) && SelectedItem.Code.Equals("DrugBarcode"), (mr) => mr.DrugInfo.DrugBarcode.Contains(SearchValue))
|
||||||
.OrderBy(mr => mr.OperationTime)
|
.OrderBy(mr => mr.OperationTime,OrderByType.Desc)
|
||||||
.ToList();
|
.ToList();
|
||||||
MachineRecords = queryData;
|
MachineRecords = queryData;
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,6 +18,8 @@ using DM_Weight.msg;
|
||||||
using DM_Weight.Port;
|
using DM_Weight.Port;
|
||||||
using DM_Weight.util;
|
using DM_Weight.util;
|
||||||
using DM_Weight.Views;
|
using DM_Weight.Views;
|
||||||
|
using SqlSugar;
|
||||||
|
using System.Threading.Channels;
|
||||||
|
|
||||||
namespace DM_Weight.ViewModels
|
namespace DM_Weight.ViewModels
|
||||||
{
|
{
|
||||||
|
@ -67,11 +69,11 @@ namespace DM_Weight.ViewModels
|
||||||
Status = 3;
|
Status = 3;
|
||||||
if(ChannelStock.DrawerType == 3)
|
if(ChannelStock.DrawerType == 3)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < msg.Quantitys.Length; i++)
|
//for (int i = 0; i < msg.Quantitys.Length; i++)
|
||||||
{
|
//{
|
||||||
ReturnQuantity += msg.Quantitys[i];
|
// ReturnQuantity += msg.Quantitys[i];
|
||||||
}
|
//}
|
||||||
//ReturnQuantity = msg.Quantitys[0];
|
ReturnQuantity = msg.Quantitys[0];
|
||||||
logger.Info($"抽屉【{ChannelStock.DrawerNo}】回收库位药品数量增加【{msg.Quantitys[0]}】");
|
logger.Info($"抽屉【{ChannelStock.DrawerNo}】回收库位药品数量增加【{msg.Quantitys[0]}】");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -136,7 +138,13 @@ namespace DM_Weight.ViewModels
|
||||||
SetProperty(ref _machineRecords, value);
|
SetProperty(ref _machineRecords, value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
private MachineRecord _machineRecord;
|
||||||
|
|
||||||
|
public MachineRecord MachineRecordStock
|
||||||
|
{
|
||||||
|
get { return _machineRecord; }
|
||||||
|
set { SetProperty(ref _machineRecord, value); }
|
||||||
|
}
|
||||||
private ChannelStock _channelStock;
|
private ChannelStock _channelStock;
|
||||||
|
|
||||||
public ChannelStock ChannelStock
|
public ChannelStock ChannelStock
|
||||||
|
@ -176,7 +184,7 @@ namespace DM_Weight.ViewModels
|
||||||
.Where(mr => mr.MachineId.Equals(ConfigurationManager.AppSettings["machineId"] ?? "DM1"))
|
.Where(mr => mr.MachineId.Equals(ConfigurationManager.AppSettings["machineId"] ?? "DM1"))
|
||||||
.Where(mr => mr.Type == 2)
|
.Where(mr => mr.Type == 2)
|
||||||
.Where(mr => mr.Status != 2)
|
.Where(mr => mr.Status != 2)
|
||||||
.OrderBy(mr => mr.OperationTime)
|
.OrderBy(mr => mr.OperationTime,OrderByType.Desc)
|
||||||
.OrderBy(mr => mr.Id)
|
.OrderBy(mr => mr.Id)
|
||||||
.ToList();
|
.ToList();
|
||||||
MachineRecords = queryData;
|
MachineRecords = queryData;
|
||||||
|
@ -219,7 +227,25 @@ namespace DM_Weight.ViewModels
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public DelegateCommand RowSelected
|
||||||
|
{
|
||||||
|
get => new DelegateCommand(() =>
|
||||||
|
{
|
||||||
|
if (MachineRecords != null)
|
||||||
|
{
|
||||||
|
MachineRecords = MachineRecords.Select(x =>
|
||||||
|
{
|
||||||
|
if (x.Id == MachineRecordStock.Id)
|
||||||
|
{
|
||||||
|
x.IsSelected = !x.IsSelected;
|
||||||
|
}
|
||||||
|
return x;
|
||||||
|
}).ToList();
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
private bool _isFinishClick = false;
|
private bool _isFinishClick = false;
|
||||||
|
|
||||||
public bool IsFinishClick { get => _isFinishClick; set => SetProperty(ref _isFinishClick, value); }
|
public bool IsFinishClick { get => _isFinishClick; set => SetProperty(ref _isFinishClick, value); }
|
||||||
|
@ -259,7 +285,7 @@ namespace DM_Weight.ViewModels
|
||||||
ReturnQuantity2 = _MachineRecord.Quantity - _MachineRecord.ReturnQuantity1,
|
ReturnQuantity2 = _MachineRecord.Quantity - _MachineRecord.ReturnQuantity1,
|
||||||
Id = _MachineRecord.Id,
|
Id = _MachineRecord.Id,
|
||||||
Status = 2,
|
Status = 2,
|
||||||
}).UpdateColumns(it => new { it.ReturnQuantity1, it.Status }).ExecuteCommand();
|
}).UpdateColumns(it => new { it.ReturnQuantity2, it.Status }).ExecuteCommand();
|
||||||
|
|
||||||
// 保存数据 还药空瓶记录
|
// 保存数据 还药空瓶记录
|
||||||
SqlSugarHelper.Db.Insertable(new MachineRecord()
|
SqlSugarHelper.Db.Insertable(new MachineRecord()
|
||||||
|
@ -268,7 +294,8 @@ namespace DM_Weight.ViewModels
|
||||||
DrawerNo = ChannelStock.DrawerNo,
|
DrawerNo = ChannelStock.DrawerNo,
|
||||||
ColNo = ChannelStock.ColNo,
|
ColNo = ChannelStock.ColNo,
|
||||||
DrugId = ChannelStock.DrugId,
|
DrugId = ChannelStock.DrugId,
|
||||||
ManuNo = ChannelStock.ManuNo,
|
//ManuNo = ChannelStock.ManuNo,
|
||||||
|
ManuNo = _MachineRecord.ManuNo,
|
||||||
EffDate = !String.IsNullOrEmpty(ChannelStock.EffDate) ? DateTime.ParseExact(ChannelStock.EffDate, "yyyy-MM-dd", System.Globalization.CultureInfo.CurrentCulture) : null,
|
EffDate = !String.IsNullOrEmpty(ChannelStock.EffDate) ? DateTime.ParseExact(ChannelStock.EffDate, "yyyy-MM-dd", System.Globalization.CultureInfo.CurrentCulture) : null,
|
||||||
Operator = HomeWindowViewModel.Operator?.Id,
|
Operator = HomeWindowViewModel.Operator?.Id,
|
||||||
Reviewer = HomeWindowViewModel.Reviewer?.Id,
|
Reviewer = HomeWindowViewModel.Reviewer?.Id,
|
||||||
|
|
|
@ -12,13 +12,17 @@ using DM_Weight.Models;
|
||||||
using DM_Weight.util;
|
using DM_Weight.util;
|
||||||
using System.Reflection.PortableExecutable;
|
using System.Reflection.PortableExecutable;
|
||||||
using System.Configuration;
|
using System.Configuration;
|
||||||
|
using DM_Weight.msg;
|
||||||
|
using Prism.Events;
|
||||||
|
using DM_Weight.Port;
|
||||||
|
using System.Threading.Channels;
|
||||||
|
|
||||||
namespace DM_Weight.ViewModels
|
namespace DM_Weight.ViewModels
|
||||||
{
|
{
|
||||||
public class ReturnEmptyWindowViewModel : BindableBase, IConfirmNavigationRequest, IRegionMemberLifetime
|
public class ReturnEmptyWindowViewModel : BindableBase, IConfirmNavigationRequest, IRegionMemberLifetime
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private List<ChannelStock>? _channelStocks;
|
private List<ChannelStock>? _channelStocks;
|
||||||
|
|
||||||
|
@ -35,34 +39,225 @@ namespace DM_Weight.ViewModels
|
||||||
get { return _channelStock; }
|
get { return _channelStock; }
|
||||||
set { SetProperty(ref _channelStock, value); }
|
set { SetProperty(ref _channelStock, value); }
|
||||||
}
|
}
|
||||||
|
public event Action<IDialogResult> RequestClose;
|
||||||
IDialogService _dialogService;
|
IDialogService _dialogService;
|
||||||
public ReturnEmptyWindowViewModel(IDialogService dialogService)
|
IEventAggregator _eventAggregator;
|
||||||
|
public ReturnEmptyWindowViewModel(IDialogService dialogService, IEventAggregator eventAggregator)
|
||||||
{
|
{
|
||||||
_dialogService = dialogService;
|
_dialogService = dialogService;
|
||||||
|
_eventAggregator = eventAggregator;
|
||||||
}
|
}
|
||||||
|
|
||||||
public DelegateCommand RowSelected
|
public DelegateCommand RowSelected
|
||||||
{
|
{
|
||||||
get => new DelegateCommand(() =>
|
get => new DelegateCommand(() =>
|
||||||
{
|
{
|
||||||
|
if (Channel != null && Channel.DrugId != null)
|
||||||
if (Channel != null && Channel.DrugId == null)
|
|
||||||
{
|
{
|
||||||
|
Channels = Channels.Select(x =>
|
||||||
|
{
|
||||||
|
if (x.Id == Channel.Id)
|
||||||
|
{
|
||||||
|
x.IsSelected = !x.IsSelected;
|
||||||
|
}
|
||||||
|
return x;
|
||||||
|
}).ToList();
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
else if(Channel != null && Channel.DrugId == null)
|
||||||
|
{
|
||||||
|
|
||||||
DialogParameters dialogParameters = new DialogParameters();
|
DialogParameters dialogParameters = new DialogParameters();
|
||||||
dialogParameters.Add("DrawerNo", Channel.DrawerNo);
|
dialogParameters.Add("DrawerNo", Channel.DrawerNo);
|
||||||
DialogServiceExtensions.ShowDialogHost(_dialogService, "BindingChannelDialog", dialogParameters, DoDialogResult, "RootDialog");
|
DialogServiceExtensions.ShowDialogHost(_dialogService, "BindingChannelDialog", dialogParameters, DoDialogResult, "RootDialog");
|
||||||
}
|
}
|
||||||
else if(Channel != null && Channel.CanReturnQuantity > 0)
|
|
||||||
|
//if (Channel != null && Channel.DrugId == null)
|
||||||
|
//{
|
||||||
|
// DialogParameters dialogParameters = new DialogParameters();
|
||||||
|
// dialogParameters.Add("DrawerNo", Channel.DrawerNo);
|
||||||
|
// DialogServiceExtensions.ShowDialogHost(_dialogService, "BindingChannelDialog", dialogParameters, DoDialogResult, "RootDialog");
|
||||||
|
//}
|
||||||
|
//else if (Channel != null && Channel.CanReturnQuantity > 0)
|
||||||
|
//{
|
||||||
|
// DialogParameters dialogParameters = new DialogParameters();
|
||||||
|
// dialogParameters.Add("channel", Channel);
|
||||||
|
// DialogServiceExtensions.ShowDialogHost(_dialogService, "ReturnEmptyDialog", dialogParameters, DoDialogResult, "RootDialog");
|
||||||
|
//}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
//还空瓶
|
||||||
|
public DelegateCommand ReturnEmptyCommand
|
||||||
|
{
|
||||||
|
get => new DelegateCommand(() =>
|
||||||
|
{
|
||||||
|
List<ChannelStock> records = Channels.FindAll(it => it.IsSelected).ToList();
|
||||||
|
if (records.Count > 0)
|
||||||
{
|
{
|
||||||
DialogParameters dialogParameters = new DialogParameters();
|
if(records.Count > 1&&records.FindAll(rs=>rs.CanReturnQuantity>0).Count>1)
|
||||||
dialogParameters.Add("channel", Channel);
|
{
|
||||||
DialogServiceExtensions.ShowDialogHost(_dialogService, "ReturnEmptyDialog", dialogParameters, DoDialogResult, "RootDialog");
|
//还空瓶只能选择一条进行归还
|
||||||
|
AlertMsg alertMsg = new AlertMsg
|
||||||
|
{
|
||||||
|
Message = "请选择一条可归还数量不为0的数据进行归还",
|
||||||
|
Type = MsgType.ERROR,
|
||||||
|
};
|
||||||
|
_eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
DialogParameters dialogParameters = new DialogParameters();
|
||||||
|
dialogParameters.Add("channel", records.Single(rs => rs.CanReturnQuantity > 0));
|
||||||
|
DialogServiceExtensions.ShowDialogHost(_dialogService, "ReturnEmptyDialog", dialogParameters, DoDialogResult, "RootDialog");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
AlertMsg alertMsg = new AlertMsg
|
||||||
|
{
|
||||||
|
Message = "请选择要还的空瓶",
|
||||||
|
Type = MsgType.ERROR,
|
||||||
|
};
|
||||||
|
_eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
private List<ChannelStock> csList=new List<ChannelStock>();
|
||||||
|
//销毁
|
||||||
|
public DelegateCommand DestoryCommand
|
||||||
|
{
|
||||||
|
get => new DelegateCommand(() =>
|
||||||
|
{
|
||||||
|
if (Channels != null && Channels.Count > 0)
|
||||||
|
{
|
||||||
|
csList = Channels.FindAll(it => it.IsSelected && it.Quantity > 0).ToList();
|
||||||
|
if (csList != null && csList.Count > 0)
|
||||||
|
{
|
||||||
|
//RequestClose?.Invoke(new DialogResult(ButtonResult.Cancel));
|
||||||
|
//DialogParameters dialogParameters = new DialogParameters();
|
||||||
|
//List<string> msg = new List<string>();
|
||||||
|
//msg.Add("确认");
|
||||||
|
//msg.Add("确认要销毁吗?");
|
||||||
|
//dialogParameters.Add("msgInfo", msg);
|
||||||
|
//DialogServiceExtensions.ShowDialogHost(_dialogService, "ConfirmMessageDialog", dialogParameters, DestoryDialogResult, "RootDialog");
|
||||||
|
|
||||||
|
csList.ForEach(it => it.Quantity = 0);
|
||||||
|
var f = SqlSugarHelper.Db.UseTran(() =>
|
||||||
|
{
|
||||||
|
SqlSugarHelper.Db.Updateable(csList).ExecuteCommand();
|
||||||
|
string[] str=new string[csList.Count];
|
||||||
|
str=csList.Select(t=>t.DrugId).ToArray();
|
||||||
|
List<MachineRecord> machines = SqlSugarHelper.Db.Queryable<MachineRecord>()
|
||||||
|
//.InnerJoin<ChannelStock>((mr, cs) => mr.DrugId == cs.DrugId)
|
||||||
|
//.Where(mr => mr.DrugId.Contains(csList.Select(it => it.DrugId).ToList()) && mr.Type = 32)
|
||||||
|
.Where(mr => mr.MachineId.Equals(ConfigurationManager.AppSettings["machineId"] ?? "DM1"))
|
||||||
|
.In(mr=>mr.DrugId, str)
|
||||||
|
.Where(mr => mr.Type == 32)
|
||||||
|
.ToList();
|
||||||
|
SqlSugarHelper.Db.Updateable(machines).ReSetValue(mr =>
|
||||||
|
{
|
||||||
|
mr.IsDestroy = 1;
|
||||||
|
}).ExecuteCommand();
|
||||||
|
return true;
|
||||||
|
});
|
||||||
|
if (f.Data)
|
||||||
|
{
|
||||||
|
|
||||||
|
RequestData();
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
AlertMsg alertMsg = new AlertMsg
|
||||||
|
{
|
||||||
|
Message = "未勾选要销毁的数据或勾选的数据库存为0",
|
||||||
|
Type = MsgType.ERROR,
|
||||||
|
};
|
||||||
|
_eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
AlertMsg alertMsg = new AlertMsg
|
||||||
|
{
|
||||||
|
Message = "没有要操作销毁的数据",
|
||||||
|
Type = MsgType.ERROR,
|
||||||
|
};
|
||||||
|
_eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
private void DestoryDialogResult(IDialogResult dialogResult)
|
||||||
|
{
|
||||||
|
if(dialogResult.Result==ButtonResult.Yes)
|
||||||
|
{
|
||||||
|
DestoryAction();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//执行销毁操作
|
||||||
|
private void DestoryAction()
|
||||||
|
{
|
||||||
|
if (csList != null && csList.Count > 0)
|
||||||
|
{
|
||||||
|
csList.ForEach(it => it.Quantity = 0);
|
||||||
|
var f = SqlSugarHelper.Db.UseTran(() =>
|
||||||
|
{
|
||||||
|
SqlSugarHelper.Db.Updateable(csList).ExecuteCommand();
|
||||||
|
|
||||||
|
List<MachineRecord> machines = SqlSugarHelper.Db.Queryable<MachineRecord>()
|
||||||
|
.InnerJoin<ChannelStock>((mr, cs) => mr.DrugId == cs.DrugId)
|
||||||
|
//.Where(mr => mr.DrugId.Contains(csList.Select(it => it.DrugId).ToList()) && mr.Type = 32)
|
||||||
|
.Where(mr => mr.MachineId.Equals(ConfigurationManager.AppSettings["machineId"] ?? "DM1"))
|
||||||
|
.Where(mr => mr.Type == 32)
|
||||||
|
.ToList();
|
||||||
|
SqlSugarHelper.Db.Updateable(machines).ReSetValue(mr =>
|
||||||
|
{
|
||||||
|
mr.IsDestroy = 1;
|
||||||
|
}).ExecuteCommand();
|
||||||
|
return true;
|
||||||
|
});
|
||||||
|
if (f.Data)
|
||||||
|
{
|
||||||
|
|
||||||
|
RequestData();
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void DoDialogResult(IDialogResult dialogResult)
|
private void DoDialogResult(IDialogResult dialogResult)
|
||||||
{
|
{
|
||||||
// 委托 被动执行 被子窗口执行
|
// 委托 被动执行 被子窗口执行
|
||||||
|
@ -100,10 +295,11 @@ namespace DM_Weight.ViewModels
|
||||||
{
|
{
|
||||||
|
|
||||||
Channels = SqlSugarHelper.Db.Queryable<ChannelStock>()
|
Channels = SqlSugarHelper.Db.Queryable<ChannelStock>()
|
||||||
.LeftJoin<DrugInfo>((cs,di) => cs.DrugId == di.DrugId.ToString())
|
.LeftJoin<DrugInfo>((cs, di) => cs.DrugId == di.DrugId.ToString())
|
||||||
.Where((cs) => cs.DrawerType != 1&& cs.MachineId.Equals(ConfigurationManager.AppSettings["machineId"] ?? "DM1"))
|
.Where((cs) => cs.DrawerType != 1 && cs.MachineId.Equals(ConfigurationManager.AppSettings["machineId"] ?? "DM1"))
|
||||||
.Select((cs, di) => new ChannelStock{
|
.Select((cs, di) => new ChannelStock
|
||||||
CanReturnQuantity = SqlFunc.Subqueryable<MachineRecord>().Where(mr => mr.DrugId == cs.DrugId).Where(mr => mr.Type == 2).Where(mr => mr.Status != 2).Select(mr => SqlFunc.IsNull(SqlFunc.AggregateSumNoNull(mr.Quantity - mr.ReturnQuantity1 - mr.ReturnQuantity2), 0)) ,
|
{
|
||||||
|
CanReturnQuantity = SqlFunc.Subqueryable<MachineRecord>().Where(mr => mr.DrugId == cs.DrugId).Where(mr => mr.Type == 2).Where(mr => mr.Status != 2).Select(mr => SqlFunc.IsNull(SqlFunc.AggregateSumNoNull(mr.Quantity - mr.ReturnQuantity1 - mr.ReturnQuantity2), 0)),
|
||||||
DrugInfo = new DrugInfo
|
DrugInfo = new DrugInfo
|
||||||
{
|
{
|
||||||
DrugId = di.DrugId,
|
DrugId = di.DrugId,
|
||||||
|
|
|
@ -0,0 +1,25 @@
|
||||||
|
<UserControl x:Class="DM_Weight.Views.Dialog.ConfirmMessageDialog"
|
||||||
|
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"
|
||||||
|
mc:Ignorable="d"
|
||||||
|
d:DesignHeight="450" d:DesignWidth="800">
|
||||||
|
<Grid>
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="auto"/>
|
||||||
|
<RowDefinition/>
|
||||||
|
<RowDefinition Height="auto"/>
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
<TextBlock Padding="5" d:Text="确认" FontSize="14"
|
||||||
|
Text="{Binding Title}" Style="{StaticResource MaterialDesignCaptionTextBlock}"/>
|
||||||
|
<TextBlock Grid.Row="1" Padding="15,0" HorizontalAlignment="Center" VerticalAlignment="Center"
|
||||||
|
Text="{Binding Msg}" FontSize="18" Margin="5" FontWeight="Bold"/>
|
||||||
|
<StackPanel Grid.Row="2" Margin="10" HorizontalAlignment="Center" Orientation="Horizontal">
|
||||||
|
<Button Command="{Binding YesCommand}" Content="是"/>
|
||||||
|
<Grid Width="10"></Grid>
|
||||||
|
<Button Command="{Binding NoCommand}" Content="否"/>
|
||||||
|
</StackPanel>
|
||||||
|
</Grid>
|
||||||
|
</UserControl>
|
|
@ -0,0 +1,28 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Windows;
|
||||||
|
using System.Windows.Controls;
|
||||||
|
using System.Windows.Data;
|
||||||
|
using System.Windows.Documents;
|
||||||
|
using System.Windows.Input;
|
||||||
|
using System.Windows.Media;
|
||||||
|
using System.Windows.Media.Imaging;
|
||||||
|
using System.Windows.Navigation;
|
||||||
|
using System.Windows.Shapes;
|
||||||
|
|
||||||
|
namespace DM_Weight.Views.Dialog
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// ConfirmMessageDialog.xaml 的交互逻辑
|
||||||
|
/// </summary>
|
||||||
|
public partial class ConfirmMessageDialog : UserControl
|
||||||
|
{
|
||||||
|
public ConfirmMessageDialog()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -8,6 +8,7 @@
|
||||||
prism:ViewModelLocator.AutoWireViewModel="True"
|
prism:ViewModelLocator.AutoWireViewModel="True"
|
||||||
xmlns:convert="clr-namespace:DM_Weight.Converter"
|
xmlns:convert="clr-namespace:DM_Weight.Converter"
|
||||||
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
|
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
|
||||||
|
xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
|
||||||
MinWidth="880"
|
MinWidth="880"
|
||||||
Width="Auto"
|
Width="Auto"
|
||||||
Height="Auto"
|
Height="Auto"
|
||||||
|
@ -35,7 +36,7 @@
|
||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
<RowDefinition Height="Auto" />
|
<RowDefinition Height="Auto" />
|
||||||
<RowDefinition Height="50" />
|
<RowDefinition Height="50" />
|
||||||
<RowDefinition Height="Auto" />
|
<RowDefinition Height="300" />
|
||||||
<RowDefinition Height="Auto" />
|
<RowDefinition Height="Auto" />
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
<Grid Background="#03a9f4" Grid.Row="0">
|
<Grid Background="#03a9f4" Grid.Row="0">
|
||||||
|
@ -120,45 +121,51 @@
|
||||||
Style="{StaticResource MaterialDesignBody2TextBlock}"
|
Style="{StaticResource MaterialDesignBody2TextBlock}"
|
||||||
Text="{Binding ChannelStock.CanReturnQuantity}" />
|
Text="{Binding ChannelStock.CanReturnQuantity}" />
|
||||||
</Grid>
|
</Grid>
|
||||||
<ListView
|
<ScrollViewer Grid.Row="2">
|
||||||
Grid.Row="2"
|
<ListView
|
||||||
ItemsSource="{Binding MachineRecords}"
|
|
||||||
|
ItemsSource="{Binding MachineRecords}" SelectedItem="{Binding MachineRecordStock}"
|
||||||
materialDesign:ListViewAssist.HeaderRowBackground="#31ccec"
|
materialDesign:ListViewAssist.HeaderRowBackground="#31ccec"
|
||||||
materialDesign:DataGridAssist.ColumnHeaderPadding="10"
|
materialDesign:DataGridAssist.ColumnHeaderPadding="10"
|
||||||
materialDesign:ListViewAssist.ListViewItemPadding="13">
|
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" />
|
||||||
</Style>
|
</Style>
|
||||||
</ListView.Resources>
|
</ListView.Resources>
|
||||||
<ListView.View>
|
<i:Interaction.Triggers>
|
||||||
<GridView ColumnHeaderContainerStyle="{StaticResource st}">
|
<i:EventTrigger EventName="SelectionChanged">
|
||||||
<GridViewColumn Header="选择" Width="100">
|
<i:InvokeCommandAction Command="{Binding RowSelected}" />
|
||||||
<GridViewColumn.CellTemplate>
|
</i:EventTrigger>
|
||||||
<DataTemplate>
|
</i:Interaction.Triggers>
|
||||||
<CheckBox IsChecked="{Binding IsSelected}" />
|
<ListView.View>
|
||||||
</DataTemplate>
|
<GridView ColumnHeaderContainerStyle="{StaticResource st}">
|
||||||
</GridViewColumn.CellTemplate>
|
<GridViewColumn Header="选择" Width="100">
|
||||||
</GridViewColumn>
|
<GridViewColumn.CellTemplate>
|
||||||
<GridViewColumn Width="100"
|
<DataTemplate>
|
||||||
|
<CheckBox IsChecked="{Binding IsSelected}" />
|
||||||
|
</DataTemplate>
|
||||||
|
</GridViewColumn.CellTemplate>
|
||||||
|
</GridViewColumn>
|
||||||
|
<GridViewColumn Width="100"
|
||||||
Header="操作人"
|
Header="操作人"
|
||||||
DisplayMemberBinding="{Binding User.Nickname}"/>
|
DisplayMemberBinding="{Binding User.Nickname}"/>
|
||||||
<GridViewColumn Width="150"
|
<GridViewColumn Width="150"
|
||||||
Header="时间"
|
Header="时间"
|
||||||
DisplayMemberBinding="{Binding OperationTime, StringFormat='yyyy-MM-dd HH:mm:ss'}" />
|
DisplayMemberBinding="{Binding OperationTime, StringFormat='yyyy-MM-dd HH:mm:ss'}" />
|
||||||
<GridViewColumn Width="100"
|
<GridViewColumn Width="100"
|
||||||
DisplayMemberBinding="{Binding Quantity}"
|
DisplayMemberBinding="{Binding Quantity}"
|
||||||
Header="数量"/>
|
Header="数量"/>
|
||||||
<GridViewColumn Width="150"
|
<GridViewColumn Width="150"
|
||||||
DisplayMemberBinding="{Binding ManuNo}"
|
DisplayMemberBinding="{Binding ManuNo}"
|
||||||
Header="批次"/>
|
Header="批次"/>
|
||||||
<GridViewColumn Width="150"
|
<GridViewColumn Width="150"
|
||||||
DisplayMemberBinding="{Binding EffDate, StringFormat=yyyy-MM-dd}"
|
DisplayMemberBinding="{Binding EffDate, StringFormat=yyyy-MM-dd}"
|
||||||
Header="效期"/>
|
Header="效期"/>
|
||||||
</GridView>
|
</GridView>
|
||||||
</ListView.View>
|
</ListView.View>
|
||||||
</ListView>
|
</ListView>
|
||||||
|
</ScrollViewer>
|
||||||
<Grid Grid.Row="3">
|
<Grid Grid.Row="3">
|
||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
<RowDefinition />
|
<RowDefinition />
|
||||||
|
|
|
@ -29,8 +29,19 @@
|
||||||
<RowDefinition />
|
<RowDefinition />
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
<Grid Margin="0 6 0 6" Grid.Row="0">
|
<Grid Margin="0 6 0 6" Grid.Row="0">
|
||||||
|
|
||||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
|
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
|
||||||
|
<Button
|
||||||
|
Margin="0 0 3 0"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Command="{Binding ReturnEmptyCommand}"
|
||||||
|
Style="{StaticResource MaterialDesignOutlinedLightButton}"
|
||||||
|
Content="还空瓶" />
|
||||||
|
<Button
|
||||||
|
Margin="0 0 3 0"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Command="{Binding DestoryCommand}"
|
||||||
|
Style="{StaticResource MaterialDesignOutlinedLightButton}"
|
||||||
|
Content="销毁" />
|
||||||
<Button
|
<Button
|
||||||
Margin="0 0 6 0"
|
Margin="0 0 6 0"
|
||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
|
@ -44,6 +55,7 @@
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Grid>
|
</Grid>
|
||||||
<ListView
|
<ListView
|
||||||
|
x:Name="ViewList"
|
||||||
Grid.Row="1"
|
Grid.Row="1"
|
||||||
ItemsSource="{Binding Channels}"
|
ItemsSource="{Binding Channels}"
|
||||||
SelectedItem="{Binding Channel}"
|
SelectedItem="{Binding Channel}"
|
||||||
|
@ -59,9 +71,21 @@
|
||||||
<i:EventTrigger EventName="SelectionChanged">
|
<i:EventTrigger EventName="SelectionChanged">
|
||||||
<i:InvokeCommandAction Command="{Binding RowSelected}" />
|
<i:InvokeCommandAction Command="{Binding RowSelected}" />
|
||||||
</i:EventTrigger>
|
</i:EventTrigger>
|
||||||
</i:Interaction.Triggers>
|
</i:Interaction.Triggers>
|
||||||
|
<!--<i:Interaction.Triggers>
|
||||||
|
<i:EventTrigger EventName="Click">
|
||||||
|
<i:InvokeCommandAction Command="{Binding RowSelected}" />
|
||||||
|
</i:EventTrigger>
|
||||||
|
</i:Interaction.Triggers>-->
|
||||||
<ListView.View>
|
<ListView.View>
|
||||||
<GridView ColumnHeaderContainerStyle="{StaticResource st}">
|
<GridView ColumnHeaderContainerStyle="{StaticResource st}">
|
||||||
|
<GridViewColumn Header="选择" Width="100">
|
||||||
|
<GridViewColumn.CellTemplate>
|
||||||
|
<DataTemplate>
|
||||||
|
<CheckBox IsChecked="{Binding IsSelected}"/>
|
||||||
|
</DataTemplate>
|
||||||
|
</GridViewColumn.CellTemplate>
|
||||||
|
</GridViewColumn>
|
||||||
<GridViewColumn Width="140"
|
<GridViewColumn Width="140"
|
||||||
Header="库位"
|
Header="库位"
|
||||||
DisplayMemberBinding="{Binding Location}"/>
|
DisplayMemberBinding="{Binding Location}"/>
|
||||||
|
|
Loading…
Reference in New Issue