修改余液处理时间字段取值

This commit is contained in:
maqiao 2025-05-13 16:56:35 +08:00
parent 4e50d926f3
commit b95d42d39d
7 changed files with 48 additions and 15 deletions

View File

@ -77,6 +77,10 @@ namespace DM_Weight.Converter
break;
}
int SelectedDrawerNo = int.Parse(value[1].ToString());
if (value.Count() >= 3 && value[2] != null)
{
SelectedDrawerNo -= 1;
}
return ButtonDrawerNo == SelectedDrawerNo;
}

View File

@ -2,6 +2,7 @@
using DM_Weight.msg;
using DM_Weight.Report;
using DM_Weight.util;
using log4net;
using Prism.Commands;
using Prism.Events;
using Prism.Mvvm;
@ -16,6 +17,7 @@ namespace DM_Weight.ViewModels
{
public class AccountWindowViewModel : BindableBase, INavigationAware, IRegionMemberLifetime
{
private readonly ILog logger = LogManager.GetLogger(typeof(AccountWindowViewModel));
public static AccountWindowViewModel vm;
private DateTime? _startDate = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day);
@ -68,18 +70,33 @@ namespace DM_Weight.ViewModels
{
get => new DelegateCommand(() =>
{
if(DrugInfo==null||string.IsNullOrEmpty(DrugInfo.DrugId))
try
{
if (DrugInfo == null || string.IsNullOrEmpty(DrugInfo.DrugId))
{
AlertMsg alertMsg = new AlertMsg
{
Message = $"请选择药品!",
Type = MsgType.ERROR,
};
_eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg);
return;
}
GridReportUtil.PrintReportAccountBook(StartDate, EndDate, DrugInfo.DrugId);
}
catch (Exception ex)
{
AlertMsg alertMsg = new AlertMsg
{
Message = $"请选择药品!",
Message = "导出报表异常",
Type = MsgType.ERROR,
};
_eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg);
logger.Info($"导出报表异常{ex.Message}");
return;
}
GridReportUtil.PrintReportAccountBook(StartDate, EndDate, DrugInfo.DrugId);
});
}

View File

@ -446,6 +446,9 @@ namespace DM_Weight.ViewModels
_ChannelList.BaseQuantity = baseQty;
_ChannelList.channelStocks[0].BaseQuantity = baseQty;
int iUpdate = SqlSugarHelper.Db.Updateable<ChannelStock>(_ChannelList.channelStocks[0]).ExecuteCommand();
_ChannelList.channelStocks.ForEach(cs=>cs.BaseQuantity= baseQty);
int iBaseUpdate= SqlSugarHelper.Db.Updateable(_ChannelList.channelStocks).UpdateColumns(cs => cs.BaseQuantity).ExecuteCommand();
//更新ChannelList表中的BaseQuantity
int iUpdateChannelList = SqlSugarHelper.Db.Updateable<ChannelList>()
.SetColumns(it => new ChannelList() { BaseQuantity = baseQty })

View File

@ -82,7 +82,14 @@ namespace DM_Weight.ViewModels
get => _drawerNo;
set => SetProperty(ref _drawerNo, value);
}
//所选药箱号
private int _currentDrawerNo = -1;
public int CurrentDrawerNo
{
get => _currentDrawerNo;
set => SetProperty(ref _currentDrawerNo, value);
}
//开名下药箱按钮的显示状态
//private bool _selfEnable = false;
//public bool SelfEnable { get => _selfEnable; set => SetProperty(ref _selfEnable, value); }
@ -769,6 +776,7 @@ namespace DM_Weight.ViewModels
// .WhereIF(this.DrawerType == 0, cl => cl.BelongUser == HomeWindowViewModel.Operator.UserBarcode).Select(cl => cl.DrawerState).First();
DrawerNo = Convert.ToInt32(strDrawerNo);
CurrentDrawerNo += DrawerNo + 1;
MachineRecord machineRecord = new MachineRecord();
machineRecord.MachineId = "DM5";
machineRecord.DrawerNo = DrawerNo;

View File

