2026-05-14 15:52:00 +08:00
|
|
|
<hc:Window x:Class="YY.Admin.Views.RawMaterialEntry.RawMaterialCardGenerateConfirmWindow"
|
|
|
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
|
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
|
|
|
xmlns:hc="https://handyorg.github.io/handycontrol"
|
|
|
|
|
xmlns:wv2="clr-namespace:Microsoft.Web.WebView2.Wpf;assembly=Microsoft.Web.WebView2.Wpf"
|
|
|
|
|
Width="1416"
|
|
|
|
|
Height="864"
|
|
|
|
|
MinWidth="1176"
|
|
|
|
|
MinHeight="744"
|
|
|
|
|
Title="生成并打印原材料卡片"
|
|
|
|
|
ResizeMode="CanResize">
|
|
|
|
|
<Grid Margin="16">
|
|
|
|
|
<Grid.RowDefinitions>
|
|
|
|
|
<RowDefinition Height="Auto"/>
|
|
|
|
|
<RowDefinition Height="*"/>
|
|
|
|
|
<RowDefinition Height="Auto"/>
|
|
|
|
|
</Grid.RowDefinitions>
|
|
|
|
|
|
|
|
|
|
<Grid Grid.Row="0" Margin="0,0,0,10">
|
|
|
|
|
<Grid.ColumnDefinitions>
|
|
|
|
|
<ColumnDefinition Width="*"/>
|
|
|
|
|
<ColumnDefinition Width="Auto"/>
|
|
|
|
|
</Grid.ColumnDefinitions>
|
|
|
|
|
<StackPanel Grid.Column="0">
|
|
|
|
|
<TextBlock Text="即将生成的原材料卡片"
|
|
|
|
|
FontSize="16"
|
|
|
|
|
FontWeight="SemiBold"/>
|
|
|
|
|
<TextBlock Text="{Binding HeaderText}"
|
|
|
|
|
Margin="0,4,0,0"
|
|
|
|
|
FontSize="12"
|
|
|
|
|
Foreground="#8C8C8C"/>
|
|
|
|
|
</StackPanel>
|
|
|
|
|
<StackPanel Grid.Column="1"
|
|
|
|
|
Orientation="Horizontal"
|
|
|
|
|
VerticalAlignment="Center">
|
|
|
|
|
<TextBlock Text="打印机:"
|
|
|
|
|
VerticalAlignment="Center"
|
|
|
|
|
Margin="0,0,6,0"/>
|
|
|
|
|
<ComboBox Width="300"
|
|
|
|
|
Height="34"
|
|
|
|
|
ItemsSource="{Binding Printers}"
|
|
|
|
|
SelectedItem="{Binding SelectedPrinter, Mode=TwoWay}"
|
|
|
|
|
DisplayMemberPath="Name"
|
|
|
|
|
VerticalContentAlignment="Center"/>
|
|
|
|
|
<Button Content="刷新打印机"
|
|
|
|
|
Height="34"
|
|
|
|
|
Margin="8,0,8,0"
|
|
|
|
|
Padding="12,0"
|
|
|
|
|
Click="RefreshPrintersButton_OnClick"/>
|
|
|
|
|
<TextBlock Text="{Binding PrinterStatus}"
|
|
|
|
|
VerticalAlignment="Center"
|
|
|
|
|
Foreground="#595959"/>
|
|
|
|
|
</StackPanel>
|
|
|
|
|
</Grid>
|
|
|
|
|
|
|
|
|
|
<Grid Grid.Row="1">
|
|
|
|
|
<Grid.ColumnDefinitions>
|
|
|
|
|
<ColumnDefinition x:Name="LeftPaneCol" Width="7*"/>
|
|
|
|
|
<ColumnDefinition Width="10"/>
|
|
|
|
|
<ColumnDefinition x:Name="RightPaneCol" Width="3*"/>
|
|
|
|
|
</Grid.ColumnDefinitions>
|
|
|
|
|
|
|
|
|
|
<Border Grid.Column="0"
|
|
|
|
|
BorderBrush="#E5E6EB"
|
|
|
|
|
BorderThickness="1"
|
|
|
|
|
CornerRadius="4"
|
|
|
|
|
Padding="0"
|
|
|
|
|
Background="#FFFFFF">
|
|
|
|
|
<DataGrid x:Name="PlanGrid"
|
|
|
|
|
ItemsSource="{Binding PlanItems}"
|
|
|
|
|
SelectedItem="{Binding SelectedPlanItem, Mode=TwoWay}"
|
|
|
|
|
AutoGenerateColumns="False"
|
2026-05-15 15:46:25 +08:00
|
|
|
EnableRowVirtualization="False"
|
|
|
|
|
EnableColumnVirtualization="False"
|
2026-05-14 15:52:00 +08:00
|
|
|
HeadersVisibility="Column"
|
|
|
|
|
CanUserResizeColumns="True"
|
|
|
|
|
CanUserReorderColumns="False"
|
|
|
|
|
CanUserSortColumns="False"
|
|
|
|
|
CanUserAddRows="False"
|
|
|
|
|
CanUserDeleteRows="False"
|
|
|
|
|
IsReadOnly="True"
|
|
|
|
|
GridLinesVisibility="None"
|
|
|
|
|
HorizontalGridLinesBrush="Transparent"
|
|
|
|
|
VerticalGridLinesBrush="Transparent"
|
|
|
|
|
BorderThickness="0"
|
|
|
|
|
RowHeaderWidth="0"
|
|
|
|
|
SelectionMode="Single"
|
|
|
|
|
SelectionUnit="FullRow"
|
|
|
|
|
ScrollViewer.HorizontalScrollBarVisibility="Auto"
|
2026-05-15 15:46:25 +08:00
|
|
|
ScrollViewer.VerticalScrollBarVisibility="Auto">
|
2026-05-14 15:52:00 +08:00
|
|
|
<DataGrid.Resources>
|
|
|
|
|
<Style x:Key="CenteredCellTextStyle" TargetType="TextBlock">
|
2026-05-15 15:46:25 +08:00
|
|
|
<Setter Property="Foreground" Value="#262626"/>
|
2026-05-14 15:52:00 +08:00
|
|
|
<Setter Property="HorizontalAlignment" Value="Center"/>
|
|
|
|
|
<Setter Property="VerticalAlignment" Value="Center"/>
|
|
|
|
|
<Setter Property="TextAlignment" Value="Center"/>
|
|
|
|
|
</Style>
|
|
|
|
|
</DataGrid.Resources>
|
|
|
|
|
<DataGrid.ColumnHeaderStyle>
|
|
|
|
|
<Style TargetType="DataGridColumnHeader">
|
|
|
|
|
<Setter Property="HorizontalContentAlignment" Value="Center"/>
|
|
|
|
|
<Setter Property="VerticalContentAlignment" Value="Center"/>
|
|
|
|
|
<Setter Property="FontWeight" Value="SemiBold"/>
|
|
|
|
|
<Setter Property="MinHeight" Value="36"/>
|
|
|
|
|
<Setter Property="Padding" Value="8,6"/>
|
|
|
|
|
<Setter Property="VerticalAlignment" Value="Center"/>
|
|
|
|
|
</Style>
|
|
|
|
|
</DataGrid.ColumnHeaderStyle>
|
2026-05-15 15:46:25 +08:00
|
|
|
<!-- 勿覆盖默认选中配色:显式写出 IsSelected/悬停背景 + 深色文字,避免出现白字白底、“整表发白”的假死感 -->
|
2026-05-14 15:52:00 +08:00
|
|
|
<DataGrid.RowStyle>
|
|
|
|
|
<Style TargetType="DataGridRow">
|
2026-05-15 15:46:25 +08:00
|
|
|
<Setter Property="SnapsToDevicePixels" Value="True"/>
|
2026-05-14 15:52:00 +08:00
|
|
|
<Setter Property="BorderThickness" Value="0"/>
|
|
|
|
|
<Setter Property="BorderBrush" Value="Transparent"/>
|
|
|
|
|
<Setter Property="Background" Value="#FFFFFF"/>
|
2026-05-15 15:46:25 +08:00
|
|
|
<Style.Triggers>
|
|
|
|
|
<Trigger Property="IsMouseOver" Value="True">
|
|
|
|
|
<Setter Property="Background" Value="#F5F5F5"/>
|
|
|
|
|
</Trigger>
|
|
|
|
|
<Trigger Property="IsSelected" Value="True">
|
|
|
|
|
<Setter Property="Background" Value="#E6F7FF"/>
|
|
|
|
|
</Trigger>
|
|
|
|
|
</Style.Triggers>
|
2026-05-14 15:52:00 +08:00
|
|
|
</Style>
|
|
|
|
|
</DataGrid.RowStyle>
|
|
|
|
|
<DataGrid.CellStyle>
|
|
|
|
|
<Style TargetType="DataGridCell">
|
|
|
|
|
<Setter Property="BorderThickness" Value="0"/>
|
|
|
|
|
<Setter Property="BorderBrush" Value="Transparent"/>
|
|
|
|
|
<Setter Property="Padding" Value="8,10"/>
|
|
|
|
|
<Setter Property="Background" Value="Transparent"/>
|
2026-05-15 15:46:25 +08:00
|
|
|
<Setter Property="Foreground" Value="#262626"/>
|
2026-05-14 15:52:00 +08:00
|
|
|
<Setter Property="HorizontalContentAlignment" Value="Center"/>
|
|
|
|
|
<Setter Property="VerticalContentAlignment" Value="Center"/>
|
|
|
|
|
<Setter Property="VerticalAlignment" Value="Center"/>
|
|
|
|
|
<Setter Property="TextBlock.TextAlignment" Value="Center"/>
|
2026-05-15 15:46:25 +08:00
|
|
|
<Style.Triggers>
|
|
|
|
|
<Trigger Property="IsSelected" Value="True">
|
|
|
|
|
<Setter Property="Foreground" Value="#1F1F1F"/>
|
|
|
|
|
<Setter Property="Background" Value="Transparent"/>
|
|
|
|
|
</Trigger>
|
|
|
|
|
</Style.Triggers>
|
2026-05-14 15:52:00 +08:00
|
|
|
</Style>
|
|
|
|
|
</DataGrid.CellStyle>
|
|
|
|
|
<DataGrid.Columns>
|
|
|
|
|
<DataGridTextColumn Header="#" Binding="{Binding Index}" Width="70" MinWidth="60" ElementStyle="{StaticResource CenteredCellTextStyle}"/>
|
|
|
|
|
<DataGridTextColumn Header="条码" Binding="{Binding Card.Barcode}" Width="220" MinWidth="170" ElementStyle="{StaticResource CenteredCellTextStyle}"/>
|
|
|
|
|
<DataGridTextColumn Header="来源行" Binding="{Binding SourceRowNo}" Width="90" MinWidth="70" ElementStyle="{StaticResource CenteredCellTextStyle}"/>
|
|
|
|
|
<DataGridTextColumn Header="物料名称" Binding="{Binding Card.MaterialName}" Width="220" MinWidth="160" ElementStyle="{StaticResource CenteredCellTextStyle}"/>
|
|
|
|
|
<DataGridTextColumn Header="批次号" Binding="{Binding Card.BatchNo}" Width="220" MinWidth="160" ElementStyle="{StaticResource CenteredCellTextStyle}"/>
|
|
|
|
|
<DataGridTextColumn Header="库位" Binding="{Binding Card.WarehouseArea}" Width="150" MinWidth="100" ElementStyle="{StaticResource CenteredCellTextStyle}"/>
|
|
|
|
|
</DataGrid.Columns>
|
|
|
|
|
</DataGrid>
|
|
|
|
|
</Border>
|
|
|
|
|
|
|
|
|
|
<GridSplitter Grid.Column="1"
|
|
|
|
|
Width="10"
|
|
|
|
|
HorizontalAlignment="Stretch"
|
|
|
|
|
VerticalAlignment="Stretch"
|
|
|
|
|
Background="Transparent"
|
|
|
|
|
ResizeBehavior="PreviousAndNext"
|
|
|
|
|
Cursor="SizeWE"
|
|
|
|
|
DragCompleted="MainSplitter_OnDragCompleted"/>
|
|
|
|
|
|
|
|
|
|
<Border Grid.Column="2"
|
|
|
|
|
BorderBrush="#E5E6EB"
|
|
|
|
|
BorderThickness="1"
|
|
|
|
|
CornerRadius="4"
|
|
|
|
|
Background="#FFFFFF">
|
|
|
|
|
<Grid>
|
|
|
|
|
<Grid.RowDefinitions>
|
|
|
|
|
<RowDefinition Height="Auto"/>
|
|
|
|
|
<RowDefinition Height="*"/>
|
|
|
|
|
</Grid.RowDefinitions>
|
|
|
|
|
<StackPanel Grid.Row="0" Margin="10,8,10,8">
|
|
|
|
|
<TextBlock Text="打印模板预览" FontSize="14" FontWeight="SemiBold"/>
|
|
|
|
|
<TextBlock Text="{Binding TemplateText}" Margin="0,4,0,0" FontSize="12" Foreground="#8C8C8C"/>
|
|
|
|
|
</StackPanel>
|
2026-05-15 15:46:25 +08:00
|
|
|
<!-- 与入场页预览区一致:加载 NavigateToString 间隙减少刺眼的整片白闪烁 -->
|
|
|
|
|
<wv2:WebView2 x:Name="PreviewWebView" Grid.Row="1" DefaultBackgroundColor="#FF525659"/>
|
2026-05-14 15:52:00 +08:00
|
|
|
</Grid>
|
|
|
|
|
</Border>
|
|
|
|
|
</Grid>
|
|
|
|
|
|
|
|
|
|
<StackPanel Grid.Row="2"
|
|
|
|
|
Orientation="Horizontal"
|
|
|
|
|
HorizontalAlignment="Right"
|
|
|
|
|
Margin="0,12,0,0">
|
|
|
|
|
<Button Content="取消"
|
|
|
|
|
Width="92"
|
|
|
|
|
Height="34"
|
|
|
|
|
Margin="0,0,10,0"
|
|
|
|
|
Click="CancelButton_OnClick"
|
|
|
|
|
Style="{StaticResource ButtonDefault}"/>
|
|
|
|
|
<Button Content="生成并打印"
|
|
|
|
|
Width="120"
|
|
|
|
|
Height="34"
|
|
|
|
|
Click="ConfirmButton_OnClick"
|
|
|
|
|
Style="{StaticResource ButtonPrimary}"/>
|
|
|
|
|
</StackPanel>
|
|
|
|
|
</Grid>
|
|
|
|
|
</hc:Window>
|