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.

272 lines
20 KiB
Plaintext

<UserControl x:Class="Aucma.Core.PrintTo.Views.IndexPageView"
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"
mc:Ignorable="d"
1 year ago
Background="#1152AC"
FontFamily="Microsoft YaHei"
1 year ago
d:DesignHeight="1080"
d:DesignWidth="1920" FontSize="18">
<UserControl.Resources>
<Style x:Key="DataGridTextColumnCenterSytle" TargetType="{x:Type TextBlock}">
<!--<Setter Property="Height" Value="40"/>-->
<Setter Property="FontSize" Value="16"/>
1 year ago
<Setter Property="VerticalAlignment" Value="Stretch" />
<Setter Property="HorizontalAlignment" Value="Left" />
</Style>
1 year ago
<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>
1 year ago
<!--列头标题栏样式-->
<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" />-->
1 year ago
<Setter Property="HorizontalContentAlignment" Value="Left" />
1 year ago
<Setter Property="BorderBrush" Value="#dddddd" />
1 year ago
<Setter Property="Height" Value="48"/>
1 year ago
<Setter Property="FontSize" Value="18"/>
1 year ago
<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}" >
1 year ago
<ContentPresenter HorizontalAlignment="Left" VerticalAlignment="Center" />
1 year ago
</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>-->
1 year ago
<Style TargetType="{x:Type Slider}">
<Style.Resources>
<!-- 重写重复触发按钮的样式 -->
<Style x:Key="RepeatButtonStyle" TargetType="{x:Type RepeatButton}">
<Setter Property="Focusable" Value="false" />
<Setter Property="IsTabStop" Value="false" />
<Setter Property="Padding" Value="0" />
1 year ago
<Setter Property="Width" Value="50" />
1 year ago
</Style>
</Style.Resources>
<Setter Property="Stylus.IsPressAndHoldEnabled" Value="false" />
<Setter Property="SmallChange" Value="1" />
<!-- 重写Slider的模板 -->
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Slider}">
<Grid>
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
1 year ago
<TextBox Grid.RowSpan="2" Height="Auto" Margin="0" Padding="0" VerticalAlignment="Stretch" BorderBrush="White"
1 year ago
VerticalContentAlignment="Center" Text="{Binding RelativeSource={RelativeSource Mode=TemplatedParent}, Path=Value}">
1 year ago
<!-- 给TextBox绑定上下命令 -->
<TextBox.InputBindings>
<KeyBinding Gesture="Up" Command="{x:Static Slider.IncreaseSmall}" />
<KeyBinding Gesture="Down" Command="{x:Static Slider.DecreaseSmall}" />
<KeyBinding Gesture="PageUp" Command="{x:Static Slider.IncreaseLarge}" />
<KeyBinding Gesture="PageDown" Command="{x:Static Slider.DecreaseLarge}" />
</TextBox.InputBindings>
</TextBox>
1 year ago
<RepeatButton Grid.Row="0" Grid.Column="1" Command="{x:Static Slider.IncreaseSmall}"
Style="{StaticResource RepeatButtonStyle}">
1 year ago
<Path Data="M4,0 L0,4 8,4 Z" Fill="Black" />
</RepeatButton>
1 year ago
<RepeatButton Grid.Row="1" Grid.Column="1" Command="{x:Static Slider.DecreaseSmall}"
Style="{StaticResource RepeatButtonStyle}">
1 year ago
<Path Data="M0,0 L4,4 8,0 Z" Fill="Black" />
</RepeatButton>
<!-- 由于Slider的内部实现要求存在这些必要组件,所以必须保留,但是设置为隐藏即可 -->
<Border x:Name="TrackBackground" Visibility="Collapsed">
<Rectangle x:Name="PART_SelectionRange" Visibility="Collapsed" />
</Border>
<Thumb x:Name="Thumb" Visibility="Collapsed" />
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</UserControl.Resources>
<Grid >
<Grid.ColumnDefinitions>
1 year ago
<ColumnDefinition Width="3*"/>
<ColumnDefinition />
</Grid.ColumnDefinitions>
1 year ago
<UniformGrid Grid.Column="0" Margin="0 0 0 5" >
1 year ago
<Border BorderBrush="#0288d1" BorderThickness="1" CornerRadius="5" Background="Transparent">
<Grid Margin="3">
<Grid.RowDefinitions>
<RowDefinition Height="auto"/>
<RowDefinition />
</Grid.RowDefinitions>
<WrapPanel Grid.Row="0" Margin="5 5 0 0">
<Label Content="查询条件" VerticalAlignment="Center" Foreground="White" />
<TextBox x:Name="queryParam" Text="" Style="{x:Null}" PreviewMouseDoubleClick="queryParam_PreviewMouseDown" Width="300" HorizontalAlignment="Left" VerticalContentAlignment="Center"/>
1 year ago
<Button Content="查询" Background="#4285DE" Width="100" Height="40" Margin="5 0" Command="{Binding QueryStringCommand}" CommandParameter="{Binding Text, ElementName=queryParam}"/>
</WrapPanel>
1 year ago
<UniformGrid Grid.Row="1" Margin="0 5 0 0" x:Name="HeightPanel">
<!--
AlternationCount="2" 表示两行交替显示背景色;
AutoGenerateColumns="False" 表示不让DataGrid自动生成列。如果设置成true则效果 多出了不需要的列;
HorizontalAlignment="Left" 不显示多余的空白列;
1 year ago
-->
1 year ago
<DataGrid x:Name="dgvMH" Height="{Binding Path=ActualHeight, ElementName=HeightPanel}"
1 year ago
HorizontalAlignment="Left" 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>
1 year ago
<DataGridTextColumn Width="1.2*" Binding="{Binding CreatedTime, StringFormat=\{0:yyy-MM-dd\}}" Header="订单日期" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Width="1.2*" Binding="{Binding OrderCode}" Header="SAP订单编号" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Width="1.2*" Binding="{Binding ProductCode}" Header="产品编码" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Width="3*" Binding="{Binding ProductName}" Header="产品型号" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Width="*" Binding="{Binding PlanAmount}" Header="订单数量" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
10 months ago
<DataGridTextColumn Width="*" Binding="{Binding CompleteAmount}" Header="下线数量" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<!--<DataGridTextColumn Width="*" Binding="{Binding LinerAmount}" Header="内胆编码" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}" />
<DataGridTextColumn Width="*" Binding="{Binding BoxAmount}" Header="箱体编码" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>-->
1 year ago
<DataGridTextColumn Width="*" Binding="{Binding LinerCodeNum}" Header="内胆码&#x0a;已打数量" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Width="*" Binding="{Binding BoxCodeNum}" Header="箱体码&#x0a;已打数量" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Width="*" Binding="{Binding ErrorNum}" Header="异常量" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Width="*" Binding="{Binding PrintName}" Header="打印名称" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}" />
</DataGrid.Columns>
</DataGrid>
</UniformGrid>
</Grid>
</Border>
</UniformGrid>
1 year ago
<UniformGrid Grid.Column="1" Margin="5">
<Border BorderBrush="#0288d1" BorderThickness="1" CornerRadius="5">
1 year ago
<Grid Margin="0 20">
<Grid.RowDefinitions>
<RowDefinition Height="auto"/>
<RowDefinition Height="auto"/>
<RowDefinition Height="auto"/>
<RowDefinition Height="auto"/>
<RowDefinition Height="auto"/>
<RowDefinition Height="auto"/>
1 year ago
<RowDefinition Height="auto"/>
1 year ago
<RowDefinition Height="auto"/>
</Grid.RowDefinitions>
1 year ago
<WrapPanel Grid.Row="0" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0 15">
1 year ago
<TextBlock Text="SAP订单编号" FontSize="18" Foreground="White" HorizontalAlignment="Center" VerticalAlignment="Center" />
1 year ago
<TextBox x:Name="OrderCode" Foreground="white" BorderBrush="White" Text="{Binding SelectedItem.OrderCode, ElementName=dgvMH}" IsReadOnly="True" Margin="15 0 0 0 " FontSize="18" VerticalContentAlignment="Center" HorizontalContentAlignment="Left" Width="{Binding Path=ActualWidth, ElementName=ProductNo}"
1 year ago
materialDesign:HintAssist.Hint="SAP订单编号" />
1 year ago
</WrapPanel>
<WrapPanel Grid.Row="1" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0 15">
1 year ago
<TextBlock Text="&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;产品编码" FontSize="18" Foreground="White" HorizontalAlignment="Center" VerticalAlignment="Center" />
<TextBox x:Name="ProductNo" Foreground="white" BorderBrush="White" Text="{Binding SelectedItem.ProductCode, ElementName=dgvMH}" IsReadOnly="True" Margin="15 0 0 0 " FontSize="18" VerticalContentAlignment="Center" HorizontalContentAlignment="Left" Width="250"
materialDesign:HintAssist.Hint="产品编码"/>
</WrapPanel>
1 year ago
<WrapPanel Grid.Row="2" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0 15">
1 year ago
<TextBlock Text="&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;产品型号" FontSize="18" Foreground="White" HorizontalAlignment="Center" VerticalAlignment="Center" />
<TextBox x:Name="ProductName" Foreground="white" BorderBrush="White" Text="{Binding SelectedItem.ProductName, ElementName=dgvMH}" IsReadOnly="True" Margin="15 0 0 0" FontSize="18" VerticalContentAlignment="Center" HorizontalContentAlignment="Left" Width="{Binding Path=ActualWidth, ElementName=ProductNo}"
1 year ago
materialDesign:HintAssist.Hint="产品型号" />
</WrapPanel>
1 year ago
<WrapPanel Grid.Row="3" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0 15">
1 year ago
<TextBlock Text="&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;打印名称" FontSize="18" Foreground="White" HorizontalAlignment="Center" VerticalAlignment="Center" />
1 year ago
<TextBox x:Name="PrintName" Foreground="white" BorderBrush="White" Text="{Binding SelectedItem.PrintName, ElementName=dgvMH}" Margin="15 0 0 0" FontSize="18" VerticalContentAlignment="Center" HorizontalContentAlignment="Left" Width="{Binding Path=ActualWidth, ElementName=ProductNo}"
1 year ago
materialDesign:HintAssist.Hint="打印名称" />
</WrapPanel>
<WrapPanel Grid.Row="4" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0 15">
1 year ago
<TextBlock Text="&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;打印数量" FontSize="18" Foreground="White" HorizontalAlignment="Center" VerticalAlignment="Center" />
1 year ago
<Slider x:Name="PlanAmount" FontSize="18" Minimum="0" Maximum="500" BorderBrush="White" Value="{Binding PrintAmount,Mode=TwoWay}" Foreground="White" Height="30" VerticalContentAlignment="Center"
HorizontalContentAlignment="Left" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="15 0 0 0" Width="{Binding Path=ActualWidth, ElementName=ProductNo}"/>
<!--<TextBlock Text="1~500" Width="60" Margin="10 0 0 0" Foreground="White" FontWeight="Bold" VerticalAlignment="Center" HorizontalAlignment="Center" />-->
</WrapPanel>
<Border Grid.Row="5" BorderBrush="#0288d1" BorderThickness="1" CornerRadius="5" Width="420" >
<StackPanel >
1 year ago
<WrapPanel Height="300">
1 year ago
<RadioButton Content="内胆码-L" Foreground="White" FontSize="18" BorderBrush="White" x:Name="内胆" Margin="30 15" Command="{Binding RadioQueryCommand}" CommandParameter="{Binding Name, ElementName=内胆}"/>
<RadioButton Content="箱体码-B" Foreground="White" FontSize="18" BorderBrush="White" x:Name="箱体" Margin="30 15" Command="{Binding RadioQueryCommand}" CommandParameter="{Binding Name, ElementName=箱体}"/>
</WrapPanel>
1 year ago
<!--<Button Content="添加" Foreground="White" BorderBrush="#0288d1" Background="#4285DE" HorizontalAlignment="Right" VerticalAlignment="Bottom" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" />-->
</StackPanel>
1 year ago
</Border>
<WrapPanel Grid.Row="6" HorizontalAlignment="Center">
<Button
1 year ago
Background="#4285DE" Height="40"
1 year ago
Content="常规" Width="100" Margin="0 10 0 0" Command="{Binding PrintCommand}" IsEnabled="{Binding PrintIsEnabled}" CommandParameter="{Binding ElementName=ProductNo,Path=Text}"/>
<Button
1 year ago
Background="#4285DE" Height="40"
1 year ago
Content="补打" Margin="5 10 0 0" Width="100" Command="{Binding SupplementPrintCommand}" CommandParameter="{Binding ElementName=ProductNo,Path=Text}"
IsEnabled="{Binding DataContext.ControlsEnabled, RelativeSource={RelativeSource FindAncestor, AncestorType=Window}}"/>
<Button
1 year ago
Background="#4285DE" Height="40"
1 year ago
Content="追加" Margin="5 10 0 0" Width="100" Command="{Binding AppendPrintPrintCommand}" CommandParameter="{Binding ElementName=ProductNo,Path=Text}"
IsEnabled="{Binding DataContext.ControlsEnabled, RelativeSource={RelativeSource FindAncestor, AncestorType=Window}}"/>
<Button
1 year ago
Background="#4285DE" Height="40"
1 year ago
Content="特殊" Margin="5 10 0 0" Width="100" Command="{Binding SpecialPrintCommand}"
IsEnabled="{Binding DataContext.ControlsEnabled, RelativeSource={RelativeSource FindAncestor, AncestorType=Window}}" />
</WrapPanel>
</Grid>
</Border>
</UniformGrid>
</Grid>
</UserControl>