添加抽屉加药与抽屉取药时开药盒字段列的显示与隐藏,抽屉类型不是药盒的则开药盒操作字段列不显示
This commit is contained in:
parent
3fd569bf6e
commit
2baf8ffc3a
|
@ -13,8 +13,8 @@ namespace DM_Weight.Converter
|
|||
{
|
||||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
int status = int.Parse(value.ToString());
|
||||
if(status == 3||status==35)
|
||||
bool status = bool.Parse(value.ToString());
|
||||
if(status)
|
||||
{
|
||||
return Visibility.Visible;
|
||||
}
|
||||
|
|
|
@ -33,6 +33,13 @@ namespace DM_Weight.ViewModels
|
|||
set => SetProperty(ref _channelStocks, value);
|
||||
}
|
||||
|
||||
private bool _openBoxVisibility = false;
|
||||
public bool OpenBoxVisibility
|
||||
{
|
||||
get => _openBoxVisibility;
|
||||
set=>SetProperty(ref _openBoxVisibility, value);
|
||||
}
|
||||
|
||||
private static readonly DateTime Jan1st1970 = new DateTime
|
||||
(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc);
|
||||
|
||||
|
|
|
@ -39,7 +39,12 @@ namespace DM_Weight.ViewModels
|
|||
private static readonly DateTime Jan1st1970 = new DateTime
|
||||
(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc);
|
||||
|
||||
|
||||
private bool _openBoxVisibility=false;
|
||||
public bool OpenBoxVisibility
|
||||
{
|
||||
get => _openBoxVisibility;
|
||||
set => SetProperty(ref _openBoxVisibility, value);
|
||||
}
|
||||
|
||||
private PortUtil _portUtil;
|
||||
IEventAggregator _eventAggregator;
|
||||
|
@ -445,6 +450,8 @@ namespace DM_Weight.ViewModels
|
|||
.Where(cs => cs.Quantity > 0)
|
||||
.OrderBy(cs => cs.ColNo)
|
||||
.ToList();
|
||||
|
||||
OpenBoxVisibility = queryData[0].BoardType == 3 ? true : queryData[0].BoardType == 35 ? true : false ;
|
||||
ChannelStocks = queryData;
|
||||
}
|
||||
|
||||
|
|
|
@ -12,8 +12,10 @@
|
|||
<UserControl.Resources>
|
||||
<convert:DrawerSelectConverter x:Key="DrawerSelectConverter" />
|
||||
<convert:StatusConverter x:Key="StatusConverter" />
|
||||
<convert:OpenBoxConverter x:Key="OpenBoxConverter" />
|
||||
<convert:InputQuantityConverter x:Key="InputQuantityConverter" />
|
||||
<convert:QuantityCountConverter x:Key="QuantityCountConverter"/>
|
||||
<convert:QuantityCountConverter x:Key="QuantityCountConverter"/>
|
||||
<FrameworkElement x:Key="ProxyElement" DataContext="{Binding}"/>
|
||||
</UserControl.Resources>
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
|
@ -21,7 +23,7 @@
|
|||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition />
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<ContentControl Content="{StaticResource ProxyElement}" Visibility="Collapsed"/>
|
||||
<Grid Margin="0" Grid.Column="0" Width="280" Height="570" Visibility="{Binding Is8Drawer, Converter={StaticResource BooleanToVisibilityConverter}}">
|
||||
<Grid.Background>
|
||||
<ImageBrush ImageSource="/Images/box.png" />
|
||||
|
@ -295,8 +297,8 @@
|
|||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
<!--Visibility="{Binding BoxShow, Converter={StaticResource StatusConverter}, ConverterParameter=OpenBox}"-->
|
||||
<DataGridTemplateColumn Width="100"
|
||||
Header="操作">
|
||||
<DataGridTemplateColumn Width="100"
|
||||
Header="操作" Visibility="{Binding DataContext.OpenBoxVisibility,Source={StaticResource ProxyElement},Converter={StaticResource OpenBoxConverter}}">
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<Button Content="开药盒" Command="{Binding DataContext.OpenBoxCommand, RelativeSource={RelativeSource AncestorType=DataGrid}}" CommandParameter="{Binding}"/>
|
||||
|
|
|
@ -15,12 +15,15 @@
|
|||
<convert:StatusConverter x:Key="StatusConverter" />
|
||||
<convert:OpenBoxConverter x:Key="OpenBoxConverter" />
|
||||
<convert:InputQuantityConverter x:Key="InputQuantityConverter" />
|
||||
<FrameworkElement x:Key="ProxyElement" DataContext="{Binding}"/>
|
||||
</UserControl.Resources>
|
||||
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition />
|
||||
</Grid.ColumnDefinitions>
|
||||
<ContentControl Content="{StaticResource ProxyElement}" Visibility="Collapsed"/>
|
||||
<Grid Margin="0" Grid.Column="0" Width="280" Height="570" Visibility="{Binding Is8Drawer, Converter={StaticResource BooleanToVisibilityConverter}}">
|
||||
<Grid.Background>
|
||||
<ImageBrush ImageSource="/Images/box.png" />
|
||||
|
@ -200,7 +203,7 @@
|
|||
<Setter Property="HorizontalAlignment" Value="Left" />
|
||||
</Trigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</Style>
|
||||
</DataGrid.Resources>
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn Width="100"
|
||||
|
@ -261,7 +264,7 @@
|
|||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
<DataGridTemplateColumn Width="100"
|
||||
Visibility="{Binding DrawerType,Converter={StaticResource OpenBoxConverter}}"
|
||||
Visibility="{Binding DataContext.OpenBoxVisibility,Source={StaticResource ProxyElement}, Converter={StaticResource OpenBoxConverter}}"
|
||||
Header="操作">
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
|
|
Loading…
Reference in New Issue