236 lines
		
	
	
		
			12 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
		
		
			
		
	
	
			236 lines
		
	
	
		
			12 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
| 
								 | 
							
								<UserControl x:Class="DM_Weight.Views.Dialog.ExchangeDialog"
							 | 
						||
| 
								 | 
							
								             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/"
							 | 
						||
| 
								 | 
							
								             xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
							 | 
						||
| 
								 | 
							
								             prism:ViewModelLocator.AutoWireViewModel="True"
							 | 
						||
| 
								 | 
							
								             xmlns:convert="clr-namespace:DM_Weight.Converter"
							 | 
						||
| 
								 | 
							
								             xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
							 | 
						||
| 
								 | 
							
								             MinWidth="880"
							 | 
						||
| 
								 | 
							
								             Width="Auto"
							 | 
						||
| 
								 | 
							
								             Height="Auto"
							 | 
						||
| 
								 | 
							
								             mc:Ignorable="d" >
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								    <UserControl.Resources>
							 | 
						||
| 
								 | 
							
								        <convert:StatusConverter x:Key="StatusConverter" />
							 | 
						||
| 
								 | 
							
								        <convert:InputQuantityConverter x:Key="InputQuantityConverter" />
							 | 
						||
| 
								 | 
							
								        <Style x:Key="st" TargetType="GridViewColumnHeader">
							 | 
						||
| 
								 | 
							
								            <Style.Setters>
							 | 
						||
| 
								 | 
							
								                <Setter Property="Height">
							 | 
						||
| 
								 | 
							
								                    <Setter.Value>55</Setter.Value>
							 | 
						||
| 
								 | 
							
								                </Setter>
							 | 
						||
| 
								 | 
							
								                <Setter Property="Background">
							 | 
						||
| 
								 | 
							
								                    <Setter.Value>#31ccec</Setter.Value>
							 | 
						||
| 
								 | 
							
								                </Setter>
							 | 
						||
| 
								 | 
							
								                <Setter Property="Foreground">
							 | 
						||
| 
								 | 
							
								                    <Setter.Value>white</Setter.Value>
							 | 
						||
| 
								 | 
							
								                </Setter>
							 | 
						||
| 
								 | 
							
								            </Style.Setters>
							 | 
						||
| 
								 | 
							
								        </Style>
							 | 
						||
| 
								 | 
							
								    </UserControl.Resources>
							 | 
						||
| 
								 | 
							
								    <materialDesign:Card Padding="0">
							 | 
						||
| 
								 | 
							
								        <Grid>
							 | 
						||
| 
								 | 
							
								            <Grid.RowDefinitions>
							 | 
						||
| 
								 | 
							
								                <RowDefinition Height="Auto" />
							 | 
						||
| 
								 | 
							
								                <RowDefinition Height="50" />
							 | 
						||
| 
								 | 
							
								                <RowDefinition Height="200" />
							 | 
						||
| 
								 | 
							
								                <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}"
							 | 
						||
| 
								 | 
							
								                        IsEnabled="{Binding Status, Converter={StaticResource StatusConverter}, ConverterParameter=CloseBtn}"
							 | 
						||
| 
								 | 
							
								                        ToolTip="关闭"
							 | 
						||
| 
								 | 
							
								                    >
							 | 
						||
| 
								 | 
							
								                    <materialDesign:PackIcon Kind="Close" Width="34" Height="34" />
							 | 
						||
| 
								 | 
							
								                </Button>
							 | 
						||
| 
								 | 
							
								            </Grid>
							 | 
						||
| 
								 | 
							
								            <Grid Grid.Row="1">
							 | 
						||
| 
								 | 
							
								                <Grid.ColumnDefinitions>
							 | 
						||
| 
								 | 
							
								                    <ColumnDefinition Width="2*" />
							 | 
						||
| 
								 | 
							
								                    <ColumnDefinition Width="3*" />
							 | 
						||
