<UserControl x:Class="Aucma.Core.SheetMetal.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:lvc="clr-namespace:LiveCharts.Wpf;assembly=LiveCharts.Wpf" xmlns:local="clr-namespace:Aucma.Core.SheetMetal.Views" mc:Ignorable="d" Background="#1152AC" FontFamily="Microsoft YaHei" d:DesignHeight="1080" d:DesignWidth="1920" > <UserControl.Resources> <Style x:Key="DataGridTextColumnCenterSytle" TargetType="{x:Type TextBlock}"> <Setter Property="VerticalAlignment" Value="Center" /> <Setter Property="FontSize" Value="15"/> </Style> <Style TargetType="DataGrid"> <!--网格线颜色--> <Setter Property="CanUserResizeColumns" Value="false"/> <Setter Property="Background" Value="#1152AC" /> <Setter Property="BorderBrush" Value="#4285DE" /> <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="#4285DE" /> <Setter Property="Height" Value="40"/> <Setter Property="FontSize" Value="18"/> <Setter Property="Background" Value="#4285DE"/> <Setter Property="Foreground" Value="White"/> <Setter Property="FontFamily" Value="Microsoft YaHei"/> </Style> <!--单元格样式--> <Style TargetType="DataGridCell"> <Setter Property="FocusVisualStyle" Value="{x:Null}" /> <Setter Property="BorderThickness" Value="0" /> <Setter Property="BorderBrush" Value="#4285DE" /> <Setter Property="Height" Value="40"/> <Setter Property="FontSize" Value="18"/> <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> <DataTrigger Binding="{Binding ExecuteStatus}" Value="2"> <Setter Property="Background" Value="#0FD1E2" /> </DataTrigger> </Style.Triggers> </Style> </UserControl.Resources> <Grid Margin="0,5 0 0"> <Grid.Resources> <Style TargetType="TextBlock"> <Setter Property="VerticalAlignment" Value="Center"/> <Setter Property="HorizontalAlignment" Value="Center"/> <Setter Property="FontSize" Value="16"/> <Setter Property="FontFamily" Value="微软雅黑"/> </Style> <Style TargetType="Border"> <Setter Property="BorderBrush" Value="#0288d1"/> <Setter Property="BorderThickness" Value="1"/> </Style> </Grid.Resources> <Grid.ColumnDefinitions> <ColumnDefinition Width="7.5*"/> <ColumnDefinition Width="6*"/> </Grid.ColumnDefinitions> <Grid.RowDefinitions> <RowDefinition/> <RowDefinition/> </Grid.RowDefinitions> <!--计划执行--> <Border Grid.Row="0" Grid.Column="0" BorderBrush="#0288d1" BorderThickness="1" CornerRadius="5" Background="Transparent" Margin="5 0 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="#1157b9" Margin="1,1,5,5" > <TextBlock Text="计划执行" FontSize="20" FontWeight="Bold" Foreground="White" 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" 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="Right" > <TextBlock Text="工位名称" FontSize="18" Foreground="White" /> <TextBox FontSize="18" Text="{Binding StationName}" Foreground="White" BorderBrush="White" Width="300" IsReadOnly="True" Margin="30,0,0,0" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" /> </StackPanel> <StackPanel Grid.Row="1" Grid.Column="0" Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Right" > <TextBlock Text="SAP计划编号" FontSize="18" Foreground="White"/> <TextBox FontSize="18" Text="{Binding OrderCode}" Foreground="White" BorderBrush="White" Width="300" IsReadOnly="True" Margin="30,0,0,0" HorizontalContentAlignment="Center" VerticalContentAlignment="Center"/> </StackPanel> <StackPanel Grid.Row="2" Grid.Column="0" Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Right" > <TextBlock Text="MES工单编号" FontSize="18" Foreground="White"/> <TextBox FontSize="18" Text="{Binding MesOrderCode}" Foreground="White" BorderBrush="White" Width="300" IsReadOnly="True" Margin="30,0,0,0" HorizontalContentAlignment="Center" VerticalContentAlignment="Center"/> </StackPanel> <StackPanel Grid.Row="3" Grid.Column="0" Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Right" > <TextBlock Text="成品型号" FontSize="18" Foreground="White"/> <TextBox FontSize="18" Text="{Binding ProductModel}" Foreground="White" BorderBrush="White" Width="300" IsReadOnly="True" Margin="30,0,0,0" HorizontalContentAlignment="Center" VerticalContentAlignment="Center"/> </StackPanel> <StackPanel Grid.Row="4" Grid.Column="0" Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Right" > <TextBlock Text="开始时间" FontSize="18" Foreground="White"/> <TextBox FontSize="18" Text="{Binding BeginTime}" Foreground="White" BorderBrush="White" Width="300" IsReadOnly="True" Margin="30,0,0,0" HorizontalContentAlignment="Center" VerticalContentAlignment="Center"/> </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="SAP订单数量" FontSize="18" FontWeight="Bold" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Center"/> </Border> <Border Grid.Row="1" BorderBrush="#0288d1" BorderThickness="0" CornerRadius="0" Background="Transparent" Margin="1,1,0,0" > <lvc:Gauge Margin="5" DisableAnimations="True" Uses360Mode="True" From="0" To="{Binding PlanMaxNum,Mode=TwoWay}" Value="{Binding PlanMaxNum,Mode=TwoWay}" Foreground="White"/> </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="18" FontWeight="Bold" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Center"/> </Border> <Border Grid.Row="1" BorderBrush="#0288d1" BorderThickness="0" CornerRadius="0" Background="Transparent" Margin="1,1,0,0" > <lvc:Gauge Margin="5" DisableAnimations="True" Uses360Mode="True" From="0" To="{Binding PlanMaxNum,Mode=TwoWay}" Value="{Binding RealQuantity,Mode=TwoWay}" Foreground="White" /> </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" BorderThickness="0" CornerRadius="0" Background="Transparent" Margin="1,1,0,0" > <TextBlock Text="差异数量" FontSize="18" FontWeight="Bold" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Center"/> </Border> <Border Grid.Row="1" BorderThickness="0" CornerRadius="0" Background="Transparent" Margin="1,1,0,0" > <lvc:Gauge DisableAnimations="True" Margin="5" Uses360Mode="True" From="0" To="{Binding PlanMaxNum,Mode=TwoWay}" Value="{Binding DiffQuantity,Mode=TwoWay}" Foreground="White"/> </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" BorderThickness="0" CornerRadius="0" Background="Transparent" Margin="1,1,0,0" > <TextBlock Text="订单完成率" FontSize="18" FontWeight="Bold" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Center"/> </Border> <Border Grid.Row="1" BorderThickness="0" CornerRadius="0" Background="Transparent" Margin="1,1,0,0" > <lvc:Gauge Margin="5" DisableAnimations="True" Uses360Mode="True" From="0" To="1" Value="{Binding CompletionRate,Mode=TwoWay}" Foreground="White"/> </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="0 0 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="#1157b9" Margin="1,1,5,5" > <TextBlock Text="当日产量" FontSize="20" FontWeight="Bold" Foreground="White" 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 Achievement, UpdateSourceTrigger=PropertyChanged}" DisableAnimations="True" LegendLocation="Top" Foreground="White"> <lvc:CartesianChart.DataTooltip > <lvc:DefaultTooltip SelectionMode="OnlySender" BulletSize="10" Foreground="Black"></lvc:DefaultTooltip> </lvc:CartesianChart.DataTooltip> <lvc:CartesianChart.AxisX > <lvc:Axis Labels="{Binding ProductionHourList}" FontSize="18" Foreground="White" LabelsRotation="0" DisableAnimations="True" Position="LeftBottom" > <lvc:Axis.Separator> <lvc:Separator Visibility="Hidden" StrokeThickness="1" StrokeDashArray="0" Stroke="#404F56" Step="1" > </lvc:Separator> </lvc:Axis.Separator> </lvc:Axis> </lvc:CartesianChart.AxisX> <lvc:CartesianChart.AxisY> <lvc:Axis FontSize="18" Foreground="White" MinValue="0"> <lvc:Axis.Separator> <lvc:Separator Visibility="Hidden" StrokeThickness="1" StrokeDashArray="3" Step="10" Stroke="#404F56" > </lvc:Separator> </lvc:Axis.Separator> </lvc:Axis> </lvc:CartesianChart.AxisY> </lvc:CartesianChart> </Grid> </Border> </Border> </Grid> </Border> <!--计划列表--> <Border Grid.Row="1" Grid.Column="0" BorderBrush="#0288d1" BorderThickness="1" CornerRadius="5" Background="Transparent" Margin="5 0 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="#1157b9" Margin="5 5 5 5"> <TextBlock Text="计划列表" FontSize="20" FontWeight="Bold" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Center"/> </Border> <!--计划列表--> <Border Grid.Row="1" Grid.Column="0" Background="Transparent" Margin="1,1,5,5"> <Grid> <Grid.RowDefinitions> <RowDefinition Height="6*"/> <RowDefinition Height="*"/> </Grid.RowDefinitions> <DataGrid x:Name="dgvMH" ItemsSource="{Binding PlanInfoDataGrid}" HorizontalAlignment="Center" VerticalAlignment="Top" AlternationCount="2" RowHeaderWidth="0" ColumnWidth="*" AutoGenerateColumns="False" IsReadOnly="True" CanUserAddRows="False" SelectionMode="Single" Foreground="White" SelectedItem="{Binding SelectedCells, Mode=OneWayToSource}" FontSize="15"> <DataGrid.Columns > <DataGridTextColumn Binding="{Binding ID}" Header="主键" Width="auto" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}" Visibility="Hidden" /> <DataGridTextColumn Binding="{Binding No}" x:Name="No" Header="编号" Width="0.5*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}" /> <DataGridTextColumn Binding="{Binding TaskCode}" Header="计划编号" Width="1.8*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}" /> <DataGridTextColumn Binding="{Binding MaterialName}" Header="物料型号" Width="2.5*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}" /> <DataGridTextColumn Binding="{Binding TaskAmount}" Header="计划" Width="0.6*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/> <DataGridTextColumn Binding="{Binding SidePanelAmount}" Header="前板" Width="0.6*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/> <DataGridTextColumn Binding="{Binding BackPanelAmount}" Header="后板" Width="0.6*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/> <DataGridTextColumn Binding="{Binding PlanType}" Header="计划类型" Width="1*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/> <DataGridTextColumn Binding="{Binding Recipe}" Header="配方" Width="1*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/> <DataGridTextColumn Binding="{Binding BeginTime ,StringFormat=\{0:MM-dd HH:mm\}}" Header="开始时间" Width="1.2*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/> <DataGridTextColumn Binding="{Binding ExecuteStatus}" Header="执行状态" Visibility="Collapsed"/> <DataGridTemplateColumn Header="操作" Width="2*" > <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" Background="#df4642" BorderBrush="#df4642" 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.MoveDownCommand, 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="White" FontSize="20" Margin="20,0,0,0"/> <ComboBox Width="200" Height="30" Margin="10 0 0 0" FontSize="18" ItemsSource="{Binding LocationSource,Mode=OneWay}" Style="{x:Null}" Background="#1152AC" VerticalAlignment="Center" SelectedItem="{Binding SelectLocation,Mode=TwoWay}" SelectedValuePath="SelectedModel" DisplayMemberPath="TypeName" SelectedValue="{Binding SelectLocation,Mode=TwoWay}"> <!--<ComboBoxItem Content="手动" IsSelected="True"/> <ComboBoxItem Content="自动" />--> </ComboBox> <Button Content="计划创建" Command="{Binding SplitPlanCommand}" Margin="20,0,0,0" FontSize="18" Height="40" BorderThickness="1" /> <Button Content="物料库存" Command="{Binding InventoryStatisticsCommand}" Margin="20,0,0,0" FontSize="18" Height="40" 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="#1157b9" Margin="1,1,5,5" > <TextBlock Text="型号统计" FontSize="20" FontWeight="Bold" Foreground="White" 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 LegendLocation="Top" Series="{Binding ModelStatistics, UpdateSourceTrigger=PropertyChanged}" DisableAnimations="True" Foreground="White"> <lvc:CartesianChart.DataTooltip> <lvc:DefaultTooltip BulletSize="10" Foreground="Black"></lvc:DefaultTooltip> </lvc:CartesianChart.DataTooltip> <lvc:CartesianChart.AxisX> <lvc:Axis Labels="{Binding MaterialNameList}" FontSize="18" Foreground="White"> <lvc:Axis.Separator> <lvc:Separator Step="1" Visibility="Hidden" StrokeThickness="1" StrokeDashArray="0" Stroke="#404F56" > </lvc:Separator> </lvc:Axis.Separator> </lvc:Axis> </lvc:CartesianChart.AxisX> <lvc:CartesianChart.AxisY> <lvc:Axis FontSize="18" Foreground="White" MinValue="0"> <lvc:Axis.Separator> <lvc:Separator Visibility="Hidden" StrokeThickness="1" StrokeDashArray="3" Step="10" Stroke="#404F56" > </lvc:Separator> </lvc:Axis.Separator> </lvc:Axis> </lvc:CartesianChart.AxisY> </lvc:CartesianChart> </Grid> </Border> </Grid> </Border> </Grid> </UserControl>