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.

341 lines
22 KiB
XML

<Window x:Class="XGLFinishPro.Views.ExecReportWorkWin"
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:hc="https://handyorg.github.io/handycontrol"
xmlns:local="clr-namespace:XGLFinishPro.Views"
xmlns:convert="clr-namespace:XGLFinishPro.Tools"
mc:Ignorable="d"
Title="CheckUserWin" Height="750" Width="1350" WindowStartupLocation="CenterScreen" WindowStyle="None" Loaded="Window_Loaded">
<Window.Resources>
<ResourceDictionary>
<!--ComboBox下拉按钮-->
<Style TargetType="ToggleButton" x:Key="ComboxStyleBtn">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate>
<Border x:Name="Back" Background="#F7FDF7" BorderThickness="1" BorderBrush="Transparent">
<Path Name="PathFill" Fill="Blue" Width="8" Height="6" StrokeThickness="0" Data="M5,0 L10,10 L0,10 z" RenderTransformOrigin="0.5,0.5" Stretch="Fill">
<Path.RenderTransform>
<TransformGroup>
<ScaleTransform/>
<SkewTransform/>
<RotateTransform Angle="180"/>
<TranslateTransform/>
</TransformGroup>
</Path.RenderTransform>
</Path>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="PathFill" Property="Fill" Value="White"></Setter>
<Setter TargetName="Back" Property="Background" Value="#3697A4"></Setter>
<Setter TargetName="Back" Property="BorderBrush" Value="#3697A4"></Setter>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style TargetType="ComboBox" x:Key="ComboBoxStyle">
<Setter Property="ItemContainerStyle">
<Setter.Value>
<!--ComBoxItem #59CA4F #81D779-->
<Style TargetType="ComboBoxItem">
<Setter Property="Height" Value="60"></Setter>
<Setter Property="MinHeight" Value="22"></Setter>
<Setter Property="MinWidth" Value="60"></Setter>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ComboBoxItem">
<Border Name="Back" Background="Transparent" CornerRadius="5,5,5,5"
RenderTransformOrigin="0.5,0.5" BorderThickness="0,0,0,0" BorderBrush="Blue" >
<ContentPresenter ContentSource="{Binding Source}" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="5,0,0,0"></ContentPresenter>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="Back" Property="Background" Value="LightGray"></Setter>
</Trigger>
<Trigger Property="IsHighlighted" Value="True">
<Setter TargetName="Back" Property="Background" Value="LightGray"></Setter>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</Setter.Value>
</Setter>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ComboBox">
<Grid Background="#F7FDF7">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="0.7*"/>
<ColumnDefinition Width="0.3*" MaxWidth="30"/>
</Grid.ColumnDefinitions>
<TextBox x:Name="PART_EditableTextBox" Grid.Column="0" IsReadOnly="{TemplateBinding IsReadOnly}" FontSize="18" VerticalContentAlignment="Center" Text="{TemplateBinding Text}"></TextBox>
<Border Grid.Column="0" BorderThickness="1,1,0,1" BorderBrush="LightGray" CornerRadius="1,0,0,1">
</Border>
<Border Grid.Column="1" BorderThickness="0,1,1,1" BorderBrush="LightGray" CornerRadius="0,1,1,0">
<ToggleButton Style="{StaticResource ComboxStyleBtn}" IsChecked="{Binding Path=IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" ClickMode="Press"></ToggleButton>
</Border>
<Popup IsOpen="{TemplateBinding IsDropDownOpen}" Placement="Bottom" x:Name="Popup" Focusable="False" AllowsTransparency="True" PopupAnimation="Slide">
<Border CornerRadius="1" MaxHeight="{TemplateBinding MaxDropDownHeight}" MinWidth="{TemplateBinding ActualWidth}" x:Name="DropDown" SnapsToDevicePixels="True">
<Border.Effect>
<DropShadowEffect Color="Black" BlurRadius="2" ShadowDepth="0" Opacity="0.5"/>
</Border.Effect>
<ScrollViewer Margin="4,6,4,6" Style="{DynamicResource ScrollViewerStyle}" MaxHeight="{TemplateBinding MaxDropDownHeight}" SnapsToDevicePixels="True" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto" CanContentScroll="True">
<!-- StackPanel 用于显示子级,方法是将 IsItemsHost 设置为 True -->
<StackPanel IsItemsHost="True" KeyboardNavigation.DirectionalNavigation="Contained" Background="White"/>
</ScrollViewer>
</Border>
</Popup>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style TargetType="TextBox">
<Setter Property="Height" Value="40"/>
<Setter Property="Margin" Value="5"/>
<Setter Property="Background" Value="Red"></Setter>
<Setter Property="VerticalContentAlignment" Value="Center"/>
<Setter Property="Template" >
<Setter.Value>
<ControlTemplate TargetType="TextBox">
<Border BorderThickness="2" CornerRadius="8" Background="#f2f3f5">
<ScrollViewer x:Name="PART_ContentHost" />
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style TargetType="Label">
<Setter Property="Margin" Value="15,0,0,0"/>
<Setter Property="Foreground" Value="Black"/>
</Style>
<Style x:Key="CustomCellStyle" TargetType="DataGridCell">
<Setter Property="Foreground" Value="Black" />
<Setter Property="TextBlock.TextAlignment" Value="Center" />
<Setter Property="TextBlock.FontSize" Value="22" />
<Setter Property="BorderThickness" Value="0 0 1 1" />
</Style>
<SolidColorBrush x:Key="EvenRowBackground" Color="#E0E0E0"/>
<SolidColorBrush x:Key="OddRowBackground" Color="#FFFFFF"/>
<Style x:Key="DataGridRowStyle" TargetType="DataGridRow">
<Setter Property="VerticalContentAlignment" Value="Center"/>
<Setter Property="HorizontalContentAlignment" Value="Center"/>
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="BorderBrush" Value="LightGray"/>
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="Background" Value="{StaticResource EvenRowBackground}"/>
<Style.Triggers>
<Trigger Property="ItemsControl.AlternationIndex" Value="1">
<Setter Property="Background" Value="{StaticResource OddRowBackground}"/>
</Trigger>
</Style.Triggers>
</Style>
<Style x:Key="btnKey" TargetType="Button">
<Setter Property="Width" Value="120"/>
<Setter Property="Height" Value="43"/>
<Setter Property="Foreground" Value="White"/>
<Setter Property="FontSize" Value="22"/>
<Setter Property="FontWeight" Value="Bold"/>
<Setter Property="HorizontalContentAlignment" Value="Center"/>
<Setter Property="HorizontalAlignment" Value="Right"/>
<Setter Property="Template" >
<Setter.Value>
<ControlTemplate TargetType="Button">
<Border x:Name="Back" Background="#2B7EE6" BorderThickness="2" CornerRadius="10">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="Back" Property="Background" Value="#3697A4"></Setter>
<Setter TargetName="Back" Property="BorderBrush" Value="#3697A4"></Setter>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="btnCancelKey" TargetType="Button">
<Setter Property="Width" Value="120"/>
<Setter Property="Height" Value="43"/>
<Setter Property="Foreground" Value="Black"/>
<Setter Property="FontSize" Value="22"/>
<Setter Property="FontWeight" Value="Bold"/>
<Setter Property="HorizontalContentAlignment" Value="Center"/>
<Setter Property="HorizontalAlignment" Value="Right"/>
<Setter Property="Template" >
<Setter.Value>
<ControlTemplate TargetType="Button">
<Border x:Name="Back" Background="#f2f3f5" BorderThickness="2" CornerRadius="10">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="Back" Property="Background" Value="#3697A4"></Setter>
<Setter TargetName="Back" Property="BorderBrush" Value="#3697A4"></Setter>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>
</Window.Resources>
<Grid >
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="40"/>
<RowDefinition Height="200"/>
<RowDefinition Height="500"/>
</Grid.RowDefinitions>
<Label Grid.Row="0" Grid.ColumnSpan="2" x:Name="lbTitle" HorizontalAlignment="Left" VerticalAlignment="Center" Foreground="Black" FontSize="24" Content="报工" FontWeight="Bold"></Label>
<ScrollViewer x:Name="scrollViewer" Grid.Row="1" Grid.ColumnSpan="2" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto">
<Grid x:Name="MyGrid" Grid.Row="1" Grid.ColumnSpan="2">
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Left" Grid.Row="1">
<Label Grid.Row="1" HorizontalAlignment="Left" VerticalAlignment="Center" FontSize="24" Content="当前工单:"></Label>
<Label x:Name="lbCurrOrderNo" Grid.Row="1" HorizontalAlignment="Left" VerticalAlignment="Center" FontSize="24" Content="202311010001" Width="260"></Label>
</StackPanel>
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Left" Grid.Row="1" Grid.Column="1">
<Label Grid.Row="1" HorizontalAlignment="Left" VerticalAlignment="Center" FontSize="24" Content="报工数量:"></Label>
<TextBox x:Name="txtQuantity" Grid.Row="1" HorizontalAlignment="Left" VerticalAlignment="Center" FontSize="24" Width="260" TextChanged="txtQuantity_TextChanged"></TextBox>
</StackPanel>
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Left" Grid.Row="2">
<Label Grid.Row="1" HorizontalAlignment="Left" VerticalAlignment="Center" FontSize="24" Content="工 时:"></Label>
<TextBox x:Name="txtWorkTime" Grid.Row="1" HorizontalAlignment="Left" VerticalAlignment="Center" FontSize="24" Width="260" TextChanged="txtWorkTime_TextChanged"></TextBox>
</StackPanel>
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Left" Grid.Row="2" Grid.Column="1">
<Label Grid.Row="1" HorizontalAlignment="Left" VerticalAlignment="Center" FontSize="24" Content="人 数:"></Label>
<TextBox x:Name="txtUserCount" Grid.Row="1" HorizontalAlignment="Left" VerticalAlignment="Center" FontSize="24" Width="260" TextChanged="txtUserCount_TextChanged"></TextBox>
</StackPanel>
<!--<StackPanel Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Left" Grid.Row="3" Grid.Column="1">
<Label Grid.Row="1" HorizontalAlignment="Left" VerticalAlignment="Center" FontSize="24" Content="母单人数:"></Label>
<TextBox x:Name="txtFOUserCount" Grid.Row="1" HorizontalAlignment="Left" VerticalAlignment="Center" FontSize="24" Width="260" TextChanged="txtFOUserCount_TextChanged"></TextBox>
</StackPanel>-->
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Left" Grid.Row="13" Grid.Column="0" Grid.ColumnSpan="2">
<Label Grid.Row="1" HorizontalAlignment="Left" VerticalAlignment="Center" FontSize="24" Content="成本中心:"></Label>
<ComboBox x:Name="comboBoxCostCenter" Grid.Row="1" HorizontalAlignment="Left" VerticalAlignment="Center" FontSize="24" Width="360" Height="50"
Style="{StaticResource ComboBoxStyle}" SelectionChanged="comboBoxCostCenter_SelectionChanged"></ComboBox>
</StackPanel>
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Left" Grid.Row="13" Grid.Column="1" Grid.ColumnSpan="2">
<Label Grid.Row="1" HorizontalAlignment="Left" VerticalAlignment="Center" FontSize="24" Content="批 次 号:"></Label>
<ComboBox x:Name="comboBoxBatch" Grid.Row="1" HorizontalAlignment="Left" VerticalAlignment="Center" FontSize="24" Margin="2,5,0,0" Width="360" Height="50" Style="{StaticResource ComboBoxStyle}"></ComboBox>
<TextBlock Text="* 不选批次号则默认为该工单报工&#x0a;* 不选批次号则无法创建批次成品检验任务" Foreground="Red" VerticalAlignment="Center" TextWrapping="Wrap" />
</StackPanel>
</Grid>
</ScrollViewer>
<!--<Grid.Background>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="#FF2281D1"></GradientStop>
<GradientStop Color="AliceBlue" Offset="0.8"></GradientStop>
<GradientStop Color="AliceBlue" Offset="1"></GradientStop>
</LinearGradientBrush>
</Grid.Background>-->
<Grid Grid.Row="2" Grid.ColumnSpan="2">
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="380"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<DataGrid x:Name="dgConsumeInfo" Grid.Row="0" Grid.ColumnSpan="2" Background="#0000"
GridLinesVisibility="All" HorizontalGridLinesBrush="AliceBlue" VerticalGridLinesBrush="AliceBlue"
AlternatingRowBackground="LightGray"
RowBackground="White"
LoadingRow="dgConsumeInfo_LoadingRow"
CanUserAddRows="False"
AutoGenerateColumns="False"
HeadersVisibility="Column"
SelectionMode="Single"
CellEditEnding="dgConsumeInfo_CellEditEnding"
RowStyle="{StaticResource DataGridRowStyle}"
CellStyle="{StaticResource CustomCellStyle}" MinRowHeight="35">
<DataGrid.ColumnHeaderStyle >
<Style TargetType="DataGridColumnHeader">
<Setter Property="HorizontalContentAlignment" Value="Center" />
<Setter Property="Height" Value="48" />
<Setter Property="FontSize" Value="20" />
<Setter Property="Foreground" Value="Gray" />
<Setter Property="Background" Value="#f7f9fe" />
</Style>
</DataGrid.ColumnHeaderStyle>
<DataGrid.Columns>
<DataGridTemplateColumn Header=" 序号" Width="50" MinWidth="10" IsReadOnly="True">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock Text="{Binding RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type DataGridRow}}, Path=Header}" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="10,0,0,0"></TextBlock>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<!--如果新增列,需要调整用量的取值序号-->
<DataGridTextColumn Width="250" Header="组件编码" Binding="{Binding material_code1}" IsReadOnly="True"/>
<DataGridTextColumn Width="250" Header="组件编码" Binding="{Binding material_code}" Visibility="Hidden" IsReadOnly="True"/>
<DataGridTextColumn Width="350" Header="组件名称" Binding="{Binding material_name}" IsReadOnly="True"/>
<DataGridTextColumn Width="100" Header="单位" Binding="{Binding unit}" IsReadOnly="True"/>
<DataGridTextColumn Width="100" Header="反冲标识" Binding="{Binding recoil}" IsReadOnly="True"/>
<DataGridTextColumn Width="120" Header="领取数" Binding="{Binding quantity}" IsReadOnly="True" />
<DataGridTextColumn Width="120" Header="实际用量" Binding="{Binding qty}" IsReadOnly="False"></DataGridTextColumn>
<DataGridTextColumn Width="100" Header="母单" Binding="{Binding parent_work_order}" IsReadOnly="True" Visibility="Hidden"/>
<DataGridTextColumn Width="180" Header="母单" Binding="{Binding workorder_code_sap}" IsReadOnly="True" />
<DataGridTextColumn Width="100" Header="备注" Binding="{Binding remark}" IsReadOnly="False" />
<!--<DataGridTextColumn Width="250" Header="物料组" Binding="{Binding productGroup}" IsReadOnly="True"/>
<DataGridTextColumn Width="250" Header="组名称" Binding="{Binding productGroupName}" IsReadOnly="True"/>-->
</DataGrid.Columns>
</DataGrid>
<Label x:Name="tbMsg" Width="600" Height="40" Grid.Row="1" Grid.ColumnSpan="2" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" VerticalAlignment="Center" FontSize="24" Foreground="Red" FontWeight="Bold"></Label>
<CheckBox Content="最终报工" Height="auto" Grid.Row="2" Margin="15,20,0,0" FontSize="10" ToolTip="选择后将结束该工单" IsChecked="False" HorizontalAlignment="Left" VerticalContentAlignment="Center" Click="xuanze9_Click" Name="xuanze9" Checked="xuanze9_Checked">
<CheckBox.LayoutTransform >
<ScaleTransform ScaleX="2" ScaleY="2" />
</CheckBox.LayoutTransform>
</CheckBox>
<Button x:Name="btnOK" Grid.Row="2" Grid.Column="1" Style="{StaticResource btnKey}" Content="确定" Margin="30,20,20,0" Click="btnOK_Click"/>
<Button x:Name="btnCancel" Grid.Row="2" Grid.Column="1" Style="{StaticResource btnCancelKey}" Background="Gray" Content="取消" Margin="30,20,170,0" Click="btnCancel_Click"/>
</Grid>
</Grid>
</Window>