| 
								 | 
							
								                    <ColumnDefinition Width="2*" />
							 | 
						||
| 
								 | 
							
								                    <ColumnDefinition Width="*" />
							 | 
						||
| 
								 | 
							
								                    <ColumnDefinition Width="*" />
							 | 
						||
| 
								 | 
							
								                    <ColumnDefinition Width="*" />
							 | 
						||
| 
								 | 
							
								                    <ColumnDefinition Width="2*" />
							 | 
						||
| 
								 | 
							
								                    <ColumnDefinition Width="2*" />
							 | 
						||
| 
								 | 
							
								                    <ColumnDefinition Width="3*" />
							 | 
						||
| 
								 | 
							
								                    <ColumnDefinition Width="*" />
							 | 
						||
| 
								 | 
							
								                </Grid.ColumnDefinitions>
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								                <TextBlock
							 | 
						||
| 
								 | 
							
								                      Grid.Column="0"
							 | 
						||
| 
								 | 
							
								                      Margin="16 0 16 8"
							 | 
						||
| 
								 | 
							
								                      VerticalAlignment="Center"
							 | 
						||
| 
								 | 
							
								                      HorizontalAlignment="Right"
							 | 
						||
| 
								 | 
							
								                      Style="{StaticResource MaterialDesignBody2TextBlock}"
							 | 
						||
| 
								 | 
							
								                      Text="药品:" />
							 | 
						||
| 
								 | 
							
								                <TextBlock
							 | 
						||
| 
								 | 
							
								                      Grid.Column="1"
							 | 
						||
| 
								 | 
							
								                      Margin="16 0 16 8"
							 | 
						||
| 
								 | 
							
								                      VerticalAlignment="Center"
							 | 
						||
| 
								 | 
							
								                      HorizontalAlignment="Left"
							 | 
						||
| 
								 | 
							
								                      Style="{StaticResource MaterialDesignBody2TextBlock}"
							 | 
						||
| 
								 | 
							
								                      Text="{Binding _ChannelStock.DrugInfo.DrugName}" />
							 | 
						||
| 
								 | 
							
								                <TextBlock
							 | 
						||
| 
								 | 
							
								                      Grid.Column="2"
							 | 
						||
| 
								 | 
							
								                      Margin="16 0 16 8"
							 | 
						||
| 
								 | 
							
								                      VerticalAlignment="Center"
							 | 
						||
| 
								 | 
							
								                      HorizontalAlignment="Right"
							 | 
						||
| 
								 | 
							
								                      Style="{StaticResource MaterialDesignBody2TextBlock}"
							 | 
						||
| 
								 | 
							
								                      Text="规格:" />
							 | 
						||
| 
								 | 
							
								                <TextBlock
							 | 
						||
| 
								 | 
							
								                      Grid.Column="3"
							 | 
						||
| 
								 | 
							
								                      Margin="16 0 16 8"
							 | 
						||
| 
								 | 
							
								                      VerticalAlignment="Center"
							 | 
						||
| 
								 | 
							
								                      HorizontalAlignment="Left"
							 | 
						||
| 
								 | 
							
								                      Style="{StaticResource MaterialDesignBody2TextBlock}"
							 | 
						||
| 
								 | 
							
								                      Text="{Binding _ChannelStock.DrugInfo.DrugSpec}" />
							 | 
						||
| 
								 | 
							
								                <TextBlock
							 | 
						||
| 
								 | 
							
								                      Grid.Column="4"
							 | 
						||
| 
								 | 
							
								                      Margin="16 0 16 8"
							 | 
						||
| 
								 | 
							
								                      VerticalAlignment="Center"
							 | 
						||
| 
								 | 
							
								                      HorizontalAlignment="Right"
							 | 
						||
| 
								 | 
							
								                      Style="{StaticResource MaterialDesignBody2TextBlock}"
							 | 
						||
| 
								 | 
							
								                      Text="批次:" />
							 | 
						||
| 
								 | 
							
								                <TextBlock
							 | 
						||
