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.
171 lines
14 KiB
XML
171 lines
14 KiB
XML
<Window
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
|
|
xmlns:local="clr-namespace:Aucma.Core.SheetMetal.Views"
|
|
x:Class="Aucma.Core.SheetMetal.Views.SplitPlanView"
|
|
mc:Ignorable="d"
|
|
Background="White"
|
|
Title="计划维护" MinHeight="600" MinWidth="1000">
|
|
|
|
<Window.Resources>
|
|
<Style x:Key="DataGridTextColumnCenterSytle" TargetType="{x:Type TextBlock}">
|
|
<Setter Property="VerticalAlignment" Value="Center" />
|
|
</Style>
|
|
<Style x:Key="ColumnHeaderStyle" TargetType="{x:Type DataGridColumnHeader}">
|
|
<Setter Property="HorizontalContentAlignment" Value="Center"/>
|
|
<Setter Property="Background" Value="#dddddd"/>
|
|
</Style>
|
|
|
|
<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" />
|
|
<Setter Property="Width" Value="30" />
|
|
</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>
|
|
<TextBox Grid.RowSpan="2" Height="Auto" Margin="0" Padding="0" VerticalAlignment="Stretch" VerticalContentAlignment="Center" Text="{Binding RelativeSource={RelativeSource Mode=TemplatedParent}, Path=Value}">
|
|
<!-- 给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>
|
|
<RepeatButton Grid.Row="0" Grid.Column="1" Command="{x:Static Slider.IncreaseSmall}" Style="{StaticResource RepeatButtonStyle}">
|
|
<Path Data="M4,0 L0,4 8,4 Z" Fill="Black" />
|
|
</RepeatButton>
|
|
<RepeatButton Grid.Row="1" Grid.Column="1" Command="{x:Static Slider.DecreaseSmall}" Style="{StaticResource RepeatButtonStyle}">
|
|
<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>
|
|
</Window.Resources>
|
|
|
|
<Border Grid.Row="1" Grid.Column="1" BorderBrush="#0288d1" BorderThickness="1" CornerRadius="5" Margin="5">
|
|
<Grid>
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="0.8*"/>
|
|
<RowDefinition Height="9*"/>
|
|
</Grid.RowDefinitions>
|
|
<Border Grid.Row="0" BorderBrush="#0288d1" BorderThickness="0,0,0,1" CornerRadius="0" Margin="1,1,5,5" >
|
|
<TextBlock Text="计划维护" FontSize="20" FontWeight="Bold" Foreground="#0288d1" VerticalAlignment="Center" HorizontalAlignment="Center"/>
|
|
</Border>
|
|
<Border Grid.Row="1" BorderBrush="#0288d1" BorderThickness="0" CornerRadius="5" Margin="1,1,5,5">
|
|
<Grid>
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="2*"/>
|
|
<ColumnDefinition/>
|
|
</Grid.ColumnDefinitions>
|
|
<UniformGrid Grid.Column="0" Margin="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" />
|
|
<TextBox x:Name="queryParam" Text="" Style="{x:Null}" Width="200" HorizontalAlignment="Left" VerticalContentAlignment="Center" />
|
|
<Button Content="查询" Margin="9,0,4,0" Width="100" Command="{Binding QueryPlanCommand}" CommandParameter="{Binding Text, ElementName=queryParam}"/>
|
|
</WrapPanel>
|
|
<UniformGrid Grid.Row="1">
|
|
<DataGrid ItemsSource="{Binding MaterialDataGrid}" Background="#00000000"
|
|
ColumnHeaderHeight="35" x:Name="dgvMH"
|
|
RowHeight="50" AutoGenerateColumns="False" RowHeaderWidth="0"
|
|
GridLinesVisibility="None" VerticalAlignment="Stretch"
|
|
ScrollViewer.VerticalScrollBarVisibility="Visible" ScrollViewer.HorizontalScrollBarVisibility="Visible"
|
|
BorderThickness="0" CanUserAddRows="False" SelectionMode="Single" IsReadOnly="True"
|
|
Foreground="Gray" SelectedItem="{Binding SelectedCells, Mode=OneWayToSource}">
|
|
|
|
<DataGrid.Columns>
|
|
<DataGridTextColumn Binding="{Binding No}" Header="序号" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
|
|
<DataGridTextColumn MinWidth="160" Binding="{Binding PlanCode}" Header="计划号" Width="2*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
|
|
<DataGridTextColumn MinWidth="160" Binding="{Binding MaterialCode}" Header="物料编号" Width="2*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
|
|
<DataGridTextColumn MinWidth="160" Binding="{Binding MaterialName}" Header="物料名称" Width="4*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
|
|
<DataGridTextColumn MinWidth="160" Binding="{Binding OrderCode}" Header="订单编码" Width="2*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
|
|
<DataGridTextColumn MinWidth="160" Binding="{Binding PlanAmount}" Header="计划" Width="1*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
|
|
<DataGridTextColumn MinWidth="160" Binding="{Binding ResidueAmount}" Header="剩余" Width="1*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
|
|
<DataGridTextColumn MinWidth="160" Binding="{Binding SpliteResidueAmount}" Header="计划可拆分数量" Width="1*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
|
|
</DataGrid.Columns>
|
|
</DataGrid>
|
|
</UniformGrid>
|
|
</Grid>
|
|
</UniformGrid>
|
|
<Border Grid.Column="1" BorderBrush="#0288d1" BorderThickness="1" CornerRadius="5" Margin="5">
|
|
<Grid Margin="5 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="Gray" HorizontalAlignment="Center" VerticalAlignment="Center" />
|
|
<TextBox x:Name="PlanCode" Text="{Binding SelectedItem.PlanCode, ElementName=dgvMH}" IsReadOnly="True" FontSize="15" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" Margin="15 0 0 0" MinWidth="200"
|
|
materialDesign:HintAssist.Hint="计划编码" />
|
|
</WrapPanel>
|
|
<WrapPanel Grid.Row="1" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0 15">
|
|
<TextBlock Text="订单编码" FontSize="15" Foreground="Gray" HorizontalAlignment="Center" VerticalAlignment="Center" />
|
|
<TextBox x:Name="OrderCode" Text="{Binding SelectedItem.OrderCode, ElementName=dgvMH}" IsReadOnly="True" FontSize="15" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" Margin="15 0 0 0" Width="{Binding Path=ActualWidth, ElementName=PlanCode}"
|
|
materialDesign:HintAssist.Hint="订单编码" />
|
|
</WrapPanel>
|
|
|
|
<WrapPanel Grid.Row="2" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0 5">
|
|
<TextBlock Text="物料编码" FontSize="15" Foreground="Gray" HorizontalAlignment="Center" VerticalAlignment="Center" />
|
|
<TextBox x:Name="OrderNo" Text="{Binding SelectedItem.MaterialCode, ElementName=dgvMH}" IsReadOnly="True" Margin="15 0 0 0 " FontSize="15" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" Width="{Binding Path=ActualWidth, ElementName=PlanCode}"
|
|
materialDesign:HintAssist.Hint="物料编码" />
|
|
</WrapPanel>
|
|
|
|
<WrapPanel Grid.Row="3" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0 15">
|
|
<TextBlock Text="物料名称" FontSize="15" Foreground="Gray" HorizontalAlignment="Center" VerticalAlignment="Center" />
|
|
<TextBox x:Name="MaterialName" Text="{Binding SelectedItem.MaterialName, ElementName=dgvMH}" IsReadOnly="True" Margin="15 0 0 0" FontSize="15" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" Width="{Binding Path=ActualWidth, ElementName=PlanCode}"
|
|
materialDesign:HintAssist.Hint="物料名称" />
|
|
</WrapPanel>
|
|
|
|
<WrapPanel Grid.Row="4" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0 15">
|
|
<TextBlock Text="可拆分数量" FontSize="15" Foreground="Gray" HorizontalAlignment="Center" VerticalAlignment="Center" />
|
|
<!--<TextBox x:Name="SpliteResidueAmount" Text="{Binding SelectedItem.SpliteResidueAmount, ElementName=dgvMH}" Margin="15 0 0 0" materialDesign:HintAssist.Hint="可拆分数量" FontSize="15" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" Width="{Binding Path=ActualWidth, ElementName=PlanCode}"/>-->
|
|
<Slider x:Name="SpliteResidueAmount" Minimum="0" Maximum="100" Value="90" Foreground="white" Height="30" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="15 0 0 0" FontSize="15" Width="{Binding Path=ActualWidth, ElementName=PlanCode}"/>
|
|
</WrapPanel>
|
|
<WrapPanel Grid.Row="5" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0 15">
|
|
<Button Content="手动创建" Margin="5" Command="{Binding CreateTaskCommand}" CommandParameter="{Binding Text, ElementName=OrderCode}"/>
|
|
</WrapPanel>
|
|
</Grid>
|
|
</Border>
|
|
</Grid>
|
|
</Border>
|
|
</Grid>
|
|
</Border>
|
|
</Window>
|