431 lines
25 KiB
XML
431 lines
25 KiB
XML
<UserControl x:Class="YY.Admin.Views.RawMaterialEntry.RawMaterialEntryEditDialogView"
|
||
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:hc="https://handyorg.github.io/handycontrol"
|
||
xmlns:ctrls="clr-namespace:YY.Admin.Controls"
|
||
xmlns:prism="http://prismlibrary.com/"
|
||
prism:ViewModelLocator.AutoWireViewModel="True"
|
||
mc:Ignorable="d"
|
||
Width="1280"
|
||
MinWidth="1100"
|
||
MinHeight="500">
|
||
|
||
<Grid Background="{DynamicResource ThirdlyRegionBrush}">
|
||
<Grid.RowDefinitions>
|
||
<RowDefinition Height="Auto"/>
|
||
<RowDefinition Height="*"/>
|
||
<RowDefinition Height="Auto"/>
|
||
</Grid.RowDefinitions>
|
||
|
||
<!-- 标题栏 -->
|
||
<hc:SimplePanel Margin="24,20,24,12">
|
||
<TextBlock FontSize="18" Foreground="{DynamicResource PrimaryTextBrush}" Text="{Binding DialogTitle}" HorizontalAlignment="Left" VerticalAlignment="Center"/>
|
||
<Button Width="22" Height="22" Command="hc:ControlCommands.Close" Style="{StaticResource ButtonIcon}"
|
||
Foreground="{DynamicResource PrimaryBrush}" hc:IconElement.Geometry="{StaticResource ErrorGeometry}"
|
||
Padding="0" HorizontalAlignment="Right" VerticalAlignment="Center"/>
|
||
</hc:SimplePanel>
|
||
|
||
<!-- 表单区域 -->
|
||
<hc:ScrollViewer Grid.Row="1" IsInertiaEnabled="True">
|
||
<StackPanel x:Name="RootPanel" Margin="24,8,24,8">
|
||
<hc:Row Gutter="16">
|
||
|
||
<!-- 密炼物料选择(弹窗) -->
|
||
<hc:Col Span="16">
|
||
<Grid Margin="0,0,0,8">
|
||
<Grid.ColumnDefinitions>
|
||
<ColumnDefinition Width="80"/>
|
||
<ColumnDefinition Width="*"/>
|
||
<ColumnDefinition Width="60"/>
|
||
<ColumnDefinition Width="32"/>
|
||
</Grid.ColumnDefinitions>
|
||
<TextBlock Grid.Column="0" Text="密炼物料" VerticalAlignment="Center"
|
||
FontSize="14" Foreground="{DynamicResource PrimaryTextBrush}"/>
|
||
<Border Grid.Column="1" CornerRadius="4" Height="34"
|
||
BorderBrush="{DynamicResource BorderBrush}" BorderThickness="1"
|
||
Background="{DynamicResource ThirdlyRegionBrush}">
|
||
<TextBlock Text="{Binding SelectedMaterialDisplay}" VerticalAlignment="Center"
|
||
Margin="8,0" FontSize="13" TextTrimming="CharacterEllipsis">
|
||
<TextBlock.Style>
|
||
<Style TargetType="TextBlock">
|
||
<Setter Property="Foreground" Value="{DynamicResource SecondaryTextBrush}"/>
|
||
<Style.Triggers>
|
||
<DataTrigger Binding="{Binding HasSelectedMaterial}" Value="True">
|
||
<Setter Property="Foreground" Value="{DynamicResource PrimaryTextBrush}"/>
|
||
</DataTrigger>
|
||
</Style.Triggers>
|
||
</Style>
|
||
</TextBlock.Style>
|
||
</TextBlock>
|
||
</Border>
|
||
<Button Grid.Column="2" Content="选 择"
|
||
Command="{Binding OpenMaterialPickerCommand}"
|
||
Style="{StaticResource ButtonPrimary}"
|
||
Height="34" Margin="6,0,0,0" FontSize="12"/>
|
||
<Button Grid.Column="3"
|
||
Command="{Binding ClearMaterialCommand}"
|
||
Style="{StaticResource ButtonIcon}"
|
||
Height="34" Width="28" Margin="4,0,0,0" Padding="0"
|
||
ToolTip="清除物料"
|
||
Foreground="{DynamicResource SecondaryTextBrush}"
|
||
hc:IconElement.Geometry="{StaticResource ErrorGeometry}"/>
|
||
</Grid>
|
||
</hc:Col>
|
||
|
||
<!-- 物料名称(只读回显) -->
|
||
<hc:Col Span="8">
|
||
<hc:TextBox Text="{Binding Entry.MaterialName}"
|
||
Height="34"
|
||
IsReadOnly="True"
|
||
hc:InfoElement.Title="物料名称"
|
||
hc:InfoElement.TitleWidth="80"
|
||
hc:InfoElement.TitlePlacement="Left"
|
||
Foreground="{DynamicResource SecondaryTextBrush}"
|
||
Margin="0,0,0,8"/>
|
||
</hc:Col>
|
||
|
||
<!-- 条码 -->
|
||
<hc:Col Span="8">
|
||
<hc:TextBox Text="{Binding Entry.Barcode, UpdateSourceTrigger=PropertyChanged}"
|
||
Height="34"
|
||
hc:InfoElement.Title="条码"
|
||
hc:InfoElement.TitleWidth="80"
|
||
hc:InfoElement.TitlePlacement="Left"
|
||
hc:InfoElement.Placeholder="请输入条码"
|
||
hc:InfoElement.ShowClearButton="True"
|
||
Margin="0,0,0,8"/>
|
||
</hc:Col>
|
||
|
||
<!-- 批次号 -->
|
||
<hc:Col Span="8">
|
||
<hc:TextBox Text="{Binding Entry.BatchNo, UpdateSourceTrigger=PropertyChanged}"
|
||
Height="34"
|
||
hc:InfoElement.Title="批次号"
|
||
hc:InfoElement.TitleWidth="80"
|
||
hc:InfoElement.TitlePlacement="Left"
|
||
hc:InfoElement.Placeholder="请输入批次号"
|
||
hc:InfoElement.ShowClearButton="True"
|
||
Margin="0,0,0,8"/>
|
||
</hc:Col>
|
||
|
||
<!-- 入场时间:DateTimePicker 弹出层自带「此刻 / 确定」,可同时选择年/月/日/时/分/秒 -->
|
||
<hc:Col Span="8">
|
||
<DockPanel Margin="0,0,0,8" LastChildFill="True">
|
||
<TextBlock DockPanel.Dock="Left" Text="入场时间" Width="80"
|
||
VerticalAlignment="Center"
|
||
Foreground="{DynamicResource PrimaryTextBrush}"/>
|
||
<ctrls:DateTimeListPicker SelectedDateTime="{Binding Entry.EntryTime, Mode=TwoWay}"
|
||
DateTimeFormat="yyyy-MM-dd HH:mm:ss"
|
||
Placeholder="请选择入场时间"/>
|
||
</DockPanel>
|
||
</hc:Col>
|
||
|
||
<!-- 榜单号(弹窗选择) -->
|
||
<hc:Col Span="8">
|
||
<Grid Margin="0,0,0,8">
|
||
<Grid.ColumnDefinitions>
|
||
<ColumnDefinition Width="80"/>
|
||
<ColumnDefinition Width="*"/>
|
||
<ColumnDefinition Width="60"/>
|
||
<ColumnDefinition Width="32"/>
|
||
</Grid.ColumnDefinitions>
|
||
<TextBlock Grid.Column="0" Text="榜单号" VerticalAlignment="Center"
|
||
FontSize="14" Foreground="{DynamicResource PrimaryTextBrush}"/>
|
||
<Border Grid.Column="1" CornerRadius="4" Height="34"
|
||
BorderBrush="{DynamicResource BorderBrush}" BorderThickness="1"
|
||
Background="{DynamicResource ThirdlyRegionBrush}">
|
||
<TextBlock Text="{Binding Entry.BillNo}" VerticalAlignment="Center"
|
||
Margin="8,0" FontSize="13" TextTrimming="CharacterEllipsis"
|
||
Foreground="{DynamicResource PrimaryTextBrush}"/>
|
||
</Border>
|
||
<Button Grid.Column="2" Content="选 择"
|
||
Command="{Binding OpenWeightRecordPickerCommand}"
|
||
Style="{StaticResource ButtonPrimary}"
|
||
Height="34" Margin="6,0,0,0" FontSize="12"/>
|
||
<Button Grid.Column="3"
|
||
Command="{Binding ClearWeightRecordCommand}"
|
||
Style="{StaticResource ButtonIcon}"
|
||
Height="34" Width="28" Margin="4,0,0,0" Padding="0"
|
||
ToolTip="清除榜单"
|
||
Foreground="{DynamicResource SecondaryTextBrush}"
|
||
hc:IconElement.Geometry="{StaticResource ErrorGeometry}"/>
|
||
</Grid>
|
||
</hc:Col>
|
||
|
||
<!-- 供料客户 -->
|
||
<hc:Col Span="8">
|
||
<hc:TextBox Text="{Binding Entry.SupplyCustomer, UpdateSourceTrigger=PropertyChanged}"
|
||
Height="34"
|
||
hc:InfoElement.Title="供料客户"
|
||
hc:InfoElement.TitleWidth="80"
|
||
hc:InfoElement.TitlePlacement="Left"
|
||
hc:InfoElement.Placeholder="请输入供料客户"
|
||
hc:InfoElement.ShowClearButton="True"
|
||
Margin="0,0,0,8"/>
|
||
</hc:Col>
|
||
|
||
<!-- 供应商名称 -->
|
||
<hc:Col Span="8">
|
||
<hc:TextBox Text="{Binding Entry.SupplierName, UpdateSourceTrigger=PropertyChanged}"
|
||
Height="34"
|
||
hc:InfoElement.Title="供应商名称"
|
||
hc:InfoElement.TitleWidth="80"
|
||
hc:InfoElement.TitlePlacement="Left"
|
||
hc:InfoElement.Placeholder="根据榜单自动带出"
|
||
hc:InfoElement.ShowClearButton="True"
|
||
IsReadOnly="True"
|
||
Margin="0,0,0,8"/>
|
||
</hc:Col>
|
||
|
||
<!-- 厂家物料名称 -->
|
||
<hc:Col Span="8">
|
||
<hc:TextBox Text="{Binding Entry.ManufacturerMaterialName, UpdateSourceTrigger=PropertyChanged}"
|
||
Height="34"
|
||
hc:InfoElement.Title="厂家物料名称"
|
||
hc:InfoElement.TitleWidth="80"
|
||
hc:InfoElement.TitlePlacement="Left"
|
||
hc:InfoElement.Placeholder="请输入厂家物料名称"
|
||
hc:InfoElement.ShowClearButton="True"
|
||
IsReadOnly="True"
|
||
Margin="0,0,0,8"/>
|
||
</hc:Col>
|
||
|
||
<!-- 保质期 -->
|
||
<hc:Col Span="8">
|
||
<hc:TextBox Text="{Binding Entry.ShelfLife, UpdateSourceTrigger=PropertyChanged}"
|
||
Height="34"
|
||
hc:InfoElement.Title="保质期"
|
||
hc:InfoElement.TitleWidth="80"
|
||
hc:InfoElement.TitlePlacement="Left"
|
||
hc:InfoElement.Placeholder="自动计算到期日期"
|
||
hc:InfoElement.ShowClearButton="True"
|
||
IsReadOnly="True"
|
||
Margin="0,0,0,8"/>
|
||
</hc:Col>
|
||
|
||
<!-- 总重(KG) -->
|
||
<hc:Col Span="8">
|
||
<hc:NumericUpDown Value="{Binding TotalWeightInput}"
|
||
Minimum="0"
|
||
DecimalPlaces="2"
|
||
Height="34"
|
||
Style="{StaticResource NumericUpDownPlus}"
|
||
hc:InfoElement.Title="总重(KG)"
|
||
hc:InfoElement.TitleWidth="80"
|
||
hc:InfoElement.TitlePlacement="Left"
|
||
hc:InfoElement.Placeholder="请输入总重"
|
||
Margin="0,0,0,8"/>
|
||
</hc:Col>
|
||
|
||
<!-- 总份数 / 每份总重 / 每份包数:字段升级为字符串,支持多行明细拼接(如 20/1/) -->
|
||
<hc:Col Span="8">
|
||
<hc:TextBox Text="{Binding Entry.TotalPortions, UpdateSourceTrigger=PropertyChanged}"
|
||
Height="34"
|
||
hc:InfoElement.Title="总份数"
|
||
hc:InfoElement.TitleWidth="80"
|
||
hc:InfoElement.TitlePlacement="Left"
|
||
hc:InfoElement.Placeholder="请输入总份数(多行明细用 / 拼接)"
|
||
hc:InfoElement.ShowClearButton="True"
|
||
Margin="0,0,0,8"/>
|
||
</hc:Col>
|
||
|
||
<hc:Col Span="8">
|
||
<hc:TextBox Text="{Binding Entry.PortionWeight, UpdateSourceTrigger=PropertyChanged}"
|
||
Height="34"
|
||
hc:InfoElement.Title="每份总重(KG)"
|
||
hc:InfoElement.TitleWidth="80"
|
||
hc:InfoElement.TitlePlacement="Left"
|
||
hc:InfoElement.Placeholder="请输入每份总重(多行明细用 / 拼接)"
|
||
hc:InfoElement.ShowClearButton="True"
|
||
Margin="0,0,0,8"/>
|
||
</hc:Col>
|
||
|
||
<hc:Col Span="8">
|
||
<hc:TextBox Text="{Binding Entry.PortionPackages, UpdateSourceTrigger=PropertyChanged}"
|
||
Height="34"
|
||
hc:InfoElement.Title="每份包数"
|
||
hc:InfoElement.TitleWidth="80"
|
||
hc:InfoElement.TitlePlacement="Left"
|
||
hc:InfoElement.Placeholder="请输入每份包数(多行明细用 / 拼接)"
|
||
hc:InfoElement.ShowClearButton="True"
|
||
Margin="0,0,0,8"/>
|
||
</hc:Col>
|
||
|
||
<!-- 检测结果 -->
|
||
<hc:Col Span="8">
|
||
<hc:ComboBox SelectedValuePath="Value"
|
||
DisplayMemberPath="Key"
|
||
ItemsSource="{Binding TestResultOptions}"
|
||
SelectedValue="{Binding Entry.TestResult}"
|
||
Height="34"
|
||
hc:InfoElement.Title="检测结果"
|
||
hc:InfoElement.TitleWidth="80"
|
||
hc:InfoElement.TitlePlacement="Left"
|
||
hc:InfoElement.Placeholder="请选择检测结果"
|
||
Margin="0,0,0,8"/>
|
||
</hc:Col>
|
||
|
||
<!-- 检测状态 -->
|
||
<hc:Col Span="8">
|
||
<hc:ComboBox SelectedValuePath="Value"
|
||
DisplayMemberPath="Key"
|
||
ItemsSource="{Binding TestStatusOptions}"
|
||
SelectedValue="{Binding Entry.TestStatus}"
|
||
Height="34"
|
||
hc:InfoElement.Title="检测状态"
|
||
hc:InfoElement.TitleWidth="80"
|
||
hc:InfoElement.TitlePlacement="Left"
|
||
hc:InfoElement.Placeholder="请选择检测状态"
|
||
Margin="0,0,0,8"/>
|
||
</hc:Col>
|
||
|
||
<!-- 打印标记 -->
|
||
<hc:Col Span="8">
|
||
<hc:ComboBox SelectedValuePath="Value"
|
||
DisplayMemberPath="Key"
|
||
ItemsSource="{Binding PrintFlagOptions}"
|
||
SelectedValue="{Binding Entry.PrintFlag}"
|
||
Height="34"
|
||
hc:InfoElement.Title="打印标记"
|
||
hc:InfoElement.TitleWidth="80"
|
||
hc:InfoElement.TitlePlacement="Left"
|
||
hc:InfoElement.Placeholder="请选择打印标记"
|
||
Margin="0,0,0,8"/>
|
||
</hc:Col>
|
||
|
||
<!-- 入库结存 -->
|
||
<hc:Col Span="8">
|
||
<hc:ComboBox SelectedValuePath="Value"
|
||
DisplayMemberPath="Key"
|
||
ItemsSource="{Binding StockBalanceOptions}"
|
||
SelectedValue="{Binding Entry.StockBalance}"
|
||
Height="34"
|
||
hc:InfoElement.Title="入库结存"
|
||
hc:InfoElement.TitleWidth="80"
|
||
hc:InfoElement.TitlePlacement="Left"
|
||
hc:InfoElement.Placeholder="请选择入库结存"
|
||
Margin="0,0,0,8"/>
|
||
</hc:Col>
|
||
|
||
<!-- 库位 -->
|
||
<hc:Col Span="8">
|
||
<hc:TextBox Text="{Binding Entry.WarehouseLocation, UpdateSourceTrigger=PropertyChanged}"
|
||
Height="34"
|
||
hc:InfoElement.Title="库位"
|
||
hc:InfoElement.TitleWidth="80"
|
||
hc:InfoElement.TitlePlacement="Left"
|
||
hc:InfoElement.Placeholder="请输入库位"
|
||
hc:InfoElement.ShowClearButton="True"
|
||
Margin="0,0,0,8"/>
|
||
</hc:Col>
|
||
|
||
<!-- 卸货人 -->
|
||
<hc:Col Span="8">
|
||
<hc:TextBox Text="{Binding Entry.UnloadOperator, UpdateSourceTrigger=PropertyChanged}"
|
||
Height="34"
|
||
hc:InfoElement.Title="卸货人"
|
||
hc:InfoElement.TitleWidth="80"
|
||
hc:InfoElement.TitlePlacement="Left"
|
||
hc:InfoElement.Placeholder="请输入卸货人"
|
||
hc:InfoElement.ShowClearButton="True"
|
||
Margin="0,0,0,8"/>
|
||
</hc:Col>
|
||
|
||
<!-- 是否特采 -->
|
||
<hc:Col Span="8">
|
||
<hc:ComboBox SelectedValuePath="Value"
|
||
DisplayMemberPath="Key"
|
||
ItemsSource="{Binding IsSpecialAdoptionOptions}"
|
||
SelectedValue="{Binding Entry.IsSpecialAdoption}"
|
||
Height="34"
|
||
hc:InfoElement.Title="是否特采"
|
||
hc:InfoElement.TitleWidth="80"
|
||
hc:InfoElement.TitlePlacement="Left"
|
||
hc:InfoElement.Placeholder="请选择是否特采"
|
||
Margin="0,0,0,8"/>
|
||
</hc:Col>
|
||
|
||
<!-- 特采操作人 -->
|
||
<hc:Col Span="8">
|
||
<hc:TextBox Text="{Binding Entry.SpecialAdoptionOperator, UpdateSourceTrigger=PropertyChanged}"
|
||
Height="34"
|
||
hc:InfoElement.Title="特采操作人"
|
||
hc:InfoElement.TitleWidth="80"
|
||
hc:InfoElement.TitlePlacement="Left"
|
||
hc:InfoElement.Placeholder="请输入特采操作人"
|
||
hc:InfoElement.ShowClearButton="True"
|
||
Margin="0,0,0,8"/>
|
||
</hc:Col>
|
||
|
||
<!-- 特采时间 -->
|
||
<hc:Col Span="8">
|
||
<DockPanel Margin="0,0,0,8" LastChildFill="True">
|
||
<TextBlock DockPanel.Dock="Left" Text="特采时间" Width="80"
|
||
VerticalAlignment="Center"
|
||
Foreground="{DynamicResource PrimaryTextBrush}"/>
|
||
<ctrls:DateTimeListPicker SelectedDateTime="{Binding Entry.SpecialAdoptionTime, Mode=TwoWay}"
|
||
DateTimeFormat="yyyy-MM-dd HH:mm:ss"
|
||
Placeholder="请选择特采时间"/>
|
||
</DockPanel>
|
||
</hc:Col>
|
||
|
||
<!-- 状态 -->
|
||
<hc:Col Span="8">
|
||
<hc:ComboBox SelectedValuePath="Value"
|
||
DisplayMemberPath="Key"
|
||
ItemsSource="{Binding StatusOptions}"
|
||
SelectedValue="{Binding Entry.Status}"
|
||
Height="34"
|
||
hc:InfoElement.Title="状态"
|
||
hc:InfoElement.TitleWidth="80"
|
||
hc:InfoElement.TitlePlacement="Left"
|
||
hc:InfoElement.Placeholder="请选择状态"
|
||
Margin="0,0,0,8"/>
|
||
</hc:Col>
|
||
|
||
<!-- 特采原因(全宽) -->
|
||
<hc:Col Span="24">
|
||
<hc:TextBox Text="{Binding Entry.SpecialAdoptionReason, UpdateSourceTrigger=PropertyChanged}"
|
||
hc:InfoElement.Title="特采原因"
|
||
hc:InfoElement.TitleWidth="80"
|
||
hc:InfoElement.TitlePlacement="Left"
|
||
hc:InfoElement.Placeholder="请输入特采原因"
|
||
hc:InfoElement.ShowClearButton="True"
|
||
TextWrapping="Wrap"
|
||
AcceptsReturn="True"
|
||
HorizontalAlignment="Stretch"
|
||
Height="64"
|
||
VerticalScrollBarVisibility="Auto"
|
||
Margin="0,0,0,8"/>
|
||
</hc:Col>
|
||
|
||
<!-- 备注(全宽) -->
|
||
<hc:Col Span="24">
|
||
<hc:TextBox Text="{Binding Entry.Remark, UpdateSourceTrigger=PropertyChanged}"
|
||
hc:InfoElement.Title="备注"
|
||
hc:InfoElement.TitleWidth="80"
|
||
hc:InfoElement.TitlePlacement="Left"
|
||
hc:InfoElement.Placeholder="请输入备注"
|
||
hc:InfoElement.ShowClearButton="True"
|
||
TextWrapping="Wrap"
|
||
AcceptsReturn="True"
|
||
HorizontalAlignment="Stretch"
|
||
Height="64"
|
||
VerticalScrollBarVisibility="Auto"
|
||
Margin="0,0,0,8"/>
|
||
</hc:Col>
|
||
|
||
</hc:Row>
|
||
</StackPanel>
|
||
</hc:ScrollViewer>
|
||
|
||
<!-- 按钮区域 -->
|
||
<StackPanel Grid.Row="2" Orientation="Horizontal" HorizontalAlignment="Center" Margin="0,12,0,20">
|
||
<Button Content="取消" Command="{Binding CancelCommand}" Style="{StaticResource ButtonDefault}" Margin="0,0,15,0" Width="100"/>
|
||
<Button Content="确定" Command="{Binding SaveCommand}" Style="{StaticResource ButtonPrimary}" Width="100"/>
|
||
</StackPanel>
|
||
</Grid>
|
||
</UserControl>
|