| 
								 | 
							
								                      Grid.Column="5"
							 | 
						||
| 
								 | 
							
								                      Margin="16 0 16 8"
							 | 
						||
| 
								 | 
							
								                      VerticalAlignment="Center"
							 | 
						||
| 
								 | 
							
								                      HorizontalAlignment="Left"
							 | 
						||
| 
								 | 
							
								                      Style="{StaticResource MaterialDesignBody2TextBlock}"
							 | 
						||
| 
								 | 
							
								                      Text="{Binding _ChannelStock.ManuNo}" />
							 | 
						||
| 
								 | 
							
								                <TextBlock
							 | 
						||
| 
								 | 
							
								                      Grid.Column="6"
							 | 
						||
| 
								 | 
							
								                      Margin="16 0 16 8"
							 | 
						||
| 
								 | 
							
								                      VerticalAlignment="Center"
							 | 
						||
| 
								 | 
							
								                      HorizontalAlignment="Right"
							 | 
						||
| 
								 | 
							
								                      Style="{StaticResource MaterialDesignBody2TextBlock}"
							 | 
						||
| 
								 | 
							
								                      Text="库存:" />
							 | 
						||
| 
								 | 
							
								                <TextBlock
							 | 
						||
| 
								 | 
							
								                      Grid.Column="7"
							 | 
						||
| 
								 | 
							
								                      Margin="16 0 16 8"
							 | 
						||
| 
								 | 
							
								                      VerticalAlignment="Center"
							 | 
						||
| 
								 | 
							
								                      HorizontalAlignment="Left"
							 | 
						||
| 
								 | 
							
								                      Style="{StaticResource MaterialDesignBody2TextBlock}"
							 | 
						||
| 
								 | 
							
								                      Text="{Binding _ChannelStock.Quantity}" />
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								                <ComboBox
							 | 
						||
| 
								 | 
							
								                  Grid.Column="8"
							 | 
						||
| 
								 | 
							
								                  Margin="6 0 0 0"
							 | 
						||
| 
								 | 
							
								                  Style="{StaticResource MaterialDesignOutlinedComboBox}"
							 | 
						||
| 
								 | 
							
								                  SelectedItem="{Binding SelectedItem}"
							 | 
						||
| 
								 | 
							
								                  DisplayMemberPath="Name"
							 | 
						||
| 
								 | 
							
								                  ItemsSource="{Binding Selects}"
							 | 
						||
| 
								 | 
							
								                  />
							 | 
						||
| 
								 | 
							
								            </Grid>
							 | 
						||
| 
								 | 
							
								            <ListView
							 | 
						||
| 
								 | 
							
								                Grid.Row="2"
							 | 
						||
| 
								 | 
							
								                ItemsSource="{Binding _ChannelStocks}"
							 | 
						||
| 
								 | 
							
								                materialDesign:ListViewAssist.HeaderRowBackground="#31ccec"
							 | 
						||
| 
								 | 
							
								                materialDesign:DataGridAssist.ColumnHeaderPadding="10"
							 | 
						||
| 
								 | 
							
								                materialDesign:ListViewAssist.ListViewItemPadding="13">
							 | 
						||
| 
								 | 
							
								                <ListView.Resources>
							 | 
						||
| 
								 | 
							
								                    <Style TargetType="{x:Type GridViewColumnHeader}" BasedOn="{StaticResource {x:Type GridViewColumnHeader}}">
							 | 
						||
| 
								 | 
							
								                        <Setter Property="Foreground" Value="White" />
							 | 
						||
| 
								 | 
							
								                    </Style>
							 | 
						||
| 
								 | 
							
								                    <Style TargetType="ScrollViewer">
							 | 
						||
| 
								 | 
							
								                        <Setter Property="HorizontalScrollBarVisibility" Value="Visible"/>
							 | 
						||
| 
								 | 
							
								                        <Setter Property="VerticalScrollBarVisibility" Value="Visible"/>
							 | 
						||
