You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

205 lines
15 KiB
XML

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<UserControl x:Class="Admin.Core.Wpf.Views.IndexPage"
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:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
xmlns:local="clr-namespace:Admin.Core.Wpf.Views"
mc:Ignorable="d"
d:DesignHeight="900"
d:DesignWidth="800">
<UserControl.Resources>
<Style x:Key="DataGridTextColumnCenterSytle" TargetType="{x:Type TextBlock}">
<Setter Property="VerticalAlignment" Value="Center" />
</Style>
<Style TargetType="DataGrid">
<!--网格线颜色-->
<Setter Property="CanUserResizeColumns" Value="false"/>
<Setter Property="Background" Value="#1152AC" />
<Setter Property="BorderBrush" Value="#4285DE" />
<Setter Property="Foreground" Value="White"/>
<Setter Property="HorizontalGridLinesBrush">
<Setter.Value>
<SolidColorBrush Color="#4285DE"/>
</Setter.Value>
</Setter>
<Setter Property="VerticalGridLinesBrush">
<Setter.Value>
<SolidColorBrush Color="#1152AC"/>
</Setter.Value>
</Setter>
</Style>
<!--列头标题栏样式-->
<Style TargetType="DataGridColumnHeader">
<!--<Setter Property="HorizontalContentAlignment" Value="Center"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>-->
<!--<Setter Property="Background" Value="#dddddd"/>
<Setter Property="Foreground" Value="Black"/>-->
<!--<Setter Property="BorderThickness" Value="1" />-->
<Setter Property="HorizontalContentAlignment" Value="Center" />
<Setter Property="BorderBrush" Value="#dddddd" />
<Setter Property="Height" Value="40"/>
<Setter Property="FontSize" Value="14"/>
<Setter Property="Background" Value="#4285DE"/>
<Setter Property="Foreground" Value="White"/>
</Style>
<!--单元格样式-->
<Style TargetType="DataGridCell">
<Setter Property="FocusVisualStyle" Value="{x:Null}" />
<Setter Property="BorderThickness" Value="0" />
<Setter Property="BorderBrush" Value="Gray" />
<Setter Property="Height" Value="40"/>
<Setter Property="FontSize" Value="12"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type DataGridCell}">
<Grid Background="{TemplateBinding Background}" >
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" />
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<Trigger Property="IsSelected" Value="True">
<Setter Property="Background" Value="#4285DE"/>
<Setter Property="Foreground" Value="White"/>
</Trigger>
</Style.Triggers>
</Style>
<!--背景色改变必须先设置cellStyle 因为cellStyle会覆盖rowStyle样式换行换色-->
<!--<Style TargetType="DataGridRow">
<Setter Property="Height" Value="30"/>
<Style.Triggers>
<Trigger Property="AlternationIndex" Value="0">
<Setter Property="Background" Value="#e7e7e7"/>
</Trigger>
<Trigger Property="AlternationIndex" Value="1">
<Setter Property="Background" Value="#f2f2f2" />
</Trigger>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="#f1ef9f" />
</Trigger>
<Trigger Property="IsSelected" Value="True">
<Setter Property="Background" Value="#05c4ff"/>
</Trigger>
<Trigger Property="IsFocused" Value="True">
<Setter Property="Background" Value="#05c4ff"/>
</Trigger>
</Style.Triggers>
</Style>-->
</UserControl.Resources>
<Grid >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1.8*"/>
<ColumnDefinition />
</Grid.ColumnDefinitions>
<UniformGrid Grid.Column="0" Margin="3" >
<Border BorderBrush="#0288d1" BorderThickness="1" Padding="5" CornerRadius="5">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="auto"/>
<RowDefinition />
</Grid.RowDefinitions>
<WrapPanel Grid.Row="0" Margin="5 5 0 0">
<Label Content="查询条件" Width="60" VerticalAlignment="Center" Foreground="white" />
<TextBox x:Name="queryParam" Text="" Style="{x:Null}" Width="200" HorizontalAlignment="Left" VerticalContentAlignment="Center" />
<Button Content="查询" Background="#4285DE" Margin="9,0,4,0" Width="100" Command="{Binding QueryStringCommand}" CommandParameter="{Binding ElementName=queryParam,Path=Text}">
</Button>
</WrapPanel>
<UniformGrid Grid.Row="1" Margin="5 5 0 0" x:Name="HeightPanel">
<!--
AlternationCount="2" 表示两行交替显示背景色;
AutoGenerateColumns="False" 表示不让DataGrid自动生成列。如果设置成true则效果 多出了不需要的列;
HorizontalAlignment="Left" 不显示多余的空白列;
-->
<DataGrid x:Name="dgvMH" Height="{Binding Path=ActualHeight, ElementName=HeightPanel}"
HorizontalAlignment="Center" VerticalAlignment="Top" AlternationCount="2" RowHeaderWidth="0"
ItemsSource="{Binding Datalist}" ColumnWidth="*" AutoGenerateColumns="False" IsReadOnly="True" CanUserAddRows="False" SelectionMode="Single"
SelectedItem="{Binding SelectedCells, Mode=OneWayToSource}">
<DataGrid.Columns>
<DataGridTextColumn MinWidth="160" Binding="{Binding created_time}" Header="订单日期" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn MinWidth="110" Binding="{Binding order_code}" Header="订单编码" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn MinWidth="110" Binding="{Binding product_code}" Header="产品编码" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn MinWidth="200" Binding="{Binding product_name}" Header="产品名称" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn MinWidth="100" Binding="{Binding plan_amount}" Header="订单量" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn MinWidth="100" Binding="{Binding CompleteNum}" Header="完成量" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn MinWidth="100" Binding="{Binding ErrorNum}" Header="异常量" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn MinWidth="120" Binding="{Binding linerCodeNum}" Header="内胆码已打量" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn MinWidth="120" Binding="{Binding BoxCodeNum}" Header="U壳码已打量" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn MinWidth="110" Binding="{Binding material_code}" Header="物料编码" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn MinWidth="200" Binding="{Binding material_name}" Header="物料名称" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn MinWidth="200" Binding="{Binding standard_amount}" Header="物料数量" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
</DataGrid.Columns>
</DataGrid>
</UniformGrid>
</Grid>
</Border>
</UniformGrid>
<UniformGrid Grid.Column="1" Margin="0 5 3 3">
<Border BorderBrush="#0288d1" BorderThickness="1" CornerRadius="5">
<Grid Margin="0 30">
<Grid.RowDefinitions>
<RowDefinition Height="auto"/>
<RowDefinition Height="auto"/>
<RowDefinition Height="auto"/>
<RowDefinition Height="auto"/>
<RowDefinition Height="auto"/>
<RowDefinition Height="auto"/>
</Grid.RowDefinitions>
<WrapPanel Grid.Row="0" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0 15">
<TextBlock Text="产品编码" FontSize="15" Foreground="white" HorizontalAlignment="Center" VerticalAlignment="Center" />
<TextBox x:Name="ProductNo" Foreground="white" Text="{Binding SelectedItem.product_code, ElementName=dgvMH}" IsReadOnly="True" Margin="15 0 0 0 " FontSize="15" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" Width="300"
materialDesign:HintAssist.Hint="产品编码" />
</WrapPanel>
<WrapPanel Grid.Row="1" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0 15">
<TextBlock Text="产品名称" FontSize="15" Foreground="white" HorizontalAlignment="Center" VerticalAlignment="Center" />
<TextBox x:Name="ProductName" Foreground="white" Text="{Binding SelectedItem.product_name, ElementName=dgvMH}" IsReadOnly="True" Margin="15 0 0 0" FontSize="15" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" Width="{Binding Path=ActualWidth, ElementName=ProductNo}"
materialDesign:HintAssist.Hint="产品名称" />
</WrapPanel>
<WrapPanel Grid.Row="2" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0 15">
<TextBlock Text="打印名称" FontSize="15" Foreground="white" HorizontalAlignment="Center" VerticalAlignment="Center" />
<TextBox x:Name="MaterialName" Foreground="white" Text="{Binding SelectedItem.material_name, ElementName=dgvMH}" IsReadOnly="True" Margin="15 0 0 0" FontSize="15" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" Width="{Binding Path=ActualWidth, ElementName=ProductNo}"
materialDesign:HintAssist.Hint="打印名称" />
</WrapPanel>
<WrapPanel Grid.Row="3" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0 15">
<TextBlock Text="打印数量" FontSize="15" Foreground="white" HorizontalAlignment="Center" VerticalAlignment="Center" />
<TextBox x:Name="PlanAmount" Foreground="white" Text="{Binding SelectedItem.standard_amount, ElementName=dgvMH}" Margin="15 0 0 0" FontSize="15" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" Width="{Binding Path=ActualWidth, ElementName=ProductNo}"
materialDesign:HintAssist.Hint="打印数量" />
</WrapPanel>
<Border Grid.Row="4" BorderBrush="#0288d1" BorderThickness="1" CornerRadius="5" Margin="30 5">
<StackPanel >
<WrapPanel Height="110">
<RadioButton Content="内胆" Foreground="white" FontSize="15" x:Name="内胆" Margin="10 5" Command="{Binding RadioQueryCommand}" CommandParameter="{Binding Name, ElementName=内胆}"/>
<RadioButton Content="U壳" Foreground="white" FontSize="15" x:Name="U壳" Margin="10 5" Command="{Binding RadioQueryCommand}" CommandParameter="{Binding Name,ElementName=U壳}"/>
</WrapPanel>
<Button Content="添加" Foreground="White" BorderBrush="#0288d1" Background="#4285DE" HorizontalAlignment="Right" VerticalAlignment="Bottom" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" />
</StackPanel>
</Border>
<WrapPanel Grid.Row="5" HorizontalAlignment="Center">
<Button
Background="#4285DE"
Content="打印" Margin="0 0" Command="{Binding PrintCommand}" CommandParameter="{Binding ElementName=ProductNo,Path=Text}"/>
<Button
Background="#4285DE"
Content="补打" Margin="10 0 0 0" Command="{Binding SupplementPrintCommand}" CommandParameter="{Binding ElementName=ProductNo,Path=Text}"
IsEnabled="{Binding DataContext.ControlsEnabled, RelativeSource={RelativeSource FindAncestor, AncestorType=Window}}"/>
<Button
Background="#4285DE"
Content="续打" Margin="10 0 0 0" Command="{Binding SupplementPrintCommand}"
IsEnabled="{Binding DataContext.ControlsEnabled, RelativeSource={RelativeSource FindAncestor, AncestorType=Window}}" CommandParameter="{Binding ElementName=ProductNo,Path=Text}"/>
</WrapPanel>
</Grid>
</Border>
</UniformGrid>
</Grid>
</UserControl>