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.

361 lines
26 KiB
XML

<UserControl x:Class="Aucma.Core.SheetMetal.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:lvc="clr-namespace:LiveChartsCore.SkiaSharpView.WPF;assembly=LiveChartsCore.SkiaSharpView.WPF"
xmlns:local="clr-namespace:Aucma.Core.SheetMetal.Views"
mc:Ignorable="d"
d:DesignHeight="800"
d:DesignWidth="1000" >
<UserControl.Resources>
<Style x:Key="DataGridTextColumnCenterSytle" TargetType="{x:Type TextBlock}">
<Setter Property="VerticalAlignment" Value="Center" />
</Style>
<Style x:Key="ColumnHeaderStyle" TargetType="DataGridColumnHeader">
<Setter Property="HorizontalContentAlignment" Value="Center"/>
<Setter Property="Background" Value="#dddddd"/>
</Style>
</UserControl.Resources>
<Grid Margin="5,5">
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<Border Grid.Row="0" Grid.Column="0" BorderBrush="#0288d1" BorderThickness="1" CornerRadius="5" Background="Transparent" Margin="1,1,5,5">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="9*"/>
</Grid.RowDefinitions>
<Border Grid.Row="0" BorderBrush="#0288d1" BorderThickness="0,0,0,1" CornerRadius="0" Background="Transparent" 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" Background="Transparent" Margin="1,1,5,5">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="7*"/>
<ColumnDefinition Width="5*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Border Grid.Column="0" BorderBrush="Red" BorderThickness="0" Background="Transparent" CornerRadius="5" >
<Grid>
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<StackPanel Grid.Row="0" Grid.Column="0" Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Center" >
<TextBlock Text="工位名称" FontSize="15" Foreground="Gray" />
<TextBox FontSize="15" Text="{Binding StationName}" Foreground="Gray" Width="200" IsReadOnly="True" Margin="30,0,0,0" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" />
</StackPanel>
<StackPanel Grid.Row="1" Grid.Column="0" Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Center" >
<TextBlock Text="订单编号" FontSize="15" Foreground="Gray"/>
<TextBox FontSize="15" Text="{Binding OrderCode}" Foreground="Gray" Width="200" IsReadOnly="True" Margin="30,0,0,0" HorizontalContentAlignment="Center" VerticalContentAlignment="Center"/>
</StackPanel>
<StackPanel Grid.Row="2" Grid.Column="0" Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Center" >
<TextBlock Text="计划编号" FontSize="15" Foreground="Gray"/>
<TextBox FontSize="15" Text="{Binding PlanCode}" Foreground="Gray" Width="200" IsReadOnly="True" Margin="30,0,0,0" HorizontalContentAlignment="Center" VerticalContentAlignment="Center"/>
</StackPanel>
<StackPanel Grid.Row="3" Grid.Column="0" Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Center" >
<TextBlock Text="产品型号" FontSize="15" Foreground="Gray"/>
<TextBox FontSize="15" Text="{Binding ProductModel}" Foreground="Gray" Width="200" IsReadOnly="True" Margin="30,0,0,0" HorizontalContentAlignment="Center" VerticalContentAlignment="Center"/>
</StackPanel>
<StackPanel Grid.Row="4" Grid.Column="0" Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Center" >
<TextBlock Text="开始时间" FontSize="15" Foreground="Gray"/>
<TextBox FontSize="15" Text="{Binding BeginTime}" Foreground="Gray" Width="200" IsReadOnly="True" Margin="30,0,0,0" HorizontalContentAlignment="Center" VerticalContentAlignment="Center"/>
<Button Content="测试" Command="{Binding TestCommand}" />
</StackPanel>
</Grid>
</Border>
<Border Grid.Column="1" BorderBrush="#0288d1" BorderThickness="0" Background="Transparent" CornerRadius="5" Margin="0,10,0,0">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="4*"/>
<RowDefinition Height="4*"/>
<RowDefinition Height="2*"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Border Grid.Row="0" Grid.Column="0" BorderBrush="CadetBlue" BorderThickness="0" CornerRadius="5" >
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="2*"/>
<RowDefinition Height="7*"/>
</Grid.RowDefinitions>
<Border Grid.Row="0" BorderBrush="#0288d1" BorderThickness="0" CornerRadius="0" Background="Transparent" Margin="1,1,0,0" >
<TextBlock Text="计划数量" FontSize="15" FontWeight="Bold" Foreground="#0288d1" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Border>
<Border Grid.Row="1" BorderBrush="#0288d1" BorderThickness="0" CornerRadius="0" Background="Transparent" Margin="1,1,0,0" >
<lvc:PieChart Foreground="#0288d1"
Series="{Binding Plan_Num ,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
></lvc:PieChart>
</Border>
</Grid>
</Border>
<Border Grid.Row="0" Grid.Column="1" BorderBrush="#0288d1" BorderThickness="0" CornerRadius="5" Margin="5,0,0,0">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="2*"/>
<RowDefinition Height="7*"/>
</Grid.RowDefinitions>
<Border Grid.Row="0" BorderBrush="#0288d1" BorderThickness="0" CornerRadius="0" Background="Transparent" Margin="1,1,0,0" >
<TextBlock Text="实际数量" FontSize="15" FontWeight="Bold" Foreground="#0288d1" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Border>
<Border Grid.Row="1" BorderBrush="#0288d1" BorderThickness="0" CornerRadius="0" Background="Transparent" Margin="1,1,0,0" >
<lvc:PieChart Foreground="#0288d1"
Series="{Binding Plan_Num}"
MinValue="0"
MaxValue="100"></lvc:PieChart>
</Border>
</Grid>
</Border>
<Border Grid.Row="1" Grid.Column="0" BorderBrush="#0288d1" BorderThickness="0" CornerRadius="5" Margin="5,0,0,0">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="2*"/>
<RowDefinition Height="7*"/>
</Grid.RowDefinitions>
<Border Grid.Row="0" BorderBrush="#0288d1" BorderThickness="0" CornerRadius="0" Background="Transparent" Margin="1,1,0,0" >
<TextBlock Text="差异数量" FontSize="15" FontWeight="Bold" Foreground="#0288d1" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Border>
<Border Grid.Row="1" BorderBrush="#0288d1" BorderThickness="0" CornerRadius="0" Background="Transparent" Margin="1,1,0,0" >
<lvc:PieChart Foreground="Red"
Series="{Binding Plan_Num}"
MinValue="0"
MaxValue="100"></lvc:PieChart>
</Border>
</Grid>
</Border>
<Border Grid.Row="1" Grid.Column="1" BorderBrush="#0288d1" BorderThickness="0" CornerRadius="5" Margin="5,0,0,0">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="2*"/>
<RowDefinition Height="7*"/>
</Grid.RowDefinitions>
<Border Grid.Row="0" BorderBrush="CadetBlue" BorderThickness="0" CornerRadius="0" Background="Transparent" Margin="1,1,0,0" >
<TextBlock Text="完成率" FontSize="15" FontWeight="Bold" Foreground="#0288d1" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Border>
<Border Grid.Row="1" BorderBrush="CadetBlue" BorderThickness="0" CornerRadius="0" Background="Transparent" Margin="1,1,0,0" >
<lvc:PieChart Foreground="#0288d1"
Series="{Binding Plan_Num}"
MinValue="0"
MaxValue="100"></lvc:PieChart>
</Border>
</Grid>
</Border>
</Grid>
</Border>
</Grid>
</Border>
</Grid>
</Border>
<!--日产量-->
<Border Grid.Row="0" Grid.Column="1" BorderBrush="#0288d1" BorderThickness="1" CornerRadius="5" Background="Transparent" Margin="1,1,5,5">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="9*"/>
</Grid.RowDefinitions>
<Border Grid.Row="0" BorderBrush="#0288d1" BorderThickness="0,0,0,1" CornerRadius="0" Background="Transparent" 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" Background="Transparent" Margin="1,1,5,5">
<Border Grid.Row="1" BorderBrush="#0288d1" BorderThickness="0" CornerRadius="5" Background="Transparent" Margin="1,1,5,5">
<Grid Margin="10,10">
<lvc:CartesianChart Series="{Binding Series}" XAxes="{Binding XAxes}"/>
</Grid>
</Border>
</Border>
</Grid>
</Border>
<!--计划列表-->
<Border Grid.Row="1" Grid.Column="0" BorderBrush="#0288d1" BorderThickness="1" CornerRadius="5" Background="Transparent" Margin="1,1,5,5">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="9*"/>
</Grid.RowDefinitions>
<Border Grid.Row="0" BorderBrush="#0288d1" BorderThickness="0,0,0,1" CornerRadius="0" Background="Transparent" Margin="1,1,5,5" >
<TextBlock Text="计划列表" FontSize="20" FontWeight="Bold" Foreground="#0288d1" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Border>
<!--计划列表-->
<Border Grid.Row="1" Grid.Column="0" BorderBrush="#0288d1" BorderThickness="0" CornerRadius="5" Background="Transparent" Margin="1,1,5,5">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="6*"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<DataGrid Grid.Row="0" ItemsSource="{Binding PlanInfoDataGrid}" Background="#00000000"
ColumnHeaderHeight="35"
RowHeight="50" AutoGenerateColumns="False" RowHeaderWidth="0"
GridLinesVisibility="None" ScrollViewer.HorizontalScrollBarVisibility="Hidden"
ScrollViewer.VerticalScrollBarVisibility="Hidden" BorderThickness="0" CanUserAddRows="False" SelectionMode="Single" IsReadOnly="True"
Foreground="Gray" >
<DataGrid.Columns>
<DataGridTextColumn Binding="{Binding ID}" Header="主键" Width="auto" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}" Visibility="Hidden" />
<DataGridTextColumn Binding="{Binding PlanCode}" Header="计划编号" Width="auto" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}" Visibility="Hidden" />
<!--<DataGridTextColumn Binding="{Binding IsExec}" x:Name="ExecControl" Header="执行" Width="1*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}" />-->
<!--<DataGridTextColumn Binding="{Binding MaterialName}" Header="产品型号" Width="3.5*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}" />-->
<DataGridTemplateColumn Header="产品型号" Width="3.5*">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<Border x:Name="levelControl" VerticalAlignment="Center">
<StackPanel >
<TextBlock x:Name="txtName" TextWrapping="Wrap" Text="{Binding MaterialName}" ToolTip="{Binding MaterialName}" />
<TextBlock Text="{Binding IsExec}" Visibility="Collapsed" />
</StackPanel>
</Border>
<DataTemplate.Triggers>
<DataTrigger Binding="{Binding IsExec}" Value="2">
<Setter TargetName="txtName" Property="Foreground" Value="Green" ></Setter>
</DataTrigger>
</DataTemplate.Triggers>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn Header="计划" Width="0.95*">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<Border x:Name="levelControl" VerticalAlignment="Center">
<StackPanel >
<TextBlock x:Name="txtName" TextWrapping="Wrap" Text="{Binding TaskAmount}" ToolTip="{Binding TaskAmount}" />
<TextBlock Text="{Binding IsExec}" Visibility="Collapsed" />
</StackPanel>
</Border>
<DataTemplate.Triggers>
<DataTrigger Binding="{Binding IsExec}" Value="2">
<Setter TargetName="txtName" Property="Foreground" Value="Green" ></Setter>
</DataTrigger>
</DataTemplate.Triggers>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn Header="完成" Width="0.95*">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<Border x:Name="levelControl" VerticalAlignment="Center">
<StackPanel >
<TextBlock x:Name="txtName" TextWrapping="Wrap" Text="{Binding CompleteAmount}" ToolTip="{Binding CompleteAmount}" />
<TextBlock Text="{Binding IsExec}" Visibility="Collapsed" />
</StackPanel>
</Border>
<DataTemplate.Triggers>
<DataTrigger Binding="{Binding IsExec}" Value="2">
<Setter TargetName="txtName" Property="Foreground" Value="Green" ></Setter>
</DataTrigger>
</DataTemplate.Triggers>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn Header="开始时间" Width="2*" >
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<Border x:Name="levelControl" VerticalAlignment="Center">
<StackPanel >
<TextBlock x:Name="txtName" TextWrapping="Wrap" Text="{Binding BeginTime,StringFormat=\{0:MM-dd HH:mm\}}" ToolTip="{Binding BeginTime}" MinWidth="20" />
<TextBlock Text="{Binding IsExec}" Visibility="Collapsed" />
</StackPanel>
</Border>
<DataTemplate.Triggers>
<DataTrigger Binding="{Binding IsExec}" Value="1">
<Setter TargetName="txtName" Property="Foreground" Value="Green" ></Setter>
</DataTrigger>
</DataTemplate.Triggers>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<!--<DataGridTextColumn Binding="{Binding TaskAmount}" Header="计划" Width="0.95*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Binding="{Binding CompleteAmount}" Header="完成" Width="0.95*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Binding="{Binding BeginTime ,StringFormat=\{0:MM-dd HH:mm\}}" Header="开始时间" Width="1.7*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>-->
<DataGridTemplateColumn Header="操作" Width="4*" >
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<WrapPanel>
<Button Content="上移" FontSize="12" CommandParameter="{Binding ID}" Margin="0 2 0 2" Command="{Binding DataContext.MoveUpCommand, RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=DataGrid }}" />
<Button Content="下移" FontSize="12" CommandParameter="{Binding ID}" Margin="2 2 0 2" Command="{Binding DataContext.MoveDownCommand, RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=DataGrid }}" />
<Button Content="删除" FontSize="12" CommandParameter="{Binding ID}" Margin="2 2 0 2" Command="{Binding DataContext.DeletePlanCommand, RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=DataGrid }}" />
<Button Content="下传" FontSize="12" CommandParameter="{Binding ID}" Margin="2 2 0 2" Command="{Binding DataContext.NextPassCommand, RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=DataGrid }}" />
</WrapPanel>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
</DataGrid.Columns>
</DataGrid>
<Border Grid.Row="1" BorderBrush="#0288d1" BorderThickness="0,0,0,1">
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Right" Margin="0,0,20,0">
<TextBlock Text="执行方式" VerticalAlignment="Center" Foreground="Gray" FontSize="15" Margin="20,0,0,0"/>
<ComboBox Text="{Binding MaterialTypeCombox}" Width="200" Height="25" Margin="10 0 0 0" Foreground="Black" VerticalAlignment="Center" FontSize="15">
<ComboBoxItem Content="手动" IsSelected="True"/>
<ComboBoxItem Content="自动" />
</ComboBox>
<Button Content="计划维护" Command="{Binding SplitPlanCommand}" Margin="20,0,0,0" BorderBrush="DeepSkyBlue" BorderThickness="1" />
</StackPanel>
</Border>
</Grid>
</Border>
</Grid>
</Border>
<!--型号统计-->
<Border Grid.Row="1" Grid.Column="1" BorderBrush="#0288d1" BorderThickness="1" CornerRadius="5" Background="Transparent" Margin="1,1,5,5">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="9*"/>
</Grid.RowDefinitions>
<Border Grid.Row="0" BorderBrush="#0288d1" BorderThickness="0,0,0,1" CornerRadius="0" Background="Transparent" 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" Background="Transparent" Margin="1,1,5,5">
<Grid Margin="10,10">
<lvc:CartesianChart Series="{Binding Series}" XAxes="{Binding XAxes}"/>
<!--<lvc:CartesianChart
Series="{Binding ModelSeries}"
XAxes="{Binding XModelAxes}"
YAxes="{Binding YModelAxes}"
TooltipPosition="Hidden">
</lvc:CartesianChart>-->
</Grid>
</Border>
</Grid>
</Border>
</Grid>
</UserControl>