| 
								 | 
							
								                    </Style>
							 | 
						||
| 
								 | 
							
								                </ListView.Resources>
							 | 
						||
| 
								 | 
							
								                <!--<i:Interaction.Triggers>
							 | 
						||
| 
								 | 
							
								                    <i:EventTrigger EventName="SelectionChanged">
							 | 
						||
| 
								 | 
							
								                        <i:InvokeCommandAction Command="{Binding RowSelected}" />
							 | 
						||
| 
								 | 
							
								                    </i:EventTrigger>
							 | 
						||
| 
								 | 
							
								                </i:Interaction.Triggers>-->
							 | 
						||
| 
								 | 
							
								                <ListView.View>
							 | 
						||
| 
								 | 
							
								                    <GridView   ColumnHeaderContainerStyle="{StaticResource st}">
							 | 
						||
| 
								 | 
							
								                        <!--<GridViewColumn Header="选择" Width="100">
							 | 
						||
| 
								 | 
							
								                            <GridViewColumn.CellTemplate>
							 | 
						||
| 
								 | 
							
								                                <DataTemplate>
							 | 
						||
| 
								 | 
							
								                                    <CheckBox IsChecked="{Binding IsSelected}"/>
							 | 
						||
| 
								 | 
							
								                                </DataTemplate>
							 | 
						||
| 
								 | 
							
								                            </GridViewColumn.CellTemplate>
							 | 
						||
| 
								 | 
							
								                        </GridViewColumn>-->
							 | 
						||
| 
								 | 
							
								                        <GridViewColumn Width="80"
							 | 
						||
| 
								 | 
							
								                            Header="药箱号"
							 | 
						||
| 
								 | 
							
								                            DisplayMemberBinding="{Binding DrawerNo}"/>
							 | 
						||
| 
								 | 
							
								                        <GridViewColumn Width="150"
							 | 
						||
| 
								 | 
							
								                            Header="药品"
							 | 
						||
| 
								 | 
							
								                            DisplayMemberBinding="{Binding DrugInfo.DrugName}"/>
							 | 
						||
| 
								 | 
							
								                        <GridViewColumn Width="150"
							 | 
						||
| 
								 | 
							
								                            DisplayMemberBinding="{Binding DrugInfo.DrugSpec}"
							 | 
						||
| 
								 | 
							
								                            Header="规格"/>
							 | 
						||
| 
								 | 
							
								                        <GridViewColumn Width="150"
							 | 
						||
| 
								 | 
							
								                            DisplayMemberBinding="{Binding ManuNo}"
							 | 
						||
| 
								 | 
							
								                            Header="批次"/>
							 | 
						||
| 
								 | 
							
								                        <GridViewColumn Width="80"
							 | 
						||
| 
								 | 
							
								                            DisplayMemberBinding="{Binding Quantity}"
							 | 
						||
| 
								 | 
							
								                            Header="库存"/>
							 | 
						||
| 
								 | 
							
								                        <GridViewColumn Width="80"  Header="交换数量">
							 | 
						||
| 
								 | 
							
								                            <GridViewColumn.CellTemplate>
							 | 
						||
| 
								 | 
							
								                                <DataTemplate>
							 | 
						||
| 
								 | 
							
								                                    <TextBox Width="80" Style="{StaticResource MaterialDesignDataGridTextColumnEditingStyle}">
							 | 
						||
| 
								 | 
							
								                                        <TextBox.Text>
							 | 
						||
| 
								 | 
							
								                                            <Binding Path="TakeQuantity" Mode="TwoWay" UpdateSourceTrigger="PropertyChanged">
							 | 
						||
| 
								 | 
							
								                                                <Binding.ValidationRules>
							 | 
						||
| 
								 | 
							
								                                                    <ExceptionValidationRule />
							 | 
						||
| 
								 | 
							
								                                                </Binding.ValidationRules>
							 | 
						||
| 
								 | 
							
								                                            </Binding>
							 | 
						||
| 
								 | 
							
								                                        </TextBox.Text>
							 | 
						||
| 
								 | 
							
								                                    </TextBox>
							 | 
						||
| 
								 | 
							
								                                </DataTemplate>
							 | 
						||
| 
								 | 
							
								                            </GridViewColumn.CellTemplate>
							 | 
						||
| 
								 | 
							
								                        </GridViewColumn>
							 | 
						||
| 
								 | 
							
								                    </GridView>
							 | 
						||
| 
								 | 
							
								                </ListView.View>
							 | 
						||
| 
								 | 
							
								            </ListView>
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								            <Grid Grid.Row="3">
							 | 
						||
| 
								 | 
							
								                <Grid.RowDefinitions>
							 | 
						||
| 
								 | 
							
								                    <RowDefinition />
							 | 
						||
| 
								 | 
							
								                </Grid.RowDefinitions>
							 | 
						||
| 
								 | 
							
								                <Grid.ColumnDefinitions>
							 | 
						||
| 
								 | 
							
								                    <ColumnDefinition />
							 | 
						||
| 
								 | 
							
								                    <ColumnDefinition/>
							 | 
						||
| 
								 | 
							
								                    <ColumnDefinition />
							 | 
						||
| 
								 | 
							
								                </Grid.ColumnDefinitions>
							 | 
						||
| 
								 | 
							
								                <StackPanel Orientation="Horizontal" Grid.Row="0" Grid.Column="1" HorizontalAlignment="Center" Margin="6">
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								                    <Button
							 | 
						||
| 
								 | 
							
								                            Margin="2"
							 | 
						||
| 
								 | 
							
								                            Style="{StaticResource MaterialDesignRaisedAccentButton}"
							 | 
						||
| 
								 | 
							
								                            Visibility="{Binding Status,Converter={StaticResource StatusConverter}, ConverterParameter=opearBtnVisible}"
							 | 
						||
| 
								 | 
							
								                            materialDesign:ButtonProgressAssist.IsIndicatorVisible="{Binding Status, Converter={StaticResource StatusConverter}, ConverterParameter=opearBtnLoading}"
							 | 
						||
| 
								 | 
							
								                            materialDesign:ButtonProgressAssist.IsIndeterminate="{Binding Status, Converter={StaticResource StatusConverter}, ConverterParameter=opearBtnLoading}"
							 | 
						||
| 
								 | 
							
								                            Content="开药箱"
							 | 
						||
| 
								 | 
							
								                            Command="{Binding OpenDrawer}">
							 | 
						||
| 
								 | 
							
								                    </Button>
							 | 
						||
| 
								 | 
							
								                    <Button
							 | 
						||
| 
								 | 
							
								                            Margin="2"
							 | 
						||
| 
								 | 
							
								                            Style="{StaticResource MaterialDesignRaisedAccentButton}"
							 | 
						||
| 
								 | 
							
								                            Content="完成"
							 | 
						||
| 
								 | 
							
								                            Command="{Binding FinishCommand}"/>
							 | 
						||
| 
								 | 
							
								                    <Button
							 | 
						||
| 
								 | 
							
								                            Margin="2"
							 | 
						||
| 
								 | 
							
								                            Style="{StaticResource MaterialDesignRaisedButton}"
							 | 
						||
| 
								 | 
							
								                            Background="Orange"
							 | 
						||
| 
								 | 
							
								                            BorderBrush="Orange"
							 | 
						||
| 
								 | 
							
								                            Content="取消"
							 | 
						||
| 
								 | 
							
								                            Command="{Binding CancleCommand}" />
							 | 
						||
| 
								 | 
							
								                </StackPanel>
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								            </Grid>
							 | 
						||
| 
								 | 
							
								        </Grid>
							 | 
						||
| 
								 | 
							
								    </materialDesign:Card>
							 | 
						||
| 
								 | 
							
								</UserControl>
							 |