From 593b55d53fe0b7e424b24176d25e0e69e8844979 Mon Sep 17 00:00:00 2001 From: maqiao <625215135@qq.com> Date: Fri, 3 Jan 2025 17:45:51 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BD=BF=E7=94=A8=E7=99=BB=E8=AE=B0=E5=86=8C?= =?UTF-8?q?=E4=BF=AE=E6=94=B9;=E4=BA=A4=E6=8E=A5=E6=9F=9C=E8=A1=A5?= =?UTF-8?q?=E8=8D=AF=E5=A4=84=E6=96=B9=E4=B8=8E=E8=8D=AF=E5=93=811?= =?UTF-8?q?=E5=AF=B91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DM_Weight/Models/ChannelStock.cs | 7 +- DM_Weight/Report/GridReportUtil.cs | 12 +- .../ReportTemp/account_use_temp - 副本.grf | 452 ++++++++++++++++++ DM_Weight/ReportTemp/account_use_temp.grf | 50 +- .../ViewModels/AddToJiaoJieDialogViewModel.cs | 3 +- .../ViewModels/UseAccountWindowViewModel.cs | 45 +- DM_Weight/Views/UseAccountWindow.xaml | 16 +- 7 files changed, 559 insertions(+), 26 deletions(-) create mode 100644 DM_Weight/ReportTemp/account_use_temp - 副本.grf diff --git a/DM_Weight/Models/ChannelStock.cs b/DM_Weight/Models/ChannelStock.cs index 2b74885..248b1dc 100644 --- a/DM_Weight/Models/ChannelStock.cs +++ b/DM_Weight/Models/ChannelStock.cs @@ -9,7 +9,7 @@ namespace DM_Weight.Models /// /// [SugarTable("channel_stock")] - public class ChannelStock : BindableBase + public class ChannelStock : BindableBase,ICloneable { /// /// @@ -211,5 +211,10 @@ namespace DM_Weight.Models //需要加药数量 [SugarColumn(ColumnName = "col_no2")] public int NeedNum { get; set; } + + public object Clone() + { + return this.MemberwiseClone(); + } } } \ No newline at end of file diff --git a/DM_Weight/Report/GridReportUtil.cs b/DM_Weight/Report/GridReportUtil.cs index 5ea14a7..3d7416d 100644 --- a/DM_Weight/Report/GridReportUtil.cs +++ b/DM_Weight/Report/GridReportUtil.cs @@ -381,12 +381,12 @@ namespace DM_Weight.Report string SQL = string.Empty; Report.LoadFromFile(new FileInfo(AppDomain.CurrentDomain.BaseDirectory) + "ReportTemp//" + "account_use_temp.grf"); - SQL = $@" - SELECT re.create_time as OptDate, di.drug_name as DrugName,di.Drug_spec as DrugSpec,re.manu_no as ManuNo,'' BedNum,re.patient_name as PName, - CONCAT(use_dose,dose_unit) as UDose,CONCAT(residual_dose,dose_unit) as ReDose,'' as Disposal, - re.anaesthetist_name as AName,re.operator_name as OName,re.supervisor_name as CName,'' EmpManuNO,'' EmpRecive,'' as EmpMedicRecive - from surgical_residual re inner join drug_info di on re.drug_id=di.drug_id - where re.create_time > '{startDate}' and re.create_time< '{endDate}'"; + SQL = $@" + SELECT re.create_time as OptDate, di.drug_name as DrugName,di.Drug_spec as DrugSpec,dt.Set_manu_no as ManuNo,re.patient_name as PName, + CONCAT(use_dose,dose_unit) as UDose,CONCAT(residual_dose,dose_unit) as ReDose,if(residual_dose>0,'是','否') as Disposal, + re.anaesthetist_name as AName,re.operator_name as OName,re.supervisor_name as CName,of.operator as EmpRecive,'彭蕾' as EmpMedicRecive,re.disposal_time as DisposalTime,of.win_no as WinNo + from surgical_residual re inner join drug_info di on re.drug_id=di.drug_id left join hkc_order_finish of on re.order_no=of.order_no left join order_detail_sm dt on re.order_no=dt.order_no + where re.create_time > '{startDate}' and re.create_time< '{endDate}'"; diff --git a/DM_Weight/ReportTemp/account_use_temp - 副本.grf b/DM_Weight/ReportTemp/account_use_temp - 副本.grf new file mode 100644 index 0000000..a2b98c5 --- /dev/null +++ b/DM_Weight/ReportTemp/account_use_temp - 副本.grf @@ -0,0 +1,452 @@ +{ + "Version":"6.8.1.1", + "Font":{ + "Name":"宋体", + "Size":105000, + "Weight":400, + "Charset":134 + }, + "Printer":{ + "Oriention":"Landscape", + "LeftMargin":1, + "TopMargin":1.42875, + "RightMargin":1, + "BottomMargin":1.8 + }, + "DetailGrid":{ + "CenterView":true, + "AppendBlankRow":true, + "Recordset":{ + "Field":[ + { + "Name":"日期", + "Type":"DateTime", + "Format":"M/d", + "DBFieldName":"OptDate" + }, + { + "Name":"品名", + "DBFieldName":"DrugName" + }, + { + "Name":"规格", + "DBFieldName":"DrugSpec" + }, + { + "Name":"批号", + "DBFieldName":"ManuNo" + }, + { + "Name":"床号", + "DBFieldName":"BedNum" + }, + { + "Name":"病人姓名", + "DBFieldName":"PName" + }, + { + "Name":"使用剂量", + "DBFieldName":"UDose" + }, + { + "Name":"剩余剂量", + "DBFieldName":"ReDose" + }, + { + "Name":"处理", + "DBFieldName":"Disposal" + }, + { + "Name":"医师", + "DBFieldName":"AName" + }, + { + "Name":"执行者", + "DBFieldName":"OName" + }, + { + "Name":"核对者", + "DBFieldName":"CName" + }, + { + "Name":"空安瓿批号", + "DBFieldName":"EmpManuNO" + }, + { + "Name":"空安瓿回收者", + "DBFieldName":"EmpRecive" + }, + { + "Name":"空安瓿药房接收者", + "DBFieldName":"EmpMedicRecive" + } + ] + }, + "Column":[ + { + "Name":"日期", + "Width":1.77271 + }, + { + "Name":"品名", + "Width":3.41313 + }, + { + "Name":"规格", + "Width":2.35479 + }, + { + "Name":"批号", + "Width":2.24896 + }, + { + "Name":"床号", + "Width":2.43417 + }, + { + "Name":"病人姓名", + "Width":1.79917 + }, + { + "Name":"使用剂量", + "Width":1.79917 + }, + { + "Name":"剩余剂量", + "Width":1.98438 + }, + { + "Name":"处理", + "Width":2.35479 + }, + { + "Name":"医师", + "Width":1.79917 + }, + { + "Name":"执行者", + "Width":1.61396 + }, + { + "Name":"核对者", + "Width":1.5875 + }, + { + "Name":"空安瓿批号", + "Width":1.61396 + }, + { + "Name":"空安瓿回收者", + "Width":2.19604 + }, + { + "Name":"空安瓿药房接收者", + "Width":1.61396 + } + ], + "ColumnContent":{ + "Height":0.85, + "ColumnContentCell":[ + { + "Column":"日期", + "WordWrap":true, + "TextAlign":"MiddleCenter", + "ShrinkFontToFit":true, + "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":"核对者" + }, + { + "Column":"空安瓿批号", + "TextAlign":"MiddleCenter", + "DataField":"空安瓿批号" + }, + { + "Column":"空安瓿回收者", + "TextAlign":"MiddleCenter", + "DataField":"空安瓿回收者" + }, + { + "Column":"空安瓿药房接收者", + "TextAlign":"MiddleCenter", + "DataField":"空安瓿药房接收者" + } + ] + }, + "ColumnTitle":{ + "Height":1.19063, + "RepeatStyle":"OnPage", + "ColumnTitleCell":[ + { + "GroupTitle":false, + "Column":"日期", + "Font":{ + "Name":"宋体", + "Size":105000, + "Bold":true, + "Charset":134 + }, + "TextAlign":"MiddleCenter", + "Text":"日期" + }, + { + "GroupTitle":false, + "Column":"品名", + "Font":{ + "Name":"宋体", + "Size":105000, + "Bold":true, + "Charset":134 + }, + "TextAlign":"MiddleCenter", + "Text":"品名" + }, + { + "GroupTitle":false, + "Column":"规格", + "Font":{ + "Name":"宋体", + "Size":105000, + "Bold":true, + "Charset":134 + }, + "TextAlign":"MiddleCenter", + "Text":"规格" + }, + { + "GroupTitle":false, + "Column":"批号", + "Font":{ + "Name":"宋体", + "Size":105000, + "Bold":true, + "Charset":134 + }, + "TextAlign":"MiddleCenter", + "Text":"批号" + }, + { + "GroupTitle":false, + "Column":"床号", + "Font":{ + "Name":"宋体", + "Size":105000, + "Bold":true, + "Charset":134 + }, + "TextAlign":"MiddleCenter", + "Text":"床号" + }, + { + "GroupTitle":false, + "Column":"病人姓名", + "Font":{ + "Name":"宋体", + "Size":105000, + "Bold":true, + "Charset":134 + }, + "TextAlign":"MiddleCenter", + "Text":"病人\r\n姓名" + }, + { + "GroupTitle":false, + "Column":"使用剂量", + "Font":{ + "Name":"宋体", + "Size":105000, + "Bold":true, + "Charset":134 + }, + "TextAlign":"MiddleCenter", + "Text":"使用\r\n剂量" + }, + { + "GroupTitle":false, + "Column":"剩余剂量", + "Font":{ + "Name":"宋体", + "Size":105000, + "Bold":true, + "Charset":134 + }, + "TextAlign":"MiddleCenter", + "Text":"剩余\r\n剂量" + }, + { + "GroupTitle":false, + "Column":"处理", + "Font":{ + "Name":"宋体", + "Size":105000, + "Bold":true, + "Charset":134 + }, + "TextAlign":"MiddleCenter", + "Text":"剩余剂量\r\n是否双人\r\n在监控下\r\n用棉球或\r\n敷料作介质\r\n稀释后\r\n作医疗\r\n废物处理" + }, + { + "GroupTitle":false, + "Column":"医师", + "Font":{ + "Name":"宋体", + "Size":105000, + "Bold":true, + "Charset":134 + }, + "TextAlign":"MiddleCenter", + "Text":"医师" + }, + { + "GroupTitle":false, + "Column":"执行者", + "Font":{ + "Name":"宋体", + "Size":105000, + "Bold":true, + "Charset":134 + }, + "TextAlign":"MiddleCenter", + "Text":"执行者" + }, + { + "GroupTitle":false, + "Column":"核对者", + "Font":{ + "Name":"宋体", + "Size":105000, + "Bold":true, + "Charset":134 + }, + "TextAlign":"MiddleCenter", + "Text":"核对者" + }, + { + "GroupTitle":false, + "Column":"空安瓿批号", + "Font":{ + "Name":"宋体", + "Size":105000, + "Bold":true, + "Charset":134 + }, + "TextAlign":"MiddleCenter", + "Text":"空安瓿\r\n批号" + }, + { + "GroupTitle":false, + "Column":"空安瓿回收者", + "Font":{ + "Name":"宋体", + "Size":105000, + "Bold":true, + "Charset":134 + }, + "TextAlign":"MiddleCenter", + "Text":"空安瓿\r\n回收者" + }, + { + "GroupTitle":false, + "Column":"空安瓿药房接收者", + "Font":{ + "Name":"宋体", + "Size":105000, + "Bold":true, + "Charset":134 + }, + "TextAlign":"MiddleCenter", + "Text":"空安瓿\r\n药房\r\n接收者" + } + ] + } + }, + "Parameter":[ + { + "Name":"machine_id" + }, + { + "Name":"startDate", + "DataType":"DateTime" + }, + { + "Name":"endDate", + "DataType":"DateTime" + } + ], + "ReportHeader":[ + { + "Name":"ReportHeader1", + "Height":1.79917, + "Control":[ + { + "Type":"MemoBox", + "Name":"MemoBox1", + "Dock":"Fill", + "Center":"Both", + "Font":{ + "Name":"宋体", + "Size":262500, + "Bold":true, + "Charset":134 + }, + "TextAlign":"MiddleCenter", + "Text":"麻醉药品、精神药品使用登记册" + } + ], + "RepeatOnPage":true + } + ] +} \ No newline at end of file diff --git a/DM_Weight/ReportTemp/account_use_temp.grf b/DM_Weight/ReportTemp/account_use_temp.grf index a2b98c5..f6af384 100644 --- a/DM_Weight/ReportTemp/account_use_temp.grf +++ b/DM_Weight/ReportTemp/account_use_temp.grf @@ -70,7 +70,7 @@ }, { "Name":"空安瓿批号", - "DBFieldName":"EmpManuNO" + "DBFieldName":"ManuNo" }, { "Name":"空安瓿回收者", @@ -79,6 +79,14 @@ { "Name":"空安瓿药房接收者", "DBFieldName":"EmpMedicRecive" + }, + { + "Name":"手术间", + "DBFieldName":"WinNo" + }, + { + "Name":"余液处置时间", + "DBFieldName":"DisposalTime" } ] }, @@ -97,11 +105,11 @@ }, { "Name":"批号", - "Width":2.24896 + "Width":2.83104 }, { - "Name":"床号", - "Width":2.43417 + "Name":"手术间", + "Width":1.77271 }, { "Name":"病人姓名", @@ -115,6 +123,10 @@ "Name":"剩余剂量", "Width":1.98438 }, + { + "Name":"余液处置时间", + "Width":3.22792 + }, { "Name":"处理", "Width":2.35479 @@ -133,7 +145,7 @@ }, { "Name":"空安瓿批号", - "Width":1.61396 + "Width":2.8575 }, { "Name":"空安瓿回收者", @@ -170,9 +182,9 @@ "DataField":"批号" }, { - "Column":"床号", + "Column":"手术间", "TextAlign":"MiddleCenter", - "DataField":"床号" + "DataField":"手术间" }, { "Column":"病人姓名", @@ -189,6 +201,10 @@ "TextAlign":"MiddleCenter", "DataField":"剩余剂量" }, + { + "Column":"余液处置时间", + "DataField":"余液处置时间" + }, { "Column":"处理", "TextAlign":"MiddleCenter", @@ -212,7 +228,7 @@ { "Column":"空安瓿批号", "TextAlign":"MiddleCenter", - "DataField":"空安瓿批号" + "DataField":"批号" }, { "Column":"空安瓿回收者", @@ -227,7 +243,7 @@ ] }, "ColumnTitle":{ - "Height":1.19063, + "Height":2.98979, "RepeatStyle":"OnPage", "ColumnTitleCell":[ { @@ -280,7 +296,7 @@ }, { "GroupTitle":false, - "Column":"床号", + "Column":"手术间", "Font":{ "Name":"宋体", "Size":105000, @@ -288,7 +304,7 @@ "Charset":134 }, "TextAlign":"MiddleCenter", - "Text":"床号" + "Text":"手术间" }, { "GroupTitle":false, @@ -326,6 +342,18 @@ "TextAlign":"MiddleCenter", "Text":"剩余\r\n剂量" }, + { + "GroupTitle":false, + "Column":"余液处置时间", + "Font":{ + "Name":"宋体", + "Size":105000, + "Bold":true, + "Charset":134 + }, + "TextAlign":"MiddleCenter", + "Text":"余液处置\r\n时间" + }, { "GroupTitle":false, "Column":"处理", diff --git a/DM_Weight/ViewModels/AddToJiaoJieDialogViewModel.cs b/DM_Weight/ViewModels/AddToJiaoJieDialogViewModel.cs index f92db28..2f8da68 100644 --- a/DM_Weight/ViewModels/AddToJiaoJieDialogViewModel.cs +++ b/DM_Weight/ViewModels/AddToJiaoJieDialogViewModel.cs @@ -335,6 +335,7 @@ namespace DM_Weight.ViewModels if (!_isFinishClick) { _isFinishClick = true; + List record = ChannelStocks.FindAll(it => it.TakeQuantity > 0).ToList(); if (record.Count > 0) { @@ -411,7 +412,7 @@ namespace DM_Weight.ViewModels { for (int j = 0; j < csStockList.Count; j++) { - ChannelStock csStock = csStockList[j]; + ChannelStock csStock = (ChannelStock)csStockList[j].Clone(); ChannelStock jjStockManuNo = SqlSugarHelper.Db.Queryable() .Where(cs => cs.DrawerNo == jiaoStock.DrawerNo && cs.DrugId == jiaoStock.DrugId && cs.ManuNo == csStock.ManuNo && cs.MachineId == "DM5").First(); if (jjStockManuNo != null) diff --git a/DM_Weight/ViewModels/UseAccountWindowViewModel.cs b/DM_Weight/ViewModels/UseAccountWindowViewModel.cs index a3c0de7..979ccb4 100644 --- a/DM_Weight/ViewModels/UseAccountWindowViewModel.cs +++ b/DM_Weight/ViewModels/UseAccountWindowViewModel.cs @@ -1,15 +1,20 @@ -using DM_Weight.Report; +using DM_Weight.Models; +using DM_Weight.Report; +using DM_Weight.util; using Prism.Commands; using Prism.Mvvm; +using Prism.Regions; using System; using System.Collections.Generic; +using System.Configuration; +using System.Drawing.Printing; using System.Linq; using System.Text; using System.Threading.Tasks; namespace DM_Weight.ViewModels { - public class UseAccountWindowViewModel:BindableBase + public class UseAccountWindowViewModel:BindableBase,INavigationAware { private DateTime? _startDate = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day); @@ -51,12 +56,46 @@ namespace DM_Weight.ViewModels } private string _name; public string Name { get => _name; set { SetProperty(ref _name, value); } } + + /// + /// 麻醉医师姓名 + /// + private List _UserInfos; + public List UserInfos + { + get => _UserInfos; + set { SetProperty(ref _UserInfos, value); } + } + + private UserList _User; + public UserList User + { + get => _User; + set { SetProperty(ref _User, value); } + } + private static readonly DateTime Jan1st1970 = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc); public long CurrentTimeMillis() { return (long)(DateTime.UtcNow - Jan1st1970).TotalMilliseconds; } + public void OnNavigatedTo(NavigationContext navigationContext) + { + //绑定用户信息 + UserInfos = SqlSugarHelper.Db.Queryable() + .Where(ul => ul.MachineId.Equals(ConfigurationManager.AppSettings["machineId"] ?? "DM5")).ToList(); + } + + public bool IsNavigationTarget(NavigationContext navigationContext) + { + return true; + } + + public void OnNavigatedFrom(NavigationContext navigationContext) + { + } + /// /// 导出账册 /// @@ -64,7 +103,7 @@ namespace DM_Weight.ViewModels { get => new DelegateCommand(() => { - GridReportUtil.UserAccount(StartDate, EndDate, Name ?? ""); + GridReportUtil.UserAccount(StartDate, EndDate, User.Nickname ?? ""); }); } diff --git a/DM_Weight/Views/UseAccountWindow.xaml b/DM_Weight/Views/UseAccountWindow.xaml index 8da871d..bd8d711 100644 --- a/DM_Weight/Views/UseAccountWindow.xaml +++ b/DM_Weight/Views/UseAccountWindow.xaml @@ -30,8 +30,8 @@ - - + + - + + +