258 lines
		
	
	
		
			13 KiB
		
	
	
	
		
			XML
		
	
	
	
			
		
		
	
	
			258 lines
		
	
	
		
			13 KiB
		
	
	
	
		
			XML
		
	
	
	
<UserControl x:Class="DM_Weight.Views.AccountWindow"
 | 
						||
             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"
 | 
						||
             xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" 
 | 
						||
             xmlns:pagination="clr-namespace:DM_Weight.Components.pagination"
 | 
						||
             xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
 | 
						||
             xmlns:prism="http://prismlibrary.com/"
 | 
						||
             xmlns:convert="clr-namespace:DM_Weight.Converter"
 | 
						||
             mc:Ignorable="d" 
 | 
						||
             d:DesignHeight="450" d:DesignWidth="800" Loaded="UserControl_Loaded">
 | 
						||
    <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>
 | 
						||
        <convert:MachineTypeConverter x:Key="MachineTypeConverter"/>
 | 
						||
    </UserControl.Resources>
 | 
						||
    <Grid>
 | 
						||
        <Grid.RowDefinitions>
 | 
						||
            <RowDefinition Height="Auto" />
 | 
						||
            <RowDefinition />
 | 
						||
            <RowDefinition Height="Auto" />
 | 
						||
        </Grid.RowDefinitions>
 | 
						||
        <Grid Margin="0 6 0 6" Grid.Row="0">
 | 
						||
            <Grid.ColumnDefinitions>
 | 
						||
                <ColumnDefinition Width="1.5*" />
 | 
						||
                <ColumnDefinition Width="1.5*" />
 | 
						||
                <ColumnDefinition Width="2*" />
 | 
						||
                <ColumnDefinition Width="2*" />
 | 
						||
                <ColumnDefinition Width="5*"/>
 | 
						||
            </Grid.ColumnDefinitions>
 | 
						||
            <DatePicker
 | 
						||
                Grid.Column="0"
 | 
						||
                SelectedDate="{Binding StartDate, TargetNullValue=''}"
 | 
						||
                Margin="6 0 0 0"
 | 
						||
                materialDesign:HintAssist.Hint="开始时间"
 | 
						||
                Style="{StaticResource MaterialDesignOutlinedDatePicker}"
 | 
						||
            />
 | 
						||
            <DatePicker
 | 
						||
                Grid.Column="1"
 | 
						||
                SelectedDate="{Binding EndDate}"
 | 
						||
                Margin="6 0 0 0"
 | 
						||
                materialDesign:HintAssist.Hint="结束时间"
 | 
						||
                Style="{StaticResource MaterialDesignOutlinedDatePicker}"
 | 
						||
            />
 | 
						||
            <!--<ComboBox
 | 
						||
                    Margin="12 0 0 0"
 | 
						||
                    Grid.Column="2"
 | 
						||
                    materialDesign:HintAssist.Hint="药品名称"
 | 
						||
                    IsEditable="True"
 | 
						||
                    ItemsSource="{Binding DrugInfos}"
 | 
						||
                    SelectedItem="{Binding DrugInfo}"
 | 
						||
                    DisplayMemberPath="DrugName"
 | 
						||
                />-->
 | 
						||
            <ComboBox
 | 
						||
                    Margin="6 0 6 0"
 | 
						||
                    Grid.Column="2"
 | 
						||
                    materialDesign:HintAssist.Hint="药品名称/拼音码/药品编码"
 | 
						||
                    ItemsSource="{Binding DrugInfos}"
 | 
						||
                    SelectedItem="{Binding DrugInfo}"
 | 
						||
                    DisplayMemberPath="DrugName" IsEditable="True" IsTextSearchEnabled="False" KeyUp="ComboBox_KeyUp"
 | 
						||
                />
 | 
						||
            <ComboBox
 | 
						||
                    Margin="12 0 0 0"
 | 
						||
                    Grid.Column="3"
 | 
						||
                    materialDesign:HintAssist.Hint="账册类型"
 | 
						||
                    IsEditable="True"
 | 
						||
                    ItemsSource="{Binding AccountTypeList}"
 | 
						||
                    SelectedItem="{Binding AccountType}"
 | 
						||
                    DisplayMemberPath="AccountTypeName"
 | 
						||
                />
 | 
						||
            <StackPanel Grid.Column="4" Orientation="Horizontal" HorizontalAlignment="Right">
 | 
						||
                <Button
 | 
						||
                    Margin="0 0 3 0"
 | 
						||
                    VerticalAlignment="Center"
 | 
						||
                    Style="{StaticResource MaterialDesignOutlinedLightButton}"
 | 
						||
                    ToolTip="导出" Command="{Binding DayAccountBook}">
 | 
						||
                    <StackPanel Orientation="Horizontal">
 | 
						||
                        <TextBlock Text="生成日结存" />
 | 
						||
                    </StackPanel>
 | 
						||
                </Button>
 | 
						||
                <Button
 | 
						||
                    Margin="0 0 3 0"
 | 
						||
                    VerticalAlignment="Center"
 | 
						||
                    Style="{StaticResource MaterialDesignOutlinedLightButton}"
 | 
						||
                    ToolTip="导出" Command="{Binding DownloadAccountBook}">
 | 
						||
                    <StackPanel Orientation="Horizontal">
 | 
						||
                        <materialDesign:PackIcon Kind="download" />
 | 
						||
                        <TextBlock Text="导出账册" />
 | 
						||
                    </StackPanel>
 | 
						||
                </Button>
 | 
						||
                <Button
 | 
						||
                Margin="0 0 6 0"
 | 
						||
                VerticalAlignment="Center"
 | 
						||
                Style="{StaticResource MaterialDesignOutlinedLightButton}"
 | 
						||
                ToolTip="刷新" Command="{Binding Query}">
 | 
						||
                    <materialDesign:PackIcon
 | 
						||
                    Kind="Refresh" />
 | 
						||
                </Button>
 | 
						||
            </StackPanel>
 | 
						||
 | 
						||
 | 
						||
        </Grid>
 | 
						||
        <DataGrid x:Name="dgv1"
 | 
						||
                Grid.Row="1"
 | 
						||
                materialDesign:DataGridAssist.ColumnHeaderPadding="15"
 | 
						||
                ItemsSource="{Binding AccountList}"
 | 
						||
                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="Background" 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.DrugName,StringFormat=药品:{0},}" FontWeight="Bold" />
 | 
						||
                                                    <TextBlock FontWeight="Bold" Text="{Binding Path=Name.DrugSpec,StringFormat=规格:{0},}" />
 | 
						||
                                                    <TextBlock FontWeight="Bold" Text="{Binding Path=Name.Manufactory,StringFormat=厂家:{0},}" />
 | 
						||
                                                    <TextBlock FontWeight="Bold" Text="{Binding Path=Name.MaxStock,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="80"
 | 
						||
                        Binding="{Binding OperationTime}"
 | 
						||
                        Header="日期"
 | 
						||
                        IsReadOnly="True"
 | 
						||
                        ElementStyle="{StaticResource MaterialDesignDataGridTextColumnStyle}"/>
 | 
						||
                <DataGridTextColumn Width="150"
 | 
						||
                        Binding="{Binding DrugName}"
 | 
						||
                        Header="药品名称"
 | 
						||
                        IsReadOnly="True"
 | 
						||
                        ElementStyle="{StaticResource MaterialDesignDataGridTextColumnStyle}"/>
 | 
						||
                <DataGridTextColumn Width="130"
 | 
						||
                        Binding="{Binding DrugSpec}"
 | 
						||
                        Header="规格"
 | 
						||
                        IsReadOnly="True"
 | 
						||
                        ElementStyle="{StaticResource MaterialDesignDataGridTextColumnStyle}"/>
 | 
						||
                <DataGridTextColumn Width="200"
 | 
						||
                        Binding="{Binding Manufactory}"
 | 
						||
                        Header="厂家"
 | 
						||
                        IsReadOnly="True"
 | 
						||
                        ElementStyle="{StaticResource MaterialDesignDataGridTextColumnStyle}"/>
 | 
						||
                <DataGridTextColumn Width="100"
 | 
						||
                        Binding="{Binding InvoiceId}"
 | 
						||
                        Header="凭证号"
 | 
						||
                        IsReadOnly="True"
 | 
						||
                        ElementStyle="{StaticResource MaterialDesignDataGridTextColumnStyle}"/>
 | 
						||
                <DataGridTextColumn Width="130"
 | 
						||
                        Binding="{Binding ManuNo}"
 | 
						||
                        Header="批号"
 | 
						||
                        IsReadOnly="True"
 | 
						||
                        ElementStyle="{StaticResource MaterialDesignDataGridTextColumnStyle}"/>
 | 
						||
                <DataGridTextColumn Width="100"
 | 
						||
                        Binding="{Binding EffDate, StringFormat='yy/MM/dd'}"
 | 
						||
                        Header="有效期"
 | 
						||
                        IsReadOnly="True"
 | 
						||
                        ElementStyle="{StaticResource MaterialDesignDataGridTextColumnStyle}"/>
 | 
						||
                <DataGridTextColumn Width="75"
 | 
						||
                        Binding="{Binding InQuantity}"
 | 
						||
                        Header="借入数"
 | 
						||
                        IsReadOnly="True"
 | 
						||
                        ElementStyle="{StaticResource MaterialDesignDataGridTextColumnStyle}"/>
 | 
						||
                <DataGridTextColumn Width="75"
 | 
						||
                        Binding="{Binding OutQuantity}"
 | 
						||
                        Header="发出数"
 | 
						||
                        IsReadOnly="True"
 | 
						||
                        ElementStyle="{StaticResource MaterialDesignDataGridTextColumnStyle}"/>
 | 
						||
                <DataGridTextColumn Width="75"
 | 
						||
                        Binding="{Binding StockQuantity}"
 | 
						||
                        Header="总结存"
 | 
						||
                        IsReadOnly="True"
 | 
						||
                        ElementStyle="{StaticResource MaterialDesignDataGridTextColumnStyle}"/>
 | 
						||
                <DataGridTextColumn Width="75"
 | 
						||
                        Binding="{Binding OperatorName}"
 | 
						||
                        Header="发药人"
 | 
						||
                        IsReadOnly="True"
 | 
						||
                        ElementStyle="{StaticResource MaterialDesignDataGridTextColumnStyle}"/>
 | 
						||
                <DataGridTextColumn Width="75"
 | 
						||
                        Binding="{Binding ReviewerName}"
 | 
						||
                        Header="复核人"
 | 
						||
                        IsReadOnly="True"
 | 
						||
                        ElementStyle="{StaticResource MaterialDesignDataGridTextColumnStyle}"/>
 | 
						||
                <DataGridTextColumn Width="100"
 | 
						||
                        Binding="{Binding SupplierDept}"
 | 
						||
                        Header="供应单位"
 | 
						||
                        IsReadOnly="True"
 | 
						||
                        ElementStyle="{StaticResource MaterialDesignDataGridTextColumnStyle}"/>
 | 
						||
                <DataGridTextColumn Width="100"
 | 
						||
                        Binding="{Binding ReceiveDept}"
 | 
						||
                        Header="领用部门"
 | 
						||
                        IsReadOnly="True"
 | 
						||
                        ElementStyle="{StaticResource MaterialDesignDataGridTextColumnStyle}"/>
 | 
						||
 | 
						||
            </DataGrid.Columns>
 | 
						||
        </DataGrid>
 | 
						||
 | 
						||
        <!--<pagination:Pagination Grid.Row="2"
 | 
						||
                                   CurrentPage="{Binding PageNum}"
 | 
						||
                                   PageSize="{Binding PageSize}"
 | 
						||
                                   TotalPages="{Binding TotalCount}"
 | 
						||
                                   InfoTextIsEnabel="True"
 | 
						||
                                />-->
 | 
						||
    </Grid>
 | 
						||
</UserControl>
 |