From d31b7016a7c8de7c05f184131b1beaab7547e769 Mon Sep 17 00:00:00 2001
From: maqiao <625215135@qq.com>
Date: Sun, 29 Sep 2024 16:58:56 +0800
Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=80=BC=E7=8F=AD=E6=9F=9C?=
=?UTF-8?q?=E3=80=81=E5=91=A8=E8=BD=AC=E6=9F=9C=E7=99=BB=E5=BD=95=EF=BC=8C?=
=?UTF-8?q?=E7=BB=91=E5=AE=9A=E9=A1=B5=E9=9D=A2=E8=8D=AF=E5=93=81=E6=B7=BB?=
=?UTF-8?q?=E5=8A=A0=E8=8D=AF=E5=93=81=E5=8E=82=E5=AE=B6=E4=BF=A1=E6=81=AF?=
=?UTF-8?q?=EF=BC=8C=E8=B0=83=E6=8B=A8=E4=BF=9D=E5=AD=98=E6=97=B6=E6=B7=BB?=
=?UTF-8?q?=E5=8A=A0=E4=BF=9D=E5=AD=98=E4=B8=AD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
DM_Weight/App.config | 6 +-
DM_Weight/App.xaml.cs | 11 ++
DM_Weight/Converter/StatusConverter.cs | 23 +++
DM_Weight/Models/MachineRecord.cs | 2 +-
DM_Weight/Report/GridReportUtil.cs | 58 ++-----
DM_Weight/Services/MachineRecordService.cs | 11 +-
.../ViewModels/AddDrugControlViewModel.cs | 145 +++++++++---------
DM_Weight/ViewModels/BeforeLoginViewModel.cs | 87 +++++++++++
.../BindingChannelNewDialogViewModel .cs | 6 +-
.../CheckStockNew2WindowViewModel.cs | 3 +-
.../CheckStockNewWindowViewModel.cs | 3 +-
.../ViewModels/CheckStockWindowViewModel.cs | 92 +++++------
.../DrawerAddDrugWindowViewModel.cs | 92 +++++------
DM_Weight/ViewModels/HomeWindowViewModel.cs | 18 +--
.../ViewModels/InvoiceAddDialogViewModel.cs | 92 +++++------
.../ViewModels/InvoiceTakeDialogViewModel.cs | 92 +++++------
DM_Weight/ViewModels/LoginWindowViewModel.cs | 9 +-
DM_Weight/ViewModels/MainWindowViewModel.cs | 7 +-
.../ViewModels/OrderReturnDialogViewModel.cs | 92 +++++------
.../ViewModels/OrderTakeDialogViewModel.cs | 55 +------
.../ViewModels/ReturnDrugDialogViewModel.cs | 92 +++++------
.../ViewModels/ReturnDrugWindow2ViewModel.cs | 5 +-
.../ViewModels/ReturnDrugWindowViewModel.cs | 2 +
.../ViewModels/ReturnEmptyDialogViewModel.cs | 92 +++++------
.../ViewModels/ReturnEmptyWindowViewModel.cs | 4 +
.../ViewModels/RoleManagerWindowViewModel.cs | 14 +-
.../ViewModels/SelfAddDialogViewModel.cs | 92 +++++------
.../ViewModels/SelfAddWindowViewModel.cs | 5 +-
.../ViewModels/SelfTakeDialogViewModel.cs | 92 +++++------
.../ViewModels/SelfTakeDrugWindowViewModel.cs | 2 +
.../ViewModels/StockListWindowViewModel.cs | 9 +-
DM_Weight/Views/AddDrugControl.xaml | 48 +++---
DM_Weight/Views/BeforeLogin.xaml | 88 +++++++++++
DM_Weight/Views/BeforeLogin.xaml.cs | 28 ++++
DM_Weight/Views/Dialog/OrderTakeDialog.xaml | 5 +-
DM_Weight/Views/LoginWindow.xaml | 2 +-
36 files changed, 849 insertions(+), 635 deletions(-)
create mode 100644 DM_Weight/ViewModels/BeforeLoginViewModel.cs
create mode 100644 DM_Weight/Views/BeforeLogin.xaml
create mode 100644 DM_Weight/Views/BeforeLogin.xaml.cs
diff --git a/DM_Weight/App.config b/DM_Weight/App.config
index 16114ac..5f7b376 100644
--- a/DM_Weight/App.config
+++ b/DM_Weight/App.config
@@ -3,7 +3,7 @@
-
+
-
+
@@ -28,7 +28,7 @@
-
+
diff --git a/DM_Weight/App.xaml.cs b/DM_Weight/App.xaml.cs
index b66f96f..e080d97 100644
--- a/DM_Weight/App.xaml.cs
+++ b/DM_Weight/App.xaml.cs
@@ -55,6 +55,15 @@ namespace DM_Weight
set => _currentShenUserList = value;
}
#endregion 当前登录用户的审核人信息
+ #region 登录模式,SingleModel=true则为单人登录
+ private static bool _singleModel;
+ public static bool SingleModel
+ {
+ get => _singleModel;
+ set=>_singleModel = value;
+ }
+
+ #endregion
private readonly ILog logger = LogManager.GetLogger(typeof(App));
public App()
@@ -133,6 +142,8 @@ namespace DM_Weight
// 登录页面
containerRegistry.RegisterForNavigation();
+ //值班柜、周转柜选择
+ containerRegistry.RegisterForNavigation();
// 布局页面
containerRegistry.RegisterForNavigation();
diff --git a/DM_Weight/Converter/StatusConverter.cs b/DM_Weight/Converter/StatusConverter.cs
index 8947a1e..f5ee11d 100644
--- a/DM_Weight/Converter/StatusConverter.cs
+++ b/DM_Weight/Converter/StatusConverter.cs
@@ -76,6 +76,29 @@ namespace DM_Weight.Converter
return Visibility.Collapsed;
}
}
+ //显示样式
+ if (para.Equals("TakeFinishLoading"))
+ {
+ if (status ==4)
+ {
+ return true;
+ }
+ else
+ {
+ return false;
+ }
+ }
+ if(para.Equals("TakeFinishEnable"))
+ {
+ if (status ==4)
+ {
+ return false;
+ }
+ else
+ {
+ return true;
+ }
+ }
return Visibility.Collapsed;
}
diff --git a/DM_Weight/Models/MachineRecord.cs b/DM_Weight/Models/MachineRecord.cs
index 8f41de3..2a900a4 100644
--- a/DM_Weight/Models/MachineRecord.cs
+++ b/DM_Weight/Models/MachineRecord.cs
@@ -75,7 +75,7 @@ namespace DM_Weight.Models
[SugarColumn(ColumnName = "eff_date")]
public DateTime? EffDate { get; set; }
///
- /// 出库入库类型(1入库2出库31还药32还空瓶)
+ /// 出库入库类型(1入库 2出库 31还药 32还空瓶 4盘点 5日结存)
///
[SugarColumn(ColumnName = "type")]
public int Type { get; set; }
diff --git a/DM_Weight/Report/GridReportUtil.cs b/DM_Weight/Report/GridReportUtil.cs
index 26fc4aa..3272696 100644
--- a/DM_Weight/Report/GridReportUtil.cs
+++ b/DM_Weight/Report/GridReportUtil.cs
@@ -49,7 +49,17 @@ namespace DM_Weight.Report
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,
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 ";
+ if(App.SingleModel)
+ {
+ SQL += " and cl.row_no<=8";
+ }
+ else
+ {
+ SQL += " and cl.row_no>8";
+ }
+ SQL += " ORDER BY cl.`drug_id`";
+
// 加载模板文件
Report.LoadFromFile(new FileInfo(AppDomain.CurrentDomain.BaseDirectory) + "ReportTemp//" + "stock_template.grf");
Report.DetailGrid.Recordset.ConnectionString = gridConnectionString;
@@ -359,50 +369,6 @@ namespace DM_Weight.Report
string SQL = string.Empty;
string machine_id = (ConfigurationManager.AppSettings["machineId"] ?? "DM1");
- #region MyRegion
- //string strINSql = $@"SELECT GROUP_CONCAT(Manu_No) AS StrTotalManuNo,GROUP_CONCAT(totalInQuantity) AS StrTotalQuantity FROM
- //(
- //SELECT
- // DISTINCT Manu_No ,sum(IF(mr.`type` IN (1, 31), mr.`quantity`, IF(mr.`type` = 4 AND mr.`quantity` > 0, mr.`quantity`, 0))) as totalInQuantity
- //from dm_machine_record mr
- // INNER JOIN drug_info di ON mr.`drug_id` = di.`drug_id` where mr.machine_id='{machine_id}'
- // and IF(mr.`type` IN (1, 31), mr.`quantity`, IF(mr.`type` = 4 AND mr.`quantity` > 0, mr.`quantity`, 0)) >0
- // and DATE_FORMAT(operation_time,'%Y-%m')= '{strDate}' and type in('1,31,4')
- //GROUP BY mr.drug_id,mr.manu_no
- //) as t";
- //AccountTotalQuantity InQuantityList = SqlSugarHelper.Db.SqlQueryable(strINSql)
- // .Select(it => new AccountTotalQuantity()).First();
-
- //string strOutSql = $@"SELECT GROUP_CONCAT(Manu_No) AS StrTotalManuNo,GROUP_CONCAT(TotalOutQuantity) AS StrTotalQuantity FROM
- //(
- //SELECT
- // DISTINCT Manu_No ,SUM(IF(mr.`type` = 2, mr.`quantity`, IF(mr.`type` = 4 AND mr.`quantity` < 0, (0 - mr.`quantity`), 0))) AS TotalOutQuantity
- //from dm_machine_record mr
- // INNER JOIN drug_info di ON mr.`drug_id` = di.`drug_id` where mr.machine_id='{machine_id}'
- // and IF(mr.`type` = 2, mr.`quantity`, IF(mr.`type` = 4 AND mr.`quantity` < 0, (0 - mr.`quantity`), 0)) >0
- // and DATE_FORMAT(operation_time,'%Y-%m')= '{strDate}' and type in('2,4')
- //GROUP BY mr.drug_id,mr.manu_no
- //) as t";
- //AccountTotalQuantity OutQuantityList = SqlSugarHelper.Db.SqlQueryable(strOutSql)
- // .Select(it => new AccountTotalQuantity()).First();
-
- //string strStockSql = $@"SELECT GROUP_CONCAT(Manu_No) AS StrTotalManuNo,GROUP_CONCAT(stock_quantity) AS StrTotalQuantity FROM
- // (SELECT a.Manu_No,a.stock_quantity from dm_machine_record a inner join
- // (select drug_id,manu_no,max(operation_time) as latest_date,stock_quantity from dm_machine_record
- // WHERE DATE_FORMAT(operation_time,'%Y-%m')='{strDate}' and machine_id='{machine_id}' GROUP BY drug_id,manu_no ) b on a.drug_id=b.drug_id and a.manu_no=b.manu_no
- // and a.operation_time=b.latest_date and machine_id='{machine_id}' WHERE DATE_FORMAT(operation_time,'%Y-%m')='{strDate}') as t ";
- //AccountTotalQuantity StockQuantityList = SqlSugarHelper.Db.SqlQueryable(strStockSql)
- // .Select(it => new AccountTotalQuantity()).First();
- //string str1 = "本月领药数量" + ":" + InQuantityList.StrTotalQuantity + " 批号:" + InQuantityList.StrTotalManuNo;
- //string str2 = "本月发药数量" + ":" + OutQuantityList.StrTotalQuantity + " 批号:" + OutQuantityList.StrTotalManuNo;
- //string str3 = "本月结存数量" + ":" + StockQuantityList.StrTotalQuantity + " 批号:" + StockQuantityList.StrTotalManuNo;
- //Report.ControlByName("StaticBox24").AsStaticBox.Text = str1;
- //Report.ControlByName("StaticBox26").AsStaticBox.Text = str2;
- //Report.ControlByName("StaticBox28").AsStaticBox.Text = str3;
- #endregion
-
-
- //Report.DetailGrid.Recordset.ConnectionString = gridConnectionString;
SQL = $@"SELECT mr.drug_id as drugId,'test' InTotal,YEAR(mr.`operation_time`) as DMYear,MONTH(mr.`operation_time`) as DMMonth,
DAY(mr.`operation_time`) as DMDay,manu_no as manuNo,operation_time as operationTime,return_quantity1 as inQuantity,return_quantity2 as outQuantity,
manunoQuantity as stockQuantity,u1.user_name as operatorName,u2.user_name as reviewerName,di.`drug_name` AS `drugName`,
@@ -410,8 +376,6 @@ namespace DM_Weight.Report
FROM dm_machine_record mr INNER JOIN DRUG_INFO di ON mr.drug_id=di.drug_id LEFT JOIN user_list u1 ON mr.`operator` = u1.`id`LEFT JOIN user_list u2 ON mr.`reviewer` = u2.`id`
WHERE mr.`machine_id` = '{machine_id}' and type=5 and DATE_FORMAT(operation_time,'%Y-%m')='{strDate}' ORDER BY mr.drug_id,operation_time";
- //Report.DetailGrid.Recordset.QuerySQL = SQL;
-
List> tableList = SqlSugarHelper.Db.SqlQueryable(SQL).ToDictionaryList();
for (int i = 0; i < tableList.Count; i++)
{
diff --git a/DM_Weight/Services/MachineRecordService.cs b/DM_Weight/Services/MachineRecordService.cs
index 2809a39..c54d152 100644
--- a/DM_Weight/Services/MachineRecordService.cs
+++ b/DM_Weight/Services/MachineRecordService.cs
@@ -30,13 +30,18 @@ namespace DM_Weight.Services
string p_machine_id = (ConfigurationManager.AppSettings["machineId"] ?? "DM1");
string SQL = $@"SELECT TYPE, stockQuantity,inQuantity,outQuantity,operationTime,invoiceId,drugName,drugId,drugSpec,packUnit,dosage,manufactory,manuNo,effDate,
operatorName,reviewerName,supplierDept,receiveDept FROM
- (SELECT mr.type,mr.`stock_quantity` AS `stockQuantity`, IF(mr.`type` IN (1, 31), mr.`quantity`, IF(mr.`type` = 4 AND mr.`quantity` > 0, mr.`quantity`, 0))
- AS `inQuantity`, IF(mr.`type` = 2, mr.`quantity`, IF(mr.`type` = 4 AND mr.`quantity` < 0, (0 - mr.`quantity`), 0)) AS `outQuantity`,
+ (SELECT mr.type,mr.`stock_quantity` AS `stockQuantity`,
+ -- IF(mr.`type` IN (1, 31), mr.`quantity`,IF(mr.`type` = 4 AND mr.`quantity` > 0, mr.`quantity`, 0)) AS `inQuantity`,
+ -- IF(mr.`type` = 2, mr.`quantity`, IF(mr.`type` = 4 AND mr.`quantity` < 0, (0 - mr.`quantity`), 0)) AS `outQuantity`,
+ if(mr.drawer_no>8 and mr.`type` IN (1, 31),quantity,IF(mr.`type` = 4 AND mr.`quantity` > 0, mr.`quantity`,0)) AS `inQuantity`,
+ if(OI.ORDER_NO is not null,mr.quantity,IF(mr.`type` = 4 AND mr.`quantity` < 0, (0 - mr.`quantity`), 0)) AS `outQuantity`,
DATE_FORMAT(mr.`operation_time`,'%m/%d') AS `operationTime`,IF(mr.`type`=1,mr.`invoice_id`,NULL) AS `invoiceId`, di.`drug_name` AS `drugName`, di.`drug_id` AS `drugId`,
di.`drug_spec` AS `drugSpec`, di.`pack_unit` AS `packUnit`, di.`dosage` AS `dosage`, di.`manufactory` AS `manufactory`,
mr.`manu_no` AS `manuNo`, DATE_FORMAT(mr.`eff_date`,'%y/%m/%d') AS `effDate`, u1.`user_name` AS `operatorName`, u2.`user_name` AS `reviewerName`,mr.supplierDept,mr.receiveDept FROM
dm_machine_record mr LEFT JOIN drug_info di ON mr.`drug_id` = di.`drug_id` LEFT JOIN user_list u1 ON mr.`operator` = u1.`id`
- LEFT JOIN user_list u2 ON mr.`reviewer` = u2.`id` WHERE mr.`machine_id` = '{p_machine_id}' AND mr.`operation_time` > '{p_startDate}'
+ LEFT JOIN user_list u2 ON mr.`reviewer` = u2.`id`
+ LEFT JOIN ORDER_INFO OI ON OI.ORDER_NO=mr.invoice_id
+ WHERE mr.`machine_id` = '{p_machine_id}' AND mr.`operation_time` > '{p_startDate}'
AND mr.`operation_time` < '{p_endDate}' and IF(mr.`type` = 4 AND mr.`quantity` = 0, 99999, mr.`quantity`) <>99999 ";
if (!string.IsNullOrEmpty(drug_id))
{
diff --git a/DM_Weight/ViewModels/AddDrugControlViewModel.cs b/DM_Weight/ViewModels/AddDrugControlViewModel.cs
index 738ebd0..0ecb968 100644
--- a/DM_Weight/ViewModels/AddDrugControlViewModel.cs
+++ b/DM_Weight/ViewModels/AddDrugControlViewModel.cs
@@ -148,7 +148,18 @@ namespace DM_Weight.ViewModels
private int _status;
public int Status { get => _status; set => SetProperty(ref _status, value); }
+ ///
+ /// 操作状态
+ ///
+ private int _OptionStatus = -1;
+ public int OptionStatus { get => _OptionStatus; set => SetProperty(ref _OptionStatus, value); }
+ ///
+ /// 完成按钮绑定文本(完成;保存中)
+ ///
+ private string _FinishContent = "完成";
+ public string FinishContent
+ { get => _FinishContent; set => SetProperty(ref _FinishContent, value); }
private int _drawerNo = 1;
public int DrawerNo
@@ -185,53 +196,6 @@ namespace DM_Weight.ViewModels
{
get => new DelegateCommand(() =>
{
- if (App.CurrentFaUserList.Role != null)
- {
- //查看当前用户是否有所在药品抽屉的权限
- bool bLessEight = ChannelLsts.Select(it => it.DrawerNo).Where(n => n <= 8).Any();
- bool bMoreEight = ChannelLsts.Select(it => it.DrawerNo).Where(n => n > 8 && n < 17).Any();
- bool bEqualEight = ChannelLsts.Select(it => it.DrawerNo).Where(n => n == 17).Any();
- if (bLessEight)
- {
- if (App.CurrentFaUserList.Role.FirstEightChecked == "0")
- {
- AlertMsg alertMsg = new AlertMsg
- {
- Message = "当前用户没有打开抽屉的权限!",
- Type = MsgType.ERROR,
- };
- _eventAggregator.GetEvent().Publish(alertMsg);
- return;
- }
- }
- if (bMoreEight)
- {
- if (App.CurrentFaUserList.Role.LastEightChecked == "0")
- {
- AlertMsg alertMsg = new AlertMsg
- {
- Message = "当前用户没有打开抽屉的权限!",
- Type = MsgType.ERROR,
- };
- _eventAggregator.GetEvent().Publish(alertMsg);
- return;
- }
- }
- if (bEqualEight)
- {
- if (App.CurrentFaUserList.Role.StorageBoxChecked == "0")
- {
- AlertMsg alertMsg = new AlertMsg
- {
- Message = "当前用户没有打开抽屉的权限!",
- Type = MsgType.ERROR,
- };
- _eventAggregator.GetEvent().Publish(alertMsg);
- return;
- }
- }
-
- }
Status = 1;
_portUtil.SpeakAsync("正在打开" + DrawerNo + "号抽屉");
@@ -262,7 +226,17 @@ namespace DM_Weight.ViewModels
// 完成按钮
public DelegateCommand TakeFinish
{
- get => new DelegateCommand(() =>
+ get => new DelegateCommand(TakeFinishAction);
+ }
+ private void TakeFinishAction()
+ {
+ OptionStatus = 4;
+ FinishContent = "保存中";
+ Task.Factory.StartNew(() => TakeFinishMethod());
+ }
+ private async void TakeFinishMethod()
+ {
+ try
{
if (!_isFinishClick)
{
@@ -295,9 +269,13 @@ namespace DM_Weight.ViewModels
Quantity = it.Quantity + it.AddQuantity,
ManuNo = it.ManuNo,
EffDate = it.EffDate,
- DrugId=it.DrugId,
+ DrugId = it.DrugId,
Id = it.Id,
- }).UpdateColumns(it => new { it.Quantity, it.ManuNo, it.EffDate,it.DrugId }).ExecuteCommand();
+ DrawerNo = it.DrawerNo,
+ ColNo = it.ColNo,
+ DrawerType = it.DrawerType,
+ BoardType = it.BoardType
+ }).UpdateColumns(it => new { it.Quantity, it.ManuNo, it.EffDate, it.DrugId }).ExecuteCommand();
}
else
{
@@ -343,7 +321,7 @@ namespace DM_Weight.ViewModels
ManuNo = it.ManuNo,
EffDate = !String.IsNullOrEmpty(it.EffDate) ? DateTime.ParseExact(it.EffDate, "yyyy-MM-dd", System.Globalization.CultureInfo.CurrentCulture) : null,
Operator = HomeWindowViewModel.Operator?.Id,
- Reviewer= HomeWindowViewModel.Reviewer?.Id,
+ Reviewer = HomeWindowViewModel.Reviewer?.Id,
OperationTime = DateTime.Now,
Quantity = it.AddQuantity,
Type = 1,
@@ -359,10 +337,14 @@ namespace DM_Weight.ViewModels
{
AlertMsg alertMsg = new AlertMsg
{
- Message = $"该抽屉已存在此药品批次{string.Join(',', stockRepeats.Select(r=>r.ManuNo).ToArray())},请选择其他批次",
+ Message = $"该抽屉已存在此药品批次{string.Join(',', stockRepeats.Select(r => r.ManuNo).ToArray())},请选择其他批次",
Type = MsgType.ERROR
};
- _eventAggregator.GetEvent().Publish(alertMsg);
+
+ System.Windows.Application.Current.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Send, new Action(() =>
+ {
+ _eventAggregator.GetEvent().Publish(alertMsg);
+ }));
}
else
{
@@ -374,7 +356,7 @@ namespace DM_Weight.ViewModels
if (stockRepeats.Count > 0)
{
msg = $"该抽屉下批次{string.Join(',', stockRepeats.Select(r => r.ManuNo).ToArray())}已存在,不可重复添加,其他批次加药完成,库存已更新";
- foreach(var stockRpt in stockRepeats)
+ foreach (var stockRpt in stockRepeats)
{
//移除重复的信息,以免更新屏显库存时更新了重复数据
record.Remove(stockRpt);
@@ -396,20 +378,20 @@ namespace DM_Weight.ViewModels
ret.Quantity = it.Sum(itx => itx.Quantity);
ret.AddQuantity = it.Sum(itx => itx.AddQuantity);
ret.EffDate = it.Min(it => it.EffDate);
- ret.ManuNo = it.OrderBy(it=>it.ManuNo).Select(it=>it.ManuNo).First().ToString();
+ ret.ManuNo = it.OrderBy(it => it.ManuNo).Select(it => it.ManuNo).First().ToString();
return ret;
})
- .OrderBy(it=>it.EffDate)
+ .OrderBy(it => it.EffDate)
.ToList();
singleChannels = singleChannels.Where(it => it.AddQuantity > 0).ToList();
if ((singleChannels.Count > 0 ? singleChannels[0].BoardType : 1) == 5)
{
//将库位多批次的总库存数更新标签
//_portUtil.WriteQuantity(singleChannels[0].DrawerNo, singleChannels[0].ColNo, singleChannels.Sum(it => it.Quantity) + singleChannels.Sum(it => it.AddQuantity));
-
+
singleChannels.ForEach(it =>
{
-
+
_portUtil.WriteChannelInfo(6, it.EffDate == null ? "" : it.EffDate, it.DrawerNo, it.ColNo);
Thread.Sleep(200);
_portUtil.WriteChannelInfo(5, it.ManuNo, it.DrawerNo, it.ColNo);
@@ -429,7 +411,11 @@ namespace DM_Weight.ViewModels
Message = msg,
Type = type,
};
- _eventAggregator.GetEvent().Publish(alertMsg);
+
+ System.Windows.Application.Current.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Send, new Action(() =>
+ {
+ _eventAggregator.GetEvent().Publish(alertMsg);
+ }));
}
else
{
@@ -438,7 +424,11 @@ namespace DM_Weight.ViewModels
Message = "更新库存失败",
Type = MsgType.SUCCESS,
};
- _eventAggregator.GetEvent().Publish(alertMsg);
+
+ System.Windows.Application.Current.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Send, new Action(() =>
+ {
+ _eventAggregator.GetEvent().Publish(alertMsg);
+ }));
}
}
Status = 0;
@@ -456,14 +446,31 @@ namespace DM_Weight.ViewModels
Message = "没有填写加药数量",
Type = MsgType.ERROR
};
- _eventAggregator.GetEvent().Publish(alertMsg);
+
+ System.Windows.Application.Current.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Send, new Action(() =>
+ {
+ _eventAggregator.GetEvent().Publish(alertMsg);
+ }));
}
}
-
- });
+ OptionStatus = -1;
+ }
+ catch (Exception ex)
+ {
+ logger.Info($"AddDrugControlViewModel异常:{ex.Message}");
+ _isFinishClick = false;
+ AlertMsg alertMsg = new AlertMsg
+ {
+ Message = $"异常:{ex.Message}",
+ Type = MsgType.ERROR
+ };
+ System.Windows.Application.Current.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Send, new Action(() =>
+ {
+ _eventAggregator.GetEvent().Publish(alertMsg);
+ }));
+ }
}
-
// 取消按钮
public DelegateCommand CancleTake
{
@@ -531,11 +538,11 @@ namespace DM_Weight.ViewModels
public void FindDrawerCount()
{
- int count = SqlSugarHelper.Db.Queryable().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();
- Is8Drawer = count < 9;
- Is16Drawer = count >= 16;
- Is17Drawer = count > 16;
+ //int count = SqlSugarHelper.Db.Queryable().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();
+ Is8Drawer = App.SingleModel; //count < 9;
+ Is16Drawer = !App.SingleModel; //count >= 16;
+ Is17Drawer = false;//count > 16;
}
//这个方法用于拦截请求,continuationCallback(true)就是不拦截,continuationCallback(false)拦截本次操作
diff --git a/DM_Weight/ViewModels/BeforeLoginViewModel.cs b/DM_Weight/ViewModels/BeforeLoginViewModel.cs
new file mode 100644
index 0000000..7113d5f
--- /dev/null
+++ b/DM_Weight/ViewModels/BeforeLoginViewModel.cs
@@ -0,0 +1,87 @@
+using DM_Weight.Finger;
+using DM_Weight.Port;
+using Prism.Commands;
+using Prism.Events;
+using Prism.Mvvm;
+using Prism.Regions;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Xml;
+
+namespace DM_Weight.ViewModels
+{
+ public class BeforeLoginViewModel : BindableBase, IRegionMemberLifetime, IConfirmNavigationRequest
+ {
+ public bool KeepAlive => false;
+ IRegionManager _regionManager;
+ IEventAggregator _eventAggregator;
+ public BeforeLoginViewModel(IRegionManager regionManager, IEventAggregator eventAggregator, PortUtil portUtil)
+ {
+ _regionManager = regionManager;
+ _eventAggregator = eventAggregator;
+ }
+ private NavigationParameters keys = new NavigationParameters();
+ ///
+ /// 值班柜柜登录
+ ///
+ public DelegateCommand DutyCommand
+ {
+ get => new DelegateCommand(() =>
+ {
+
+ //_loginWindowViewModel.SingleLogin = true;
+ //_loginWindowViewModel.MultiLogin = false;
+
+ keys.Add("SingleLogin", true);
+ App.SingleModel = true;
+ _regionManager.RequestNavigate("MainRegion", "LoginWindow",keys);
+ });
+ }
+ ///
+ /// 周转柜登录
+ ///
+ public DelegateCommand OtherCommand
+ {
+ get => new DelegateCommand(() =>
+ {
+ //_loginWindowViewModel.SingleLogin = false;
+ //_loginWindowViewModel.MultiLogin = true;
+
+ keys.Add("SingleLogin", false);
+ App.SingleModel = false;
+ _regionManager.RequestNavigate("MainRegion", "LoginWindow", keys);
+ });
+ }
+
+ public void ConfirmNavigationRequest(NavigationContext navigationContext, Action continuationCallback)
+ {
+ continuationCallback(true);
+ }
+
+ public bool IsNavigationTarget(NavigationContext navigationContext)
+ {
+ return true;
+ }
+
+ public void OnNavigatedFrom(NavigationContext navigationContext)
+ {
+ }
+
+ public void OnNavigatedTo(NavigationContext navigationContext)
+ {
+ }
+ //手动实现调用配置的逻辑 规避修改配置文件后不起作用的问题
+ public 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();
+ }
+ }
+}
diff --git a/DM_Weight/ViewModels/BindingChannelNewDialogViewModel .cs b/DM_Weight/ViewModels/BindingChannelNewDialogViewModel .cs
index 33fff54..ce8e2da 100644
--- a/DM_Weight/ViewModels/BindingChannelNewDialogViewModel .cs
+++ b/DM_Weight/ViewModels/BindingChannelNewDialogViewModel .cs
@@ -142,7 +142,7 @@ namespace DM_Weight.ViewModels
public void UpdateComboBoxItems(string text)
{
string str = @"SELECT d.drug_id,d.py_code,d.drug_barcode,d.drug_name,d.drug_brand_name,d.drug_spec,d.dosage,d.pack_unit,
- d.manufactory,d.max_stock,CONCAT(drug_name,' ',drug_spec)as drug_name_spec FROM `drug_info` d";
+ d.manufactory,d.max_stock,CONCAT(drug_name,';',drug_spec,';',manufactory)as drug_name_spec FROM `drug_info` d";
if (string.IsNullOrEmpty(text))
{
DrugInfos = SqlSugarHelper.Db.SqlQueryable(str).OrderBy(di => di.DrugName).OrderBy(di => di.DrugId).ToList();
@@ -247,7 +247,7 @@ namespace DM_Weight.ViewModels
//var list = SqlSugarHelper.Db.Queryable().Includes(di => di.DrugManuNos).OrderBy(di => di.DrugId).ToList();
//DrugInfos = list;
//DrugInfos_PY = list;
- string str = "SELECT d.drug_id,d.py_code,d.drug_barcode,d.drug_name,d.drug_brand_name,d.drug_spec,d.dosage,d.pack_unit,d.manufactory,d.max_stock,CONCAT(drug_name,' ',drug_spec)as drug_name_spec FROM `drug_info` d";
+ string str = "SELECT d.drug_id,d.py_code,d.drug_barcode,d.drug_name,d.drug_brand_name,d.drug_spec,d.dosage,d.pack_unit,d.manufactory,d.max_stock,CONCAT(drug_name,';',drug_spec,';',manufactory) as drug_name_spec FROM `drug_info` d";
DrugInfos = SqlSugarHelper.Db.SqlQueryable(str).OrderBy(di => di.DrugName).OrderBy(di => di.DrugId).ToList();
}
@@ -258,6 +258,8 @@ namespace DM_Weight.ViewModels
int totalCount = 0;
var list = SqlSugarHelper.Db.Queryable()
.Includes(cl => cl.Drug)
+ .WhereIF(App.SingleModel, cl => cl.DrawerNo <= 8) //单人登录开前8个抽屉,双人登录开后8个抽屉
+ .WhereIF(!(App.SingleModel), cl => cl.DrawerNo > 8)
.Includes(cs => cs.channelStocks)
.WhereIF(DrawerNo > 0, cl => cl.DrawerNo == DrawerNo)
.Where(cl => cl.MachineId.Equals(ConfigurationManager.AppSettings["machineId"] ?? "DM1"))
diff --git a/DM_Weight/ViewModels/CheckStockNew2WindowViewModel.cs b/DM_Weight/ViewModels/CheckStockNew2WindowViewModel.cs
index 8fc1864..7894adc 100644
--- a/DM_Weight/ViewModels/CheckStockNew2WindowViewModel.cs
+++ b/DM_Weight/ViewModels/CheckStockNew2WindowViewModel.cs
@@ -574,7 +574,8 @@ namespace DM_Weight.ViewModels
.Where(cs => cs.DrawerType == 1)
.Where(cs => cs.DrugId != null)
.Where(cs => cs.MachineId.Equals(ConfigurationManager.AppSettings["machineId"] ?? "DM1"))
-
+ .WhereIF(App.SingleModel, cs => cs.DrawerNo <= 8) //单人登录开前8个抽屉,双人登录开后8个抽屉
+ .WhereIF(!(App.SingleModel), cs => cs.DrawerNo > 8)
.WhereIF(!String.IsNullOrEmpty(SearchValue), cs => cs.DrugInfo.DrugName == SearchValue)
.OrderBy(cs => cs.DrawerNo)
.OrderBy(cs => cs.ColNo)
diff --git a/DM_Weight/ViewModels/CheckStockNewWindowViewModel.cs b/DM_Weight/ViewModels/CheckStockNewWindowViewModel.cs
index 742b603..40c4bb4 100644
--- a/DM_Weight/ViewModels/CheckStockNewWindowViewModel.cs
+++ b/DM_Weight/ViewModels/CheckStockNewWindowViewModel.cs
@@ -706,7 +706,8 @@ namespace DM_Weight.ViewModels
.Where(cs => cs.DrawerType == 1)
.Where(cs => cs.DrugId != null)
.Where(cs => cs.MachineId.Equals(ConfigurationManager.AppSettings["machineId"] ?? "DM1"))
-
+ .WhereIF(App.SingleModel, cs => cs.DrawerNo <= 8) //单人登录开前8个抽屉,双人登录开后8个抽屉
+ .WhereIF(!(App.SingleModel), cs => cs.DrawerNo > 8)
.WhereIF(!String.IsNullOrEmpty(SearchValue), cs => cs.DrugInfo.DrugName == SearchValue)
.OrderBy(cs => cs.DrawerNo)
//.OrderByDescending(cs => cs.DrawerNo)
diff --git a/DM_Weight/ViewModels/CheckStockWindowViewModel.cs b/DM_Weight/ViewModels/CheckStockWindowViewModel.cs
index 7293f74..e4857fe 100644
--- a/DM_Weight/ViewModels/CheckStockWindowViewModel.cs
+++ b/DM_Weight/ViewModels/CheckStockWindowViewModel.cs
@@ -121,53 +121,53 @@ namespace DM_Weight.ViewModels
{
get => new DelegateCommand(() =>
{
- if (App.CurrentFaUserList.Role != null)
- {
- //查看当前用户是否有所在药品抽屉的权限
- bool bLessEight = ChannelStocks.Select(it => it.DrawerNo).Where(n => n <= 8).Any();
- bool bMoreEight = ChannelStocks.Select(it => it.DrawerNo).Where(n => n > 8&&n<17).Any();
- bool bEqualEight = ChannelStocks.Select(it => it.DrawerNo).Where(n => n == 17).Any();
- if (bLessEight)
- {
- if (App.CurrentFaUserList.Role.FirstEightChecked == "0")
- {
- AlertMsg alertMsg = new AlertMsg
- {
- Message = "当前用户没有打开抽屉的权限!",
- Type = MsgType.ERROR,
- };
- _eventAggregator.GetEvent().Publish(alertMsg);
- return;
- }
- }
- if (bMoreEight)
- {
- if (App.CurrentFaUserList.Role.LastEightChecked == "0")
- {
- AlertMsg alertMsg = new AlertMsg
- {
- Message = "当前用户没有打开抽屉的权限!",
- Type = MsgType.ERROR,
- };
- _eventAggregator.GetEvent().Publish(alertMsg);
- return;
- }
- }
- if (bEqualEight)
- {
- if (App.CurrentFaUserList.Role.StorageBoxChecked == "0")
- {
- AlertMsg alertMsg = new AlertMsg
- {
- Message = "当前用户没有打开抽屉的权限!",
- Type = MsgType.ERROR,
- };
- _eventAggregator.GetEvent().Publish(alertMsg);
- return;
- }
- }
+ //if (App.CurrentFaUserList.Role != null)
+ //{
+ // //查看当前用户是否有所在药品抽屉的权限
+ // bool bLessEight = ChannelStocks.Select(it => it.DrawerNo).Where(n => n <= 8).Any();
+ // bool bMoreEight = ChannelStocks.Select(it => it.DrawerNo).Where(n => n > 8&&n<17).Any();
+ // bool bEqualEight = ChannelStocks.Select(it => it.DrawerNo).Where(n => n == 17).Any();
+ // if (bLessEight)
+ // {
+ // if (App.CurrentFaUserList.Role.FirstEightChecked == "0")
+ // {
+ // AlertMsg alertMsg = new AlertMsg
+ // {
+ // Message = "当前用户没有打开抽屉的权限!",
+ // Type = MsgType.ERROR,
+ // };
+ // _eventAggregator.GetEvent().Publish(alertMsg);
+ // return;
+ // }
+ // }
+ // if (bMoreEight)
+ // {
+ // if (App.CurrentFaUserList.Role.LastEightChecked == "0")
+ // {
+ // AlertMsg alertMsg = new AlertMsg
+ // {
+ // Message = "当前用户没有打开抽屉的权限!",
+ // Type = MsgType.ERROR,
+ // };
+ // _eventAggregator.GetEvent().Publish(alertMsg);
+ // return;
+ // }
+ // }
+ // if (bEqualEight)
+ // {
+ // if (App.CurrentFaUserList.Role.StorageBoxChecked == "0")
+ // {
+ // AlertMsg alertMsg = new AlertMsg
+ // {
+ // Message = "当前用户没有打开抽屉的权限!",
+ // Type = MsgType.ERROR,
+ // };
+ // _eventAggregator.GetEvent().Publish(alertMsg);
+ // return;
+ // }
+ // }
- }
+ //}
Status = 1;
diff --git a/DM_Weight/ViewModels/DrawerAddDrugWindowViewModel.cs b/DM_Weight/ViewModels/DrawerAddDrugWindowViewModel.cs
index 77a5405..bd535dd 100644
--- a/DM_Weight/ViewModels/DrawerAddDrugWindowViewModel.cs
+++ b/DM_Weight/ViewModels/DrawerAddDrugWindowViewModel.cs
@@ -138,53 +138,53 @@ namespace DM_Weight.ViewModels
{
get => new DelegateCommand(() =>
{
- if (App.CurrentFaUserList.Role != null)
- {
- //查看当前用户是否有所在药品抽屉的权限
- bool bLessEight = ChannelStocks.Select(it => it.DrawerNo).Where(n => n <= 8).Any();
- bool bMoreEight = ChannelStocks.Select(it => it.DrawerNo).Where(n => n > 8&&n<17).Any();
- bool bEqualEight = ChannelStocks.Select(it => it.DrawerNo).Where(n => n == 17).Any();
- if (bLessEight)
- {
- if (App.CurrentFaUserList.Role.FirstEightChecked == "0")
- {
- AlertMsg alertMsg = new AlertMsg
- {
- Message = "当前用户没有打开抽屉的权限!",
- Type = MsgType.ERROR,
- };
- _eventAggregator.GetEvent().Publish(alertMsg);
- return;
- }
- }
- if (bMoreEight)
- {
- if (App.CurrentFaUserList.Role.LastEightChecked == "0")
- {
- AlertMsg alertMsg = new AlertMsg
- {
- Message = "当前用户没有打开抽屉的权限!",
- Type = MsgType.ERROR,
- };
- _eventAggregator.GetEvent().Publish(alertMsg);
- return;
- }
- }
- if (bEqualEight)
- {
- if (App.CurrentFaUserList.Role.StorageBoxChecked == "0")
- {
- AlertMsg alertMsg = new AlertMsg
- {
- Message = "当前用户没有打开抽屉的权限!",
- Type = MsgType.ERROR,
- };
- _eventAggregator.GetEvent().Publish(alertMsg);
- return;
- }
- }
+ //if (App.CurrentFaUserList.Role != null)
+ //{
+ // //查看当前用户是否有所在药品抽屉的权限
+ // bool bLessEight = ChannelStocks.Select(it => it.DrawerNo).Where(n => n <= 8).Any();
+ // bool bMoreEight = ChannelStocks.Select(it => it.DrawerNo).Where(n => n > 8&&n<17).Any();
+ // bool bEqualEight = ChannelStocks.Select(it => it.DrawerNo).Where(n => n == 17).Any();
+ // if (bLessEight)
+ // {
+ // if (App.CurrentFaUserList.Role.FirstEightChecked == "0")
+ // {
+ // AlertMsg alertMsg = new AlertMsg
+ // {
+ // Message = "当前用户没有打开抽屉的权限!",
+ // Type = MsgType.ERROR,
+ // };
+ // _eventAggregator.GetEvent().Publish(alertMsg);
+ // return;
+ // }
+ // }
+ // if (bMoreEight)
+ // {
+ // if (App.CurrentFaUserList.Role.LastEightChecked == "0")
+ // {
+ // AlertMsg alertMsg = new AlertMsg
+ // {
+ // Message = "当前用户没有打开抽屉的权限!",
+ // Type = MsgType.ERROR,
+ // };
+ // _eventAggregator.GetEvent().Publish(alertMsg);
+ // return;
+ // }
+ // }
+ // if (bEqualEight)
+ // {
+ // if (App.CurrentFaUserList.Role.StorageBoxChecked == "0")
+ // {
+ // AlertMsg alertMsg = new AlertMsg
+ // {
+ // Message = "当前用户没有打开抽屉的权限!",
+ // Type = MsgType.ERROR,
+ // };
+ // _eventAggregator.GetEvent().Publish(alertMsg);
+ // return;
+ // }
+ // }
- }
+ //}
Status = 1;
_portUtil.SpeakAsync("正在打开" + DrawerNo + "号抽屉");
diff --git a/DM_Weight/ViewModels/HomeWindowViewModel.cs b/DM_Weight/ViewModels/HomeWindowViewModel.cs
index 7786bed..a03efa8 100644
--- a/DM_Weight/ViewModels/HomeWindowViewModel.cs
+++ b/DM_Weight/ViewModels/HomeWindowViewModel.cs
@@ -38,7 +38,7 @@ namespace DM_Weight.ViewModels
private int loginMode = Convert.ToInt32(ConfigurationManager.AppSettings["loginMode"]?.ToString() ?? "1");
public bool MultiLogin
{
- get => loginMode == 2;
+ get => !App.SingleModel;// loginMode == 2;
}
private PremissionDm? _selectedMenu;
@@ -206,7 +206,7 @@ namespace DM_Weight.ViewModels
logger.Info($"用户【{Operator?.Nickname}】退出登录");
Operator = null;
Reviewer = null;
- _regionManager.RequestNavigate("MainRegion", "LoginWindow");
+ _regionManager.RequestNavigate("MainRegion", "BeforeLogin");
}
else
{
@@ -358,7 +358,7 @@ namespace DM_Weight.ViewModels
Reviewer = null;
Application.Current.Dispatcher.Invoke(() =>
{
- _regionManager.RequestNavigate("MainRegion", "LoginWindow");
+ _regionManager.RequestNavigate("MainRegion", "BeforeLogin");
});
AlertMsg alertMsg = new AlertMsg
{
@@ -394,7 +394,7 @@ namespace DM_Weight.ViewModels
Reviewer = null;
Application.Current.Dispatcher.Invoke(() =>
{
- _regionManager.RequestNavigate("MainRegion", "LoginWindow");
+ _regionManager.RequestNavigate("MainRegion", "BeforeLogin");
timer.Stop();
});
}
@@ -433,7 +433,7 @@ namespace DM_Weight.ViewModels
logger.Info($"用户【{Operator?.Nickname}】退出登录");
Operator = null;
Reviewer = null;
- _regionManager.RequestNavigate("MainRegion", "LoginWindow");
+ _regionManager.RequestNavigate("MainRegion", "BeforeLogin");
}
else
{
@@ -453,7 +453,7 @@ namespace DM_Weight.ViewModels
logger.Info($"用户【{Operator?.Nickname}】退出登录");
Operator = null;
Reviewer = null;
- _regionManager.RequestNavigate("MainRegion", "LoginWindow");
+ _regionManager.RequestNavigate("MainRegion", "BeforeLogin");
}
else
{
@@ -474,7 +474,7 @@ namespace DM_Weight.ViewModels
logger.Info($"用户【{Operator?.Nickname}】退出登录");
Operator = null;
Reviewer = null;
- _regionManager.RequestNavigate("MainRegion", "LoginWindow");
+ _regionManager.RequestNavigate("MainRegion", "BeforeLogin");
}
else
{
@@ -493,7 +493,7 @@ namespace DM_Weight.ViewModels
logger.Info($"用户【{Operator?.Nickname}】退出登录");
Operator = null;
Reviewer = null;
- _regionManager.RequestNavigate("MainRegion", "LoginWindow");
+ _regionManager.RequestNavigate("MainRegion", "BeforeLogin");
}
else
{
@@ -512,7 +512,7 @@ namespace DM_Weight.ViewModels
logger.Info($"用户【{Operator?.Nickname}】退出登录");
Operator = null;
Reviewer = null;
- _regionManager.RequestNavigate("MainRegion", "LoginWindow");
+ _regionManager.RequestNavigate("MainRegion", "BeforeLogin");
}
else
{
diff --git a/DM_Weight/ViewModels/InvoiceAddDialogViewModel.cs b/DM_Weight/ViewModels/InvoiceAddDialogViewModel.cs
index 2e1dabe..7dc4f59 100644
--- a/DM_Weight/ViewModels/InvoiceAddDialogViewModel.cs
+++ b/DM_Weight/ViewModels/InvoiceAddDialogViewModel.cs
@@ -177,53 +177,53 @@ namespace DM_Weight.ViewModels
{
if (Status == 0)
{
- if (App.CurrentFaUserList.Role != null)
- {
- //查看当前用户是否有所在药品抽屉的权限
- bool bLessEight = ChannelStocks.Select(it => it.DrawerNo).Where(n => n <= 8).Any();
- bool bMoreEight = ChannelStocks.Select(it => it.DrawerNo).Where(n => n > 8 && n < 17).Any();
- bool bEqualEight = ChannelStocks.Select(it => it.DrawerNo).Where(n => n == 17).Any();
- if (bLessEight)
- {
- if (App.CurrentFaUserList.Role.FirstEightChecked == "0")
- {
- AlertMsg alertMsg = new AlertMsg
- {
- Message = "当前用户没有打开抽屉的权限!",
- Type = MsgType.ERROR,
- };
- _eventAggregator.GetEvent().Publish(alertMsg);
- return;
- }
- }
- if (bMoreEight)
- {
- if (App.CurrentFaUserList.Role.LastEightChecked == "0")
- {
- AlertMsg alertMsg = new AlertMsg
- {
- Message = "当前用户没有打开抽屉的权限!",
- Type = MsgType.ERROR,
- };
- _eventAggregator.GetEvent().Publish(alertMsg);
- return;
- }
- }
- if (bEqualEight)
- {
- if (App.CurrentFaUserList.Role.StorageBoxChecked == "0")
- {
- AlertMsg alertMsg = new AlertMsg
- {
- Message = "当前用户没有打开抽屉的权限!",
- Type = MsgType.ERROR,
- };
- _eventAggregator.GetEvent().Publish(alertMsg);
- return;
- }
- }
+ //if (App.CurrentFaUserList.Role != null)
+ //{
+ // //查看当前用户是否有所在药品抽屉的权限
+ // bool bLessEight = ChannelStocks.Select(it => it.DrawerNo).Where(n => n <= 8).Any();
+ // bool bMoreEight = ChannelStocks.Select(it => it.DrawerNo).Where(n => n > 8 && n < 17).Any();
+ // bool bEqualEight = ChannelStocks.Select(it => it.DrawerNo).Where(n => n == 17).Any();
+ // if (bLessEight)
+ // {
+ // if (App.CurrentFaUserList.Role.FirstEightChecked == "0")
+ // {
+ // AlertMsg alertMsg = new AlertMsg
+ // {
+ // Message = "当前用户没有打开抽屉的权限!",
+ // Type = MsgType.ERROR,
+ // };
+ // _eventAggregator.GetEvent().Publish(alertMsg);
+ // return;
+ // }
+ // }
+ // if (bMoreEight)
+ // {
+ // if (App.CurrentFaUserList.Role.LastEightChecked == "0")
+ // {
+ // AlertMsg alertMsg = new AlertMsg
+ // {
+ // Message = "当前用户没有打开抽屉的权限!",
+ // Type = MsgType.ERROR,
+ // };
+ // _eventAggregator.GetEvent().Publish(alertMsg);
+ // return;
+ // }
+ // }
+ // if (bEqualEight)
+ // {
+ // if (App.CurrentFaUserList.Role.StorageBoxChecked == "0")
+ // {
+ // AlertMsg alertMsg = new AlertMsg
+ // {
+ // Message = "当前用户没有打开抽屉的权限!",
+ // Type = MsgType.ERROR,
+ // };
+ // _eventAggregator.GetEvent().Publish(alertMsg);
+ // return;
+ // }
+ // }
- }
+ //}
enumerator.MoveNext();
Status = 1;
diff --git a/DM_Weight/ViewModels/InvoiceTakeDialogViewModel.cs b/DM_Weight/ViewModels/InvoiceTakeDialogViewModel.cs
index b5566dc..eed90fd 100644
--- a/DM_Weight/ViewModels/InvoiceTakeDialogViewModel.cs
+++ b/DM_Weight/ViewModels/InvoiceTakeDialogViewModel.cs
@@ -253,53 +253,53 @@ namespace DM_Weight.ViewModels
if (Status == 0)
{
- if (App.CurrentFaUserList.Role != null)
- {
- //查看当前用户是否有所在药品抽屉的权限
- bool bLessEight = ChannelStocks.Select(it => it.DrawerNo).Where(n => n <= 8).Any();
- bool bMoreEight = ChannelStocks.Select(it => it.DrawerNo).Where(n => n > 8 && n < 17).Any();
- bool bEqualEight = ChannelStocks.Select(it => it.DrawerNo).Where(n => n == 17).Any();
- if (bLessEight)
- {
- if (App.CurrentFaUserList.Role.FirstEightChecked == "0")
- {
- AlertMsg alertMsg = new AlertMsg
- {
- Message = "当前用户没有打开抽屉的权限!",
- Type = MsgType.ERROR,
- };
- _eventAggregator.GetEvent().Publish(alertMsg);
- return;
- }
- }
- if (bMoreEight)
- {
- if (App.CurrentFaUserList.Role.LastEightChecked == "0")
- {
- AlertMsg alertMsg = new AlertMsg
- {
- Message = "当前用户没有打开抽屉的权限!",
- Type = MsgType.ERROR,
- };
- _eventAggregator.GetEvent().Publish(alertMsg);
- return;
- }
- }
- if (bEqualEight)
- {
- if (App.CurrentFaUserList.Role.StorageBoxChecked == "0")
- {
- AlertMsg alertMsg = new AlertMsg
- {
- Message = "当前用户没有打开抽屉的权限!",
- Type = MsgType.ERROR,
- };
- _eventAggregator.GetEvent().Publish(alertMsg);
- return;
- }
- }
+ //if (App.CurrentFaUserList.Role != null)
+ //{
+ // //查看当前用户是否有所在药品抽屉的权限
+ // bool bLessEight = ChannelStocks.Select(it => it.DrawerNo).Where(n => n <= 8).Any();
+ // bool bMoreEight = ChannelStocks.Select(it => it.DrawerNo).Where(n => n > 8 && n < 17).Any();
+ // bool bEqualEight = ChannelStocks.Select(it => it.DrawerNo).Where(n => n == 17).Any();
+ // if (bLessEight)
+ // {
+ // if (App.CurrentFaUserList.Role.FirstEightChecked == "0")
+ // {
+ // AlertMsg alertMsg = new AlertMsg
+ // {
+ // Message = "当前用户没有打开抽屉的权限!",
+ // Type = MsgType.ERROR,
+ // };
+ // _eventAggregator.GetEvent().Publish(alertMsg);
+ // return;
+ // }
+ // }
+ // if (bMoreEight)
+ // {
+ // if (App.CurrentFaUserList.Role.LastEightChecked == "0")
+ // {
+ // AlertMsg alertMsg = new AlertMsg
+ // {
+ // Message = "当前用户没有打开抽屉的权限!",
+ // Type = MsgType.ERROR,
+ // };
+ // _eventAggregator.GetEvent().Publish(alertMsg);
+ // return;
+ // }
+ // }
+ // if (bEqualEight)
+ // {
+ // if (App.CurrentFaUserList.Role.StorageBoxChecked == "0")
+ // {
+ // AlertMsg alertMsg = new AlertMsg
+ // {
+ // Message = "当前用户没有打开抽屉的权限!",
+ // Type = MsgType.ERROR,
+ // };
+ // _eventAggregator.GetEvent().Publish(alertMsg);
+ // return;
+ // }
+ // }
- }
+ //}
enumerable = ChannelStocks.GroupBy(cs => cs.DrawerNo, cs => cs);
enumerator = enumerable.GetEnumerator();
enumerator.MoveNext();
diff --git a/DM_Weight/ViewModels/LoginWindowViewModel.cs b/DM_Weight/ViewModels/LoginWindowViewModel.cs
index 048a019..1b95b96 100644
--- a/DM_Weight/ViewModels/LoginWindowViewModel.cs
+++ b/DM_Weight/ViewModels/LoginWindowViewModel.cs
@@ -46,13 +46,15 @@ namespace DM_Weight.ViewModels
public bool SingleLogin
{
- get => ReadAppSetting("loginMode") == "1";
+ //get => ReadAppSetting("loginMode") == "1";
//get => loginMode == 1;
+ get;set;
}
public bool MultiLogin
{
//get => loginMode == 2;
- get => ReadAppSetting("loginMode") == "2";
+ //get => ReadAppSetting("loginMode") == "2";
+ get;set;
}
private FingerprintUtil _fingerprintUtil;
@@ -393,6 +395,9 @@ _exitCommand ??= new DelegateCommand(Exit);
//接收导航传过来的参数 现在是在此处初始化了表格数据
public void OnNavigatedTo(NavigationContext navigationContext)
{
+ SingleLogin = navigationContext.Parameters.GetValue("SingleLogin");
+ MultiLogin = !SingleLogin;
+
FingerMsg = !_fingerprintUtil.bIsConnected;//false;
_eventAggregator.GetEvent().Subscribe(LoginEvent);
}
diff --git a/DM_Weight/ViewModels/MainWindowViewModel.cs b/DM_Weight/ViewModels/MainWindowViewModel.cs
index 6c13274..04f0346 100644
--- a/DM_Weight/ViewModels/MainWindowViewModel.cs
+++ b/DM_Weight/ViewModels/MainWindowViewModel.cs
@@ -80,8 +80,11 @@ namespace DM_Weight.ViewModels
System.Windows.Application.Current.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Send, new Action(() =>
{
- _container.RegisterType