报表数据录入页面添加修改药品功能,页面录入实发、实物、空安瓿三个值一样,要求写一个即可避免他们重复输入。
This commit is contained in:
parent
fb23c500fc
commit
9dfb1a4363
|
@ -3,7 +3,7 @@
|
||||||
<connectionStrings>
|
<connectionStrings>
|
||||||
<!-- 数据库连接字符串 -->
|
<!-- 数据库连接字符串 -->
|
||||||
<!--<add name="database" connectionString="server=127.0.0.1;database=wpf_dm_program;userid=root;password=qq1223" />-->
|
<!--<add name="database" connectionString="server=127.0.0.1;database=wpf_dm_program;userid=root;password=qq1223" />-->
|
||||||
<add name="database" connectionString="server=127.0.0.1;port=3306;database=xiangxiang_xianchang;userid=root;password=root" />
|
<add name="database" connectionString="server=192.168.50.84;port=3306;database=xiangxiang_xianchang;userid=root;password=root" />
|
||||||
</connectionStrings>
|
</connectionStrings>
|
||||||
<!--<runtime>
|
<!--<runtime>
|
||||||
--><!--配置之后,Appdomain.CurrentDomain.UnhandledException 事件的 IsTerminating 就变成了 false 啦!也就是说,程序并不会因为这次的异常而崩溃退出。--><!--
|
--><!--配置之后,Appdomain.CurrentDomain.UnhandledException 事件的 IsTerminating 就变成了 false 啦!也就是说,程序并不会因为这次的异常而崩溃退出。--><!--
|
||||||
|
@ -120,8 +120,8 @@
|
||||||
<!--海康威视密码-->
|
<!--海康威视密码-->
|
||||||
<add key="HIKPassword" value="HKC123456"/>
|
<add key="HIKPassword" value="HKC123456"/>
|
||||||
|
|
||||||
<!--报表药品9种(写全称,与数据库中完全一致)-->
|
<!--报表药品9种(写全称,与数据库中完全一致,单引号引起来,逗号分隔)-->
|
||||||
<add key="DrugNames" value="'枸橼酸舒芬太尼注射液(医5)','盐酸麻黄碱注射液(医)','咪达唑仑注射液(医)(国基)','盐酸纳布啡注射液(医限5)','盐酸曲马多注射液(医)'"/>
|
<add key="DrugNames" value="'9437_487','1472_262','1564_487','6874_2534','8353_487'"/>
|
||||||
|
|
||||||
</appSettings>
|
</appSettings>
|
||||||
</configuration>
|
</configuration>
|
|
@ -280,6 +280,9 @@ namespace DM_Weight
|
||||||
containerRegistry.RegisterForNavigation<ShowMessageDialog, ShowMessageDialogViewModel>();
|
containerRegistry.RegisterForNavigation<ShowMessageDialog, ShowMessageDialogViewModel>();
|
||||||
|
|
||||||
containerRegistry.RegisterForNavigation<WarnDialog, WarnDialogViewModel>();
|
containerRegistry.RegisterForNavigation<WarnDialog, WarnDialogViewModel>();
|
||||||
|
//报表修改药品
|
||||||
|
containerRegistry.RegisterDialog<ReportDrugNameDialog>();
|
||||||
|
containerRegistry.RegisterForNavigation<ReportDrugNameDialog, ReportDrugNameDialogViewModel>();
|
||||||
|
|
||||||
logger.Info("结束APP-RegisterTypes");
|
logger.Info("结束APP-RegisterTypes");
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
using DM_Weight.Models;
|
using DM_Weight.Common;
|
||||||
|
using DM_Weight.Models;
|
||||||
using DM_Weight.msg;
|
using DM_Weight.msg;
|
||||||
using DM_Weight.Port;
|
using DM_Weight.Port;
|
||||||
using DM_Weight.Report;
|
using DM_Weight.Report;
|
||||||
|
@ -8,9 +9,11 @@ using Prism.Commands;
|
||||||
using Prism.Events;
|
using Prism.Events;
|
||||||
using Prism.Mvvm;
|
using Prism.Mvvm;
|
||||||
using Prism.Regions;
|
using Prism.Regions;
|
||||||
|
using Prism.Services.Dialogs;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Collections.ObjectModel;
|
||||||
using System.Configuration;
|
using System.Configuration;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
@ -63,8 +66,9 @@ namespace DM_Weight.ViewModels
|
||||||
//查询9种药品
|
//查询9种药品
|
||||||
|
|
||||||
|
|
||||||
private List<RejectionReport> _rejectionReportList = new List<RejectionReport>();//= staticRejectionReportList;
|
IDialogService _dialogService;
|
||||||
public List<RejectionReport> RejectionReportList
|
private ObservableCollection<RejectionReport> _rejectionReportList = new ObservableCollection<RejectionReport>();//= staticRejectionReportList;
|
||||||
|
public ObservableCollection<RejectionReport> RejectionReportList
|
||||||
{
|
{
|
||||||
get => _rejectionReportList;
|
get => _rejectionReportList;
|
||||||
set
|
set
|
||||||
|
@ -198,9 +202,10 @@ namespace DM_Weight.ViewModels
|
||||||
// }
|
// }
|
||||||
//}
|
//}
|
||||||
IEventAggregator _eventAggregator;
|
IEventAggregator _eventAggregator;
|
||||||
public AddReportDateViewModel(IEventAggregator eventAggregator)
|
public AddReportDateViewModel(IEventAggregator eventAggregator, IDialogService DialogService)
|
||||||
{
|
{
|
||||||
_eventAggregator = eventAggregator;
|
_eventAggregator = eventAggregator;
|
||||||
|
_dialogService = DialogService;
|
||||||
//vm = this;
|
//vm = this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -375,7 +380,29 @@ namespace DM_Weight.ViewModels
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
//修改药品
|
||||||
|
public DelegateCommand EditDrugName
|
||||||
|
{
|
||||||
|
get => new DelegateCommand(async () =>
|
||||||
|
{
|
||||||
|
// 此处延时1毫秒,等待页面渲染
|
||||||
|
await Task.Delay(TimeSpan.FromMilliseconds(1));
|
||||||
|
DialogParameters dialogParameters = new DialogParameters();
|
||||||
|
//dialogParameters.Add("orderInfo", SelectedOrder);
|
||||||
|
DialogServiceExtensions.ShowDialogHost(_dialogService, "ReportDrugNameDialog", dialogParameters, DoDialogResult, "RootDialog");
|
||||||
|
});
|
||||||
|
}
|
||||||
|
private void DoDialogResult(IDialogResult dialogResult)
|
||||||
|
{
|
||||||
|
// 委托 被动执行 被子窗口执行
|
||||||
|
// dialogResult 第一方面可以拿到任意参数 第二方面 可判断关闭状态
|
||||||
|
//if(dialogResult.Result == ButtonResult.OK)
|
||||||
|
//{
|
||||||
|
|
||||||
|
GetAllDrugInfos();
|
||||||
|
//}
|
||||||
|
//MessageBox.Show("返回值:" + dialogResult.Result.ToString());
|
||||||
|
}
|
||||||
public DelegateCommand Download
|
public DelegateCommand Download
|
||||||
{
|
{
|
||||||
get => new DelegateCommand(() =>
|
get => new DelegateCommand(() =>
|
||||||
|
@ -383,158 +410,6 @@ namespace DM_Weight.ViewModels
|
||||||
GridReportUtil.RejectionReport(StartDate, EndDate);
|
GridReportUtil.RejectionReport(StartDate, EndDate);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
////发药数据添加
|
|
||||||
//public DelegateCommand AddSendReportDateCommand
|
|
||||||
//{
|
|
||||||
// get => new DelegateCommand(() =>
|
|
||||||
// {
|
|
||||||
// if (SelectedDrug != null)
|
|
||||||
// {
|
|
||||||
// int iRet=SqlSugarHelper.Db.Insertable(new RejectionReport()
|
|
||||||
// {
|
|
||||||
// SendDate = DateTime.Parse(RejReport.SendDate.ToString("yyyy-MM-dd HH:mm")),
|
|
||||||
// SendUser = SendUser.Nickname,
|
|
||||||
// ReceiveUser = SendUserCheck.Nickname,//Jiaojie_ChannelStocks
|
|
||||||
// RealNum= RejReport.RealNum,
|
|
||||||
// DrugId = SelectedDrug.DrugId,
|
|
||||||
// DrugName = SelectedDrug.DrugName,
|
|
||||||
// DrugSpec = SelectedDrug.DrugSpec,
|
|
||||||
// BaseNum = SelectedDrug.drugBase.BaseQuantity + "支",//总基数
|
|
||||||
// OperationTime=DateTime.Now,
|
|
||||||
|
|
||||||
// }).ExecuteCommand();
|
|
||||||
// if (iRet > 0)
|
|
||||||
// {
|
|
||||||
// AlertMsg alertMsg = new AlertMsg
|
|
||||||
// {
|
|
||||||
// Message = "保存成功",
|
|
||||||
// Type = MsgType.INFO
|
|
||||||
// };
|
|
||||||
// _eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg);
|
|
||||||
|
|
||||||
// }
|
|
||||||
// else
|
|
||||||
// {
|
|
||||||
// AlertMsg alertMsg = new AlertMsg
|
|
||||||
// {
|
|
||||||
// Message = "发药数据保存失败,数据异常",
|
|
||||||
// Type = MsgType.ERROR
|
|
||||||
// };
|
|
||||||
// _eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// else
|
|
||||||
// {
|
|
||||||
// AlertMsg alertMsg = new AlertMsg
|
|
||||||
// {
|
|
||||||
// Message = "请先选择药品",
|
|
||||||
// Type = MsgType.ERROR
|
|
||||||
// };
|
|
||||||
// _eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg);
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
//}
|
|
||||||
////还药数据添加
|
|
||||||
//public DelegateCommand AddReturnReportDateCommand
|
|
||||||
//{
|
|
||||||
// get => new DelegateCommand(() =>
|
|
||||||
// {
|
|
||||||
// if (SelectedDrug != null)
|
|
||||||
// {
|
|
||||||
// int iRet= SqlSugarHelper.Db.Insertable(new RejectionReport()
|
|
||||||
// {
|
|
||||||
// ReturnTime = DateTime.Parse(RejReport.ReturnTime).ToString("yyyy-MM-dd HH:mm"),
|
|
||||||
// ReturnUser = User.UserName,
|
|
||||||
// ReturnReceiveUser = UserCheck.Nickname,//Jiaojie_ChannelStocks
|
|
||||||
// InfactNum= RejReport.InfactNum,
|
|
||||||
// EmptyNum= RejReport.EmptyNum,
|
|
||||||
// DrugId = SelectedDrug.DrugId,
|
|
||||||
// DrugName = SelectedDrug.DrugName,
|
|
||||||
// DrugSpec = SelectedDrug.DrugSpec,
|
|
||||||
// BaseNum = SelectedDrug + "支",
|
|
||||||
// }).ExecuteCommand();
|
|
||||||
// if (iRet > 0)
|
|
||||||
// {
|
|
||||||
// AlertMsg alertMsg = new AlertMsg
|
|
||||||
// {
|
|
||||||
// Message = "保存成功",
|
|
||||||
// Type = MsgType.INFO
|
|
||||||
// };
|
|
||||||
// _eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg);
|
|
||||||
|
|
||||||
// }
|
|
||||||
// else
|
|
||||||
// {
|
|
||||||
// AlertMsg alertMsg = new AlertMsg
|
|
||||||
// {
|
|
||||||
// Message = "还药数据保存失败,数据异常",
|
|
||||||
// Type = MsgType.ERROR
|
|
||||||
// };
|
|
||||||
// _eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// else
|
|
||||||
// {
|
|
||||||
// AlertMsg alertMsg = new AlertMsg
|
|
||||||
// {
|
|
||||||
// Message = "请先选择药品",
|
|
||||||
// Type = MsgType.ERROR
|
|
||||||
// };
|
|
||||||
// _eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg);
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
//}
|
|
||||||
////日消耗数据添加
|
|
||||||
//public DelegateCommand AddUseReportDateCommand
|
|
||||||
//{
|
|
||||||
// get => new DelegateCommand(() =>
|
|
||||||
// {
|
|
||||||
// if (SelectedDrug != null)
|
|
||||||
// {
|
|
||||||
// int iRet= SqlSugarHelper.Db.Insertable(new RejectionReport()
|
|
||||||
// {
|
|
||||||
// //ReturnTime = DateTime.Parse(RejReport.ReturnTime).ToString("yyyy-MM-dd HH:mm"),
|
|
||||||
// AddUser = User.UserName,
|
|
||||||
// AddCheckUser = UserCheck.Nickname,//Jiaojie_ChannelStocks
|
|
||||||
// UseBottle = RejReport.UseBottle,
|
|
||||||
// UseOrderNo = RejReport.UseOrderNo,
|
|
||||||
// UseAdd=RejReport.UseAdd,
|
|
||||||
// DrugId = SelectedDrug.DrugId,
|
|
||||||
// DrugName = SelectedDrug.DrugName,
|
|
||||||
// DrugSpec = SelectedDrug.DrugSpec,
|
|
||||||
// BaseNum = SelectedDrug + "支",
|
|
||||||
// }).ExecuteCommand();
|
|
||||||
// if(iRet>0)
|
|
||||||
// {
|
|
||||||
// AlertMsg alertMsg = new AlertMsg
|
|
||||||
// {
|
|
||||||
// Message = "保存成功",
|
|
||||||
// Type = MsgType.INFO
|
|
||||||
// };
|
|
||||||
// _eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg);
|
|
||||||
|
|
||||||
// }
|
|
||||||
// else
|
|
||||||
// {
|
|
||||||
// AlertMsg alertMsg = new AlertMsg
|
|
||||||
// {
|
|
||||||
// Message = "日消耗保存失败,数据异常",
|
|
||||||
// Type = MsgType.ERROR
|
|
||||||
// };
|
|
||||||
// _eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// else
|
|
||||||
// {
|
|
||||||
// AlertMsg alertMsg = new AlertMsg
|
|
||||||
// {
|
|
||||||
// Message = "请先选择药品",
|
|
||||||
// Type = MsgType.ERROR
|
|
||||||
// };
|
|
||||||
// _eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg);
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
//}
|
|
||||||
public DelegateCommand AddReportDateCommand
|
public DelegateCommand AddReportDateCommand
|
||||||
{
|
{
|
||||||
get => new DelegateCommand(() =>
|
get => new DelegateCommand(() =>
|
||||||
|
@ -554,12 +429,12 @@ namespace DM_Weight.ViewModels
|
||||||
SendDate = SendDate,
|
SendDate = SendDate,
|
||||||
SendUser = SendUser.Nickname,
|
SendUser = SendUser.Nickname,
|
||||||
ReceiveUser = SendUserCheck.Nickname,//Jiaojie_ChannelStocks
|
ReceiveUser = SendUserCheck.Nickname,//Jiaojie_ChannelStocks
|
||||||
RealNum = report.RealNum,
|
RealNum = report.RealNum, //实发、实物、空安瓿三个值一样,要求写一个即可避免他们重复输入
|
||||||
ReturnTime = ReturnTime,
|
ReturnTime = ReturnTime,
|
||||||
ReturnUser = ReturnUser.UserName,
|
ReturnUser = ReturnUser.UserName,
|
||||||
ReturnReceiveUser = ReturnUserCheck.Nickname,//Jiaojie_ChannelStocks
|
ReturnReceiveUser = ReturnUserCheck.Nickname,//Jiaojie_ChannelStocks
|
||||||
InfactNum = report.InfactNum,
|
InfactNum = report.RealNum,
|
||||||
EmptyNum = report.EmptyNum,
|
EmptyNum = report.RealNum,
|
||||||
AddUser = AddUser.UserName,
|
AddUser = AddUser.UserName,
|
||||||
AddCheckUser = AddUserCheck.Nickname,//Jiaojie_ChannelStocks
|
AddCheckUser = AddUserCheck.Nickname,//Jiaojie_ChannelStocks
|
||||||
UseBottle = report.UseBottle,
|
UseBottle = report.UseBottle,
|
||||||
|
@ -652,11 +527,12 @@ namespace DM_Weight.ViewModels
|
||||||
string str = "SELECT d.drug_id,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,db.baseQuantity as PyCode FROM `drug_info` d left join drug_base db on d.drug_id=db.drugid and db.machine_id='DM3'";
|
string str = "SELECT d.drug_id,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,db.baseQuantity as PyCode FROM `drug_info` d left join drug_base db on d.drug_id=db.drugid and db.machine_id='DM3'";
|
||||||
if (ConfigurationManager.AppSettings["DrugNames"] != null)
|
if (ConfigurationManager.AppSettings["DrugNames"] != null)
|
||||||
{
|
{
|
||||||
str += " where d.drug_name in (" + ConfigurationManager.AppSettings["DrugNames"] + ")";
|
str += " where d.drug_id in (" + CommonClass.ReadAppSetting("DrugNames") + ")";
|
||||||
}
|
}
|
||||||
List<DrugInfo> DrugInfos = SqlSugarHelper.Db.SqlQueryable<DrugInfo>(str).OrderBy(di => di.DrugName).OrderBy(di => di.DrugId).ToList();
|
List<DrugInfo> DrugInfos = SqlSugarHelper.Db.SqlQueryable<DrugInfo>(str).OrderBy(di => di.DrugName).OrderBy(di => di.DrugId).ToList();
|
||||||
if (DrugInfos != null && DrugInfos.Count > 0)
|
if (DrugInfos != null && DrugInfos.Count > 0)
|
||||||
{
|
{
|
||||||
|
RejectionReportList.Clear();
|
||||||
for (int i = 0; i < DrugInfos.Count; i++)
|
for (int i = 0; i < DrugInfos.Count; i++)
|
||||||
{
|
{
|
||||||
RejectionReport report = new RejectionReport();
|
RejectionReport report = new RejectionReport();
|
||||||
|
|
|
@ -0,0 +1,169 @@
|
||||||
|
using DM_Weight.Common;
|
||||||
|
using DM_Weight.Models;
|
||||||
|
using DM_Weight.Port;
|
||||||
|
using DM_Weight.util;
|
||||||
|
using Prism.Commands;
|
||||||
|
using Prism.Mvvm;
|
||||||
|
using Prism.Regions;
|
||||||
|
using Prism.Services.Dialogs;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Collections.ObjectModel;
|
||||||
|
using System.Configuration;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using Unity;
|
||||||
|
|
||||||
|
namespace DM_Weight.ViewModels
|
||||||
|
{
|
||||||
|
public class ReportDrugNameDialogViewModel : BindableBase, IRegionMemberLifetime, IDialogAware
|
||||||
|
{
|
||||||
|
private string? _reportDrugName;
|
||||||
|
public string? ReportDrugName
|
||||||
|
{
|
||||||
|
get => _reportDrugName;
|
||||||
|
set => SetProperty(ref _reportDrugName, value);
|
||||||
|
}
|
||||||
|
private DrugInfo? _leftDrug;
|
||||||
|
public DrugInfo? LeftDrug
|
||||||
|
{
|
||||||
|
get => _leftDrug;
|
||||||
|
set => SetProperty(ref _leftDrug, value);
|
||||||
|
}
|
||||||
|
private ObservableCollection<DrugInfo> _rightDrugNameList = new ObservableCollection<DrugInfo>();
|
||||||
|
|
||||||
|
public ObservableCollection<DrugInfo> RightDrugNameList
|
||||||
|
{
|
||||||
|
get => _rightDrugNameList;
|
||||||
|
set => SetProperty(ref _rightDrugNameList, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
private DrugInfo? _rightDrugName;
|
||||||
|
public DrugInfo? RightDrugName
|
||||||
|
{
|
||||||
|
get => _rightDrugName;
|
||||||
|
set => SetProperty(ref _rightDrugName, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static ObservableCollection<DrugInfo> defaultAll = new ObservableCollection<DrugInfo>();
|
||||||
|
private ObservableCollection<DrugInfo> _allPremissions = defaultAll;
|
||||||
|
|
||||||
|
public event Action<IDialogResult> RequestClose;
|
||||||
|
|
||||||
|
public ObservableCollection<DrugInfo> AllPremissions
|
||||||
|
{
|
||||||
|
get => _allPremissions;
|
||||||
|
set => SetProperty(ref _allPremissions, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool KeepAlive => false;
|
||||||
|
public bool IsNavigationTarget(NavigationContext navigationContext)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void RequestData()
|
||||||
|
{
|
||||||
|
AllPremissions = new ObservableCollection<DrugInfo>();
|
||||||
|
string str = "SELECT d.drug_id,CONCAT(drug_name,' / ',drug_spec,' / ',manufactory) as drug_name_spec FROM `drug_info` d left join drug_base db on d.drug_id=db.drugid and db.machine_id='DM3'";
|
||||||
|
if (ConfigurationManager.AppSettings["DrugNames"] != null)
|
||||||
|
{
|
||||||
|
str += " where d.drug_id not in (" + CommonClass.ReadAppSetting("DrugNames") + ")";
|
||||||
|
}
|
||||||
|
List<DrugInfo> DrugInfos = SqlSugarHelper.Db.SqlQueryable<DrugInfo>(str).OrderBy(di => di.DrugId).ToList();
|
||||||
|
|
||||||
|
AllPremissions.AddRange(DrugInfos);
|
||||||
|
|
||||||
|
|
||||||
|
string strRight = "SELECT d.drug_id,CONCAT(drug_name,' / ',drug_spec,' / ',manufactory) as drug_name_spec FROM `drug_info` d left join drug_base db on d.drug_id=db.drugid and db.machine_id='DM3'";
|
||||||
|
if (ConfigurationManager.AppSettings["DrugNames"] != null)
|
||||||
|
{
|
||||||
|
strRight += " where d.drug_id in (" + CommonClass.ReadAppSetting("DrugNames")+ ")";
|
||||||
|
}
|
||||||
|
List<DrugInfo> DrugInfosRight = SqlSugarHelper.Db.SqlQueryable<DrugInfo>(strRight).OrderBy(di => di.DrugId).ToList();
|
||||||
|
RightDrugNameList.AddRange(DrugInfosRight);
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool CanCloseDialog()
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void OnDialogClosed()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public void OnDialogOpened(IDialogParameters parameters)
|
||||||
|
{
|
||||||
|
//查询报表中的药品名称
|
||||||
|
RequestData();
|
||||||
|
}
|
||||||
|
|
||||||
|
public DelegateCommand<DrugInfo> RightSelectedItemChangedCommand
|
||||||
|
{
|
||||||
|
get => new DelegateCommand<DrugInfo>((DrugInfo _selected) =>
|
||||||
|
{
|
||||||
|
RightDrugName = _selected;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
public DelegateCommand ToRight => new DelegateCommand(() =>
|
||||||
|
{
|
||||||
|
if (LeftDrug != null)
|
||||||
|
{
|
||||||
|
RightDrugNameList.Insert(0, LeftDrug);
|
||||||
|
AllPremissions.RemoveAt(AllPremissions.ToList().FindIndex(it => it.DrugId == LeftDrug.DrugId));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
public DelegateCommand ToLeft => new DelegateCommand(() =>
|
||||||
|
{
|
||||||
|
if (RightDrugName != null)
|
||||||
|
{
|
||||||
|
AllPremissions.Insert(0, RightDrugName);
|
||||||
|
RightDrugNameList.RemoveAt(RightDrugNameList.ToList().FindIndex(it => it.DrugId == RightDrugName.DrugId));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
public DelegateCommand<DrugInfo> LeftSelectedItemChangedCommand
|
||||||
|
{
|
||||||
|
get => new DelegateCommand<DrugInfo>((DrugInfo _selected) =>
|
||||||
|
{
|
||||||
|
LeftDrug = _selected;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
//保存
|
||||||
|
public DelegateCommand AddRole
|
||||||
|
{
|
||||||
|
get=>new DelegateCommand(()=>
|
||||||
|
{
|
||||||
|
if(RightDrugNameList!=null&& RightDrugNameList.Count>0)
|
||||||
|
{
|
||||||
|
string strDrugInfo = string.Empty;
|
||||||
|
for (int i = 0; i < RightDrugNameList.Count; i++)
|
||||||
|
{
|
||||||
|
strDrugInfo +="'"+ RightDrugNameList[i].DrugId+"',";
|
||||||
|
}
|
||||||
|
if (!string.IsNullOrEmpty(strDrugInfo))
|
||||||
|
{
|
||||||
|
strDrugInfo = strDrugInfo.Substring(0, strDrugInfo.Length - 1);
|
||||||
|
CommonClass.SaveAppSetting("DrugNames", strDrugInfo);
|
||||||
|
// 关闭当前窗口
|
||||||
|
RequestClose?.Invoke(new DialogResult(ButtonResult.Cancel));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public string Title => "";
|
||||||
|
public DelegateCommand BtnCloseCommand
|
||||||
|
{
|
||||||
|
get => new DelegateCommand(() =>
|
||||||
|
{
|
||||||
|
//DialogParameters parameters = new DialogParameters();
|
||||||
|
//parameters.Add("",);
|
||||||
|
// 关闭当前窗口
|
||||||
|
RequestClose?.Invoke(new DialogResult(ButtonResult.Cancel));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -41,6 +41,15 @@
|
||||||
Style="{StaticResource MaterialDesignOutlinedDatePicker}"
|
Style="{StaticResource MaterialDesignOutlinedDatePicker}"
|
||||||
/>
|
/>
|
||||||
<StackPanel Grid.Column="3" Orientation="Horizontal" HorizontalAlignment="Right">
|
<StackPanel Grid.Column="3" Orientation="Horizontal" HorizontalAlignment="Right">
|
||||||
|
<Button
|
||||||
|
Margin="0 0 6 0"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Style="{StaticResource MaterialDesignOutlinedLightButton}"
|
||||||
|
ToolTip="" Command="{Binding EditDrugName}">
|
||||||
|
<StackPanel Orientation="Horizontal">
|
||||||
|
<TextBlock Text="修改药品" />
|
||||||
|
</StackPanel>
|
||||||
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
Margin="0 0 6 0"
|
Margin="0 0 6 0"
|
||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
|
@ -598,7 +607,7 @@ Style="{StaticResource MaterialDesignOutlinedTextBox}"/>
|
||||||
<DataTemplate>
|
<DataTemplate>
|
||||||
<TextBox Style="{StaticResource MaterialDesignDataGridTextColumnEditingStyle}">
|
<TextBox Style="{StaticResource MaterialDesignDataGridTextColumnEditingStyle}">
|
||||||
<TextBox.Text>
|
<TextBox.Text>
|
||||||
<Binding Path="InfactNum" Mode="TwoWay" UpdateSourceTrigger="PropertyChanged">
|
<Binding Path="RealNum" Mode="TwoWay" UpdateSourceTrigger="PropertyChanged">
|
||||||
</Binding>
|
</Binding>
|
||||||
</TextBox.Text>
|
</TextBox.Text>
|
||||||
</TextBox>
|
</TextBox>
|
||||||
|
@ -610,7 +619,7 @@ Style="{StaticResource MaterialDesignOutlinedTextBox}"/>
|
||||||
<DataTemplate>
|
<DataTemplate>
|
||||||
<TextBox Style="{StaticResource MaterialDesignDataGridTextColumnEditingStyle}">
|
<TextBox Style="{StaticResource MaterialDesignDataGridTextColumnEditingStyle}">
|
||||||
<TextBox.Text>
|
<TextBox.Text>
|
||||||
<Binding Path="EmptyNum" Mode="TwoWay" UpdateSourceTrigger="PropertyChanged">
|
<Binding Path="RealNum" Mode="TwoWay" UpdateSourceTrigger="PropertyChanged">
|
||||||
</Binding>
|
</Binding>
|
||||||
</TextBox.Text>
|
</TextBox.Text>
|
||||||
</TextBox>
|
</TextBox>
|
||||||
|
|
|
@ -0,0 +1,120 @@
|
||||||
|
<UserControl x:Class="DM_Weight.Views.Dialog.ReportDrugNameDialog"
|
||||||
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
|
xmlns:local="clr-namespace:DM_Weight.Views.Dialog"
|
||||||
|
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
|
||||||
|
xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
|
||||||
|
xmlns:convert="clr-namespace:DM_Weight.Converter"
|
||||||
|
xmlns:prism="http://prismlibrary.com/"
|
||||||
|
mc:Ignorable="d"
|
||||||
|
d:DesignHeight="450" d:DesignWidth="800">
|
||||||
|
<Grid>
|
||||||
|
<Grid.Resources>
|
||||||
|
<convert:NullableToEnabelConverter x:Key="NullableToEnabelConverter" />
|
||||||
|
</Grid.Resources>
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="Auto" />
|
||||||
|
<RowDefinition Height="Auto" />
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
<Grid Background="#03a9f4" Grid.Row="0">
|
||||||
|
<TextBlock VerticalAlignment="Center" Foreground="{DynamicResource PrimaryHueDarkForegroundBrush}" Margin="16 4 16 4" Style="{StaticResource MaterialDesignHeadline5TextBlock}" Text="修改药品" />
|
||||||
|
<Button
|
||||||
|
Style="{StaticResource MaterialDesignIconForegroundButton}"
|
||||||
|
Foreground="{DynamicResource PrimaryHueDarkForegroundBrush}"
|
||||||
|
HorizontalAlignment="Right"
|
||||||
|
Command="{Binding BtnCloseCommand}"
|
||||||
|
ToolTip="关闭">
|
||||||
|
<materialDesign:PackIcon Kind="Close" Width="34" Height="34" />
|
||||||
|
</Button>
|
||||||
|
</Grid>
|
||||||
|
<!--<GroupBox Margin="6" Grid.Row="1" Header="编辑/新增" materialDesign:ColorZoneAssist.Mode="PrimaryLight">-->
|
||||||
|
<Grid Grid.Row="1">
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="Auto" />
|
||||||
|
<RowDefinition />
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
<Grid Grid.Row="0">
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition />
|
||||||
|
<ColumnDefinition />
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition/>
|
||||||
|
<RowDefinition/>
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
<StackPanel Grid.Column="1" Grid.RowSpan="2" Orientation="Horizontal" Margin="10" HorizontalAlignment="Right" VerticalAlignment="Center">
|
||||||
|
<Button Command="{Binding AddRole}" Content="保存" />
|
||||||
|
</StackPanel>
|
||||||
|
</Grid>
|
||||||
|
<Grid Grid.Row="1">
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition />
|
||||||
|
<ColumnDefinition Width="Auto" />
|
||||||
|
<ColumnDefinition />
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<GroupBox Header="全部药品" Grid.Column="0" Margin="10">
|
||||||
|
<ScrollViewer Grid.Row="1" Grid.Column="1">
|
||||||
|
<TreeView x:Name="LeftTree" MinWidth="220" ItemsSource="{Binding AllPremissions}" >
|
||||||
|
<i:Interaction.Triggers>
|
||||||
|
<i:EventTrigger EventName="SelectedItemChanged">
|
||||||
|
<i:InvokeCommandAction Command="{Binding Path=LeftSelectedItemChangedCommand}"
|
||||||
|
CommandParameter="{Binding ElementName=LeftTree, Path=SelectedItem}"/>
|
||||||
|
</i:EventTrigger>
|
||||||
|
</i:Interaction.Triggers>
|
||||||
|
<TreeView.ItemTemplate>
|
||||||
|
<!--<HierarchicalDataTemplate ItemsSource="{Binding drug_name_spec}">
|
||||||
|
<TextBlock Text="{Binding drug_name_spec}" />
|
||||||
|
</HierarchicalDataTemplate>-->
|
||||||
|
<DataTemplate>
|
||||||
|
<StackPanel Orientation="Horizontal">
|
||||||
|
<TextBlock Text="{Binding drug_name_spec}"/>
|
||||||
|
</StackPanel>
|
||||||
|
</DataTemplate>
|
||||||
|
</TreeView.ItemTemplate>
|
||||||
|
</TreeView>
|
||||||
|
</ScrollViewer>
|
||||||
|
</GroupBox>
|
||||||
|
<StackPanel Grid.Column="1" Orientation="Vertical" HorizontalAlignment="Center" VerticalAlignment="Center">
|
||||||
|
<Button
|
||||||
|
Margin="0 4 0 4"
|
||||||
|
Style="{StaticResource MaterialDesignPaperLightButton}"
|
||||||
|
ToolTip="右移"
|
||||||
|
IsEnabled="{Binding LeftPremission, Converter={StaticResource NullableToEnabelConverter}}"
|
||||||
|
Command="{Binding ToRight}"
|
||||||
|
Content="{materialDesign:PackIcon ChevronRight}"/>
|
||||||
|
<Button
|
||||||
|
Margin="0 4 0 4"
|
||||||
|
Style="{StaticResource MaterialDesignPaperLightButton}"
|
||||||
|
ToolTip="左移"
|
||||||
|
IsEnabled="{Binding RightPremission, Converter={StaticResource NullableToEnabelConverter}}"
|
||||||
|
Command="{Binding ToLeft}"
|
||||||
|
Content="{materialDesign:PackIcon ChevronLeft}"/>
|
||||||
|
</StackPanel>
|
||||||
|
<GroupBox Header="已选药品" Grid.Column="2" Margin="10">
|
||||||
|
<ScrollViewer Grid.Row="1" Grid.Column="1">
|
||||||
|
<TreeView x:Name="RightTree" MinWidth="220" ItemsSource="{Binding RightDrugNameList}">
|
||||||
|
<i:Interaction.Triggers>
|
||||||
|
<i:EventTrigger EventName="SelectedItemChanged">
|
||||||
|
<i:InvokeCommandAction Command="{Binding Path=RightSelectedItemChangedCommand}"
|
||||||
|
CommandParameter="{Binding ElementName=RightTree, Path=SelectedItem}"/>
|
||||||
|
</i:EventTrigger>
|
||||||
|
</i:Interaction.Triggers>
|
||||||
|
<TreeView.ItemTemplate>
|
||||||
|
<DataTemplate>
|
||||||
|
<StackPanel Orientation="Horizontal">
|
||||||
|
<TextBlock Text="{Binding drug_name_spec}"/>
|
||||||
|
</StackPanel>
|
||||||
|
</DataTemplate>
|
||||||
|
</TreeView.ItemTemplate>
|
||||||
|
</TreeView>
|
||||||
|
</ScrollViewer>
|
||||||
|
</GroupBox>
|
||||||
|
<materialDesign:Snackbar Background="{Binding SnackbarBackground}" MessageQueue="{Binding SnackbarMessageQueue}"/>
|
||||||
|
</Grid>
|
||||||
|
|
||||||
|
</Grid>
|
||||||
|
<!--</GroupBox>-->
|
||||||
|
</Grid>
|
||||||
|
</UserControl>
|
|
@ -0,0 +1,28 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Windows;
|
||||||
|
using System.Windows.Controls;
|
||||||
|
using System.Windows.Data;
|
||||||
|
using System.Windows.Documents;
|
||||||
|
using System.Windows.Input;
|
||||||
|
using System.Windows.Media;
|
||||||
|
using System.Windows.Media.Imaging;
|
||||||
|
using System.Windows.Navigation;
|
||||||
|
using System.Windows.Shapes;
|
||||||
|
|
||||||
|
namespace DM_Weight.Views.Dialog
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// ReportDrugNameDialog.xaml 的交互逻辑
|
||||||
|
/// </summary>
|
||||||
|
public partial class ReportDrugNameDialog : UserControl
|
||||||
|
{
|
||||||
|
public ReportDrugNameDialog()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue