244 lines
13 KiB
Plaintext
244 lines
13 KiB
Plaintext
|
<UserControl x:Class="DM_Weight.Views.InvoiceInWindow"
|
|||
|
xmlns:pagination="clr-namespace:DM_Weight.Components.pagination"
|
|||
|
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
|
|||
|
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:i="http://schemas.microsoft.com/xaml/behaviors"
|
|||
|
xmlns:prism="http://prismlibrary.com/"
|
|||
|
xmlns:convert="clr-namespace:DM_Weight.Converter"
|
|||
|
mc:Ignorable="d">
|
|||
|
<UserControl.Resources>
|
|||
|
<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>
|
|||
|
<Grid>
|
|||
|
<Grid.Resources>
|
|||
|
<convert:GroupSumConverter x:Key="GroupSumConverter" />
|
|||
|
</Grid.Resources>
|
|||
|
<Grid.ColumnDefinitions>
|
|||
|
<ColumnDefinition Width="4*" />
|
|||
|
<ColumnDefinition Width="6*"/>
|
|||
|
</Grid.ColumnDefinitions>
|
|||
|
<Grid Grid.Column="0" >
|
|||
|
<Grid.RowDefinitions>
|
|||
|
<RowDefinition Height="Auto" />
|
|||
|
<RowDefinition />
|
|||
|
<RowDefinition Height="Auto" />
|
|||
|
</Grid.RowDefinitions>
|
|||
|
<Grid Margin="0 6 0 6" Grid.Row="0">
|
|||
|
<Grid.ColumnDefinitions>
|
|||
|
<ColumnDefinition Width="3*" />
|
|||
|
<ColumnDefinition Width="3*" />
|
|||
|
<ColumnDefinition Width="4*" />
|
|||
|
</Grid.ColumnDefinitions>
|
|||
|
<ComboBox
|
|||
|
Grid.Column="0"
|
|||
|
Margin="6 0 0 0"
|
|||
|
Style="{StaticResource MaterialDesignOutlinedComboBox}"
|
|||
|
SelectedItem="{Binding SelectedItem}"
|
|||
|
DisplayMemberPath="Name"
|
|||
|
ItemsSource="{Binding OrderTakeSelects}"
|
|||
|
/>
|
|||
|
<TextBox
|
|||
|
Grid.Column="1"
|
|||
|
Text="{Binding SearchValue, UpdateSourceTrigger=PropertyChanged}"
|
|||
|
materialDesign:HintAssist.Hint="{Binding SelectedItem.Name}"
|
|||
|
materialDesign:HintAssist.IsFloating="True"
|
|||
|
Margin="6 0 0 0"
|
|||
|
Style="{StaticResource MaterialDesignOutlinedTextBox}"/>
|
|||
|
<DatePicker
|
|||
|
Grid.Column="2"
|
|||
|
SelectedDate="{Binding OrderDate, StringFormat=yyyy-MM-dd, TargetNullValue='',UpdateSourceTrigger=PropertyChanged}"
|
|||
|
SelectedDateFormat="Short"
|
|||
|
Margin="6 0 0 0"
|
|||
|
materialDesign:HintAssist.Hint="日期"
|
|||
|
Style="{StaticResource MaterialDesignOutlinedDatePicker}" />
|
|||
|
|
|||
|
</Grid>
|
|||
|
<ListView Grid.Row="1"
|
|||
|
ItemsSource="{Binding Invoices}"
|
|||
|
SelectedItem="{Binding SelectedInvoice}"
|
|||
|
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>
|
|||
|
</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 Width="110"
|
|||
|
Header="凭证单号"
|
|||
|
DisplayMemberBinding="{Binding InvoiceNo}"/>
|
|||
|
<GridViewColumn Width="100"
|
|||
|
Header="时间"
|
|||
|
DisplayMemberBinding="{Binding InvoiceDate, StringFormat=yyyy-MM-dd}" />
|
|||
|
<GridViewColumn Width="100"
|
|||
|
DisplayMemberBinding="{Binding Count}"
|
|||
|
Header="药品种类"/>
|
|||
|
<GridViewColumn Width="100"
|
|||
|
DisplayMemberBinding="{Binding Quantity}"
|
|||
|
Header="药品总数"/>
|
|||
|
<!--<GridViewColumn
|
|||
|
DisplayMemberBinding="{Binding Status}"
|
|||
|
Header="状态"/>-->
|
|||
|
</GridView>
|
|||
|
</ListView.View>
|
|||
|
</ListView>
|
|||
|
|
|||
|
<pagination:Pagination Grid.Row="2"
|
|||
|
CurrentPage="{Binding PageNum}"
|
|||
|
PageSize="{Binding PageSize}"
|
|||
|
TotalPages="{Binding TotalCount}"
|
|||
|
InfoTextIsEnabel="True"
|
|||
|
/>
|
|||
|
</Grid>
|
|||
|
<Grid Grid.Column="1" Margin="10 0 0 0">
|
|||
|
<Grid.RowDefinitions>
|
|||
|
<RowDefinition Height="61" />
|
|||
|
<RowDefinition />
|
|||
|
</Grid.RowDefinitions>
|
|||
|
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
|
|||
|
<Button
|
|||
|
Margin="0 0 6 0"
|
|||
|
VerticalAlignment="Center"
|
|||
|
Style="{StaticResource MaterialDesignOutlinedLightButton}"
|
|||
|
Command="{Binding OpenInvoiceAdd}"
|
|||
|
Content="入库"
|
|||
|
/>
|
|||
|
<Button
|
|||
|
Margin="0 0 6 0"
|
|||
|
VerticalAlignment="Center"
|
|||
|
Style="{StaticResource MaterialDesignOutlinedLightButton}"
|
|||
|
Command="{Binding QueryCommand}"
|
|||
|
ToolTip="刷新">
|
|||
|
<materialDesign:PackIcon
|
|||
|
Kind="Refresh" />
|
|||
|
</Button>
|
|||
|
</StackPanel>
|
|||
|
<DataGrid
|
|||
|
Grid.Row="1"
|
|||
|
materialDesign:DataGridAssist.ColumnHeaderPadding="15"
|
|||
|
ItemsSource="{Binding ChannelStocks}"
|
|||
|
materialDesign:DataGridAssist.EnableEditBoxAssist="False"
|
|||
|
IsSynchronizedWithCurrentItem="True"
|
|||
|
materialDesign:DataGridAssist.CellPadding="13"
|
|||
|
CanUserAddRows="False"
|
|||
|
AutoGenerateColumns="False">
|
|||
|
<DataGrid.Resources>
|
|||
|
<Style TargetType="{x:Type DataGridColumnHeader}" BasedOn="{StaticResource MaterialDesignDataGridColumnHeader}">
|
|||
|
<Setter Property="Background" Value="#31ccec" />
|
|||
|
<Setter Property="Foreground" Value="white" />
|
|||
|
<Setter Property="Height" Value="56" />
|
|||
|
<Setter Property="BorderBrush" Value="white"/>
|
|||
|
<Setter Property="BorderThickness" Value="0.6"/>
|
|||
|
<Setter Property="HorizontalContentAlignment" Value="Center"/>
|
|||
|
</Style>
|
|||
|
<Style TargetType="{x:Type DataGridCell}" BasedOn="{StaticResource MaterialDesignDataGridCell}">
|
|||
|
<Style.Triggers>
|
|||
|
<Trigger Property="IsReadOnly" Value="True">
|
|||
|
<Setter Property="BorderBrush" Value="Transparent" />
|
|||
|
<Setter Property="HorizontalAlignment" Value="Left"/>
|
|||
|
</Trigger>
|
|||
|
</Style.Triggers>
|
|||
|
</Style>
|
|||
|
</DataGrid.Resources>
|
|||
|
<!--GroupStyle to group data-->
|
|||
|
<DataGrid.GroupStyle>
|
|||
|
<GroupStyle>
|
|||
|
<!--Group DataItems into DataGroup-->
|
|||
|
<GroupStyle.ContainerStyle>
|
|||
|
<Style TargetType="{x:Type GroupItem}">
|
|||
|
<Setter Property="Template">
|
|||
|
<Setter.Value>
|
|||
|
<ControlTemplate TargetType="{x:Type GroupItem}">
|
|||
|
<Expander IsExpanded="True"
|
|||
|
materialDesign:ExpanderAssist.HeaderBackground="PaleTurquoise">
|
|||
|
<Expander.Header >
|
|||
|
<StackPanel Orientation="Horizontal">
|
|||
|
<TextBlock Text="{Binding Path=Name.DrugInfo.DrugName,StringFormat=药品:{0},}" FontWeight="Bold" />
|
|||
|
<TextBlock FontWeight="Bold" Text="{Binding Path=Name.DrugInfo.DrugSpec,StringFormat=规格:{0},}" />
|
|||
|
<TextBlock FontWeight="Bold" Text="{Binding Path=Name.DrugInfo.Manufactory,StringFormat=厂家:{0},}" />
|
|||
|
<TextBlock FontWeight="Bold" Text="{Binding Path=Name.quantity,StringFormat=入库量:{0},}" />
|
|||
|
<TextBlock FontWeight="Bold" Text="{Binding Path=Items,Converter={StaticResource GroupSumConverter}}" />
|
|||
|
|
|||
|
</StackPanel>
|
|||
|
</Expander.Header>
|
|||
|
<ItemsPresenter/>
|
|||
|
</Expander>
|
|||
|
</ControlTemplate>
|
|||
|
</Setter.Value>
|
|||
|
</Setter>
|
|||
|
</Style>
|
|||
|
</GroupStyle.ContainerStyle>
|
|||
|
|
|||
|
</GroupStyle>
|
|||
|
</DataGrid.GroupStyle>
|
|||
|
<DataGrid.Columns>
|
|||
|
<DataGridTextColumn Width="100"
|
|||
|
Binding="{Binding Location}"
|
|||
|
Header="库位"
|
|||
|
IsReadOnly="True"
|
|||
|
ElementStyle="{StaticResource MaterialDesignDataGridTextColumnStyle}"/>
|
|||
|
<DataGridTextColumn Width="147"
|
|||
|
Binding="{Binding ManuNo}"
|
|||
|
Header="批次"
|
|||
|
IsReadOnly="True"
|
|||
|
ElementStyle="{StaticResource MaterialDesignDataGridTextColumnStyle}"/>
|
|||
|
<DataGridTextColumn Width="147"
|
|||
|
Binding="{Binding EffDate}"
|
|||
|
Header="效期"
|
|||
|
IsReadOnly="True"
|
|||
|
ElementStyle="{StaticResource MaterialDesignDataGridTextColumnStyle}"/>
|
|||
|
<DataGridTextColumn Width="100"
|
|||
|
Binding="{Binding Quantity}"
|
|||
|
Header="库存"
|
|||
|
IsReadOnly="True"
|
|||
|
ElementStyle="{StaticResource MaterialDesignDataGridTextColumnStyle}"/>
|
|||
|
<!--<DataGridTextColumn
|
|||
|
Binding="{Binding AddQuantity, ValidatesOnExceptions=True}"
|
|||
|
Header="添加数量"
|
|||
|
ElementStyle="{StaticResource MaterialDesignDataGridTextColumnStyle}"/>-->
|
|||
|
<DataGridTemplateColumn Width="100"
|
|||
|
Header="添加数量">
|
|||
|
<DataGridTemplateColumn.CellTemplate>
|
|||
|
<DataTemplate>
|
|||
|
<TextBox Style="{StaticResource MaterialDesignDataGridTextColumnEditingStyle}">
|
|||
|
<TextBox.Text>
|
|||
|
<Binding Path="AddQuantity" Mode="TwoWay" UpdateSourceTrigger="PropertyChanged">
|
|||
|
<Binding.ValidationRules>
|
|||
|
<ExceptionValidationRule />
|
|||
|
</Binding.ValidationRules>
|
|||
|
</Binding>
|
|||
|
</TextBox.Text>
|
|||
|
</TextBox>
|
|||
|
</DataTemplate>
|
|||
|
</DataGridTemplateColumn.CellTemplate>
|
|||
|
</DataGridTemplateColumn>
|
|||
|
</DataGrid.Columns>
|
|||
|
</DataGrid>
|
|||
|
</Grid>
|
|||
|
|
|||
|
</Grid>
|
|||
|
|
|||
|
</UserControl>
|