交接柜加药添加状态标识:已取药未入库、未取药

This commit is contained in:
maqiao 2024-11-18 12:59:31 +08:00
parent 770e82829c
commit 684c522075
6 changed files with 86 additions and 21 deletions

View File

@ -12,7 +12,7 @@
<appSettings>
<!-- 设备id -->
<add key="machineId" value="DM3" />
<add key="machineId" value="DM1" />
<!--交接柜设备id-->
<add key="jj_machineId" value="DM5" />
<!--请领药库-->
@ -40,7 +40,7 @@
<add key="autoExit" value="0"/>
<!-- 无操作退出录像时间单位秒为0时不退出录像 -->
<add key="stopRecord" value="180"/>
<add key="stopRecord" value="0"/>
<add key="gridConnectionString" value="MYSQL; Database=xiangxiang; Password=root; Port=3306; Server=127.0.0.1; User=root;"/>
<!-- 查询处方是orderNo还是orderGroupNo -->

View File

@ -0,0 +1,48 @@
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 StockStatusConverter : IValueConverter
{
//是否给交接柜补药已补药的则不可勾选未补药的可勾选以进行补药0未补1已补
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
int status = int.Parse(value.ToString());
if (parameter.ToString() == "EnableState")
{
if (status == 0)
{
return true;
}
else
{
return false;
}
}
if(parameter.ToString()== "TextState")
{
if(status == 0)
{
return "未取药";
}
else
{
return "已取药待入库";
}
}
return "";
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
}

View File

@ -84,7 +84,7 @@ namespace DM_Weight.Models
[SugarColumn(ColumnName = "board_type")]
public int BoardType { get; set; }
/// <summary>
///
/// 用于标识是否给交接柜补药0未补1已补
/// 默认值: 1
///</summary>
[SugarColumn(ColumnName = "state")]

View File

@ -352,22 +352,30 @@ namespace DM_Weight.ViewModels
}).UpdateColumns(it => new { it.Quantity, it.ManuNo, it.EffDate }).ExecuteCommand();
//更新 交接柜 库存信息
List<ChannelStock> jiaojie = Jiaojie_ChannelStocks.Where(cs => cs.DrugId == it.DrugId).ToList();
if (jiaojie != null && jiaojie.Count > 0)
{
for (int j = 0; j < jiaojie.Count; j++)
{
// 更新数据 交接柜 库存信息
ChannelStock jiaojie_it = jiaojie[j];
SqlSugarHelper.Db.Updateable(new ChannelStock()
{
Quantity = jiaojie_it.BaseQuantity,
//ManuNo = it.ManuNo,
//EffDate = it.EffDate,
Id = jiaojie_it.Id,
}).UpdateColumns(jiaojie_it => new { jiaojie_it.Quantity }).ExecuteCommand();
}
}
//List<ChannelStock> jiaojie = Jiaojie_ChannelStocks.Where(cs => cs.DrugId == it.DrugId).ToList();
//if (jiaojie != null && jiaojie.Count > 0)
//{
// for (int j = 0; j < jiaojie.Count; j++)
// {
// // 更新数据 交接柜 库存信息
// ChannelStock jiaojie_it = jiaojie[j];
// SqlSugarHelper.Db.Updateable(new ChannelStock()
// {
// Quantity = jiaojie_it.BaseQuantity,
// //ManuNo = it.ManuNo,
// //EffDate = it.EffDate,
// Id = jiaojie_it.Id,
// }).UpdateColumns(jiaojie_it => new { jiaojie_it.Quantity }).ExecuteCommand();
// //更新交接柜状态为 已取药未入库
// SqlSugarHelper.Db.Updateable(new ChannelList()
// {
// State=1,
// Id=jiaojie_it.ChannelLst.Id
// }).UpdateColumns(it => it.State).ExecuteCommand();
// }
//}
// 保存数据 出库记录

View File

@ -464,7 +464,14 @@ namespace DM_Weight.ViewModels
{
if (channelStock != null)
{
channelStock.ChannelLst.IsSelected = !channelStock.ChannelLst.IsSelected;
if (channelStock.ChannelLst.State == 0)
{
channelStock.ChannelLst.IsSelected = !channelStock.ChannelLst.IsSelected;
}
else
{
return;
}
if (channelStock != null && ChannelStocks != null)
{
ChannelStocks = ChannelStocks.Select(x =>

View File

@ -19,6 +19,7 @@
<convert:GroupSumConverter x:Key="GroupSumConverter" />
<convert:TotalCountConverter x:Key="TotalCountConverter" />
<convert:StatusConverter x:Key="StatusConverter" />
<convert:StockStatusConverter x:Key="StockStatusConverter" />
</Grid.Resources>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
@ -146,7 +147,7 @@
materialDesign:ExpanderAssist.HeaderBackground="PaleTurquoise" Expanded="Expander_Expanded" Collapsed="Expander_Collapsed">
<Expander.Header >
<StackPanel Orientation="Horizontal">
<CheckBox Margin="0 0 3 0" IsChecked="{Binding Path=Name.IsSelected}" FontSize="24" />
<CheckBox Margin="0 0 3 0" IsChecked="{Binding Path=Name.IsSelected}" IsEnabled="{Binding Name.State,Converter={StaticResource StockStatusConverter},ConverterParameter=EnableState}" FontSize="24" />
<TextBlock Text="{Binding Path=Name.DrawerNo,StringFormat={}{0}号药箱}" FontWeight="Bold" />
</StackPanel>
</Expander.Header>
@ -166,6 +167,7 @@
<DataGridTextColumn IsReadOnly="True" Header="厂家" Binding="{Binding DrugInfo.Manufactory}"/>
<DataGridTextColumn IsReadOnly="True" Header="药品基数" Binding="{Binding BaseQuantity}"/>
<DataGridTextColumn IsReadOnly="True" Header="需补药数量" Binding="{Binding AddQuantity}"/>
<DataGridTextColumn IsReadOnly="True" Header="状态" Binding="{Binding ChannelLst.State,Converter={StaticResource StockStatusConverter},ConverterParameter=TextState}"/>
</DataGrid.Columns>
</DataGrid>
</Grid>