提交修改
This commit is contained in:
parent
3e808f3806
commit
aade72f0cd
|
@ -37,11 +37,11 @@
|
||||||
<!-- 抽屉串口使用的协议232或者485 -->
|
<!-- 抽屉串口使用的协议232或者485 -->
|
||||||
<add key="DrawerProtocol" value="485" />
|
<add key="DrawerProtocol" value="485" />
|
||||||
<!-- 抽屉串口的串口号 -->
|
<!-- 抽屉串口的串口号 -->
|
||||||
<add key="DrawerPortPath" value="COM1" />
|
<add key="DrawerPortPath" value="COM3" />
|
||||||
<!-- can总线串口的串口号 -->
|
<!-- can总线串口的串口号 -->
|
||||||
<add key="CanBusPortPath" value="COM6" />
|
<add key="CanBusPortPath" value="COM9" />
|
||||||
<!-- 条码枪串口的串口号 -->
|
<!-- 条码枪串口的串口号 -->
|
||||||
<add key="ScanCodePortPath" value="COM8" />
|
<add key="ScanCodePortPath" value="COM111" />
|
||||||
<!-- 抽屉串口的串口号 --><!--
|
<!-- 抽屉串口的串口号 --><!--
|
||||||
<add key="DrawerPortPath" value="COM11" />
|
<add key="DrawerPortPath" value="COM11" />
|
||||||
--><!-- can总线串口的串口号 --><!--
|
--><!-- can总线串口的串口号 --><!--
|
||||||
|
@ -56,6 +56,10 @@
|
||||||
<add key="machineNumber" value="1"/>
|
<add key="machineNumber" value="1"/>
|
||||||
<!-- 指纹机ip -->
|
<!-- 指纹机ip -->
|
||||||
<add key="fingerIp" value="192.168.1.201"/>
|
<add key="fingerIp" value="192.168.1.201"/>
|
||||||
|
<!-- 取药还药时间段设置(时间24小时制) --><!--
|
||||||
|
<add key="TakeReturnTime" value="13:42:00-14:42:00"/>
|
||||||
|
--><!-- 取药还药周 --><!--
|
||||||
|
<add key="TakeReturnWeek" value="1,2,3,4,5"/>-->
|
||||||
|
|
||||||
</appSettings>
|
</appSettings>
|
||||||
</configuration>
|
</configuration>
|
|
@ -6,7 +6,7 @@
|
||||||
d1p1:Ignorable="d"
|
d1p1:Ignorable="d"
|
||||||
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
|
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
|
||||||
xmlns:local="clr-namespace:DM_Weight"
|
xmlns:local="clr-namespace:DM_Weight"
|
||||||
xmlns:prism="http://prismlibrary.com/">
|
xmlns:prism="http://prismlibrary.com/" Startup="PrismApplication_Startup">
|
||||||
<Application.Resources>
|
<Application.Resources>
|
||||||
<ResourceDictionary>
|
<ResourceDictionary>
|
||||||
<ResourceDictionary.MergedDictionaries>
|
<ResourceDictionary.MergedDictionaries>
|
||||||
|
|
|
@ -23,6 +23,8 @@ using log4net;
|
||||||
using System.Windows.Interop;
|
using System.Windows.Interop;
|
||||||
using System.Windows.Threading;
|
using System.Windows.Threading;
|
||||||
using System.Timers;
|
using System.Timers;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
namespace DM_Weight
|
namespace DM_Weight
|
||||||
{
|
{
|
||||||
|
@ -92,7 +94,7 @@ namespace DM_Weight
|
||||||
// 串口工具
|
// 串口工具
|
||||||
containerRegistry.RegisterSingleton<PortUtil>();
|
containerRegistry.RegisterSingleton<PortUtil>();
|
||||||
// 指纹机工具
|
// 指纹机工具
|
||||||
//containerRegistry.RegisterSingleton<FingerprintUtil>();
|
containerRegistry.RegisterSingleton<FingerprintUtil>();
|
||||||
// 组态屏工具
|
// 组态屏工具
|
||||||
containerRegistry.RegisterSingleton<ScreenUtil>();
|
containerRegistry.RegisterSingleton<ScreenUtil>();
|
||||||
|
|
||||||
|
@ -111,6 +113,8 @@ namespace DM_Weight
|
||||||
|
|
||||||
// 布局页面
|
// 布局页面
|
||||||
containerRegistry.RegisterForNavigation<HomeWindow, HomeWindowViewModel>();
|
containerRegistry.RegisterForNavigation<HomeWindow, HomeWindowViewModel>();
|
||||||
|
// 布局页面
|
||||||
|
containerRegistry.RegisterForNavigation<HomeWindow_New, HomeWindowViewModel_New>();
|
||||||
|
|
||||||
// 录入指纹模态框
|
// 录入指纹模态框
|
||||||
containerRegistry.RegisterDialog<FingerprintDialog>();
|
containerRegistry.RegisterDialog<FingerprintDialog>();
|
||||||
|
@ -181,7 +185,7 @@ namespace DM_Weight
|
||||||
// 库存列表页面
|
// 库存列表页面
|
||||||
containerRegistry.RegisterForNavigation<CheckStockWindow, CheckStockWindowViewModel>();
|
containerRegistry.RegisterForNavigation<CheckStockWindow, CheckStockWindowViewModel>();
|
||||||
// 药品列表页面
|
// 药品列表页面
|
||||||
// containerRegistry.RegisterForNavigation<DrugListWindow, DrugListWindowViewModel>();
|
containerRegistry.RegisterForNavigation<DrugListWindow, DrugListWindowViewModel>();
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
@ -207,5 +211,43 @@ namespace DM_Weight
|
||||||
containerRegistry.RegisterForNavigation<ConfirmMessageDialog, ConfirmMessageDialogViewModel>();
|
containerRegistry.RegisterForNavigation<ConfirmMessageDialog, ConfirmMessageDialogViewModel>();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static void RaiseOtherProcess()
|
||||||
|
{
|
||||||
|
Process proc = Process.GetCurrentProcess();
|
||||||
|
foreach (Process otherProc in Process.GetProcessesByName(Process.GetCurrentProcess().ProcessName))
|
||||||
|
{
|
||||||
|
if (proc.Id != otherProc.Id)
|
||||||
|
{
|
||||||
|
IntPtr hWnd = otherProc.MainWindowHandle;
|
||||||
|
if (IsIconic(hWnd))
|
||||||
|
{
|
||||||
|
ShowWindowAsync(hWnd, 9);
|
||||||
|
}
|
||||||
|
SetForegroundWindow(hWnd);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
[DllImport("user32.dll")]
|
||||||
|
private static extern bool SetForegroundWindow(IntPtr hWnd);
|
||||||
|
[DllImport("user32.dll")]
|
||||||
|
private static extern bool ShowWindowAsync(IntPtr hWnd, int nCmdShow);
|
||||||
|
[DllImport("user32.dll")]
|
||||||
|
private static extern bool IsIconic(IntPtr hWnd);
|
||||||
|
|
||||||
|
private void PrismApplication_Startup(object sender, StartupEventArgs e)
|
||||||
|
{
|
||||||
|
//获取欲启动程序名
|
||||||
|
string processName = System.Diagnostics.Process.GetCurrentProcess().ProcessName;
|
||||||
|
//检查程序是否已经启动,已经启动则显示提示退出程序
|
||||||
|
if (System.Diagnostics.Process.GetProcessesByName(processName).Length > 1)
|
||||||
|
{
|
||||||
|
//系统在运行
|
||||||
|
RaiseOtherProcess();
|
||||||
|
Application.Current.Shutdown();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,23 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Xml;
|
||||||
|
|
||||||
|
namespace DM_Weight.Common
|
||||||
|
{
|
||||||
|
public class CommonClass
|
||||||
|
{
|
||||||
|
//手动实现调用配置的逻辑 规避修改配置文件后不起作用的问题
|
||||||
|
public static string ReadAppSetting(string key)
|
||||||
|
{
|
||||||
|
string xPath = "/configuration/appSettings//add[@key='" + key + "']";
|
||||||
|
XmlDocument doc = new XmlDocument();
|
||||||
|
string exeFileName = System.Reflection.Assembly.GetExecutingAssembly().GetName().Name;
|
||||||
|
doc.Load(exeFileName + ".dll.config");
|
||||||
|
XmlNode node = doc.SelectSingleNode(xPath);
|
||||||
|
return node.Attributes["value"].Value.ToString();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,55 @@
|
||||||
|
using Prism.Mvvm;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace DM_Weight.Common
|
||||||
|
{
|
||||||
|
public class SelectableViewModel : BindableBase
|
||||||
|
{
|
||||||
|
private bool _isSelected;
|
||||||
|
private string? _name;
|
||||||
|
private string? _description;
|
||||||
|
private char _code;
|
||||||
|
private double _numeric;
|
||||||
|
private string? _food;
|
||||||
|
|
||||||
|
public bool IsSelected
|
||||||
|
{
|
||||||
|
get => _isSelected;
|
||||||
|
set => SetProperty(ref _isSelected, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
public char Code
|
||||||
|
{
|
||||||
|
get => _code;
|
||||||
|
set => SetProperty(ref _code, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
public string? Name
|
||||||
|
{
|
||||||
|
get => _name;
|
||||||
|
set => SetProperty(ref _name, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
public string? Description
|
||||||
|
{
|
||||||
|
get => _description;
|
||||||
|
set => SetProperty(ref _description, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
public double Numeric
|
||||||
|
{
|
||||||
|
get => _numeric;
|
||||||
|
set => SetProperty(ref _numeric, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
public string? Food
|
||||||
|
{
|
||||||
|
get => _food;
|
||||||
|
set => SetProperty(ref _food, value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,23 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Globalization;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Windows.Controls;
|
||||||
|
|
||||||
|
namespace DM_Weight.Common
|
||||||
|
{
|
||||||
|
public class SimpleDateValidationRule : ValidationRule
|
||||||
|
{
|
||||||
|
public override ValidationResult Validate(object value, CultureInfo cultureInfo)
|
||||||
|
{
|
||||||
|
return DateTime.TryParse((value ?? "").ToString(),
|
||||||
|
CultureInfo.CurrentCulture,
|
||||||
|
DateTimeStyles.AssumeLocal | DateTimeStyles.AllowWhiteSpaces,
|
||||||
|
out _)
|
||||||
|
? ValidationResult.ValidResult
|
||||||
|
: new ValidationResult(false, "请选择时间");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -73,6 +73,18 @@ namespace DM_Weight.Converter
|
||||||
return Visibility.Collapsed;
|
return Visibility.Collapsed;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
//还空瓶页面退出按钮
|
||||||
|
if(parameter.ToString().Equals("QuitBtnVisible"))
|
||||||
|
{
|
||||||
|
if (status == 0)
|
||||||
|
{
|
||||||
|
return Visibility.Visible;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return Visibility.Collapsed;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return Visibility.Collapsed;
|
return Visibility.Collapsed;
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,38 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Globalization;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Windows;
|
||||||
|
using System.Windows.Data;
|
||||||
|
|
||||||
|
namespace DM_Weight.Converter
|
||||||
|
{
|
||||||
|
internal class TypeConverter : IValueConverter
|
||||||
|
{
|
||||||
|
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
||||||
|
{
|
||||||
|
int mrType;
|
||||||
|
bool isType = int.TryParse(value.ToString(), out mrType);
|
||||||
|
//药品领取登记
|
||||||
|
if (parameter!=null&& parameter.ToString().Equals("DragTakeCheckIn"))
|
||||||
|
{
|
||||||
|
if (mrType == 3)
|
||||||
|
{
|
||||||
|
return Visibility.Visible;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return Visibility.Collapsed;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return Visibility.Collapsed;
|
||||||
|
}
|
||||||
|
|
||||||
|
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
||||||
|
{
|
||||||
|
throw new NotImplementedException();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -96,6 +96,12 @@
|
||||||
<None Update="ReportTemp\account_book_temp.grf">
|
<None Update="ReportTemp\account_book_temp.grf">
|
||||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||||
</None>
|
</None>
|
||||||
|
<None Update="ReportTemp\drug_take_check_in.grf">
|
||||||
|
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||||
|
</None>
|
||||||
|
<None Update="ReportTemp\drug_take_check_in2.grf">
|
||||||
|
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||||
|
</None>
|
||||||
<None Update="ReportTemp\machine_log_check.grf">
|
<None Update="ReportTemp\machine_log_check.grf">
|
||||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||||
</None>
|
</None>
|
||||||
|
|
|
@ -161,8 +161,16 @@ namespace DM_Weight.Finger
|
||||||
bool result = false;
|
bool result = false;
|
||||||
// 取消其他操作
|
// 取消其他操作
|
||||||
bool res2 = axCZKEM1.CancelOperation();
|
bool res2 = axCZKEM1.CancelOperation();
|
||||||
// 删除源指纹
|
if (machineType == 1)
|
||||||
bool res = axCZKEM1.DelUserTmp(machineNumber, Id, FingerIndex);
|
{
|
||||||
|
// 删除源指纹
|
||||||
|
bool res = axCZKEM1.DelUserTmp(machineNumber, Id, FingerIndex);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// 删除源指纹
|
||||||
|
bool res = axCZKEM1.SSR_DelUserTmp(machineNumber, Id.ToString(), FingerIndex);
|
||||||
|
}
|
||||||
// 添加新指纹
|
// 添加新指纹
|
||||||
result = axCZKEM1.StartEnrollEx(Id.ToString(), FingerIndex, 3);
|
result = axCZKEM1.StartEnrollEx(Id.ToString(), FingerIndex, 3);
|
||||||
return result;
|
return result;
|
||||||
|
|
|
@ -480,7 +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)}");
|
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;
|
||||||
|
@ -651,19 +651,19 @@ namespace DM_Weight.Port
|
||||||
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;
|
||||||
while (_length != length && end.Subtract(start).TotalMilliseconds < timeout)
|
while (_length != length && end.Subtract(start).TotalMilliseconds < timeout)
|
||||||
{
|
{
|
||||||
_length = serialPort.BytesToRead;
|
_length = serialPort.BytesToRead;
|
||||||
end = DateTime.Now;
|
end = DateTime.Now;
|
||||||
}
|
}
|
||||||
if (_length != length)
|
if (_length != length)
|
||||||
{
|
{
|
||||||
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)
|
||||||
//{
|
//{
|
||||||
|
@ -861,7 +861,7 @@ namespace DM_Weight.Port
|
||||||
byte[] buffer = new byte[] { 0xaa, (byte)channel, 0x0a, 0x00, 0x00, 0x00, 0x00, 0xee };
|
byte[] buffer = new byte[] { 0xaa, (byte)channel, 0x0a, 0x00, 0x00, 0x00, 0x00, 0xee };
|
||||||
canBusSerial.Write(buffer, 0, 8);
|
canBusSerial.Write(buffer, 0, 8);
|
||||||
string msg = string.Empty;
|
string msg = string.Empty;
|
||||||
logger.Info($"单支板有药位置亮灯指令:{string.Join(",",buffer)}");
|
logger.Info($"单支板有药位置亮灯指令:{string.Join(",", buffer)}");
|
||||||
await Task.Delay(TimeSpan.FromMilliseconds(20));
|
await Task.Delay(TimeSpan.FromMilliseconds(20));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1154,7 +1154,7 @@ namespace DM_Weight.Port
|
||||||
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)}");
|
logger.Info($"回收箱数量查询发{string.Join(",", buffer)}");
|
||||||
return await GetBufferByPort(canBusSerial, 8);
|
return await GetBufferByPort(canBusSerial, 8);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,7 +17,7 @@ namespace DM_Weight.Report
|
||||||
|
|
||||||
// 定义Grid++Report报表主对象
|
// 定义Grid++Report报表主对象
|
||||||
public static GridppReport Report = new GridppReport();
|
public static GridppReport Report = new GridppReport();
|
||||||
public static string gridConnectionString = ConfigurationManager.AppSettings["gridConnectionString"];
|
public static string gridConnectionString = ConfigurationManager.AppSettings["gridConnectionString"];
|
||||||
/**
|
/**
|
||||||
* 打印预览
|
* 打印预览
|
||||||
* tempname: 模板文件名称
|
* tempname: 模板文件名称
|
||||||
|
@ -43,7 +43,7 @@ namespace DM_Weight.Report
|
||||||
//{
|
//{
|
||||||
// Report.ParameterByName("machine_id").Value = (ConfigurationManager.AppSettings["machineId"] ?? "DM1");
|
// Report.ParameterByName("machine_id").Value = (ConfigurationManager.AppSettings["machineId"] ?? "DM1");
|
||||||
//});
|
//});
|
||||||
string machine_id=(ConfigurationManager.AppSettings["machineId"] ?? "DM1");
|
string machine_id = (ConfigurationManager.AppSettings["machineId"] ?? "DM1");
|
||||||
string SQL = $@"SELECT cl.`row_no` AS drawerNo,cl.`col_no` AS colNo,cl.`quantity` AS quantity,cl.`manu_no` AS manuNo,cl.`eff_date` AS effDate,
|
string SQL = $@"SELECT cl.`row_no` AS drawerNo,cl.`col_no` AS colNo,cl.`quantity` AS quantity,cl.`manu_no` AS manuNo,cl.`eff_date` AS effDate,
|
||||||
di.`drug_name` AS drugName,di.`drug_spec` AS drugSpec,di.`pack_unit` AS packUnit,di.`manufactory` AS manuFactory,di.`max_stock` AS baseQuantity,
|
di.`drug_name` AS drugName,di.`drug_spec` AS drugSpec,di.`pack_unit` AS packUnit,di.`manufactory` AS manuFactory,di.`max_stock` AS baseQuantity,
|
||||||
cl.`drug_id` AS drugId FROM channel_stock cl INNER JOIN drug_info di ON di.`drug_id` = cl.`drug_id` WHERE cl.`machine_id` = '{machine_id}' AND cl.`drawer_type` = 1 ORDER BY cl.`drug_id`";
|
cl.`drug_id` AS drugId FROM channel_stock cl INNER JOIN drug_info di ON di.`drug_id` = cl.`drug_id` WHERE cl.`machine_id` = '{machine_id}' AND cl.`drawer_type` = 1 ORDER BY cl.`drug_id`";
|
||||||
|
@ -57,9 +57,9 @@ namespace DM_Weight.Report
|
||||||
{
|
{
|
||||||
DateTime? p_startDate = startDate ?? Convert.ToDateTime("2010-1-1");
|
DateTime? p_startDate = startDate ?? Convert.ToDateTime("2010-1-1");
|
||||||
DateTime? p_endDate = endDate ?? DateTime.Now.AddDays(1);
|
DateTime? p_endDate = endDate ?? DateTime.Now.AddDays(1);
|
||||||
string p_machine_id= (ConfigurationManager.AppSettings["machineId"] ?? "DM1");
|
string p_machine_id = (ConfigurationManager.AppSettings["machineId"] ?? "DM1");
|
||||||
// 定义Grid++Report报表主对象
|
// 定义Grid++Report报表主对象
|
||||||
GridppReport Report = new GridppReport();
|
GridppReport Report = new GridppReport();
|
||||||
// 加载模板文件
|
// 加载模板文件
|
||||||
Report.LoadFromFile(new FileInfo(AppDomain.CurrentDomain.BaseDirectory) + "ReportTemp//" + "account_book_temp.grf");
|
Report.LoadFromFile(new FileInfo(AppDomain.CurrentDomain.BaseDirectory) + "ReportTemp//" + "account_book_temp.grf");
|
||||||
string SQL = string.Empty;
|
string SQL = string.Empty;
|
||||||
|
@ -146,13 +146,67 @@ namespace DM_Weight.Report
|
||||||
AND dmr.`machine_id` = '{p_machine_id}' AND dmr.`operation_time` > '{p_startDate}'
|
AND dmr.`machine_id` = '{p_machine_id}' AND dmr.`operation_time` > '{p_startDate}'
|
||||||
AND dmr.`operation_time` < '{p_endDate}'";
|
AND dmr.`operation_time` < '{p_endDate}'";
|
||||||
}
|
}
|
||||||
|
|
||||||
Report.DetailGrid.Recordset.ConnectionString = gridConnectionString;
|
Report.DetailGrid.Recordset.ConnectionString = gridConnectionString;
|
||||||
Report.DetailGrid.Recordset.QuerySQL= SQL;
|
Report.DetailGrid.Recordset.QuerySQL = SQL;
|
||||||
|
|
||||||
Report.PrintPreview(true);
|
Report.PrintPreview(true);
|
||||||
}
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 麻醉科精一、精二药品领取登记表
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// <para>
|
||||||
|
/// 麻醉科药品领取登记表按取药时间查询 <br/> 精一固定5种药;精二固定4种药
|
||||||
|
/// </para>
|
||||||
|
/// </remarks>
|
||||||
|
/// <param name="startDate"></param>
|
||||||
|
/// <param name="endDate"></param>
|
||||||
|
/// <param name="type">1->精1;2->精2</param>
|
||||||
|
public static void PrintReportDrugTakeCheckIn(DateTime? startDate, DateTime? endDate,int type)
|
||||||
|
{
|
||||||
|
// 定义Grid++Report报表主对象
|
||||||
|
GridppReport Report = new GridppReport();
|
||||||
|
DateTime? p_startDate = startDate ?? Convert.ToDateTime("2010-1-1");
|
||||||
|
DateTime? p_endDate = endDate ?? DateTime.Now.AddDays(1);
|
||||||
|
string p_machine_id = (ConfigurationManager.AppSettings["machineId"] ?? "DM1");
|
||||||
|
string SQL = string.Empty;
|
||||||
|
Report.Initialize += new _IGridppReportEvents_InitializeEventHandler(() =>
|
||||||
|
{
|
||||||
|
Report.ParameterByName("machine_id").Value = (ConfigurationManager.AppSettings["machineId"] ?? "DM1");
|
||||||
|
Report.ParameterByName("startDate").Value = startDate ?? DateTime.Now.AddYears(-10);
|
||||||
|
Report.ParameterByName("endDate").Value = endDate ?? DateTime.Now.AddDays(1);
|
||||||
|
});
|
||||||
|
|
||||||
|
SQL = $@"SELECT operation_time,d.drug_name,manu_no,eff_date,quantity,u.User_name,ur.user_name reviewer,returnOptTime,u2.User_name returnUser,u2r.user_name returnReviewer,return_quantity1,return_quantity2
|
||||||
|
from dm_machine_record AS mr
|
||||||
|
LEFT JOIN (SELECT operation_time returnOptTime,operator returnOperator,reviewer returnReviewer,drug_id returnDrug_id,get_id
|
||||||
|
FROM dm_machine_record) AS returnMr
|
||||||
|
ON mr.drug_id=returnMr.returnDrug_id AND returnMr.get_id=mr.id LEFT JOIN drug_info d on mr.drug_id=d.drug_id
|
||||||
|
LEFT JOIN user_list u on mr.operator=u.id
|
||||||
|
LEFT JOIN user_list ur on mr.reviewer=ur.id
|
||||||
|
LEFT JOIN user_list u2 on returnMr.returnOperator=u2.id
|
||||||
|
LEFT JOIN user_list u2r on returnMr.returnReviewer=u2r.id
|
||||||
|
WHERE mr.type=2 AND mr.`machine_id` = '{p_machine_id}' AND mr.`operation_time` > '{p_startDate}' AND mr.`operation_time` < '{p_endDate}' ";
|
||||||
|
if (type == 1)
|
||||||
|
{
|
||||||
|
// 加载模板文件
|
||||||
|
Report.LoadFromFile(new FileInfo(AppDomain.CurrentDomain.BaseDirectory) + "ReportTemp//" + "drug_take_check_in.grf");
|
||||||
|
SQL += @" and mr.DRUG_ID IN('9131487','10826545','9112595','9132487','9087821')";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// 加载模板文件
|
||||||
|
Report.LoadFromFile(new FileInfo(AppDomain.CurrentDomain.BaseDirectory) + "ReportTemp//" + "drug_take_check_in2.grf");
|
||||||
|
SQL += @" and mr.DRUG_ID IN('95892862','1053979','9644264','12663789')";
|
||||||
|
}
|
||||||
|
SQL+=" GROUP BY mr.operation_time, mr.drug_id, mr.operator, mr.machine_id";
|
||||||
|
|
||||||
|
Report.DetailGrid.Recordset.ConnectionString = gridConnectionString;
|
||||||
|
Report.DetailGrid.Recordset.QuerySQL = SQL;
|
||||||
|
|
||||||
|
Report.PrintPreview(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -166,7 +220,7 @@ namespace DM_Weight.Report
|
||||||
GridppReport Report = new GridppReport();
|
GridppReport Report = new GridppReport();
|
||||||
// 加载模板文件
|
// 加载模板文件
|
||||||
Report.LoadFromFile(new FileInfo(AppDomain.CurrentDomain.BaseDirectory) + "ReportTemp//machine_log.grf");
|
Report.LoadFromFile(new FileInfo(AppDomain.CurrentDomain.BaseDirectory) + "ReportTemp//machine_log.grf");
|
||||||
|
|
||||||
// 加载数据
|
// 加载数据
|
||||||
Report.ParameterByName("type").AsInteger = 1;
|
Report.ParameterByName("type").AsInteger = 1;
|
||||||
Report.PrintPreview(true);
|
Report.PrintPreview(true);
|
||||||
|
|
|
@ -0,0 +1,387 @@
|
||||||
|
{
|
||||||
|
"Version":"6.3.0.1",
|
||||||
|
"Font":{
|
||||||
|
"Name":"宋体",
|
||||||
|
"Size":105000,
|
||||||
|
"Weight":400,
|
||||||
|
"Charset":134
|
||||||
|
},
|
||||||
|
"Printer":{
|
||||||
|
"Oriention":"Landscape",
|
||||||
|
"TopMargin":0.3175,
|
||||||
|
"RightMargin":0.8996,
|
||||||
|
"BottomMargin":0.3969
|
||||||
|
},
|
||||||
|
"DetailGrid":{
|
||||||
|
"CenterView":true,
|
||||||
|
"AppendBlankRow":true,
|
||||||
|
"Recordset":{
|
||||||
|
"QuerySQL":"SELECT \r\n dmr.`drawer_no` AS drawerNo,\r\n dmr.`col_no` AS colNo,\r\n dmr.`type` AS `type`,\r\n dmr.`quantity` AS quantity,\r\n dmr.`manu_no` AS manuNo,\r\n dmr.`eff_date` AS effDate,\r\n dmr.`operation_time` AS operationTime,\r\n di.`drug_name` AS drugName,\r\n di.`drug_spec` AS drugSpec,\r\n di.`pack_unit` AS packUnit,\r\n di.`manufactory` AS manuFactory,\r\n di.`max_stock` AS baseQuantity,\r\n dmr.`drug_id` AS drugId,\r\n ul.`user_name` AS nickname\r\nFROM\r\n dm_machine_record dmr\r\nLEFT JOIN drug_info di ON di.`drug_id` = dmr.`drug_id`\r\nLEFT JOIN user_list ul ON ul.`id` = dmr.`Operator`\r\nWHERE dmr.`type` = 1 \r\n AND dmr.`machine_id` = :machine_id\r\n AND dmr.`operation_time` > :startDate\r\n AND dmr.`operation_time` < :endDate",
|
||||||
|
"Field":[
|
||||||
|
{
|
||||||
|
"Name":"日期",
|
||||||
|
"Type":"DateTime",
|
||||||
|
"Format":"yyyy/MM/dd HH:mm:ss",
|
||||||
|
"DBFieldName":"operation_time"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Name":"效期",
|
||||||
|
"Format":"yyyy/MM/dd HH:mm:ss",
|
||||||
|
"DBFieldName":"eff_date"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Name":"药品名称",
|
||||||
|
"DBFieldName":"drug_name"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Name":"取药数量",
|
||||||
|
"DBFieldName":"quantity"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Name":"领取人",
|
||||||
|
"DBFieldName":"User_name"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Name":"发药人",
|
||||||
|
"Format":"yyyy/MM/dd",
|
||||||
|
"DBFieldName":"reviewer"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Name":"还药时间",
|
||||||
|
"Type":"DateTime",
|
||||||
|
"Format":"yyyy/MM/dd HH:mm:ss",
|
||||||
|
"DBFieldName":"returnOptTime"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Name":"还药数量",
|
||||||
|
"DBFieldName":"return_quantity1"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Name":"还空瓶数量",
|
||||||
|
"Type":"Integer",
|
||||||
|
"DBFieldName":"return_quantity2"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Name":"还药人",
|
||||||
|
"DBFieldName":"returnUser"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Name":"收取人",
|
||||||
|
"DBFieldName":"returnReviewer"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Name":"批次",
|
||||||
|
"DBFieldName":"manu_no"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"Column":[
|
||||||
|
{
|
||||||
|
"Name":"日期",
|
||||||
|
"Width":3.78354
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Name":"药品名称",
|
||||||
|
"Width":4.63021
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Name":"批次",
|
||||||
|
"Width":1.69333
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Name":"效期",
|
||||||
|
"Width":2.56646
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Name":"取药数量",
|
||||||
|
"Width":1.19063
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Name":"领取人",
|
||||||
|
"Width":1.61396
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Name":"发药人",
|
||||||
|
"Width":1.5875
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Name":"还药时间",
|
||||||
|
"Width":3.81
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Name":"还药数量",
|
||||||
|
"Width":1.05833
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Name":"还空瓶数量",
|
||||||
|
"Width":0.978958
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Name":"还药人",
|
||||||
|
"Width":1.37583
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Name":"收取人",
|
||||||
|
"Width":1.5875
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"ColumnContent":{
|
||||||
|
"Height":1.00542,
|
||||||
|
"ColumnContentCell":[
|
||||||
|
{
|
||||||
|
"Column":"日期",
|
||||||
|
"TextAlign":"MiddleCenter",
|
||||||
|
"DataField":"日期"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Column":"药品名称",
|
||||||
|
"TextAlign":"MiddleCenter",
|
||||||
|
"DataField":"药品名称"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Column":"批次",
|
||||||
|
"TextAlign":"MiddleCenter",
|
||||||
|
"DataField":"批次"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Column":"效期",
|
||||||
|
"TextAlign":"MiddleCenter",
|
||||||
|
"DataField":"效期"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Column":"取药数量",
|
||||||
|
"TextAlign":"MiddleCenter",
|
||||||
|
"DataField":"取药数量"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Column":"领取人",
|
||||||
|
"TextAlign":"MiddleCenter",
|
||||||
|
"DataField":"领取人"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Column":"发药人",
|
||||||
|
"TextAlign":"MiddleCenter",
|
||||||
|
"DataField":"发药人"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Column":"还药时间",
|
||||||
|
"TextAlign":"MiddleCenter",
|
||||||
|
"DataField":"还药时间"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Column":"还药数量",
|
||||||
|
"TextAlign":"MiddleCenter",
|
||||||
|
"DataField":"还药数量"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Column":"还空瓶数量",
|
||||||
|
"TextAlign":"MiddleCenter",
|
||||||
|
"DataField":"还空瓶数量"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Column":"还药人",
|
||||||
|
"TextAlign":"MiddleCenter",
|
||||||
|
"DataField":"还药人"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Column":"收取人",
|
||||||
|
"TextAlign":"MiddleCenter",
|
||||||
|
"DataField":"收取人"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"ColumnTitle":{
|
||||||
|
"Height":2.19604,
|
||||||
|
"RepeatStyle":"OnPage",
|
||||||
|
"ColumnTitleCell":[
|
||||||
|
{
|
||||||
|
"GroupTitle":false,
|
||||||
|
"Column":"日期",
|
||||||
|
"Font":{
|
||||||
|
"Name":"宋体",
|
||||||
|
"Size":120000,
|
||||||
|
"Bold":true,
|
||||||
|
"Charset":134
|
||||||
|
},
|
||||||
|
"TextAlign":"MiddleCenter",
|
||||||
|
"Text":"日期"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"GroupTitle":false,
|
||||||
|
"Column":"药品名称",
|
||||||
|
"Font":{
|
||||||
|
"Name":"宋体",
|
||||||
|
"Size":120000,
|
||||||
|
"Bold":true,
|
||||||
|
"Charset":134
|
||||||
|
},
|
||||||
|
"TextAlign":"MiddleCenter",
|
||||||
|
"Text":"药品名称"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"GroupTitle":false,
|
||||||
|
"Column":"批次",
|
||||||
|
"Font":{
|
||||||
|
"Name":"宋体",
|
||||||
|
"Size":120000,
|
||||||
|
"Bold":true,
|
||||||
|
"Charset":134
|
||||||
|
},
|
||||||
|
"TextAlign":"MiddleCenter",
|
||||||
|
"Text":"批次"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"GroupTitle":false,
|
||||||
|
"Column":"效期",
|
||||||
|
"Font":{
|
||||||
|
"Name":"宋体",
|
||||||
|
"Size":120000,
|
||||||
|
"Bold":true,
|
||||||
|
"Charset":134
|
||||||
|
},
|
||||||
|
"TextAlign":"MiddleCenter",
|
||||||
|
"Text":"效期"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"GroupTitle":false,
|
||||||
|
"Column":"取药数量",
|
||||||
|
"Font":{
|
||||||
|
"Name":"宋体",
|
||||||
|
"Size":120000,
|
||||||
|
"Bold":true,
|
||||||
|
"Charset":134
|
||||||
|
},
|
||||||
|
"TextAlign":"MiddleCenter",
|
||||||
|
"Text":"取\r\n药\r\n数\r\n量"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"GroupTitle":false,
|
||||||
|
"Column":"领取人",
|
||||||
|
"Font":{
|
||||||
|
"Name":"宋体",
|
||||||
|
"Size":120000,
|
||||||
|
"Bold":true,
|
||||||
|
"Charset":134
|
||||||
|
},
|
||||||
|
"TextAlign":"MiddleCenter",
|
||||||
|
"Text":"领取人"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"GroupTitle":false,
|
||||||
|
"Column":"发药人",
|
||||||
|
"Font":{
|
||||||
|
"Name":"宋体",
|
||||||
|
"Size":120000,
|
||||||
|
"Bold":true,
|
||||||
|
"Charset":134
|
||||||
|
},
|
||||||
|
"TextAlign":"MiddleCenter",
|
||||||
|
"Text":"发药人"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"GroupTitle":false,
|
||||||
|
"Column":"还药时间",
|
||||||
|
"Font":{
|
||||||
|
"Name":"宋体",
|
||||||
|
"Size":120000,
|
||||||
|
"Bold":true,
|
||||||
|
"Charset":134
|
||||||
|
},
|
||||||
|
"TextAlign":"MiddleCenter",
|
||||||
|
"Text":"还药时间"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"GroupTitle":false,
|
||||||
|
"Column":"还药数量",
|
||||||
|
"Font":{
|
||||||
|
"Name":"宋体",
|
||||||
|
"Size":120000,
|
||||||
|
"Bold":true,
|
||||||
|
"Charset":134
|
||||||
|
},
|
||||||
|
"TextAlign":"MiddleCenter",
|
||||||
|
"Text":"还\r\n药\r\n数\r\n量"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"GroupTitle":false,
|
||||||
|
"Column":"还空瓶数量",
|
||||||
|
"Font":{
|
||||||
|
"Name":"宋体",
|
||||||
|
"Size":120000,
|
||||||
|
"Bold":true,
|
||||||
|
"Charset":134
|
||||||
|
},
|
||||||
|
"TextAlign":"MiddleCenter",
|
||||||
|
"Text":"还\r\n空\r\n瓶\r\n数\r\n量"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"GroupTitle":false,
|
||||||
|
"Column":"还药人",
|
||||||
|
"Font":{
|
||||||
|
"Name":"宋体",
|
||||||
|
"Size":120000,
|
||||||
|
"Bold":true,
|
||||||
|
"Charset":134
|
||||||
|
},
|
||||||
|
"TextAlign":"MiddleCenter",
|
||||||
|
"Text":"还药人"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"GroupTitle":false,
|
||||||
|
"Column":"收取人",
|
||||||
|
"Font":{
|
||||||
|
"Name":"宋体",
|
||||||
|
"Size":120000,
|
||||||
|
"Bold":true,
|
||||||
|
"Charset":134
|
||||||
|
},
|
||||||
|
"TextAlign":"MiddleCenter",
|
||||||
|
"Text":"收取人"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"Parameter":[
|
||||||
|
{
|
||||||
|
"Name":"startDate",
|
||||||
|
"DataType":"DateTime",
|
||||||
|
"Format":"yyyy-MM-dd hh:mm:ss",
|
||||||
|
"Value":"2023/1/1"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Name":"endDate",
|
||||||
|
"DataType":"DateTime",
|
||||||
|
"Format":"yyyy-MM-dd hh:mm:ss",
|
||||||
|
"Value":"2023/4/28 23:59:59"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Name":"machine_id",
|
||||||
|
"Value":"DM1"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"ReportHeader":[
|
||||||
|
{
|
||||||
|
"Name":"ReportHeader1",
|
||||||
|
"Height":1.79917,
|
||||||
|
"Control":[
|
||||||
|
{
|
||||||
|
"Type":"MemoBox",
|
||||||
|
"Name":"MemoBox2",
|
||||||
|
"Left":7.80521,
|
||||||
|
"Top":0.211667,
|
||||||
|
"Width":10.3981,
|
||||||
|
"Height":1.19063,
|
||||||
|
"Font":{
|
||||||
|
"Name":"宋体",
|
||||||
|
"Size":217500,
|
||||||
|
"Bold":true,
|
||||||
|
"Charset":134
|
||||||
|
},
|
||||||
|
"TextAlign":"MiddleCenter",
|
||||||
|
"Text":"麻醉科精一药品领取登记表"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"RepeatOnPage":true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
|
@ -0,0 +1,387 @@
|
||||||
|
{
|
||||||
|
"Version":"6.3.0.1",
|
||||||
|
"Font":{
|
||||||
|
"Name":"宋体",
|
||||||
|
"Size":105000,
|
||||||
|
"Weight":400,
|
||||||
|
"Charset":134
|
||||||
|
},
|
||||||
|
"Printer":{
|
||||||
|
"Oriention":"Landscape",
|
||||||
|
"TopMargin":0.3175,
|
||||||
|
"RightMargin":0.8996,
|
||||||
|
"BottomMargin":0.3969
|
||||||
|
},
|
||||||
|
"DetailGrid":{
|
||||||
|
"CenterView":true,
|
||||||
|
"AppendBlankRow":true,
|
||||||
|
"Recordset":{
|
||||||
|
"QuerySQL":"SELECT \r\n dmr.`drawer_no` AS drawerNo,\r\n dmr.`col_no` AS colNo,\r\n dmr.`type` AS `type`,\r\n dmr.`quantity` AS quantity,\r\n dmr.`manu_no` AS manuNo,\r\n dmr.`eff_date` AS effDate,\r\n dmr.`operation_time` AS operationTime,\r\n di.`drug_name` AS drugName,\r\n di.`drug_spec` AS drugSpec,\r\n di.`pack_unit` AS packUnit,\r\n di.`manufactory` AS manuFactory,\r\n di.`max_stock` AS baseQuantity,\r\n dmr.`drug_id` AS drugId,\r\n ul.`user_name` AS nickname\r\nFROM\r\n dm_machine_record dmr\r\nLEFT JOIN drug_info di ON di.`drug_id` = dmr.`drug_id`\r\nLEFT JOIN user_list ul ON ul.`id` = dmr.`Operator`\r\nWHERE dmr.`type` = 1 \r\n AND dmr.`machine_id` = :machine_id\r\n AND dmr.`operation_time` > :startDate\r\n AND dmr.`operation_time` < :endDate",
|
||||||
|
"Field":[
|
||||||
|
{
|
||||||
|
"Name":"日期",
|
||||||
|
"Type":"DateTime",
|
||||||
|
"Format":"yyyy/MM/dd HH:mm:ss",
|
||||||
|
"DBFieldName":"operation_time"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Name":"效期",
|
||||||
|
"Format":"yyyy/MM/dd HH:mm:ss",
|
||||||
|
"DBFieldName":"eff_date"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Name":"药品名称",
|
||||||
|
"DBFieldName":"drug_name"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Name":"取药数量",
|
||||||
|
"DBFieldName":"quantity"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Name":"领取人",
|
||||||
|
"DBFieldName":"User_name"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Name":"发药人",
|
||||||
|
"Format":"yyyy/MM/dd",
|
||||||
|
"DBFieldName":"reviewer"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Name":"还药时间",
|
||||||
|
"Type":"DateTime",
|
||||||
|
"Format":"yyyy/MM/dd HH:mm:ss",
|
||||||
|
"DBFieldName":"returnOptTime"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Name":"还药数量",
|
||||||
|
"DBFieldName":"return_quantity1"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Name":"还空瓶数量",
|
||||||
|
"Type":"Integer",
|
||||||
|
"DBFieldName":"return_quantity2"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Name":"还药人",
|
||||||
|
"DBFieldName":"returnUser"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Name":"收取人",
|
||||||
|
"DBFieldName":"returnReviewer"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Name":"批次",
|
||||||
|
"DBFieldName":"manu_no"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"Column":[
|
||||||
|
{
|
||||||
|
"Name":"日期",
|
||||||
|
"Width":3.78354
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Name":"药品名称",
|
||||||
|
"Width":4.63021
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Name":"批次",
|
||||||
|
"Width":1.69333
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Name":"效期",
|
||||||
|
"Width":2.56646
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Name":"取药数量",
|
||||||
|
"Width":1.19063
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Name":"领取人",
|
||||||
|
"Width":1.61396
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Name":"发药人",
|
||||||
|
"Width":1.5875
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Name":"还药时间",
|
||||||
|
"Width":3.81
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Name":"还药数量",
|
||||||
|
"Width":1.05833
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Name":"还空瓶数量",
|
||||||
|
"Width":0.978958
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Name":"还药人",
|
||||||
|
"Width":1.37583
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Name":"收取人",
|
||||||
|
"Width":1.5875
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"ColumnContent":{
|
||||||
|
"Height":1.00542,
|
||||||
|
"ColumnContentCell":[
|
||||||
|
{
|
||||||
|
"Column":"日期",
|
||||||
|
"TextAlign":"MiddleCenter",
|
||||||
|
"DataField":"日期"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Column":"药品名称",
|
||||||
|
"TextAlign":"MiddleCenter",
|
||||||
|
"DataField":"药品名称"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Column":"批次",
|
||||||
|
"TextAlign":"MiddleCenter",
|
||||||
|
"DataField":"批次"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Column":"效期",
|
||||||
|
"TextAlign":"MiddleCenter",
|
||||||
|
"DataField":"效期"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Column":"取药数量",
|
||||||
|
"TextAlign":"MiddleCenter",
|
||||||
|
"DataField":"取药数量"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Column":"领取人",
|
||||||
|
"TextAlign":"MiddleCenter",
|
||||||
|
"DataField":"领取人"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Column":"发药人",
|
||||||
|
"TextAlign":"MiddleCenter",
|
||||||
|
"DataField":"发药人"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Column":"还药时间",
|
||||||
|
"TextAlign":"MiddleCenter",
|
||||||
|
"DataField":"还药时间"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Column":"还药数量",
|
||||||
|
"TextAlign":"MiddleCenter",
|
||||||
|
"DataField":"还药数量"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Column":"还空瓶数量",
|
||||||
|
"TextAlign":"MiddleCenter",
|
||||||
|
"DataField":"还空瓶数量"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Column":"还药人",
|
||||||
|
"TextAlign":"MiddleCenter",
|
||||||
|
"DataField":"还药人"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Column":"收取人",
|
||||||
|
"TextAlign":"MiddleCenter",
|
||||||
|
"DataField":"收取人"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"ColumnTitle":{
|
||||||
|
"Height":2.19604,
|
||||||
|
"RepeatStyle":"OnPage",
|
||||||
|
"ColumnTitleCell":[
|
||||||
|
{
|
||||||
|
"GroupTitle":false,
|
||||||
|
"Column":"日期",
|
||||||
|
"Font":{
|
||||||
|
"Name":"宋体",
|
||||||
|
"Size":120000,
|
||||||
|
"Bold":true,
|
||||||
|
"Charset":134
|
||||||
|
},
|
||||||
|
"TextAlign":"MiddleCenter",
|
||||||
|
"Text":"日期"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"GroupTitle":false,
|
||||||
|
"Column":"药品名称",
|
||||||
|
"Font":{
|
||||||
|
"Name":"宋体",
|
||||||
|
"Size":120000,
|
||||||
|
"Bold":true,
|
||||||
|
"Charset":134
|
||||||
|
},
|
||||||
|
"TextAlign":"MiddleCenter",
|
||||||
|
"Text":"药品名称"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"GroupTitle":false,
|
||||||
|
"Column":"批次",
|
||||||
|
"Font":{
|
||||||
|
"Name":"宋体",
|
||||||
|
"Size":120000,
|
||||||
|
"Bold":true,
|
||||||
|
"Charset":134
|
||||||
|
},
|
||||||
|
"TextAlign":"MiddleCenter",
|
||||||
|
"Text":"批次"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"GroupTitle":false,
|
||||||
|
"Column":"效期",
|
||||||
|
"Font":{
|
||||||
|
"Name":"宋体",
|
||||||
|
"Size":120000,
|
||||||
|
"Bold":true,
|
||||||
|
"Charset":134
|
||||||
|
},
|
||||||
|
"TextAlign":"MiddleCenter",
|
||||||
|
"Text":"效期"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"GroupTitle":false,
|
||||||
|
"Column":"取药数量",
|
||||||
|
"Font":{
|
||||||
|
"Name":"宋体",
|
||||||
|
"Size":120000,
|
||||||
|
"Bold":true,
|
||||||
|
"Charset":134
|
||||||
|
},
|
||||||
|
"TextAlign":"MiddleCenter",
|
||||||
|
"Text":"取\r\n药\r\n数\r\n量"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"GroupTitle":false,
|
||||||
|
"Column":"领取人",
|
||||||
|
"Font":{
|
||||||
|
"Name":"宋体",
|
||||||
|
"Size":120000,
|
||||||
|
"Bold":true,
|
||||||
|
"Charset":134
|
||||||
|
},
|
||||||
|
"TextAlign":"MiddleCenter",
|
||||||
|
"Text":"领取人"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"GroupTitle":false,
|
||||||
|
"Column":"发药人",
|
||||||
|
"Font":{
|
||||||
|
"Name":"宋体",
|
||||||
|
"Size":120000,
|
||||||
|
"Bold":true,
|
||||||
|
"Charset":134
|
||||||
|
},
|
||||||
|
"TextAlign":"MiddleCenter",
|
||||||
|
"Text":"发药人"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"GroupTitle":false,
|
||||||
|
"Column":"还药时间",
|
||||||
|
"Font":{
|
||||||
|
"Name":"宋体",
|
||||||
|
"Size":120000,
|
||||||
|
"Bold":true,
|
||||||
|
"Charset":134
|
||||||
|
},
|
||||||
|
"TextAlign":"MiddleCenter",
|
||||||
|
"Text":"还药时间"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"GroupTitle":false,
|
||||||
|
"Column":"还药数量",
|
||||||
|
"Font":{
|
||||||
|
"Name":"宋体",
|
||||||
|
"Size":120000,
|
||||||
|
"Bold":true,
|
||||||
|
"Charset":134
|
||||||
|
},
|
||||||
|
"TextAlign":"MiddleCenter",
|
||||||
|
"Text":"还\r\n药\r\n数\r\n量"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"GroupTitle":false,
|
||||||
|
"Column":"还空瓶数量",
|
||||||
|
"Font":{
|
||||||
|
"Name":"宋体",
|
||||||
|
"Size":120000,
|
||||||
|
"Bold":true,
|
||||||
|
"Charset":134
|
||||||
|
},
|
||||||
|
"TextAlign":"MiddleCenter",
|
||||||
|
"Text":"还\r\n空\r\n瓶\r\n数\r\n量"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"GroupTitle":false,
|
||||||
|
"Column":"还药人",
|
||||||
|
"Font":{
|
||||||
|
"Name":"宋体",
|
||||||
|
"Size":120000,
|
||||||
|
"Bold":true,
|
||||||
|
"Charset":134
|
||||||
|
},
|
||||||
|
"TextAlign":"MiddleCenter",
|
||||||
|
"Text":"还药人"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"GroupTitle":false,
|
||||||
|
"Column":"收取人",
|
||||||
|
"Font":{
|
||||||
|
"Name":"宋体",
|
||||||
|
"Size":120000,
|
||||||
|
"Bold":true,
|
||||||
|
"Charset":134
|
||||||
|
},
|
||||||
|
"TextAlign":"MiddleCenter",
|
||||||
|
"Text":"收取人"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"Parameter":[
|
||||||
|
{
|
||||||
|
"Name":"startDate",
|
||||||
|
"DataType":"DateTime",
|
||||||
|
"Format":"yyyy-MM-dd hh:mm:ss",
|
||||||
|
"Value":"2023/1/1"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Name":"endDate",
|
||||||
|
"DataType":"DateTime",
|
||||||
|
"Format":"yyyy-MM-dd hh:mm:ss",
|
||||||
|
"Value":"2023/4/28 23:59:59"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Name":"machine_id",
|
||||||
|
"Value":"DM1"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"ReportHeader":[
|
||||||
|
{
|
||||||
|
"Name":"ReportHeader1",
|
||||||
|
"Height":1.79917,
|
||||||
|
"Control":[
|
||||||
|
{
|
||||||
|
"Type":"MemoBox",
|
||||||
|
"Name":"MemoBox2",
|
||||||
|
"Left":7.80521,
|
||||||
|
"Top":0.211667,
|
||||||
|
"Width":10.3981,
|
||||||
|
"Height":1.19063,
|
||||||
|
"Font":{
|
||||||
|
"Name":"宋体",
|
||||||
|
"Size":217500,
|
||||||
|
"Bold":true,
|
||||||
|
"Charset":134
|
||||||
|
},
|
||||||
|
"TextAlign":"MiddleCenter",
|
||||||
|
"Text":"麻醉科精二药品领取登记表"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"RepeatOnPage":true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
|
@ -295,8 +295,8 @@ namespace DM_Weight.ViewModels
|
||||||
public void OnNavigatedTo(NavigationContext navigationContext)
|
public void OnNavigatedTo(NavigationContext navigationContext)
|
||||||
{
|
{
|
||||||
_eventAggregator.GetEvent<PortUtilEvent>().Subscribe(DoMyPrismEvent);
|
_eventAggregator.GetEvent<PortUtilEvent>().Subscribe(DoMyPrismEvent);
|
||||||
FindDrawerCount();
|
FindDrawerCount();
|
||||||
RequestData();
|
RequestData();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -293,8 +293,8 @@ namespace DM_Weight.ViewModels
|
||||||
public void OnNavigatedTo(NavigationContext navigationContext)
|
public void OnNavigatedTo(NavigationContext navigationContext)
|
||||||
{
|
{
|
||||||
_eventAggregator.GetEvent<PortUtilEvent>().Subscribe(DoMyPrismEvent);
|
_eventAggregator.GetEvent<PortUtilEvent>().Subscribe(DoMyPrismEvent);
|
||||||
FindDrawerCount();
|
FindDrawerCount();
|
||||||
RequestData();
|
RequestData();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -301,8 +301,8 @@ namespace DM_Weight.ViewModels
|
||||||
public void OnNavigatedTo(NavigationContext navigationContext)
|
public void OnNavigatedTo(NavigationContext navigationContext)
|
||||||
{
|
{
|
||||||
_eventAggregator.GetEvent<PortUtilEvent>().Subscribe(DoMyPrismEvent);
|
_eventAggregator.GetEvent<PortUtilEvent>().Subscribe(DoMyPrismEvent);
|
||||||
FindDrawerCount();
|
FindDrawerCount();
|
||||||
RequestData();
|
RequestData();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -241,8 +241,8 @@ namespace DM_Weight.ViewModels
|
||||||
//接收导航传过来的参数
|
//接收导航传过来的参数
|
||||||
public void OnNavigatedTo(NavigationContext navigationContext)
|
public void OnNavigatedTo(NavigationContext navigationContext)
|
||||||
{
|
{
|
||||||
//查询表格数据
|
//查询表格数据
|
||||||
RequestData();
|
RequestData();
|
||||||
}
|
}
|
||||||
|
|
||||||
void GetManuNos()
|
void GetManuNos()
|
||||||
|
|
|
@ -0,0 +1,12 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace DM_Weight.ViewModels
|
||||||
|
{
|
||||||
|
internal class DrugTakeCheckIn
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,150 @@
|
||||||
|
using DM_Weight.Models;
|
||||||
|
using Prism.Commands;
|
||||||
|
using Prism.Mvvm;
|
||||||
|
using Prism.Regions;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using DM_Weight.Report;
|
||||||
|
|
||||||
|
namespace DM_Weight.ViewModels
|
||||||
|
{
|
||||||
|
public class DrugTakeCheckInWindowViewModel:BindableBase, IConfirmNavigationRequest, IRegionMemberLifetime
|
||||||
|
{
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
private DateTime? _startDate = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day);
|
||||||
|
|
||||||
|
public DateTime? StartDate
|
||||||
|
{
|
||||||
|
get => _startDate;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (value != null)
|
||||||
|
{
|
||||||
|
SetProperty(ref _startDate, new DateTime(value?.Year ?? 0, value?.Month ?? 0, value?.Day ?? 0));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
SetProperty(ref _startDate, value);
|
||||||
|
}
|
||||||
|
RequestData();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private DateTime? _endDate = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 23, 59, 59);
|
||||||
|
|
||||||
|
public DateTime? EndDate
|
||||||
|
{
|
||||||
|
get => _endDate;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (value != null)
|
||||||
|
{
|
||||||
|
TimeSpan ershisi = new TimeSpan(23, 59, 59);
|
||||||
|
SetProperty(ref _endDate, new DateTime(value?.Year ?? 0, value?.Month ?? 0, value?.Day ?? 0, 23, 59, 59));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
SetProperty(ref _endDate, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
RequestData();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
private List<MachineRecord>? machineRecords;
|
||||||
|
|
||||||
|
public List<MachineRecord>? MachineRecords
|
||||||
|
{
|
||||||
|
get { return machineRecords; }
|
||||||
|
set { SetProperty(ref machineRecords, value); }
|
||||||
|
}
|
||||||
|
public bool KeepAlive => false;
|
||||||
|
|
||||||
|
|
||||||
|
public DelegateCommand Query
|
||||||
|
{
|
||||||
|
get => new DelegateCommand(() =>
|
||||||
|
{
|
||||||
|
RequestData();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public DelegateCommand Download
|
||||||
|
{
|
||||||
|
get => new DelegateCommand(() =>
|
||||||
|
{
|
||||||
|
//GridReportUtil.PrintReportDrugTakeCheckIn(StartDate, EndDate);
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
private void RequestData()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void ConfirmNavigationRequest(NavigationContext navigationContext, Action<bool> continuationCallback)
|
||||||
|
{
|
||||||
|
continuationCallback(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void OnNavigatedTo(NavigationContext navigationContext)
|
||||||
|
{
|
||||||
|
Task.Factory.StartNew(() =>
|
||||||
|
{
|
||||||
|
RequestData();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool IsNavigationTarget(NavigationContext navigationContext)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void OnNavigatedFrom(NavigationContext navigationContext)
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -21,6 +21,10 @@ using System.Timers;
|
||||||
using Unity;
|
using Unity;
|
||||||
using System.Windows.Threading;
|
using System.Windows.Threading;
|
||||||
using Newtonsoft.Json.Linq;
|
using Newtonsoft.Json.Linq;
|
||||||
|
using DM_Weight.msg;
|
||||||
|
using MaterialDesignThemes.Wpf;
|
||||||
|
using System.Windows.Media;
|
||||||
|
using DM_Weight.Common;
|
||||||
|
|
||||||
namespace DM_Weight.ViewModels
|
namespace DM_Weight.ViewModels
|
||||||
{
|
{
|
||||||
|
@ -31,8 +35,12 @@ namespace DM_Weight.ViewModels
|
||||||
private readonly IDialogService _dialogService;
|
private readonly IDialogService _dialogService;
|
||||||
private UserList? _userList;
|
private UserList? _userList;
|
||||||
private UserList? _userList2;
|
private UserList? _userList2;
|
||||||
|
//private bool ISTakeReturn;
|
||||||
|
|
||||||
private int loginMode = Convert.ToInt32(ConfigurationManager.AppSettings["loginMode"]?.ToString() ?? "1");
|
private int loginMode = Convert.ToInt32(CommonClass.ReadAppSetting("loginMode")?.ToString() ?? "1");
|
||||||
|
//获取可取药还药的时间段
|
||||||
|
//string[] timeSpan = CommonClass.ReadAppSetting("TakeReturnTime").Split('-');
|
||||||
|
//string weeksSpan = CommonClass.ReadAppSetting("TakeReturnWeek");
|
||||||
public bool MultiLogin
|
public bool MultiLogin
|
||||||
{
|
{
|
||||||
get => loginMode == 2;
|
get => loginMode == 2;
|
||||||
|
@ -102,6 +110,10 @@ namespace DM_Weight.ViewModels
|
||||||
{
|
{
|
||||||
if (value.PremissionPath.Equals("ReturnDrugWindow") || value.PremissionPath.Equals("ReturnDrugWindow2"))
|
if (value.PremissionPath.Equals("ReturnDrugWindow") || value.PremissionPath.Equals("ReturnDrugWindow2"))
|
||||||
{
|
{
|
||||||
|
//if (!ISTakeReturn)
|
||||||
|
//{
|
||||||
|
// return;
|
||||||
|
//}
|
||||||
if (ConfigurationManager.AppSettings["returnDrugMode"].ToString().Equals("1"))
|
if (ConfigurationManager.AppSettings["returnDrugMode"].ToString().Equals("1"))
|
||||||
{
|
{
|
||||||
_regionManager.RequestNavigate("ContentRegion", "ReturnDrugWindow2");
|
_regionManager.RequestNavigate("ContentRegion", "ReturnDrugWindow2");
|
||||||
|
@ -113,7 +125,14 @@ namespace DM_Weight.ViewModels
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
_regionManager.RequestNavigate("ContentRegion", value.PremissionPath);
|
//if (value.PremissionPath.Equals("OrderTakeDrugWindow") && !ISTakeReturn)
|
||||||
|
//{
|
||||||
|
// return;
|
||||||
|
//}
|
||||||
|
//else
|
||||||
|
{
|
||||||
|
_regionManager.RequestNavigate("ContentRegion", value.PremissionPath);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -152,19 +171,38 @@ namespace DM_Weight.ViewModels
|
||||||
}
|
}
|
||||||
private void SelectionMethod(ListBox viewName)
|
private void SelectionMethod(ListBox viewName)
|
||||||
{
|
{
|
||||||
|
logger.Info($"用户【{Operator?.Nickname}】进入菜单点击事件");
|
||||||
|
|
||||||
|
//CheckTakeReturnTime();
|
||||||
|
//PremissionDm premissionDm = viewName.SelectedItem as PremissionDm;
|
||||||
|
//if ((premissionDm.PremissionName == "取药" || premissionDm.PremissionName == "还药") && !ISTakeReturn)
|
||||||
|
//{
|
||||||
|
// //AlertMsg alertMsg = new AlertMsg
|
||||||
|
// //{
|
||||||
|
// // Message = $"当前时间不可操作{premissionDm.PremissionName}",
|
||||||
|
// // Type = MsgType.ERROR,
|
||||||
|
// //};
|
||||||
|
// //_eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg);
|
||||||
|
// SnackbarMessageQueue.Enqueue($"当前时间不可操作{premissionDm.PremissionName}");
|
||||||
|
// viewName.SelectedItem = SelectedMenu;
|
||||||
|
// return;
|
||||||
|
//}
|
||||||
|
|
||||||
SelectedMenu = viewName.SelectedItem as PremissionDm;
|
SelectedMenu = viewName.SelectedItem as PremissionDm;
|
||||||
if (SelectedMenu.PremissionName == "退出")
|
if (SelectedMenu.PremissionName == "退出")
|
||||||
{
|
{
|
||||||
logger.Info($"用户【{Operator?.Nickname}】退出登录");
|
//logger.Info($"用户【{Operator?.Nickname}】退出登录");
|
||||||
|
logger.Info($"用户【{Operator?.Nickname}】退出登录;SelectionMethod{SelectedMenu.PremissionName}");
|
||||||
Operator = null;
|
Operator = null;
|
||||||
Reviewer = null;
|
Reviewer = null;
|
||||||
_regionManager.RequestNavigate("MainRegion", "LoginWindow");
|
_regionManager.RequestNavigate("MainRegion", "LoginWindow");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
//SelectedMenu.Children = SelectedMenu.Children;
|
|
||||||
SelectedChildMenu = SelectedMenu.Children[0];
|
SelectedChildMenu = SelectedMenu.Children[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
logger.Info($"用户【{Operator?.Nickname}】结束菜单点击事件");
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<PremissionDm> PremissionDmList { get { return _premissionDmList; } set { SetProperty(ref _premissionDmList, value); } }
|
public List<PremissionDm> PremissionDmList { get { return _premissionDmList; } set { SetProperty(ref _premissionDmList, value); } }
|
||||||
|
@ -182,12 +220,14 @@ namespace DM_Weight.ViewModels
|
||||||
public bool Is16Drawer { get => _is16Drawer; set => SetProperty(ref _is16Drawer, value); }
|
public bool Is16Drawer { get => _is16Drawer; set => SetProperty(ref _is16Drawer, value); }
|
||||||
public bool KeepAlive => false;
|
public bool KeepAlive => false;
|
||||||
private PortUtil _portUtil;
|
private PortUtil _portUtil;
|
||||||
|
//IEventAggregator _eventAggregator;
|
||||||
public HomeWindowViewModel(IRegionManager iRegionManager, PortUtil portUtil, IDialogService dialogService, IUnityContainer container)
|
public HomeWindowViewModel(IRegionManager iRegionManager, PortUtil portUtil, IDialogService dialogService, IUnityContainer container)
|
||||||
{
|
{
|
||||||
_portUtil = portUtil;
|
_portUtil = portUtil;
|
||||||
_regionManager = iRegionManager;
|
_regionManager = iRegionManager;
|
||||||
_dialogService = dialogService;
|
_dialogService = dialogService;
|
||||||
_container = container;
|
_container = container;
|
||||||
|
//_eventAggregator = eventAggregator;
|
||||||
}
|
}
|
||||||
|
|
||||||
public DelegateCommand<string> OpenFingerDialog
|
public DelegateCommand<string> OpenFingerDialog
|
||||||
|
@ -199,6 +239,18 @@ namespace DM_Weight.ViewModels
|
||||||
DialogServiceExtensions.ShowDialogHost(_dialogService, "FingerprintDialog", dialogParameters, DoDialogResult, "RootDialog");
|
DialogServiceExtensions.ShowDialogHost(_dialogService, "FingerprintDialog", dialogParameters, DoDialogResult, "RootDialog");
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
//退出
|
||||||
|
public DelegateCommand QuitCommand
|
||||||
|
{
|
||||||
|
get => new DelegateCommand(QuitAction);
|
||||||
|
}
|
||||||
|
private void QuitAction()
|
||||||
|
{
|
||||||
|
logger.Info($"用户【{Operator?.Nickname}】退出登录;{UserList.Nickname}");
|
||||||
|
Operator = null;
|
||||||
|
Reviewer = null;
|
||||||
|
_regionManager.RequestNavigate("MainRegion", "LoginWindow");
|
||||||
|
}
|
||||||
|
|
||||||
public DelegateCommand OpenRecoverCommand
|
public DelegateCommand OpenRecoverCommand
|
||||||
{
|
{
|
||||||
|
@ -253,11 +305,53 @@ namespace DM_Weight.ViewModels
|
||||||
continuationCallback(true);
|
continuationCallback(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private ISnackbarMessageQueue _snackbarMessageQueue = new SnackbarMessageQueue(TimeSpan.FromSeconds(3));
|
||||||
|
public ISnackbarMessageQueue SnackbarMessageQueue
|
||||||
|
{
|
||||||
|
get => _snackbarMessageQueue;
|
||||||
|
set => SetProperty(ref _snackbarMessageQueue, value);
|
||||||
|
}
|
||||||
|
private SolidColorBrush _colorBrush=new SolidColorBrush((Color) ColorConverter.ConvertFromString("#b71c1c"));
|
||||||
|
|
||||||
|
public SolidColorBrush SnackbarBackground
|
||||||
|
{
|
||||||
|
get => _colorBrush;
|
||||||
|
set => SetProperty(ref _colorBrush, value);
|
||||||
|
}
|
||||||
//接收导航传过来的参数
|
//接收导航传过来的参数
|
||||||
public void OnNavigatedTo(NavigationContext navigationContext)
|
public void OnNavigatedTo(NavigationContext navigationContext)
|
||||||
{
|
{
|
||||||
|
//CheckTakeReturnTime();
|
||||||
|
////是否可操作取药还药定时
|
||||||
|
//System.Timers.Timer TakeReturnTimer = new System.Timers.Timer();
|
||||||
|
//TakeReturnTimer.Interval = 1000;
|
||||||
|
//TakeReturnTimer.Elapsed += (sender, e) =>
|
||||||
|
//{
|
||||||
|
// // 当前时间不可操作取药、还药
|
||||||
|
// if (!CheckTakeReturnTime())
|
||||||
|
// {
|
||||||
|
// if (SelectedMenu.PremissionName == "取药" || SelectedMenu.PremissionName == "还药")
|
||||||
|
// {
|
||||||
|
// SnackbarMessageQueue.Enqueue($"当前时间不可操作{SelectedMenu.PremissionName}");
|
||||||
|
// //SelectedMenu = ISTakeReturn ? UserList.Role.Permissions[0] : UserList.Role.Permissions[1];
|
||||||
|
// //SelectedChildMenu = SelectedMenu.Children[0];
|
||||||
|
// //_regionManager.RequestNavigate("ContentRegion", SelectedMenu.Children[0].PremissionPath);
|
||||||
|
// //PremissionDmList = UserList.Role.Permissions;
|
||||||
|
|
||||||
|
// List<PremissionDm> premissions = UserList.Role.Permissions;
|
||||||
|
|
||||||
|
// SelectedMenu = ISTakeReturn ? premissions[0] : premissions[1];
|
||||||
|
// SelectedChildMenu = SelectedMenu.Children[0];
|
||||||
|
// System.Windows.Application.Current.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Send, new Action(() =>
|
||||||
|
// {
|
||||||
|
// _regionManager.RequestNavigate("ContentRegion", "SelfAddWindow");
|
||||||
|
// }));
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
//};
|
||||||
|
//TakeReturnTimer.Start();
|
||||||
|
|
||||||
|
//_portUtil.dateTime = DateTime.Now;
|
||||||
//取出user
|
//取出user
|
||||||
UserList = navigationContext.Parameters.GetValue<UserList>("operator");
|
UserList = navigationContext.Parameters.GetValue<UserList>("operator");
|
||||||
Operator = UserList;
|
Operator = UserList;
|
||||||
|
@ -273,9 +367,13 @@ namespace DM_Weight.ViewModels
|
||||||
|
|
||||||
//SqlSugarHelper.Db.SqlQueryable<PremissionDm>(sql)
|
//SqlSugarHelper.Db.SqlQueryable<PremissionDm>(sql)
|
||||||
//.ToTree(pd => pd.Children, pd => pd.ParentId, 0);
|
//.ToTree(pd => pd.Children, pd => pd.ParentId, 0);
|
||||||
|
|
||||||
PremissionDmList = premissions;
|
PremissionDmList = premissions;
|
||||||
|
//SelectedMenu = ISTakeReturn ? premissions[0] : premissions[1];
|
||||||
SelectedMenu = premissions[0];
|
SelectedMenu = premissions[0];
|
||||||
SelectedChildMenu = SelectedMenu.Children[0];
|
SelectedChildMenu = SelectedMenu.Children[0];
|
||||||
|
|
||||||
|
|
||||||
FindDrawerCount();
|
FindDrawerCount();
|
||||||
|
|
||||||
int autoExit = Convert.ToInt32(ConfigurationManager.AppSettings["autoExit"] ?? "0");
|
int autoExit = Convert.ToInt32(ConfigurationManager.AppSettings["autoExit"] ?? "0");
|
||||||
|
@ -305,7 +403,46 @@ namespace DM_Weight.ViewModels
|
||||||
timer.Start();
|
timer.Start();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
///// <summary>
|
||||||
|
///// 检查是否在可取药、还药操作时间段
|
||||||
|
///// </summary>
|
||||||
|
//private bool CheckTakeReturnTime()
|
||||||
|
//{
|
||||||
|
// ISTakeReturn = true;
|
||||||
|
// //查询该时间段能否取药跟还药
|
||||||
|
// DateTime dtNow = DateTime.Now;
|
||||||
|
// string weekNow = DateTime.Today.DayOfWeek.ToString("d");
|
||||||
|
// string[] timeSpan = CommonClass.ReadAppSetting("TakeReturnTime").Split('-');
|
||||||
|
// string weeksSpan = CommonClass.ReadAppSetting("TakeReturnWeek");
|
||||||
|
// if (timeSpan != null && timeSpan.Length == 2&& weeksSpan.IndexOf(weekNow)>=0)
|
||||||
|
// {
|
||||||
|
// bool bStart = DateTime.TryParse(timeSpan[0], out DateTime startTime);
|
||||||
|
// bool bEnd = DateTime.TryParse(timeSpan[1], out DateTime endTime);
|
||||||
|
// if (bStart && bEnd)
|
||||||
|
// {
|
||||||
|
// if (endTime < startTime)
|
||||||
|
// {
|
||||||
|
// endTime = endTime.AddDays(1);
|
||||||
|
// }
|
||||||
|
// if (dtNow >= startTime && dtNow <= endTime)
|
||||||
|
// {
|
||||||
|
// ISTakeReturn = true;
|
||||||
|
// }
|
||||||
|
// else
|
||||||
|
// {
|
||||||
|
// ISTakeReturn = false;
|
||||||
|
// //AlertMsg alertMsg = new AlertMsg
|
||||||
|
// //{
|
||||||
|
// // Message = $"当前时间不可操作{SelectedMenu.PremissionName}",
|
||||||
|
// // Type = MsgType.ERROR,
|
||||||
|
// //};
|
||||||
|
// //_eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg);
|
||||||
|
// //return;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// return ISTakeReturn;
|
||||||
|
//}
|
||||||
//每次导航的时候,该实列用不用重新创建,true是不重新创建,false是重新创建
|
//每次导航的时候,该实列用不用重新创建,true是不重新创建,false是重新创建
|
||||||
public bool IsNavigationTarget(NavigationContext navigationContext)
|
public bool IsNavigationTarget(NavigationContext navigationContext)
|
||||||
{
|
{
|
||||||
|
|
|
@ -0,0 +1,473 @@
|
||||||
|
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.Configuration;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Windows;
|
||||||
|
using System.Windows.Controls;
|
||||||
|
using DM_Weight.Models;
|
||||||
|
using DM_Weight.Port;
|
||||||
|
using DM_Weight.util;
|
||||||
|
using DM_Weight.Views;
|
||||||
|
using System.Timers;
|
||||||
|
using Unity;
|
||||||
|
using System.Windows.Threading;
|
||||||
|
using Newtonsoft.Json.Linq;
|
||||||
|
using DM_Weight.msg;
|
||||||
|
using MaterialDesignThemes.Wpf;
|
||||||
|
using System.Windows.Media;
|
||||||
|
using DM_Weight.Common;
|
||||||
|
|
||||||
|
namespace DM_Weight.ViewModels
|
||||||
|
{
|
||||||
|
public class HomeWindowViewModel_New : BindableBase, IConfirmNavigationRequest, IRegionMemberLifetime
|
||||||
|
{
|
||||||
|
|
||||||
|
private readonly ILog logger = LogManager.GetLogger(typeof(HomeWindowViewModel));
|
||||||
|
private readonly IDialogService _dialogService;
|
||||||
|
private UserList? _userList;
|
||||||
|
private UserList? _userList2;
|
||||||
|
private bool ISTakeReturn;
|
||||||
|
|
||||||
|
private int loginMode = Convert.ToInt32(CommonClass.ReadAppSetting("loginMode")?.ToString() ?? "1");
|
||||||
|
//获取可取药还药的时间段
|
||||||
|
//string[] timeSpan = CommonClass.ReadAppSetting("TakeReturnTime").Split('-');
|
||||||
|
//string weeksSpan = CommonClass.ReadAppSetting("TakeReturnWeek");
|
||||||
|
public bool MultiLogin
|
||||||
|
{
|
||||||
|
get => loginMode == 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
private PremissionDm? _selectedMenu;
|
||||||
|
|
||||||
|
private PremissionDm? _selectedChildMenu;
|
||||||
|
|
||||||
|
private List<PremissionDm>? _premissionDmList;
|
||||||
|
|
||||||
|
public PremissionDm? SelectedChildMenu
|
||||||
|
{
|
||||||
|
get { return _selectedChildMenu; }
|
||||||
|
set
|
||||||
|
{
|
||||||
|
SetProperty(ref _selectedChildMenu, value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public PremissionDm? SelectedMenu
|
||||||
|
{
|
||||||
|
get { return _selectedMenu; }
|
||||||
|
set
|
||||||
|
{
|
||||||
|
//if (value != null)
|
||||||
|
//{
|
||||||
|
// if (value.PremissionName == "退出")
|
||||||
|
// {
|
||||||
|
// logger.Info($"用户【{Operator?.Nickname}】退出登录");
|
||||||
|
// Operator = null;
|
||||||
|
// Reviewer = null;
|
||||||
|
// _regionManager.RequestNavigate("MainRegion", "LoginWindow");
|
||||||
|
// }
|
||||||
|
// else
|
||||||
|
// {
|
||||||
|
// SelectedChildMenu = value.Children[0];
|
||||||
|
// }
|
||||||
|
//}
|
||||||
|
SetProperty(ref _selectedMenu, value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#region 父菜单查询
|
||||||
|
private DelegateCommand<ListBox> _selectionCommon;
|
||||||
|
public DelegateCommand<ListBox> SelectionCommon
|
||||||
|
{
|
||||||
|
get => _selectionCommon ?? (_selectionCommon = new DelegateCommand<ListBox>(SelectionMethod));
|
||||||
|
}
|
||||||
|
private void SelectionMethod(ListBox viewName)
|
||||||
|
{
|
||||||
|
logger.Info($"用户【{Operator?.Nickname}】进入菜单点击事件");
|
||||||
|
|
||||||
|
CheckTakeReturnTime();
|
||||||
|
PremissionDm premissionDm = viewName.SelectedItem as PremissionDm;
|
||||||
|
if ((premissionDm.PremissionName == "取药" || premissionDm.PremissionName == "还药") && !ISTakeReturn)
|
||||||
|
{
|
||||||
|
//AlertMsg alertMsg = new AlertMsg
|
||||||
|
//{
|
||||||
|
// Message = $"当前时间不可操作{premissionDm.PremissionName}",
|
||||||
|
// Type = MsgType.ERROR,
|
||||||
|
//};
|
||||||
|
//_eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg);
|
||||||
|
SnackbarMessageQueue.Enqueue($"当前时间不可操作{premissionDm.PremissionName}");
|
||||||
|
viewName.SelectedItem = SelectedMenu;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
SelectedMenu = viewName.SelectedItem as PremissionDm;
|
||||||
|
if (SelectedMenu.PremissionName == "退出")
|
||||||
|
{
|
||||||
|
//logger.Info($"用户【{Operator?.Nickname}】退出登录");
|
||||||
|
logger.Info($"用户【{Operator?.Nickname}】退出登录;SelectionMethod{SelectedMenu.PremissionName}");
|
||||||
|
Operator = null;
|
||||||
|
Reviewer = null;
|
||||||
|
_regionManager.RequestNavigate("MainRegion", "LoginWindow");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
SelectedChildMenu = SelectedMenu.Children[0];
|
||||||
|
}
|
||||||
|
|
||||||
|
logger.Info($"用户【{Operator?.Nickname}】结束菜单点击事件");
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region 子菜单查询
|
||||||
|
|
||||||
|
private DelegateCommand _selectionChildCommon;
|
||||||
|
public DelegateCommand SelectionChildCommon
|
||||||
|
{
|
||||||
|
get => _selectionChildCommon ?? (_selectionChildCommon = new DelegateCommand(SelectionChildMethod));
|
||||||
|
}
|
||||||
|
private void SelectionChildMethod()
|
||||||
|
{
|
||||||
|
if (!_portUtil.Operate)
|
||||||
|
{
|
||||||
|
if (SelectedChildMenu != null)
|
||||||
|
{
|
||||||
|
if (SelectedChildMenu.PremissionPath.Equals("TakeRecordWindow"))
|
||||||
|
{
|
||||||
|
//定义传参变量
|
||||||
|
NavigationParameters keys = new NavigationParameters();
|
||||||
|
|
||||||
|
//添加参数,键值对格式
|
||||||
|
keys.Add("Type", 2);
|
||||||
|
_regionManager.RequestNavigate("ContentRegion", "MachineRecordWindow", keys);
|
||||||
|
}
|
||||||
|
else if (SelectedChildMenu.PremissionPath.Equals("AddRecordWindow"))
|
||||||
|
{
|
||||||
|
//定义传参变量
|
||||||
|
NavigationParameters keys = new NavigationParameters();
|
||||||
|
|
||||||
|
//添加参数,键值对格式
|
||||||
|
keys.Add("Type", 1);
|
||||||
|
_regionManager.RequestNavigate("ContentRegion", "MachineRecordWindow", keys);
|
||||||
|
}
|
||||||
|
else if (SelectedChildMenu.PremissionPath.Equals("ReturnRecordWindow"))
|
||||||
|
{
|
||||||
|
//定义传参变量
|
||||||
|
NavigationParameters keys = new NavigationParameters();
|
||||||
|
|
||||||
|
//添加参数,键值对格式
|
||||||
|
keys.Add("Type", 3);
|
||||||
|
_regionManager.RequestNavigate("ContentRegion", "MachineRecordWindow", keys);
|
||||||
|
}
|
||||||
|
else if (SelectedChildMenu.PremissionPath.Equals("RetrunEmptyRecordWindow"))
|
||||||
|
{
|
||||||
|
//定义传参变量
|
||||||
|
NavigationParameters keys = new NavigationParameters();
|
||||||
|
|
||||||
|
//添加参数,键值对格式
|
||||||
|
keys.Add("Type", 3);
|
||||||
|
_regionManager.RequestNavigate("ContentRegion", SelectedChildMenu.PremissionPath, keys);
|
||||||
|
}
|
||||||
|
else if (SelectedChildMenu.PremissionPath.Equals("CheckRecordWindow"))
|
||||||
|
{
|
||||||
|
//定义传参变量
|
||||||
|
NavigationParameters keys = new NavigationParameters();
|
||||||
|
|
||||||
|
//添加参数,键值对格式
|
||||||
|
keys.Add("Type", 4);
|
||||||
|
_regionManager.RequestNavigate("ContentRegion", "MachineRecordWindow", keys);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (SelectedChildMenu.PremissionPath.Equals("ReturnDrugWindow") || SelectedChildMenu.PremissionPath.Equals("ReturnDrugWindow2"))
|
||||||
|
{
|
||||||
|
if (!ISTakeReturn)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (ConfigurationManager.AppSettings["returnDrugMode"].ToString().Equals("1"))
|
||||||
|
{
|
||||||
|
_regionManager.RequestNavigate("ContentRegion", "ReturnDrugWindow2");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_regionManager.RequestNavigate("ContentRegion", "ReturnDrugWindow");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (SelectedChildMenu.PremissionPath.Equals("OrderTakeDrugWindow") && !ISTakeReturn)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_regionManager.RequestNavigate("ContentRegion", SelectedChildMenu.PremissionPath);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
SetProperty(ref _selectedChildMenu, SelectedChildMenu);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
public List<PremissionDm> PremissionDmList { get { return _premissionDmList; } set { SetProperty(ref _premissionDmList, value); } }
|
||||||
|
|
||||||
|
public UserList UserList { get { return _userList; } set { SetProperty(ref _userList, value); } }
|
||||||
|
public UserList UserList2 { get { return _userList2; } set { SetProperty(ref _userList2, value); } }
|
||||||
|
|
||||||
|
public static UserList? Operator;
|
||||||
|
public static UserList? Reviewer;
|
||||||
|
|
||||||
|
IRegionManager _regionManager;
|
||||||
|
IUnityContainer _container;
|
||||||
|
|
||||||
|
private bool _is16Drawer;
|
||||||
|
public bool Is16Drawer { get => _is16Drawer; set => SetProperty(ref _is16Drawer, value); }
|
||||||
|
public bool KeepAlive => false;
|
||||||
|
private PortUtil _portUtil;
|
||||||
|
//IEventAggregator _eventAggregator;
|
||||||
|
public HomeWindowViewModel_New(IRegionManager iRegionManager, PortUtil portUtil, IDialogService dialogService, IUnityContainer container)
|
||||||
|
{
|
||||||
|
_portUtil = portUtil;
|
||||||
|
_regionManager = iRegionManager;
|
||||||
|
_dialogService = dialogService;
|
||||||
|
_container = container;
|
||||||
|
//_eventAggregator = eventAggregator;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DelegateCommand<string> OpenFingerDialog
|
||||||
|
{
|
||||||
|
get => new DelegateCommand<string>((string Type) =>
|
||||||
|
{
|
||||||
|
DialogParameters dialogParameters = new DialogParameters();
|
||||||
|
dialogParameters.Add("User", Type.Equals("Operator") ? Operator : Reviewer);
|
||||||
|
DialogServiceExtensions.ShowDialogHost(_dialogService, "FingerprintDialog", dialogParameters, DoDialogResult, "RootDialog");
|
||||||
|
});
|
||||||
|
}
|
||||||
|
//退出
|
||||||
|
public DelegateCommand QuitCommand
|
||||||
|
{
|
||||||
|
get => new DelegateCommand(QuitAction);
|
||||||
|
}
|
||||||
|
private void QuitAction()
|
||||||
|
{
|
||||||
|
logger.Info($"用户【{Operator?.Nickname}】退出登录;{UserList.Nickname}");
|
||||||
|
Operator = null;
|
||||||
|
Reviewer = null;
|
||||||
|
_regionManager.RequestNavigate("MainRegion", "LoginWindow");
|
||||||
|
}
|
||||||
|
|
||||||
|
public DelegateCommand OpenRecoverCommand
|
||||||
|
{
|
||||||
|
get => new DelegateCommand(async () =>
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
_portUtil.WindowName = "HomeWindow";
|
||||||
|
_portUtil.Operate = true;
|
||||||
|
await _portUtil.OpenStorage();
|
||||||
|
_portUtil.ResetData();
|
||||||
|
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
logger.Info($"OpenRecoverCommand异常{ex.Message}");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public DelegateCommand<string> OpenEditPasswordDialog
|
||||||
|
{
|
||||||
|
get => new DelegateCommand<string>((string Type) =>
|
||||||
|
{
|
||||||
|
DialogParameters dialogParameters = new DialogParameters();
|
||||||
|
dialogParameters.Add("EditPass", true);
|
||||||
|
dialogParameters.Add("User", Type.Equals("Operator") ? Operator : Reviewer);
|
||||||
|
DialogServiceExtensions.ShowDialogHost(_dialogService, "EditUserDialog", dialogParameters, DoDialogResult, "RootDialog");
|
||||||
|
});
|
||||||
|
}
|
||||||
|
private void DoDialogResult(IDialogResult dialogResult)
|
||||||
|
{
|
||||||
|
// 委托 被动执行 被子窗口执行
|
||||||
|
// dialogResult 第一方面可以拿到任意参数 第二方面 可判断关闭状态
|
||||||
|
if (dialogResult.Result == ButtonResult.OK)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void FindDrawerCount()
|
||||||
|
{
|
||||||
|
int count = SqlSugarHelper.Db.Queryable<ChannelStock>().Where(cs => cs.DrawerType != 3)
|
||||||
|
.Where(cs => cs.MachineId.Equals(ConfigurationManager.AppSettings["machineId"] ?? "DM1")).GroupBy(cs => cs.DrawerNo).Select(cs => SqlFunc.AggregateCount(cs.DrawerNo)).Count();
|
||||||
|
|
||||||
|
Is16Drawer = count == 16;
|
||||||
|
}
|
||||||
|
|
||||||
|
//这个方法用于拦截请求,continuationCallback(true)就是不拦截,continuationCallback(false)拦截本次操作
|
||||||
|
public void ConfirmNavigationRequest(NavigationContext navigationContext, Action<bool> continuationCallback)
|
||||||
|
{
|
||||||
|
continuationCallback(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
private ISnackbarMessageQueue _snackbarMessageQueue = new SnackbarMessageQueue(TimeSpan.FromSeconds(3));
|
||||||
|
public ISnackbarMessageQueue SnackbarMessageQueue
|
||||||
|
{
|
||||||
|
get => _snackbarMessageQueue;
|
||||||
|
set => SetProperty(ref _snackbarMessageQueue, value);
|
||||||
|
}
|
||||||
|
private SolidColorBrush _colorBrush = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#b71c1c"));
|
||||||
|
|
||||||
|
public SolidColorBrush SnackbarBackground
|
||||||
|
{
|
||||||
|
get => _colorBrush;
|
||||||
|
set => SetProperty(ref _colorBrush, value);
|
||||||
|
}
|
||||||
|
//接收导航传过来的参数
|
||||||
|
public void OnNavigatedTo(NavigationContext navigationContext)
|
||||||
|
{
|
||||||
|
CheckTakeReturnTime();
|
||||||
|
//是否可操作取药还药定时
|
||||||
|
System.Timers.Timer TakeReturnTimer = new System.Timers.Timer();
|
||||||
|
TakeReturnTimer.Interval = 1000;
|
||||||
|
TakeReturnTimer.Elapsed += (sender, e) =>
|
||||||
|
{
|
||||||
|
// 当前时间不可操作取药、还药
|
||||||
|
if (!CheckTakeReturnTime())
|
||||||
|
{
|
||||||
|
if (SelectedMenu.PremissionName == "取药" || SelectedMenu.PremissionName == "还药")
|
||||||
|
{
|
||||||
|
SnackbarMessageQueue.Enqueue($"当前时间不可操作{SelectedMenu.PremissionName}");
|
||||||
|
//SelectedMenu = ISTakeReturn ? UserList.Role.Permissions[0] : UserList.Role.Permissions[1];
|
||||||
|
//SelectedChildMenu = SelectedMenu.Children[0];
|
||||||
|
//_regionManager.RequestNavigate("ContentRegion", SelectedMenu.Children[0].PremissionPath);
|
||||||
|
//PremissionDmList = UserList.Role.Permissions;
|
||||||
|
|
||||||
|
List<PremissionDm> premissions = UserList.Role.Permissions;
|
||||||
|
|
||||||
|
SelectedMenu = ISTakeReturn ? premissions[0] : premissions[1];
|
||||||
|
SelectedChildMenu = SelectedMenu.Children[0];
|
||||||
|
System.Windows.Application.Current.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Send, new Action(() =>
|
||||||
|
{
|
||||||
|
_regionManager.RequestNavigate("ContentRegion", "SelfAddWindow");
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
TakeReturnTimer.Start();
|
||||||
|
|
||||||
|
_portUtil.dateTime = DateTime.Now;
|
||||||
|
//取出user
|
||||||
|
UserList = navigationContext.Parameters.GetValue<UserList>("operator");
|
||||||
|
Operator = UserList;
|
||||||
|
logger.Info($"发药人【{Operator.Nickname}】登录");
|
||||||
|
if (navigationContext.Parameters.ContainsKey("reviewer"))
|
||||||
|
{
|
||||||
|
UserList2 = navigationContext.Parameters.GetValue<UserList>("reviewer");
|
||||||
|
Reviewer = UserList2;
|
||||||
|
logger.Info($"审核人【{Reviewer.Nickname}】登录");
|
||||||
|
}
|
||||||
|
|
||||||
|
List<PremissionDm> premissions = UserList.Role.Permissions;
|
||||||
|
|
||||||
|
//SqlSugarHelper.Db.SqlQueryable<PremissionDm>(sql)
|
||||||
|
//.ToTree(pd => pd.Children, pd => pd.ParentId, 0);
|
||||||
|
|
||||||
|
PremissionDmList = premissions;
|
||||||
|
SelectedMenu = ISTakeReturn ? premissions[0] : premissions[1];
|
||||||
|
SelectedChildMenu = SelectedMenu.Children[0];
|
||||||
|
|
||||||
|
|
||||||
|
FindDrawerCount();
|
||||||
|
|
||||||
|
int autoExit = Convert.ToInt32(ConfigurationManager.AppSettings["autoExit"] ?? "0");
|
||||||
|
if (autoExit > 0)
|
||||||
|
{
|
||||||
|
Timer timer = new Timer();
|
||||||
|
timer.Interval = 1000;
|
||||||
|
timer.Elapsed += (sender, e) =>
|
||||||
|
{
|
||||||
|
// 串口无人操作
|
||||||
|
if (!_portUtil.Operate)
|
||||||
|
{
|
||||||
|
// 30秒内无人操作鼠标键盘
|
||||||
|
if ((DateTime.Now - _portUtil.dateTime).TotalSeconds > autoExit && CheckComputerFreeState.GetLastInputTime() > autoExit)
|
||||||
|
{
|
||||||
|
logger.Info($"设备30秒内无人操作,用户【{Operator?.Nickname}】自动退出登录");
|
||||||
|
Operator = null;
|
||||||
|
Reviewer = null;
|
||||||
|
Application.Current.Dispatcher.Invoke(() =>
|
||||||
|
{
|
||||||
|
_regionManager.RequestNavigate("MainRegion", "LoginWindow");
|
||||||
|
timer.Stop();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
timer.Start();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 检查是否在可取药、还药操作时间段
|
||||||
|
/// </summary>
|
||||||
|
private bool CheckTakeReturnTime()
|
||||||
|
{
|
||||||
|
ISTakeReturn = true;
|
||||||
|
//查询该时间段能否取药跟还药
|
||||||
|
DateTime dtNow = DateTime.Now;
|
||||||
|
string weekNow = DateTime.Today.DayOfWeek.ToString("d");
|
||||||
|
string[] timeSpan = CommonClass.ReadAppSetting("TakeReturnTime").Split('-');
|
||||||
|
string weeksSpan = CommonClass.ReadAppSetting("TakeReturnWeek");
|
||||||
|
if (timeSpan != null && timeSpan.Length == 2 && weeksSpan.IndexOf(weekNow) >= 0)
|
||||||
|
{
|
||||||
|
bool bStart = DateTime.TryParse(timeSpan[0], out DateTime startTime);
|
||||||
|
bool bEnd = DateTime.TryParse(timeSpan[1], out DateTime endTime);
|
||||||
|
if (bStart && bEnd)
|
||||||
|
{
|
||||||
|
if (endTime < startTime)
|
||||||
|
{
|
||||||
|
endTime = endTime.AddDays(1);
|
||||||
|
}
|
||||||
|
if (dtNow >= startTime && dtNow <= endTime)
|
||||||
|
{
|
||||||
|
ISTakeReturn = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ISTakeReturn = false;
|
||||||
|
//AlertMsg alertMsg = new AlertMsg
|
||||||
|
//{
|
||||||
|
// Message = $"当前时间不可操作{SelectedMenu.PremissionName}",
|
||||||
|
// Type = MsgType.ERROR,
|
||||||
|
//};
|
||||||
|
//_eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg);
|
||||||
|
//return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return ISTakeReturn;
|
||||||
|
}
|
||||||
|
//每次导航的时候,该实列用不用重新创建,true是不重新创建,false是重新创建
|
||||||
|
public bool IsNavigationTarget(NavigationContext navigationContext)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
//这个方法用于拦截请求
|
||||||
|
public void OnNavigatedFrom(NavigationContext navigationContext)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -366,7 +366,7 @@ namespace DM_Weight.ViewModels
|
||||||
//接收导航传过来的参数 现在是在此处初始化了表格数据
|
//接收导航传过来的参数 现在是在此处初始化了表格数据
|
||||||
public void OnNavigatedTo(NavigationContext navigationContext)
|
public void OnNavigatedTo(NavigationContext navigationContext)
|
||||||
{
|
{
|
||||||
RequestData();
|
RequestData();
|
||||||
}
|
}
|
||||||
|
|
||||||
//每次导航的时候,该实列用不用重新创建,true是不重新创建,false是重新创建
|
//每次导航的时候,该实列用不用重新创建,true是不重新创建,false是重新创建
|
||||||
|
|
|
@ -252,7 +252,7 @@ namespace DM_Weight.ViewModels
|
||||||
//接收导航传过来的参数 现在是在此处初始化了表格数据
|
//接收导航传过来的参数 现在是在此处初始化了表格数据
|
||||||
public void OnNavigatedTo(NavigationContext navigationContext)
|
public void OnNavigatedTo(NavigationContext navigationContext)
|
||||||
{
|
{
|
||||||
RequestData();
|
RequestData();
|
||||||
}
|
}
|
||||||
|
|
||||||
//每次导航的时候,该实列用不用重新创建,true是不重新创建,false是重新创建
|
//每次导航的时候,该实列用不用重新创建,true是不重新创建,false是重新创建
|
||||||
|
|
|
@ -151,7 +151,23 @@ namespace DM_Weight.ViewModels
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public DelegateCommand DragTakeCheckInCommand
|
||||||
|
{
|
||||||
|
get => new DelegateCommand(() =>
|
||||||
|
{
|
||||||
|
GridReportUtil.PrintReportDrugTakeCheckIn(StartDate, EndDate,1);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public DelegateCommand DragTakeCheckIn2Command
|
||||||
|
{
|
||||||
|
get => new DelegateCommand(() =>
|
||||||
|
{
|
||||||
|
GridReportUtil.PrintReportDrugTakeCheckIn(StartDate, EndDate,2);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
void ReportInitialize()
|
void ReportInitialize()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -170,8 +186,8 @@ namespace DM_Weight.ViewModels
|
||||||
//取出Type决定页面显示内容
|
//取出Type决定页面显示内容
|
||||||
Type = navigationContext.Parameters.GetValue<int>("Type");
|
Type = navigationContext.Parameters.GetValue<int>("Type");
|
||||||
|
|
||||||
//查询表格数据
|
//查询表格数据
|
||||||
RequestData();
|
RequestData();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -15,12 +15,14 @@ using DM_Weight.select;
|
||||||
using DM_Weight.util;
|
using DM_Weight.util;
|
||||||
using DM_Weight.msg;
|
using DM_Weight.msg;
|
||||||
using Prism.Events;
|
using Prism.Events;
|
||||||
|
using log4net.Repository.Hierarchy;
|
||||||
|
using log4net;
|
||||||
|
|
||||||
namespace DM_Weight.ViewModels
|
namespace DM_Weight.ViewModels
|
||||||
{
|
{
|
||||||
public class OrderTakeDrugWindowViewModel : BindableBase, IConfirmNavigationRequest, IRegionMemberLifetime
|
public class OrderTakeDrugWindowViewModel : BindableBase, IConfirmNavigationRequest, IRegionMemberLifetime
|
||||||
{
|
{
|
||||||
|
private readonly ILog logger = LogManager.GetLogger(typeof(OrderTakeDrugWindowViewModel));
|
||||||
private int _pageNum = 1;
|
private int _pageNum = 1;
|
||||||
public int PageNum
|
public int PageNum
|
||||||
{
|
{
|
||||||
|
@ -72,6 +74,8 @@ namespace DM_Weight.ViewModels
|
||||||
|
|
||||||
public OrderTakeDrugWindowViewModel(IDialogService DialogService, IEventAggregator eventAggregator)
|
public OrderTakeDrugWindowViewModel(IDialogService DialogService, IEventAggregator eventAggregator)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
logger.Info($"用户【{HomeWindowViewModel.Operator?.Nickname}】进入OrderTakeDrugWindowViewModel构造函数");
|
||||||
_dialogService = DialogService;
|
_dialogService = DialogService;
|
||||||
_eventAggregator = eventAggregator;
|
_eventAggregator = eventAggregator;
|
||||||
}
|
}
|
||||||
|
@ -244,8 +248,21 @@ namespace DM_Weight.ViewModels
|
||||||
//接收导航传过来的参数 现在是在此处初始化了表格数据
|
//接收导航传过来的参数 现在是在此处初始化了表格数据
|
||||||
public void OnNavigatedTo(NavigationContext navigationContext)
|
public void OnNavigatedTo(NavigationContext navigationContext)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
logger.Info($"用户【{HomeWindowViewModel.Operator?.Nickname}】进入OrderTakeDrugWindowViewModel.OnNavigatedTo函数");
|
||||||
|
|
||||||
_eventAggregator.GetEvent<PortUtilEvent>().Subscribe(DoMyPrismEvent);
|
_eventAggregator.GetEvent<PortUtilEvent>().Subscribe(DoMyPrismEvent);
|
||||||
RequestData();
|
Task.Factory.StartNew(() =>
|
||||||
|
{
|
||||||
|
|
||||||
|
logger.Info($"用户【{HomeWindowViewModel.Operator?.Nickname}】进入OnNavigatedTo请求数据线程");
|
||||||
|
RequestData();
|
||||||
|
|
||||||
|
logger.Info($"用户【{HomeWindowViewModel.Operator?.Nickname}】结束OnNavigatedTo请求数据线程");
|
||||||
|
});
|
||||||
|
|
||||||
|
logger.Info($"用户【{HomeWindowViewModel.Operator?.Nickname}】结束OrderTakeDrugWindowViewModel.OnNavigatedTo函数");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//每次导航的时候,该实列用不用重新创建,true是不重新创建,false是重新创建
|
//每次导航的时候,该实列用不用重新创建,true是不重新创建,false是重新创建
|
||||||
|
|
|
@ -88,7 +88,7 @@ namespace DM_Weight.ViewModels
|
||||||
{
|
{
|
||||||
logger.Error(e);
|
logger.Error(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
// 打开失败
|
// 打开失败
|
||||||
case EventType.OPENERROR:
|
case EventType.OPENERROR:
|
||||||
|
@ -176,12 +176,12 @@ namespace DM_Weight.ViewModels
|
||||||
List<ChannelStock> queryData = SqlSugarHelper.Db.Queryable<ChannelStock>()
|
List<ChannelStock> queryData = SqlSugarHelper.Db.Queryable<ChannelStock>()
|
||||||
.Where(cs => cs.DrugId == MachineRecord.DrugId)
|
.Where(cs => cs.DrugId == MachineRecord.DrugId)
|
||||||
.Where(cs => cs.MachineId.Equals(ConfigurationManager.AppSettings["machineId"] ?? "DM1"))
|
.Where(cs => cs.MachineId.Equals(ConfigurationManager.AppSettings["machineId"] ?? "DM1"))
|
||||||
.WhereIF(MachineRecord.ManuNo != null,cs => cs.ManuNo == MachineRecord.ManuNo)
|
.WhereIF(MachineRecord.ManuNo != null, cs => cs.ManuNo == MachineRecord.ManuNo)
|
||||||
.OrderBy(cs => cs.DrawerNo)
|
.OrderBy(cs => cs.DrawerNo)
|
||||||
.OrderBy(cs => cs.ColNo)
|
.OrderBy(cs => cs.ColNo)
|
||||||
.ToList();
|
.ToList();
|
||||||
ChannelStocks = queryData;
|
ChannelStocks = queryData;
|
||||||
if(ChannelStocks.Count > 0)
|
if (ChannelStocks.Count > 0)
|
||||||
{
|
{
|
||||||
ChannelStock = ChannelStocks[0];
|
ChannelStock = ChannelStocks[0];
|
||||||
}
|
}
|
||||||
|
@ -202,7 +202,8 @@ namespace DM_Weight.ViewModels
|
||||||
_portUtil.ColNos = new int[] { ChannelStock.ColNo };
|
_portUtil.ColNos = new int[] { ChannelStock.ColNo };
|
||||||
_portUtil.DrawerNo = ChannelStock.DrawerNo;
|
_portUtil.DrawerNo = ChannelStock.DrawerNo;
|
||||||
_portUtil.Start();
|
_portUtil.Start();
|
||||||
} else
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
AlertMsg alertMsg = new AlertMsg
|
AlertMsg alertMsg = new AlertMsg
|
||||||
{
|
{
|
||||||
|
@ -224,51 +225,64 @@ namespace DM_Weight.ViewModels
|
||||||
{
|
{
|
||||||
get => new DelegateCommand(() =>
|
get => new DelegateCommand(() =>
|
||||||
{
|
{
|
||||||
|
if (MachineRecord.ReturnQuantity2>0&&(MachineRecord.CanReturnQuantity - ReturnQuantity) != 0)
|
||||||
|
{
|
||||||
|
AlertMsg alertMsg = new AlertMsg
|
||||||
|
{
|
||||||
|
Message = "归还数目与实际数目不符",
|
||||||
|
Type = MsgType.ERROR,
|
||||||
|
};
|
||||||
|
_eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg);
|
||||||
|
IsFinishClick = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
IsFinishClick = true;
|
IsFinishClick = true;
|
||||||
string InvoiceId = "RETURN_" + CurrentTimeMillis();
|
string InvoiceId = "RETURN_" + CurrentTimeMillis();
|
||||||
|
|
||||||
var f = SqlSugarHelper.Db.UseTran(() =>
|
var f = SqlSugarHelper.Db.UseTran(() =>
|
||||||
|
{
|
||||||
|
|
||||||
|
// 更新数据 库存信息
|
||||||
|
SqlSugarHelper.Db.Updateable(new ChannelStock()
|
||||||
{
|
{
|
||||||
|
Quantity = ChannelStock.Quantity + ReturnQuantity,
|
||||||
// 更新数据 库存信息
|
Id = ChannelStock.Id,
|
||||||
SqlSugarHelper.Db.Updateable(new ChannelStock()
|
}).UpdateColumns(it => new { it.Quantity }).ExecuteCommand();
|
||||||
{
|
|
||||||
Quantity = ChannelStock.Quantity + ReturnQuantity,
|
|
||||||
Id = ChannelStock.Id,
|
|
||||||
}).UpdateColumns(it => new { it.Quantity }).ExecuteCommand();
|
|
||||||
|
|
||||||
// 获取更新完库存后的药品库存
|
// 获取更新完库存后的药品库存
|
||||||
List<ChannelStock> nowChannels = SqlSugarHelper.Db.Queryable<ChannelStock>()
|
List<ChannelStock> nowChannels = SqlSugarHelper.Db.Queryable<ChannelStock>()
|
||||||
.Where(cs => cs.MachineId.Equals(ChannelStock.MachineId))
|
.Where(cs => cs.MachineId.Equals(ChannelStock.MachineId))
|
||||||
.Where(cs => cs.DrugId.Equals(ChannelStock.DrugId))
|
.Where(cs => cs.DrugId.Equals(ChannelStock.DrugId))
|
||||||
.Where(cs => cs.DrawerType == 1)
|
.Where(cs => cs.DrawerType == 1)
|
||||||
.ToList();
|
.ToList();
|
||||||
// 更新数据 取药记录 设置还药数量、状态
|
// 更新数据 取药记录 设置还药数量、状态
|
||||||
SqlSugarHelper.Db.Updateable(new MachineRecord()
|
SqlSugarHelper.Db.Updateable(new MachineRecord()
|
||||||
{
|
{
|
||||||
ReturnQuantity1 = MachineRecord.ReturnQuantity1 + ReturnQuantity,
|
ReturnQuantity1 = MachineRecord.ReturnQuantity1 + ReturnQuantity,
|
||||||
Id = MachineRecord.Id,
|
Id = MachineRecord.Id,
|
||||||
Status = (MachineRecord.CanReturnQuantity - ReturnQuantity) == 0 ? 2 : 1,
|
Status = (MachineRecord.CanReturnQuantity - ReturnQuantity) == 0 ? 2 : 1,
|
||||||
}).UpdateColumns(it => new { it.ReturnQuantity1, it.Status }).ExecuteCommand();
|
}).UpdateColumns(it => new { it.ReturnQuantity1, it.Status }).ExecuteCommand();
|
||||||
|
|
||||||
// 保存数据 还药记录
|
// 保存数据 还药记录
|
||||||
SqlSugarHelper.Db.Insertable(new MachineRecord()
|
SqlSugarHelper.Db.Insertable(new MachineRecord()
|
||||||
{
|
{
|
||||||
MachineId = ChannelStock.MachineId,
|
MachineId = ChannelStock.MachineId,
|
||||||
DrawerNo = ChannelStock.DrawerNo,
|
DrawerNo = ChannelStock.DrawerNo,
|
||||||
ColNo = ChannelStock.ColNo,
|
ColNo = ChannelStock.ColNo,
|
||||||
DrugId = ChannelStock.DrugId,
|
DrugId = ChannelStock.DrugId,
|
||||||
ManuNo = ChannelStock.ManuNo,
|
ManuNo = ChannelStock.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,
|
||||||
OperationTime = DateTime.Now,
|
OperationTime = DateTime.Now,
|
||||||
Quantity = ReturnQuantity,
|
Quantity = ReturnQuantity,
|
||||||
Type = 31,
|
Type = 31,
|
||||||
InvoiceId = InvoiceId,
|
InvoiceId = InvoiceId,
|
||||||
GetId = MachineRecord.Id,
|
GetId = MachineRecord.Id,
|
||||||
StockQuantity = nowChannels.Sum(it => it.Quantity)
|
StockQuantity = nowChannels.Sum(it => it.Quantity)
|
||||||
}).ExecuteCommand();
|
}).ExecuteCommand();
|
||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
if (f.Data)
|
if (f.Data)
|
||||||
{
|
{
|
||||||
// 更新屏显库存
|
// 更新屏显库存
|
||||||
|
|
|
@ -236,7 +236,7 @@ namespace DM_Weight.ViewModels
|
||||||
//接收导航传过来的参数 现在是在此处初始化了表格数据
|
//接收导航传过来的参数 现在是在此处初始化了表格数据
|
||||||
public void OnNavigatedTo(NavigationContext navigationContext)
|
public void OnNavigatedTo(NavigationContext navigationContext)
|
||||||
{
|
{
|
||||||
RequestData();
|
RequestData();
|
||||||
}
|
}
|
||||||
|
|
||||||
//每次导航的时候,该实列用不用重新创建,true是不重新创建,false是重新创建
|
//每次导航的时候,该实列用不用重新创建,true是不重新创建,false是重新创建
|
||||||
|
|
|
@ -12,12 +12,13 @@ using DM_Weight.Models;
|
||||||
using DM_Weight.select;
|
using DM_Weight.select;
|
||||||
using DM_Weight.util;
|
using DM_Weight.util;
|
||||||
using SqlSugar;
|
using SqlSugar;
|
||||||
|
using log4net;
|
||||||
|
|
||||||
namespace DM_Weight.ViewModels
|
namespace DM_Weight.ViewModels
|
||||||
{
|
{
|
||||||
public class ReturnDrugWindowViewModel : BindableBase, IConfirmNavigationRequest, IRegionMemberLifetime
|
public class ReturnDrugWindowViewModel : BindableBase, IConfirmNavigationRequest, IRegionMemberLifetime
|
||||||
{
|
{
|
||||||
|
private readonly ILog logger = LogManager.GetLogger(typeof(ReturnDrugWindowViewModel));
|
||||||
IDialogService _dialogService;
|
IDialogService _dialogService;
|
||||||
|
|
||||||
private DelegateCommand _rowSelected;
|
private DelegateCommand _rowSelected;
|
||||||
|
@ -26,6 +27,7 @@ namespace DM_Weight.ViewModels
|
||||||
|
|
||||||
public ReturnDrugWindowViewModel(IDialogService DialogService)
|
public ReturnDrugWindowViewModel(IDialogService DialogService)
|
||||||
{
|
{
|
||||||
|
logger.Info($"用户【{HomeWindowViewModel.Operator?.Nickname}】进入ReturnDrugWindowViewModel构造函数");
|
||||||
_dialogService = DialogService;
|
_dialogService = DialogService;
|
||||||
}
|
}
|
||||||
//刷新
|
//刷新
|
||||||
|
@ -191,7 +193,10 @@ 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,OrderByType.Desc)
|
.OrderBy(mr => mr.Operator != HomeWindowViewModel.Operator.Id)
|
||||||
|
.OrderBy(mr => mr.Operator)
|
||||||
|
.OrderBy(mr =>mr.OperationTime,OrderByType.Desc)
|
||||||
|
|
||||||
.ToList();
|
.ToList();
|
||||||
MachineRecords = queryData;
|
MachineRecords = queryData;
|
||||||
}
|
}
|
||||||
|
@ -199,7 +204,14 @@ namespace DM_Weight.ViewModels
|
||||||
//接收导航传过来的参数 现在是在此处初始化了表格数据
|
//接收导航传过来的参数 现在是在此处初始化了表格数据
|
||||||
public void OnNavigatedTo(NavigationContext navigationContext)
|
public void OnNavigatedTo(NavigationContext navigationContext)
|
||||||
{
|
{
|
||||||
RequestData();
|
logger.Info($"用户【{HomeWindowViewModel.Operator?.Nickname}】进入OnNavigatedTo请求数据线程");
|
||||||
|
Task.Factory.StartNew(() =>
|
||||||
|
{
|
||||||
|
logger.Info($"用户【{HomeWindowViewModel.Operator?.Nickname}】进入OnNavigatedTo请求数据线程");
|
||||||
|
RequestData();
|
||||||
|
logger.Info($"用户【{HomeWindowViewModel.Operator?.Nickname}】结束OnNavigatedTo请求数据线程");
|
||||||
|
});
|
||||||
|
logger.Info($"用户【{HomeWindowViewModel.Operator?.Nickname}】结束OnNavigatedTo请求数据线程");
|
||||||
}
|
}
|
||||||
|
|
||||||
//每次导航的时候,该实列用不用重新创建,true是不重新创建,false是重新创建
|
//每次导航的时候,该实列用不用重新创建,true是不重新创建,false是重新创建
|
||||||
|
|
|
@ -184,6 +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)
|
||||||
|
.Where(mr=>mr.ReturnQuantity2<=0)
|
||||||
.OrderBy(mr => mr.OperationTime,OrderByType.Desc)
|
.OrderBy(mr => mr.OperationTime,OrderByType.Desc)
|
||||||
.OrderBy(mr => mr.Id)
|
.OrderBy(mr => mr.Id)
|
||||||
.ToList();
|
.ToList();
|
||||||
|
@ -194,6 +195,17 @@ namespace DM_Weight.ViewModels
|
||||||
{
|
{
|
||||||
get => new DelegateCommand(() =>
|
get => new DelegateCommand(() =>
|
||||||
{
|
{
|
||||||
|
int iCount= MachineRecords.FindAll(it => it.IsSelected).ToList().Count;
|
||||||
|
if(iCount > 1||iCount<=0)
|
||||||
|
{
|
||||||
|
AlertMsg alertMsg = new AlertMsg
|
||||||
|
{
|
||||||
|
Message = "请选择且仅选择一条要归还数据记录",
|
||||||
|
Type = MsgType.ERROR,
|
||||||
|
};
|
||||||
|
_eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg);
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (ChannelStock != null)
|
if (ChannelStock != null)
|
||||||
{
|
{
|
||||||
if (Status == 0)
|
if (Status == 0)
|
||||||
|
@ -233,11 +245,14 @@ namespace DM_Weight.ViewModels
|
||||||
{
|
{
|
||||||
if (MachineRecords != null)
|
if (MachineRecords != null)
|
||||||
{
|
{
|
||||||
|
bool bSelect= MachineRecordStock.IsSelected;
|
||||||
|
MachineRecords.ForEach(mr => mr.IsSelected = false);
|
||||||
|
|
||||||
MachineRecords = MachineRecords.Select(x =>
|
MachineRecords = MachineRecords.Select(x =>
|
||||||
{
|
{
|
||||||
if (x.Id == MachineRecordStock.Id)
|
if (x.Id == MachineRecordStock.Id)
|
||||||
{
|
{
|
||||||
x.IsSelected = !x.IsSelected;
|
x.IsSelected = !bSelect;
|
||||||
}
|
}
|
||||||
return x;
|
return x;
|
||||||
}).ToList();
|
}).ToList();
|
||||||
|
@ -256,8 +271,8 @@ namespace DM_Weight.ViewModels
|
||||||
{
|
{
|
||||||
IsFinishClick = true;
|
IsFinishClick = true;
|
||||||
List<MachineRecord> records = MachineRecords.FindAll(it => it.IsSelected).ToList();
|
List<MachineRecord> records = MachineRecords.FindAll(it => it.IsSelected).ToList();
|
||||||
if (records.Count > 0 && records.Sum(it => it.Quantity - it.ReturnQuantity1) == ReturnQuantity)
|
//if (records.Count > 0 && records.Sum(it => it.Quantity - it.ReturnQuantity1) == ReturnQuantity)
|
||||||
{
|
//{
|
||||||
string InvoiceId = "RETURN_" + CurrentTimeMillis();
|
string InvoiceId = "RETURN_" + CurrentTimeMillis();
|
||||||
var f = SqlSugarHelper.Db.UseTran(() =>
|
var f = SqlSugarHelper.Db.UseTran(() =>
|
||||||
{
|
{
|
||||||
|
@ -282,9 +297,9 @@ namespace DM_Weight.ViewModels
|
||||||
// 更新数据 取药记录 设置还药数量、状态
|
// 更新数据 取药记录 设置还药数量、状态
|
||||||
SqlSugarHelper.Db.Updateable(new MachineRecord()
|
SqlSugarHelper.Db.Updateable(new MachineRecord()
|
||||||
{
|
{
|
||||||
ReturnQuantity2 = _MachineRecord.Quantity - _MachineRecord.ReturnQuantity1,
|
ReturnQuantity2 =ReturnQuantity, // _MachineRecord.Quantity - _MachineRecord.ReturnQuantity1,
|
||||||
Id = _MachineRecord.Id,
|
Id = _MachineRecord.Id,
|
||||||
Status = 2,
|
Status = (_MachineRecord.Quantity - ReturnQuantity) == 0 ? 2 : 1,// 2,
|
||||||
}).UpdateColumns(it => new { it.ReturnQuantity2, it.Status }).ExecuteCommand();
|
}).UpdateColumns(it => new { it.ReturnQuantity2, it.Status }).ExecuteCommand();
|
||||||
|
|
||||||
// 保存数据 还药空瓶记录
|
// 保存数据 还药空瓶记录
|
||||||
|
@ -336,17 +351,18 @@ namespace DM_Weight.ViewModels
|
||||||
}
|
}
|
||||||
Status = 0;
|
Status = 0;
|
||||||
IsFinishClick = false;
|
IsFinishClick = false;
|
||||||
RequestClose?.Invoke(new DialogResult(ButtonResult.OK));
|
//RequestClose?.Invoke(new DialogResult(ButtonResult.OK));
|
||||||
} else
|
//}
|
||||||
{
|
//else
|
||||||
AlertMsg alertMsg = new AlertMsg
|
//{
|
||||||
{
|
// AlertMsg alertMsg = new AlertMsg
|
||||||
Message = "归还数目与实际数目不符",
|
// {
|
||||||
Type = MsgType.ERROR,
|
// Message = "归还数目与实际数目不符",
|
||||||
};
|
// Type = MsgType.ERROR,
|
||||||
_eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg);
|
// };
|
||||||
IsFinishClick = false;
|
// _eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg);
|
||||||
}
|
// IsFinishClick = false;
|
||||||
|
//}
|
||||||
}, () => !IsFinishClick && ReturnQuantity > 0).ObservesProperty(() => IsFinishClick).ObservesProperty(() => ReturnQuantity);
|
}, () => !IsFinishClick && ReturnQuantity > 0).ObservesProperty(() => IsFinishClick).ObservesProperty(() => ReturnQuantity);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -365,7 +381,28 @@ namespace DM_Weight.ViewModels
|
||||||
Status = 0;
|
Status = 0;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 继续归还
|
||||||
|
/// </summary>
|
||||||
|
public DelegateCommand ContinueCommand
|
||||||
|
{
|
||||||
|
get => new DelegateCommand(() =>
|
||||||
|
{
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 退出
|
||||||
|
/// </summary>
|
||||||
|
public DelegateCommand QuitCommand
|
||||||
|
{
|
||||||
|
get => new DelegateCommand(() =>
|
||||||
|
{
|
||||||
|
Status = 0;
|
||||||
|
// 关闭当前窗口
|
||||||
|
RequestClose?.Invoke(new DialogResult(ButtonResult.Cancel));
|
||||||
|
});
|
||||||
|
}
|
||||||
public DelegateCommand BtnCloseCommand
|
public DelegateCommand BtnCloseCommand
|
||||||
{
|
{
|
||||||
get => new DelegateCommand(() =>
|
get => new DelegateCommand(() =>
|
||||||
|
|
|
@ -100,7 +100,7 @@ namespace DM_Weight.ViewModels
|
||||||
//还空瓶只能选择一条进行归还
|
//还空瓶只能选择一条进行归还
|
||||||
AlertMsg alertMsg = new AlertMsg
|
AlertMsg alertMsg = new AlertMsg
|
||||||
{
|
{
|
||||||
Message = "请选择一条可归还数量不为0的数据进行归还",
|
Message = "请选择一条且可归还数量不为0的数据进行归还",
|
||||||
Type = MsgType.ERROR,
|
Type = MsgType.ERROR,
|
||||||
};
|
};
|
||||||
_eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg);
|
_eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg);
|
||||||
|
@ -287,8 +287,8 @@ namespace DM_Weight.ViewModels
|
||||||
//接收导航传过来的参数
|
//接收导航传过来的参数
|
||||||
public void OnNavigatedTo(NavigationContext navigationContext)
|
public void OnNavigatedTo(NavigationContext navigationContext)
|
||||||
{
|
{
|
||||||
//查询表格数据
|
//查询表格数据
|
||||||
RequestData();
|
RequestData();
|
||||||
}
|
}
|
||||||
|
|
||||||
void RequestData()
|
void RequestData()
|
||||||
|
|
|
@ -111,7 +111,7 @@ namespace DM_Weight.ViewModels
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
||||||
if (p.Id != 6)
|
if (p != null && p.Children != null && it != null && it.Children != null && p.Id != 6)
|
||||||
{
|
{
|
||||||
it.Children.ToList().ForEach(it3 =>
|
it.Children.ToList().ForEach(it3 =>
|
||||||
{
|
{
|
||||||
|
@ -127,7 +127,7 @@ namespace DM_Weight.ViewModels
|
||||||
AllPremissions.RemoveAt(index);
|
AllPremissions.RemoveAt(index);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else if(index>=0)
|
||||||
{
|
{
|
||||||
AllPremissions.RemoveAt(index);
|
AllPremissions.RemoveAt(index);
|
||||||
}
|
}
|
||||||
|
@ -350,13 +350,13 @@ namespace DM_Weight.ViewModels
|
||||||
defaultAll.Add(sysset);
|
defaultAll.Add(sysset);
|
||||||
#endregion
|
#endregion
|
||||||
#region 退出菜单
|
#region 退出菜单
|
||||||
PremissionDm logout = new PremissionDm
|
//PremissionDm logout = new PremissionDm
|
||||||
{
|
//{
|
||||||
Id = 6,
|
// Id = 6,
|
||||||
PremissionName = "退出",
|
// PremissionName = "退出",
|
||||||
PremissionImage = "/Images/TbExit.png",
|
// PremissionImage = "/Images/TbExit.png",
|
||||||
};
|
//};
|
||||||
defaultAll.Add(logout);
|
//defaultAll.Add(logout);
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -684,8 +684,8 @@ namespace DM_Weight.ViewModels
|
||||||
//接收导航传过来的参数
|
//接收导航传过来的参数
|
||||||
public void OnNavigatedTo(NavigationContext navigationContext)
|
public void OnNavigatedTo(NavigationContext navigationContext)
|
||||||
{
|
{
|
||||||
//查询表格数据
|
//查询表格数据
|
||||||
RequestData();
|
RequestData();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -14,11 +14,14 @@ using DM_Weight.select;
|
||||||
using DM_Weight.util;
|
using DM_Weight.util;
|
||||||
using Prism.Events;
|
using Prism.Events;
|
||||||
using DM_Weight.msg;
|
using DM_Weight.msg;
|
||||||
|
using log4net.Repository.Hierarchy;
|
||||||
|
using log4net;
|
||||||
|
|
||||||
namespace DM_Weight.ViewModels
|
namespace DM_Weight.ViewModels
|
||||||
{
|
{
|
||||||
public class SelfAddWindowViewModel : BindableBase, IConfirmNavigationRequest, IRegionMemberLifetime
|
public class SelfAddWindowViewModel : BindableBase, IConfirmNavigationRequest, IRegionMemberLifetime
|
||||||
{
|
{
|
||||||
|
private readonly ILog logger = LogManager.GetLogger(typeof(SelfAddWindowViewModel));
|
||||||
IDialogService _dialogService;
|
IDialogService _dialogService;
|
||||||
IEventAggregator _eventAggregator;
|
IEventAggregator _eventAggregator;
|
||||||
|
|
||||||
|
@ -48,6 +51,7 @@ namespace DM_Weight.ViewModels
|
||||||
|
|
||||||
public SelfAddWindowViewModel(IDialogService DialogService,IEventAggregator eventAggregator)
|
public SelfAddWindowViewModel(IDialogService DialogService,IEventAggregator eventAggregator)
|
||||||
{
|
{
|
||||||
|
logger.Info($"用户【{HomeWindowViewModel.Operator?.Nickname}】进入SelfAddWindowViewModel构造函数");
|
||||||
_dialogService = DialogService;
|
_dialogService = DialogService;
|
||||||
_eventAggregator = eventAggregator;
|
_eventAggregator = eventAggregator;
|
||||||
}
|
}
|
||||||
|
@ -183,7 +187,14 @@ namespace DM_Weight.ViewModels
|
||||||
//接收导航传过来的参数 现在是在此处初始化了表格数据
|
//接收导航传过来的参数 现在是在此处初始化了表格数据
|
||||||
public void OnNavigatedTo(NavigationContext navigationContext)
|
public void OnNavigatedTo(NavigationContext navigationContext)
|
||||||
{
|
{
|
||||||
RequestChannelData();
|
logger.Info($"用户【{HomeWindowViewModel.Operator?.Nickname}】进入OnNavigatedTo请求数据线程");
|
||||||
|
Task.Factory.StartNew(() =>
|
||||||
|
{
|
||||||
|
logger.Info($"用户【{HomeWindowViewModel.Operator?.Nickname}】进入OnNavigatedTo请求数据线程");
|
||||||
|
RequestChannelData();
|
||||||
|
logger.Info($"用户【{HomeWindowViewModel.Operator?.Nickname}】结束OnNavigatedTo请求数据线程");
|
||||||
|
});
|
||||||
|
logger.Info($"用户【{HomeWindowViewModel.Operator?.Nickname}】结束OnNavigatedTo请求数据线程");
|
||||||
}
|
}
|
||||||
|
|
||||||
//每次导航的时候,该实列用不用重新创建,true是不重新创建,false是重新创建
|
//每次导航的时候,该实列用不用重新创建,true是不重新创建,false是重新创建
|
||||||
|
|
|
@ -16,11 +16,13 @@ using DM_Weight.select;
|
||||||
using DM_Weight.util;
|
using DM_Weight.util;
|
||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
using System.Windows.Data;
|
using System.Windows.Data;
|
||||||
|
using log4net;
|
||||||
|
|
||||||
namespace DM_Weight.ViewModels
|
namespace DM_Weight.ViewModels
|
||||||
{
|
{
|
||||||
public class StockListWindowViewModel : BindableBase, IConfirmNavigationRequest, IRegionMemberLifetime
|
public class StockListWindowViewModel : BindableBase, IConfirmNavigationRequest, IRegionMemberLifetime
|
||||||
{
|
{
|
||||||
|
private readonly ILog logger = LogManager.GetLogger(typeof(StockListWindowViewModel));
|
||||||
|
|
||||||
public static List<OrderTakeSelect> StaticSelects = new()
|
public static List<OrderTakeSelect> StaticSelects = new()
|
||||||
{
|
{
|
||||||
|
@ -89,6 +91,7 @@ namespace DM_Weight.ViewModels
|
||||||
IDialogService _dialogService;
|
IDialogService _dialogService;
|
||||||
public StockListWindowViewModel(IDialogService dialogService)
|
public StockListWindowViewModel(IDialogService dialogService)
|
||||||
{
|
{
|
||||||
|
logger.Info($"用户【{HomeWindowViewModel.Operator?.Nickname}】进入StockListWindowViewModel构造函数");
|
||||||
_dialogService = dialogService;
|
_dialogService = dialogService;
|
||||||
}
|
}
|
||||||
private ChannelStock? _selectedChannel;
|
private ChannelStock? _selectedChannel;
|
||||||
|
@ -171,8 +174,8 @@ namespace DM_Weight.ViewModels
|
||||||
.OrderBy(cs => cs.ColNo)
|
.OrderBy(cs => cs.ColNo)
|
||||||
.ToList();
|
.ToList();
|
||||||
|
|
||||||
ICollectionView vw = CollectionViewSource.GetDefaultView(q);
|
//ICollectionView vw = CollectionViewSource.GetDefaultView(q);
|
||||||
vw.GroupDescriptions.Add(new PropertyGroupDescription("DrugInfo"));
|
//vw.GroupDescriptions.Add(new PropertyGroupDescription("DrugInfo"));
|
||||||
ChannelStocks = q;
|
ChannelStocks = q;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -180,7 +183,14 @@ namespace DM_Weight.ViewModels
|
||||||
//接收导航传过来的参数 现在是在此处初始化了表格数据
|
//接收导航传过来的参数 现在是在此处初始化了表格数据
|
||||||
public void OnNavigatedTo(NavigationContext navigationContext)
|
public void OnNavigatedTo(NavigationContext navigationContext)
|
||||||
{
|
{
|
||||||
RequestData();
|
logger.Info($"用户【{HomeWindowViewModel.Operator?.Nickname}】进入OnNavigatedTo请求数据线程");
|
||||||
|
Task.Factory.StartNew(() =>
|
||||||
|
{
|
||||||
|
logger.Info($"用户【{HomeWindowViewModel.Operator?.Nickname}】进入OnNavigatedTo请求数据线程");
|
||||||
|
RequestData();
|
||||||
|
logger.Info($"用户【{HomeWindowViewModel.Operator?.Nickname}】结束OnNavigatedTo请求数据线程");
|
||||||
|
});
|
||||||
|
logger.Info($"用户【{HomeWindowViewModel.Operator?.Nickname}】结束OnNavigatedTo请求数据线程");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -164,8 +164,8 @@ namespace DM_Weight.ViewModels
|
||||||
//接收导航传过来的参数
|
//接收导航传过来的参数
|
||||||
public void OnNavigatedTo(NavigationContext navigationContext)
|
public void OnNavigatedTo(NavigationContext navigationContext)
|
||||||
{
|
{
|
||||||
//查询表格数据
|
//查询表格数据
|
||||||
RequestData();
|
RequestData();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -143,7 +143,7 @@
|
||||||
<GridViewColumn Header="选择" Width="100">
|
<GridViewColumn Header="选择" Width="100">
|
||||||
<GridViewColumn.CellTemplate>
|
<GridViewColumn.CellTemplate>
|
||||||
<DataTemplate>
|
<DataTemplate>
|
||||||
<CheckBox IsChecked="{Binding IsSelected}" />
|
<RadioButton IsChecked="{Binding IsSelected}" GroupName="selectionGroup" />
|
||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
</GridViewColumn.CellTemplate>
|
</GridViewColumn.CellTemplate>
|
||||||
</GridViewColumn>
|
</GridViewColumn>
|
||||||
|
@ -196,6 +196,24 @@
|
||||||
Content="归还"
|
Content="归还"
|
||||||
Command="{Binding OpenDrawer}">
|
Command="{Binding OpenDrawer}">
|
||||||
</Button>
|
</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"
|
||||||
|
Style="{StaticResource MaterialDesignRaisedAccentButton}"
|
||||||
|
Visibility="{Binding Status,Converter={StaticResource StatusConverter}, ConverterParameter=QuitBtnVisible}"
|
||||||
|
materialDesign:ButtonProgressAssist.IsIndicatorVisible="{Binding Status, Converter={StaticResource StatusConverter}, ConverterParameter=opearBtnLoading}"
|
||||||
|
materialDesign:ButtonProgressAssist.IsIndeterminate="{Binding Status, Converter={StaticResource StatusConverter}, ConverterParameter=opearBtnLoading}"
|
||||||
|
Content="退出"
|
||||||
|
Command="{Binding QuitCommand}">
|
||||||
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
Margin="2"
|
Margin="2"
|
||||||
Visibility="{Binding Status, Converter={StaticResource StatusConverter}, ConverterParameter=CompleteBtn}"
|
Visibility="{Binding Status, Converter={StaticResource StatusConverter}, ConverterParameter=CompleteBtn}"
|
||||||
|
|
|
@ -0,0 +1,133 @@
|
||||||
|
<UserControl x:Class="DM_Weight.Views.DrugTakeCheckInWindow"
|
||||||
|
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"
|
||||||
|
xmlns:prism="http://prismlibrary.com/"
|
||||||
|
xmlns:pagination="clr-namespace:DM_Weight.Components.pagination"
|
||||||
|
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
|
||||||
|
mc:Ignorable="d"
|
||||||
|
d:DesignHeight="450" d:DesignWidth="800">
|
||||||
|
<UserControl.Resources>
|
||||||
|
<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="1.5*" />
|
||||||
|
<ColumnDefinition Width="2*" />
|
||||||
|
<ColumnDefinition Width="5*"/>
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<DatePicker
|
||||||
|
Grid.Column="0"
|
||||||
|
SelectedDate="{Binding StartDate, TargetNullValue=''}"
|
||||||
|
Margin="6 0 0 0"
|
||||||
|
materialDesign:HintAssist.Hint="开始时间"
|
||||||
|
Style="{StaticResource MaterialDesignOutlinedDatePicker}"
|
||||||
|
/>
|
||||||
|
<DatePicker
|
||||||
|
Grid.Column="1"
|
||||||
|
SelectedDate="{Binding EndDate}"
|
||||||
|
Margin="6 0 0 0"
|
||||||
|
materialDesign:HintAssist.Hint="结束时间"
|
||||||
|
Style="{StaticResource MaterialDesignOutlinedDatePicker}"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<StackPanel Grid.Column="3" Orientation="Horizontal" HorizontalAlignment="Right">
|
||||||
|
<Button
|
||||||
|
Margin="0 0 3 0"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Style="{StaticResource MaterialDesignOutlinedLightButton}"
|
||||||
|
ToolTip="导出" Command="{Binding DownloadAccountBook}">
|
||||||
|
<StackPanel Orientation="Horizontal">
|
||||||
|
<materialDesign:PackIcon Kind="download" />
|
||||||
|
<TextBlock Text="导出领取登记表" />
|
||||||
|
</StackPanel>
|
||||||
|
</Button>
|
||||||
|
|
||||||
|
<Button
|
||||||
|
Margin="0 0 6 0"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Style="{StaticResource MaterialDesignOutlinedLightButton}"
|
||||||
|
ToolTip="刷新" Command="{Binding Query}">
|
||||||
|
<materialDesign:PackIcon
|
||||||
|
Kind="Refresh" />
|
||||||
|
</Button>
|
||||||
|
</StackPanel>
|
||||||
|
|
||||||
|
|
||||||
|
</Grid>
|
||||||
|
<ListView Grid.Row="1" ItemsSource="{Binding MachineRecords}"
|
||||||
|
materialDesign:ListViewAssist.HeaderRowBackground="#31ccec"
|
||||||
|
materialDesign:DataGridAssist.ColumnHeaderPadding="10"
|
||||||
|
materialDesign:ListViewAssist.ListViewItemPadding="13">
|
||||||
|
|
||||||
|
<ListView.Resources>
|
||||||
|
<Style TargetType="{x:Type GridViewColumnHeader}" BasedOn="{StaticResource {x:Type GridViewColumnHeader}}">
|
||||||
|
<Setter Property="Foreground" Value="White" />
|
||||||
|
</Style>
|
||||||
|
</ListView.Resources>
|
||||||
|
<ListView.View>
|
||||||
|
<GridView ColumnHeaderContainerStyle="{StaticResource st}">
|
||||||
|
<GridViewColumn Width="100"
|
||||||
|
Header="日期"
|
||||||
|
DisplayMemberBinding="{Binding OperationTime, StringFormat='yyyy-MM-dd HH:mm:ss'}" />
|
||||||
|
<GridViewColumn Width="100"
|
||||||
|
Header="领取时间"
|
||||||
|
DisplayMemberBinding="{Binding OperationTime, StringFormat='yyyy-MM-dd HH:mm:ss'}" />
|
||||||
|
<GridViewColumn Width="180"
|
||||||
|
DisplayMemberBinding="{Binding DrugInfo.DrugName}"
|
||||||
|
Header="药品名称"/>
|
||||||
|
<GridViewColumn Width="150"
|
||||||
|
DisplayMemberBinding="{Binding EffDate, StringFormat=yyyy-MM-dd}"
|
||||||
|
Header="效期"/>
|
||||||
|
<GridViewColumn Width="100"
|
||||||
|
DisplayMemberBinding="{Binding DrugInfo.DrugSpec}"
|
||||||
|
Header="领取人"/>
|
||||||
|
<GridViewColumn Width="100"
|
||||||
|
DisplayMemberBinding="{Binding Quantity}"
|
||||||
|
Header="发药人"/>
|
||||||
|
<GridViewColumn Width="180"
|
||||||
|
DisplayMemberBinding="{Binding ManuNo}"
|
||||||
|
Header="还药时间"/>
|
||||||
|
<GridViewColumn Width="180"
|
||||||
|
DisplayMemberBinding="{Binding ManuNo}"
|
||||||
|
Header="还药数量"/>
|
||||||
|
<GridViewColumn Width="100"
|
||||||
|
DisplayMemberBinding="{Binding DrugInfo.DrugSpec}"
|
||||||
|
Header="还药人"/>
|
||||||
|
<GridViewColumn Width="100"
|
||||||
|
DisplayMemberBinding="{Binding Quantity}"
|
||||||
|
Header="收取人"/>
|
||||||
|
|
||||||
|
</GridView>
|
||||||
|
</ListView.View>
|
||||||
|
</ListView>
|
||||||
|
|
||||||
|
<pagination:Pagination Grid.Row="2"
|
||||||
|
CurrentPage="{Binding PageNum}"
|
||||||
|
PageSize="{Binding PageSize}"
|
||||||
|
TotalPages="{Binding TotalCount}"
|
||||||
|
InfoTextIsEnabel="True"
|
||||||
|
/>
|
||||||
|
</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
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// DrugTakeCheckInWindow.xaml 的交互逻辑
|
||||||
|
/// </summary>
|
||||||
|
public partial class DrugTakeCheckInWindow : UserControl
|
||||||
|
{
|
||||||
|
public DrugTakeCheckInWindow()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -97,6 +97,11 @@
|
||||||
CommandParameter="Operator"
|
CommandParameter="Operator"
|
||||||
Foreground="{DynamicResource MaterialDesignLightForeground}"
|
Foreground="{DynamicResource MaterialDesignLightForeground}"
|
||||||
Header="修改密码" />
|
Header="修改密码" />
|
||||||
|
<MenuItem
|
||||||
|
Command="{Binding QuitCommand}"
|
||||||
|
CommandParameter="Operator"
|
||||||
|
Foreground="{DynamicResource MaterialDesignLightForeground}"
|
||||||
|
Header="退出登录" />
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
</Menu>
|
</Menu>
|
||||||
<Menu Grid.Column="1" Visibility="{Binding MultiLogin, Converter={StaticResource BooleanToVisibilityConverter}}">
|
<Menu Grid.Column="1" Visibility="{Binding MultiLogin, Converter={StaticResource BooleanToVisibilityConverter}}">
|
||||||
|
@ -120,9 +125,11 @@
|
||||||
<Button Content="储物箱" Command="{Binding OpenRecoverCommand}" Visibility="{Binding Is16Drawer, Converter={StaticResource BooleanToVisibilityConverter}}" Style="{StaticResource MaterialDesignFlatSecondaryLightButton}" />
|
<Button Content="储物箱" Command="{Binding OpenRecoverCommand}" Visibility="{Binding Is16Drawer, Converter={StaticResource BooleanToVisibilityConverter}}" Style="{StaticResource MaterialDesignFlatSecondaryLightButton}" />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
|
<materialDesign:Snackbar HorizontalAlignment="Center" VerticalAlignment="Center"
|
||||||
|
Background="{Binding SnackbarBackground}"
|
||||||
|
MessageQueue="{Binding SnackbarMessageQueue}"/>
|
||||||
|
|
||||||
</Grid>
|
</Grid>
|
||||||
</UserControl>
|
</UserControl>
|
||||||
|
|
|
@ -0,0 +1,139 @@
|
||||||
|
<!--布局界面-->
|
||||||
|
<UserControl x:Class="DM_Weight.Views.HomeWindow_New"
|
||||||
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
|
||||||
|
TextElement.Foreground="{DynamicResource MaterialDesignBody}"
|
||||||
|
TextElement.FontWeight="Regular"
|
||||||
|
TextElement.FontSize="13"
|
||||||
|
TextOptions.TextFormattingMode="Ideal"
|
||||||
|
TextOptions.TextRenderingMode="Auto"
|
||||||
|
xmlns:prism="http://prismlibrary.com/"
|
||||||
|
FontFamily="{DynamicResource MaterialDesignFont}"
|
||||||
|
xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
|
||||||
|
mc:Ignorable="d" Cursor="Hand">
|
||||||
|
<Grid>
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="Auto"></RowDefinition>
|
||||||
|
<RowDefinition></RowDefinition>
|
||||||
|
<RowDefinition Height="Auto"></RowDefinition>
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
<Grid Background="#00bcd4">
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="Auto" />
|
||||||
|
<ColumnDefinition />
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<Image Grid.Column="0" Margin="30 0 30 0" HorizontalAlignment="Left" Width="Auto" Height="26" Source="/Images/logo.png" />
|
||||||
|
<ListBox Name="ListBoxName" Grid.Column="1" ItemsSource="{Binding PremissionDmList}" HorizontalAlignment="Right" Cursor="Hand">
|
||||||
|
<i:Interaction.Triggers>
|
||||||
|
<i:EventTrigger EventName="SelectionChanged">
|
||||||
|
<i:InvokeCommandAction Command="{Binding SelectionCommon}" CommandParameter="{Binding ElementName=ListBoxName}"/>
|
||||||
|
</i:EventTrigger>
|
||||||
|
</i:Interaction.Triggers>
|
||||||
|
<ListBox.ItemsPanel>
|
||||||
|
<ItemsPanelTemplate>
|
||||||
|
<WrapPanel Orientation="Horizontal" IsItemsHost="True"/>
|
||||||
|
</ItemsPanelTemplate>
|
||||||
|
</ListBox.ItemsPanel>
|
||||||
|
<ListBox.ItemTemplate>
|
||||||
|
<DataTemplate>
|
||||||
|
<StackPanel Width="64" Height="64" >
|
||||||
|
<Image Width="48" Height="48" Source="{ Binding PremissionImage }" />
|
||||||
|
<TextBlock Foreground="{DynamicResource MaterialDesignPaper}" HorizontalAlignment="Center" FontSize="15" Text="{Binding PremissionName}" />
|
||||||
|
</StackPanel>
|
||||||
|
</DataTemplate>
|
||||||
|
</ListBox.ItemTemplate>
|
||||||
|
</ListBox>
|
||||||
|
</Grid>
|
||||||
|
<Grid Grid.Row="1" Margin="8,6,8,6">
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="Auto"/>
|
||||||
|
<RowDefinition/>
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
<materialDesign:Card Grid.Row="0">
|
||||||
|
|
||||||
|
<ListBox x:Name="ListBoxChild" ItemsSource="{Binding SelectedMenu.Children}" SelectedItem="{ Binding SelectedChildMenu }" HorizontalAlignment="left" Cursor="Hand">
|
||||||
|
<i:Interaction.Triggers>
|
||||||
|
<i:EventTrigger EventName="SelectionChanged">
|
||||||
|
<i:InvokeCommandAction Command="{Binding SelectionChildCommon}"/>
|
||||||
|
</i:EventTrigger>
|
||||||
|
</i:Interaction.Triggers>
|
||||||
|
<ListBox.ItemsPanel>
|
||||||
|
<ItemsPanelTemplate>
|
||||||
|
<WrapPanel Orientation="Horizontal" IsItemsHost="True"/>
|
||||||
|
</ItemsPanelTemplate>
|
||||||
|
</ListBox.ItemsPanel>
|
||||||
|
<ListBox.ItemTemplate>
|
||||||
|
<DataTemplate>
|
||||||
|
<Border Padding="0,0,5,0" BorderThickness="0 0 1 0" BorderBrush="#31ccec">
|
||||||
|
<TextBlock FontWeight="Black" FontSize="14" FontFamily="楷书" Padding="4" Text="{Binding PremissionName}" />
|
||||||
|
</Border>
|
||||||
|
</DataTemplate>
|
||||||
|
</ListBox.ItemTemplate>
|
||||||
|
</ListBox>
|
||||||
|
</materialDesign:Card>
|
||||||
|
<materialDesign:Card Grid.Row="1" Margin="0 8 0 8">
|
||||||
|
<ScrollViewer HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Disabled" Focusable="True">
|
||||||
|
|
||||||
|
<ContentControl prism:RegionManager.RegionName="ContentRegion" />
|
||||||
|
</ScrollViewer>
|
||||||
|
</materialDesign:Card>
|
||||||
|
</Grid>
|
||||||
|
<Grid Background="#2196f3" Grid.Row="2">
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="70*"/>
|
||||||
|
<ColumnDefinition Width="70*"/>
|
||||||
|
<ColumnDefinition Width="270*"/>
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<Menu Grid.Column="0">
|
||||||
|
<MenuItem
|
||||||
|
Foreground="White"
|
||||||
|
Header="{Binding UserList.Nickname}">
|
||||||
|
<MenuItem
|
||||||
|
Command="{Binding OpenFingerDialog}"
|
||||||
|
CommandParameter="Operator"
|
||||||
|
Foreground="{DynamicResource MaterialDesignLightForeground}"
|
||||||
|
Header="录制指纹" />
|
||||||
|
<MenuItem
|
||||||
|
Command="{Binding OpenEditPasswordDialog}"
|
||||||
|
CommandParameter="Operator"
|
||||||
|
Foreground="{DynamicResource MaterialDesignLightForeground}"
|
||||||
|
Header="修改密码" />
|
||||||
|
<MenuItem
|
||||||
|
Command="{Binding QuitCommand}"
|
||||||
|
CommandParameter="Operator"
|
||||||
|
Foreground="{DynamicResource MaterialDesignLightForeground}"
|
||||||
|
Header="退出登录" />
|
||||||
|
</MenuItem>
|
||||||
|
</Menu>
|
||||||
|
<Menu Grid.Column="1" Visibility="{Binding MultiLogin, Converter={StaticResource BooleanToVisibilityConverter}}">
|
||||||
|
<MenuItem
|
||||||
|
Foreground="White"
|
||||||
|
Header="{Binding UserList2.Nickname}">
|
||||||
|
<MenuItem
|
||||||
|
Command="{Binding OpenFingerDialog}"
|
||||||
|
CommandParameter="Reviewer"
|
||||||
|
Foreground="{DynamicResource MaterialDesignLightForeground}"
|
||||||
|
Header="录制指纹" />
|
||||||
|
<MenuItem
|
||||||
|
Command="{Binding OpenEditPasswordDialog}"
|
||||||
|
CommandParameter="Reviewer"
|
||||||
|
Foreground="{DynamicResource MaterialDesignLightForeground}"
|
||||||
|
Header="修改密码" />
|
||||||
|
</MenuItem>
|
||||||
|
</Menu>
|
||||||
|
<Grid Grid.Column="2">
|
||||||
|
<StackPanel Margin="6" Orientation="Horizontal" HorizontalAlignment="Right">
|
||||||
|
<Button Content="储物箱" Command="{Binding OpenRecoverCommand}" Visibility="{Binding Is16Drawer, Converter={StaticResource BooleanToVisibilityConverter}}" Style="{StaticResource MaterialDesignFlatSecondaryLightButton}" />
|
||||||
|
</StackPanel>
|
||||||
|
</Grid>
|
||||||
|
</Grid>
|
||||||
|
|
||||||
|
<materialDesign:Snackbar HorizontalAlignment="Center" VerticalAlignment="Center"
|
||||||
|
Background="{Binding SnackbarBackground}"
|
||||||
|
MessageQueue="{Binding SnackbarMessageQueue}"/>
|
||||||
|
|
||||||
|
</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
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Interaction logic for MainWindow.xaml
|
||||||
|
/// </summary>
|
||||||
|
public partial class HomeWindow_New : UserControl
|
||||||
|
{
|
||||||
|
public HomeWindow_New()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -9,6 +9,7 @@
|
||||||
xmlns:local="clr-namespace:DM_Weight.Views"
|
xmlns:local="clr-namespace:DM_Weight.Views"
|
||||||
xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
|
xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
|
||||||
xmlns:prism="http://prismlibrary.com/"
|
xmlns:prism="http://prismlibrary.com/"
|
||||||
|
xmlns:convert="clr-namespace:DM_Weight.Converter"
|
||||||
mc:Ignorable="d">
|
mc:Ignorable="d">
|
||||||
<UserControl.Resources>
|
<UserControl.Resources>
|
||||||
<Style x:Key="st" TargetType="GridViewColumnHeader">
|
<Style x:Key="st" TargetType="GridViewColumnHeader">
|
||||||
|
@ -24,6 +25,7 @@
|
||||||
</Setter>
|
</Setter>
|
||||||
</Style.Setters>
|
</Style.Setters>
|
||||||
</Style>
|
</Style>
|
||||||
|
<convert:TypeConverter x:Key="TypeConverter" />
|
||||||
</UserControl.Resources>
|
</UserControl.Resources>
|
||||||
<Grid>
|
<Grid>
|
||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
|
@ -52,7 +54,14 @@
|
||||||
materialDesign:HintAssist.Hint="结束时间"
|
materialDesign:HintAssist.Hint="结束时间"
|
||||||
Style="{StaticResource MaterialDesignOutlinedDatePicker}"
|
Style="{StaticResource MaterialDesignOutlinedDatePicker}"
|
||||||
/>
|
/>
|
||||||
|
<!--<Viewbox Grid.Column="1" HorizontalAlignment="Left" Width="150">
|
||||||
|
--><!--<DatePicker CalendarStyle="{StaticResource styleCalendar}"/>--><!--
|
||||||
|
<DatePicker
|
||||||
|
Grid.Column="0"
|
||||||
|
SelectedDate="{Binding StartDate, TargetNullValue=''}"
|
||||||
|
Margin="6 0 0 0"
|
||||||
|
materialDesign:HintAssist.Hint="开始时间"/>
|
||||||
|
</Viewbox>-->
|
||||||
<StackPanel Grid.Column="3" Orientation="Horizontal" HorizontalAlignment="Right">
|
<StackPanel Grid.Column="3" Orientation="Horizontal" HorizontalAlignment="Right">
|
||||||
<Button
|
<Button
|
||||||
Margin="0 0 3 0"
|
Margin="0 0 3 0"
|
||||||
|
@ -74,7 +83,27 @@
|
||||||
<TextBlock Text="导出记录" />
|
<TextBlock Text="导出记录" />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Button>
|
</Button>
|
||||||
|
<Button Visibility="{Binding Type, Converter={StaticResource TypeConverter}, ConverterParameter=DragTakeCheckIn}"
|
||||||
|
Margin="0 0 3 0"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Style="{StaticResource MaterialDesignOutlinedLightButton}"
|
||||||
|
ToolTip="导出" Command="{Binding DragTakeCheckInCommand}">
|
||||||
|
<StackPanel Orientation="Horizontal">
|
||||||
|
<materialDesign:PackIcon Kind="download" />
|
||||||
|
<TextBlock Text="精一领取登记" />
|
||||||
|
</StackPanel>
|
||||||
|
</Button>
|
||||||
|
|
||||||
|
<Button Visibility="{Binding Type, Converter={StaticResource TypeConverter}, ConverterParameter=DragTakeCheckIn}"
|
||||||
|
Margin="0 0 3 0"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Style="{StaticResource MaterialDesignOutlinedLightButton}"
|
||||||
|
ToolTip="导出" Command="{Binding DragTakeCheckIn2Command}">
|
||||||
|
<StackPanel Orientation="Horizontal">
|
||||||
|
<materialDesign:PackIcon Kind="download" />
|
||||||
|
<TextBlock Text="精二领取登记" />
|
||||||
|
</StackPanel>
|
||||||
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
Margin="0 0 6 0"
|
Margin="0 0 6 0"
|
||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
|
|
|
@ -12,6 +12,11 @@
|
||||||
mc:Ignorable="d">
|
mc:Ignorable="d">
|
||||||
<Grid>
|
<Grid>
|
||||||
<Grid.Resources>
|
<Grid.Resources>
|
||||||
|
<CollectionViewSource x:Key="GroupedDataList" Source="{Binding ChannelStocks}">
|
||||||
|
<CollectionViewSource.GroupDescriptions>
|
||||||
|
<PropertyGroupDescription PropertyName="DrugInfo" />
|
||||||
|
</CollectionViewSource.GroupDescriptions>
|
||||||
|
</CollectionViewSource>
|
||||||
<convert:GroupSumConverter x:Key="GroupSumConverter" />
|
<convert:GroupSumConverter x:Key="GroupSumConverter" />
|
||||||
</Grid.Resources>
|
</Grid.Resources>
|
||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
|
@ -67,7 +72,7 @@
|
||||||
<DataGrid
|
<DataGrid
|
||||||
Grid.Row="1"
|
Grid.Row="1"
|
||||||
materialDesign:DataGridAssist.ColumnHeaderPadding="15"
|
materialDesign:DataGridAssist.ColumnHeaderPadding="15"
|
||||||
ItemsSource="{Binding ChannelStocks}"
|
ItemsSource="{Binding Source={StaticResource GroupedDataList}}"
|
||||||
SelectedItem="SelectedChannel"
|
SelectedItem="SelectedChannel"
|
||||||
materialDesign:DataGridAssist.EnableEditBoxAssist="False"
|
materialDesign:DataGridAssist.EnableEditBoxAssist="False"
|
||||||
IsSynchronizedWithCurrentItem="True"
|
IsSynchronizedWithCurrentItem="True"
|
||||||
|
|
|
@ -0,0 +1,15 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace DM_Weight.select
|
||||||
|
{
|
||||||
|
public class Week
|
||||||
|
{
|
||||||
|
public string? Code { get; set; }
|
||||||
|
public string? Name { get; set; }
|
||||||
|
public bool IsSelected { get; set; }
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue