208 lines
		
	
	
		
			11 KiB
		
	
	
	
		
			XML
		
	
	
	
			
		
		
	
	
			208 lines
		
	
	
		
			11 KiB
		
	
	
	
		
			XML
		
	
	
	
<UserControl xmlns:pagination="clr-namespace:DM_Weight.Components.pagination"  x:Class="DM_Weight.Views.Dialog.BindingChannelDialog"
 | 
						|
             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:prism="http://prismlibrary.com/"
 | 
						|
             prism:ViewModelLocator.AutoWireViewModel="True"
 | 
						|
             xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
 | 
						|
             xmlns:convert="clr-namespace:DM_Weight.Converter"
 | 
						|
             xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
 | 
						|
             MinWidth="880"
 | 
						|
             MinHeight="615"
 | 
						|
             Width="Auto"
 | 
						|
             Height="Auto"
 | 
						|
             mc:Ignorable="d" >
 | 
						|
 | 
						|
    <UserControl.Resources>
 | 
						|
        <convert:BoardTypeConverter x:Key="BoardTypeConverter" />
 | 
						|
    </UserControl.Resources>
 | 
						|
 | 
						|
        <Grid>
 | 
						|
            <Grid.RowDefinitions>
 | 
						|
                <RowDefinition Height="Auto" />
 | 
						|
                <RowDefinition Height="Auto" />
 | 
						|
                <RowDefinition Height="Auto" />
 | 
						|
                <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="{Binding Title}" />
 | 
						|
                <Button
 | 
						|
                        Style="{StaticResource MaterialDesignIconForegroundButton}"
 | 
						|
                        Foreground="{DynamicResource PrimaryHueDarkForegroundBrush}"
 | 
						|
                        HorizontalAlignment="Right"
 | 
						|
                        Command="{Binding BtnCloseCommand}"
 | 
						|
                        ToolTip="关闭" Cursor="Hand"
 | 
						|
                    >
 | 
						|
                    <materialDesign:PackIcon Kind="Close" Width="34" Height="34" />
 | 
						|
                </Button>
 | 
						|
            </Grid>
 | 
						|
            <Grid Grid.Row="1" Margin="0 4 0 4">
 | 
						|
                <Grid.ColumnDefinitions>
 | 
						|
                    <ColumnDefinition />
 | 
						|
                    <ColumnDefinition />
 | 
						|
                    <ColumnDefinition />
 | 
						|
                </Grid.ColumnDefinitions>
 | 
						|
            <ComboBox
 | 
						|
                    Margin="6 0 6 0"
 | 
						|
                    Grid.Column="0"
 | 
						|
                    materialDesign:HintAssist.Hint="药品名称/拼音码"
 | 
						|
                    IsEditable="True"
 | 
						|
                    ItemsSource="{Binding DrugInfos}"
 | 
						|
                    SelectedItem="{Binding DrugInfo}"
 | 
						|
                    DisplayMemberPath="drug_name_spec" IsEnabled="True" IsTextSearchEnabled="False" KeyUp="ComboBox_KeyUp"
 | 
						|
                />
 | 
						|
            <ComboBox
 | 
						|
                    Grid.Column="1"
 | 
						|
                    Style="{StaticResource MaterialDesignOutlinedComboBox}"
 | 
						|
                    materialDesign:HintAssist.Hint="批次"
 | 
						|
                    ItemsSource="{Binding DrugManuNos}"
 | 
						|
                    SelectedItem="{Binding DrugManuNo}"
 | 
						|
                    DisplayMemberPath="ManuNo"/>
 | 
						|
                <StackPanel HorizontalAlignment="Right"  Grid.Column="2" Orientation="Horizontal">
 | 
						|
                    <Button
 | 
						|
                        Style="{StaticResource MaterialDesignOutlinedLightButton}"
 | 
						|
                        ToolTip="绑定库位"
 | 
						|
                        Content="绑定"
 | 
						|
                        Command="{Binding BindingDrug}"/>
 | 
						|
                    <Button
 | 
						|
                        Margin="6 0 6 0"
 | 
						|
                        Style="{StaticResource MaterialDesignOutlinedLightButton}"
 | 
						|
                        ToolTip="解除绑定"
 | 
						|
                        Content="解绑"
 | 
						|
                        Command="{Binding RemoveBinding}" />
 | 
						|
                    <Button
 | 
						|
                        Margin="0 0 6 0"
 | 
						|
                        Style="{StaticResource MaterialDesignOutlinedLightButton}"
 | 
						|
                        ToolTip="刷新"
 | 
						|
                        Command="{Binding Query}"
 | 
						|
                        Content="{materialDesign:PackIcon Refresh}"/>
 | 
						|
                </StackPanel>
 | 
						|
            </Grid>
 | 
						|
        <ItemsControl
 | 
						|
                Grid.Row="2"
 | 
						|
                ItemsSource="{Binding Channels}"
 | 
						|
                Grid.IsSharedSizeScope="True"
 | 
						|
                Margin="12 0 12 0">
 | 
						|
            <ItemsControl.ItemsPanel>
 | 
						|
                <ItemsPanelTemplate>
 | 
						|
                    <UniformGrid />
 | 
						|
                </ItemsPanelTemplate>
 | 
						|
            </ItemsControl.ItemsPanel>
 | 
						|
            <ItemsControl.ItemTemplate>
 | 
						|
                <DataTemplate>
 | 
						|
                    <materialDesign:Card
 | 
						|
                                Background="{StaticResource MaterialDesignLightBackground}"
 | 
						|
                                Margin="4"
 | 
						|
                                Padding="0">
 | 
						|
                        <Grid>
 | 
						|
                            <Grid.RowDefinitions>
 | 
						|
                                <RowDefinition />
 | 
						|
                                <RowDefinition />
 | 
						|
                            </Grid.RowDefinitions>
 | 
						|
                            <StackPanel Grid.Row="0" Orientation="Horizontal" Background="#31ccec" >
 | 
						|
                                <CheckBox
 | 
						|
                                        materialDesign:CheckBoxAssist.CheckBoxSize="30"
 | 
						|
                                        VerticalAlignment="Center"
 | 
						|
                                        IsChecked="{Binding IsSelected}" />
 | 
						|
                                <TextBlock
 | 
						|
                                        Style="{StaticResource MaterialDesignHeadline5TextBlock}"
 | 
						|
                                        Foreground="{DynamicResource PrimaryHueDarkForegroundBrush}"
 | 
						|
                                        Padding="8"
 | 
						|
                                        Text="{Binding Location}" />
 | 
						|
                                <TextBlock
 | 
						|
                                        Style="{StaticResource MaterialDesignHeadline5TextBlock}"
 | 
						|
                                        Foreground="{DynamicResource PrimaryHueDarkForegroundBrush}"
 | 
						|
                                        Padding="8"
 | 
						|
                                        HorizontalAlignment="Right">
 | 
						|
                                    <TextBlock.Text>
 | 
						|
                                        <MultiBinding Converter="{StaticResource BoardTypeConverter}">
 | 
						|
                                            <Binding Path="BoardType" />
 | 
						|
                                            <Binding Path="DrawerType" />
 | 
						|
                                        </MultiBinding>
 | 
						|
                                    </TextBlock.Text>
 | 
						|
                                </TextBlock>
 | 
						|
                            </StackPanel>
 | 
						|
                            <Grid Grid.Row="1" x:Name="Border">
 | 
						|
                                <Grid.RowDefinitions>
 | 
						|
                                    <RowDefinition />
 | 
						|
                                    <RowDefinition />
 | 
						|
                                    <RowDefinition />
 | 
						|
                                </Grid.RowDefinitions>
 | 
						|
                                <Grid.ColumnDefinitions>
 | 
						|
                                    <ColumnDefinition Width="Auto" />
 | 
						|
                                    <ColumnDefinition />
 | 
						|
                                </Grid.ColumnDefinitions>
 | 
						|
                                <Grid.Resources>
 | 
						|
                                    <Style TargetType="{x:Type TextBlock}" BasedOn="{StaticResource MaterialDesignSubtitle1TextBlock}">
 | 
						|
                                        <Setter Property="Padding" Value="6" />
 | 
						|
                                    </Style>
 | 
						|
                                </Grid.Resources>
 | 
						|
                                <TextBlock
 | 
						|
                                        HorizontalAlignment="Left"
 | 
						|
                                        Grid.Row="0"
 | 
						|
                                        Grid.Column="0"
 | 
						|
                                        Text="药品:" />
 | 
						|
                                <StackPanel
 | 
						|
                                        Grid.Row="0"
 | 
						|
                                        Grid.Column="1"
 | 
						|
                                        HorizontalAlignment="Right"
 | 
						|
                                        Orientation="Horizontal">
 | 
						|
                                    <TextBlock Text="{Binding DrugInfo.DrugName}" />
 | 
						|
                                    <TextBlock
 | 
						|
                                            Visibility="{Binding Quantity, Converter={StaticResource NotZeroToVisibilityConverter}}"
 | 
						|
                                            Text="{Binding Quantity, StringFormat=({0})}" />
 | 
						|
                                </StackPanel>
 | 
						|
 | 
						|
                                <TextBlock
 | 
						|
                                        HorizontalAlignment="Left"
 | 
						|
                                        Grid.Row="1"
 | 
						|
                                        Grid.Column="0"
 | 
						|
                                        Text="批次:" />
 | 
						|
                                <TextBlock
 | 
						|
                                        HorizontalAlignment="Right"
 | 
						|
                                        Grid.Row="1"
 | 
						|
                                        Grid.Column="1"
 | 
						|
                                        Text="{Binding ManuNo}" />
 | 
						|
                                <TextBlock
 | 
						|
                                        HorizontalAlignment="Left"
 | 
						|
                                        Grid.Row="2"
 | 
						|
                                        Grid.Column="0"
 | 
						|
                                        Text="效期:" />
 | 
						|
                                <TextBlock
 | 
						|
                                        HorizontalAlignment="Right"
 | 
						|
                                        Grid.Row="2"
 | 
						|
                                        Grid.Column="1"
 | 
						|
                                        Text="{Binding EffDate}" />
 | 
						|
                            </Grid>
 | 
						|
                        </Grid>
 | 
						|
                    </materialDesign:Card>
 | 
						|
                    <DataTemplate.Triggers>
 | 
						|
                        <DataTrigger Binding="{Binding IsSelected}" Value="True">
 | 
						|
                            <Setter Property="RenderTransformOrigin" Value="0.5,0.5" />
 | 
						|
                            <Setter TargetName="Border" Property="Background" Value="#90caf9" />
 | 
						|
                            <Setter Property="RenderTransform">
 | 
						|
                                <Setter.Value>
 | 
						|
                                    <ScaleTransform  ScaleX="0.95" ScaleY="0.95" />
 | 
						|
                                </Setter.Value>
 | 
						|
                            </Setter>
 | 
						|
                        </DataTrigger>
 | 
						|
                    </DataTemplate.Triggers>
 | 
						|
                </DataTemplate>
 | 
						|
            </ItemsControl.ItemTemplate>
 | 
						|
        </ItemsControl>
 | 
						|
 | 
						|
        <pagination:Pagination Grid.Row="3"
 | 
						|
                                   CurrentPage="{Binding PageNum}"
 | 
						|
                                   PageSize="{Binding PageSize}"
 | 
						|
                                   TotalPages="{Binding TotalCount}"
 | 
						|
                                   InfoTextIsEnabel="True"
 | 
						|
                                />
 | 
						|
        <materialDesign:Snackbar
 | 
						|
                Background="{Binding SnackbarBackground}"
 | 
						|
                MessageQueue="{Binding SnackbarMessageQueue}"/>
 | 
						|
        </Grid>
 | 
						|
</UserControl>
 |