@ -72,11 +72,11 @@ namespace DM_Weight.ViewModels
DrawerNo = Convert.ToInt32(strDrawerNo);
MachineRecord machineRecord = new MachineRecord();
machineRecord.MachineId = "DM5";
machineRecord.DrawerNo = DrawerNo;
machineRecord.DrawerNo = DrawerNo+1;
machineRecord.Operator = HomeWindowViewModel.Operator?.Id;
machineRecord.OperationTime = DateTime.Now;
machineRecord.Type = 55;
machineRecord.InvoiceId = $"打开{DrawerNo}号手术间";
machineRecord.InvoiceId = $"打开{DrawerNo+1}号手术间";
if (DrawerNo > 0)
@ -90,7 +90,7 @@ namespace DM_Weight.ViewModels
SqlSugarHelper.Db.Insertable(machineRecord).ExecuteCommand();
try
{
_socketHelper.SendMessage(new MyBaseMessage() { lockNo = (short)(DrawerNo - 1) });
_socketHelper.SendMessage(new MyBaseMessage() { lockNo = (short)(DrawerNo) });
_socketHelper.dateTime = DateTime.Now;
}
catch (Exception ex)
@ -106,7 +106,7 @@ namespace DM_Weight.ViewModels
}
_socketHelper.OpenStatus = true;
//记录药箱打开时间
ChannelList channelList = SqlSugarHelper.Db.Queryable<ChannelList>().Where(cl => cl.MachineId == "DM5" && cl.DrawerNo == DrawerNo).First();
ChannelList channelList = SqlSugarHelper.Db.Queryable<ChannelList>().Where(cl => cl.MachineId == "DM5" && cl.DrawerNo == (DrawerNo+1)).First();
if (channelList != null && (channelList.EffDate is null || Convert.ToDateTime(channelList.EffDate).ToString("yyyy-MM-dd") != DateTime.Now.ToString("yyyy-MM-dd")))
{
@ -166,7 +166,7 @@ namespace DM_Weight.ViewModels
{
List<ChannelStock> queryData = SqlSugarHelper.Db.Queryable<ChannelStock>()
.Includes(cs => cs.DrugInfo)
.Where(cs => cs.DrawerNo == DrawerNo + 1)
.Where(cs => cs.DrawerNo == (DrawerNo + 1))
.Where(cs => cs.DrugId != null)
.Where(cs => cs.MachineId.Equals(ConfigurationManager.AppSettings["machineId"] ?? "DM5"))
.OrderBy(cs => cs.DrugId)

View File

@ -195,7 +195,7 @@
DisplayMemberBinding="{Binding _OrderDetail.surgicalResidual.ResidualDoseInfo}"
Header="剩余量"/>
<GridViewColumn Width="160"
DisplayMemberBinding="{Binding _OrderDetail.surgicalResidual.CreateTime}"
DisplayMemberBinding="{Binding _OrderDetail.surgicalResidual.DisposalTime}"
Header="余液处置时间"/>
<!--<GridViewColumn Width="180" Header="药品名称">

View File

@ -40,7 +40,7 @@
<Style TargetType="{x:Type Button}" BasedOn="{StaticResource MaterialDesignPaperLightButton}">
<Setter Property="Foreground" Value="#00a0ea" />
<Setter Property="BorderBrush" Value="#00a0ea" />
<!--<Style.Triggers>
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="#d1e7f5" />
<Setter Property="BorderBrush" Value="#d1e7f5" />
@ -50,12 +50,13 @@
<MultiBinding Converter="{StaticResource DrawerSelectConverter}">
<Binding RelativeSource="{ RelativeSource Mode=Self }" Path="Content" />
<Binding Path="DrawerNo" />
<Binding Path="CurrentDrawerNo"/>
</MultiBinding>
</DataTrigger.Binding>
<Setter Property="Background" Value="#d1e7f5" />
<Setter Property="BorderBrush" Value="#d1e7f5" />
</DataTrigger>
</Style.Triggers>-->
</Style.Triggers>
</Style>
</Grid.Resources>
<Grid.RowDefinitions>
@ -200,7 +201,7 @@
DisplayMemberBinding="{Binding _OrderDetail.surgicalResidual.ResidualDoseInfo}"
Header="剩余量"/>
<GridViewColumn Width="160"
DisplayMemberBinding="{Binding _OrderDetail.surgicalResidual.CreateTime}"
DisplayMemberBinding="{Binding _OrderDetail.surgicalResidual.DisposalTime}"
Header="余液处置时间"/>
<!--<GridViewColumn Width="180" Header="药品名称">