增强原材料卡片管理功能,新增免密接口和数据处理逻辑,支持原材料卡片的增删改查操作。更新前端视图以支持多行拆码明细拼接,优化用户体验和系统实时数据同步能力。
This commit is contained in:
@@ -0,0 +1,223 @@
|
||||
<UserControl x:Class="YY.Admin.Views.RawMaterialCard.RawMaterialCardEditDialogView"
|
||||
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:prism="http://prismlibrary.com/"
|
||||
prism:ViewModelLocator.AutoWireViewModel="True"
|
||||
mc:Ignorable="d"
|
||||
Width="780"
|
||||
MinHeight="480">
|
||||
|
||||
<Grid Background="{DynamicResource ThirdlyRegionBrush}">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!-- 标题栏 -->
|
||||
<hc:SimplePanel Margin="20">
|
||||
<TextBlock FontSize="18" Foreground="{DynamicResource PrimaryTextBrush}" Text="{Binding DialogTitle}" HorizontalAlignment="Left" VerticalAlignment="Top"/>
|
||||
<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="Top" Margin="0,4,4,0"/>
|
||||
</hc:SimplePanel>
|
||||
|
||||
<!-- 表单区域 -->
|
||||
<hc:ScrollViewer Grid.Row="1" IsInertiaEnabled="True">
|
||||
<StackPanel Margin="20,0,20,0">
|
||||
<hc:Row Gutter="10">
|
||||
|
||||
<!-- 条码 -->
|
||||
<hc:Col Span="12">
|
||||
<hc:TextBox Text="{Binding Card.Barcode, UpdateSourceTrigger=PropertyChanged}"
|
||||
hc:InfoElement.Title="条码"
|
||||
hc:InfoElement.TitleWidth="90"
|
||||
hc:InfoElement.TitlePlacement="Left"
|
||||
hc:InfoElement.Placeholder="请输入条码"
|
||||
hc:InfoElement.ShowClearButton="True"
|
||||
Margin="0,0,0,16"/>
|
||||
</hc:Col>
|
||||
|
||||
<!-- 批次号 -->
|
||||
<hc:Col Span="12">
|
||||
<hc:TextBox Text="{Binding Card.BatchNo, UpdateSourceTrigger=PropertyChanged}"
|
||||
hc:InfoElement.Title="批次号"
|
||||
hc:InfoElement.TitleWidth="90"
|
||||
hc:InfoElement.TitlePlacement="Left"
|
||||
hc:InfoElement.Placeholder="请输入批次号"
|
||||
hc:InfoElement.ShowClearButton="True"
|
||||
Margin="0,0,0,16"/>
|
||||
</hc:Col>
|
||||
|
||||
<!-- 入场日期 -->
|
||||
<hc:Col Span="12">
|
||||
<hc:DatePicker SelectedDate="{Binding Card.EntryDate}"
|
||||
hc:InfoElement.Title="入场日期"
|
||||
hc:InfoElement.TitleWidth="90"
|
||||
hc:InfoElement.TitlePlacement="Left"
|
||||
hc:InfoElement.Placeholder="请选择入场日期"
|
||||
Margin="0,0,0,16"/>
|
||||
</hc:Col>
|
||||
|
||||
<!-- 物料名称 -->
|
||||
<hc:Col Span="12">
|
||||
<hc:TextBox Text="{Binding Card.MaterialName, UpdateSourceTrigger=PropertyChanged}"
|
||||
hc:InfoElement.Title="物料名称"
|
||||
hc:InfoElement.TitleWidth="90"
|
||||
hc:InfoElement.TitlePlacement="Left"
|
||||
hc:InfoElement.Placeholder="请输入物料名称"
|
||||
hc:InfoElement.Necessary="True"
|
||||
hc:InfoElement.Symbol="*"
|
||||
hc:InfoElement.ShowClearButton="True"
|
||||
Margin="0,0,0,16"/>
|
||||
</hc:Col>
|
||||
|
||||
<!-- 供应商名称 -->
|
||||
<hc:Col Span="12">
|
||||
<hc:TextBox Text="{Binding Card.SupplierName, UpdateSourceTrigger=PropertyChanged}"
|
||||
hc:InfoElement.Title="供应商名称"
|
||||
hc:InfoElement.TitleWidth="90"
|
||||
hc:InfoElement.TitlePlacement="Left"
|
||||
hc:InfoElement.Placeholder="请输入供应商名称"
|
||||
hc:InfoElement.ShowClearButton="True"
|
||||
Margin="0,0,0,16"/>
|
||||
</hc:Col>
|
||||
|
||||
<!-- 厂家物料名称 -->
|
||||
<hc:Col Span="12">
|
||||
<hc:TextBox Text="{Binding Card.ManufacturerMaterialName, UpdateSourceTrigger=PropertyChanged}"
|
||||
hc:InfoElement.Title="厂家物料名称"
|
||||
hc:InfoElement.TitleWidth="90"
|
||||
hc:InfoElement.TitlePlacement="Left"
|
||||
hc:InfoElement.Placeholder="请输入厂家物料名称"
|
||||
hc:InfoElement.ShowClearButton="True"
|
||||
Margin="0,0,0,16"/>
|
||||
</hc:Col>
|
||||
|
||||
<!-- 保质期 -->
|
||||
<hc:Col Span="12">
|
||||
<hc:TextBox Text="{Binding Card.ShelfLife, UpdateSourceTrigger=PropertyChanged}"
|
||||
hc:InfoElement.Title="保质期"
|
||||
hc:InfoElement.TitleWidth="90"
|
||||
hc:InfoElement.TitlePlacement="Left"
|
||||
hc:InfoElement.Placeholder="请输入保质期"
|
||||
hc:InfoElement.ShowClearButton="True"
|
||||
Margin="0,0,0,16"/>
|
||||
</hc:Col>
|
||||
|
||||
<!-- 库区 -->
|
||||
<hc:Col Span="12">
|
||||
<hc:TextBox Text="{Binding Card.WarehouseArea, UpdateSourceTrigger=PropertyChanged}"
|
||||
hc:InfoElement.Title="库区"
|
||||
hc:InfoElement.TitleWidth="90"
|
||||
hc:InfoElement.TitlePlacement="Left"
|
||||
hc:InfoElement.Placeholder="请输入库区"
|
||||
hc:InfoElement.ShowClearButton="True"
|
||||
Margin="0,0,0,16"/>
|
||||
</hc:Col>
|
||||
|
||||
<!-- 卸货人 -->
|
||||
<hc:Col Span="12">
|
||||
<hc:TextBox Text="{Binding Card.UnloadOperator, UpdateSourceTrigger=PropertyChanged}"
|
||||
hc:InfoElement.Title="卸货人"
|
||||
hc:InfoElement.TitleWidth="90"
|
||||
hc:InfoElement.TitlePlacement="Left"
|
||||
hc:InfoElement.Placeholder="请输入卸货人"
|
||||
hc:InfoElement.ShowClearButton="True"
|
||||
Margin="0,0,0,16"/>
|
||||
</hc:Col>
|
||||
|
||||
<!-- 总重 -->
|
||||
<hc:Col Span="12">
|
||||
<hc:NumericUpDown Value="{Binding Card.TotalWeight}"
|
||||
Minimum="0"
|
||||
DecimalPlaces="3"
|
||||
Style="{StaticResource NumericUpDownPlus}"
|
||||
hc:InfoElement.Title="总重(kg)"
|
||||
hc:InfoElement.TitleWidth="90"
|
||||
hc:InfoElement.TitlePlacement="Left"
|
||||
hc:InfoElement.Placeholder="请输入总重"
|
||||
hc:InfoElement.ShowClearButton="True"
|
||||
Margin="0,0,0,16"/>
|
||||
</hc:Col>
|
||||
|
||||
<!-- 剩余重量 -->
|
||||
<hc:Col Span="12">
|
||||
<hc:NumericUpDown Value="{Binding Card.RemainingWeight}"
|
||||
Minimum="0"
|
||||
DecimalPlaces="3"
|
||||
Style="{StaticResource NumericUpDownPlus}"
|
||||
hc:InfoElement.Title="剩余重量"
|
||||
hc:InfoElement.TitleWidth="90"
|
||||
hc:InfoElement.TitlePlacement="Left"
|
||||
hc:InfoElement.ShowClearButton="True"
|
||||
Margin="0,0,0,16"/>
|
||||
</hc:Col>
|
||||
|
||||
<!-- 剩余数量 -->
|
||||
<hc:Col Span="12">
|
||||
<hc:NumericUpDown Value="{Binding Card.RemainingQuantity}"
|
||||
Minimum="0"
|
||||
DecimalPlaces="0"
|
||||
Style="{StaticResource NumericUpDownPlus}"
|
||||
hc:InfoElement.Title="剩余数量"
|
||||
hc:InfoElement.TitleWidth="90"
|
||||
hc:InfoElement.TitlePlacement="Left"
|
||||
hc:InfoElement.ShowClearButton="True"
|
||||
Margin="0,0,0,16"/>
|
||||
</hc:Col>
|
||||
|
||||
<!-- 状态 -->
|
||||
<hc:Col Span="12">
|
||||
<hc:ComboBox SelectedValuePath="Value"
|
||||
DisplayMemberPath="Key"
|
||||
ItemsSource="{Binding StatusOptions}"
|
||||
SelectedValue="{Binding Card.Status}"
|
||||
hc:InfoElement.Title="状态"
|
||||
hc:InfoElement.TitleWidth="90"
|
||||
hc:InfoElement.TitlePlacement="Left"
|
||||
Margin="0,0,0,16"/>
|
||||
</hc:Col>
|
||||
|
||||
<!-- 检测结果 -->
|
||||
<hc:Col Span="12">
|
||||
<hc:ComboBox SelectedValuePath="Value"
|
||||
DisplayMemberPath="Key"
|
||||
ItemsSource="{Binding TestResultOptions}"
|
||||
SelectedValue="{Binding Card.TestResult}"
|
||||
hc:InfoElement.Title="检测结果"
|
||||
hc:InfoElement.TitleWidth="90"
|
||||
hc:InfoElement.TitlePlacement="Left"
|
||||
Margin="0,0,0,16"/>
|
||||
</hc:Col>
|
||||
|
||||
<!-- 物料描述 -->
|
||||
<hc:Col Span="24">
|
||||
<hc:TextBox Text="{Binding Card.MaterialDesc, UpdateSourceTrigger=PropertyChanged}"
|
||||
hc:InfoElement.Title="物料描述"
|
||||
hc:InfoElement.TitleWidth="90"
|
||||
hc:InfoElement.TitlePlacement="Left"
|
||||
hc:InfoElement.Placeholder="请输入物料描述"
|
||||
TextWrapping="Wrap"
|
||||
AcceptsReturn="True"
|
||||
MinHeight="60"
|
||||
MaxHeight="100"
|
||||
VerticalScrollBarVisibility="Auto"
|
||||
Margin="0,0,0,16"/>
|
||||
</hc:Col>
|
||||
|
||||
</hc:Row>
|
||||
</StackPanel>
|
||||
</hc:ScrollViewer>
|
||||
|
||||
<!-- 按钮区域 -->
|
||||
<StackPanel Grid.Row="2" Orientation="Horizontal" HorizontalAlignment="Center" Margin="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>
|
||||
@@ -0,0 +1,11 @@
|
||||
using System.Windows.Controls;
|
||||
|
||||
namespace YY.Admin.Views.RawMaterialCard;
|
||||
|
||||
public partial class RawMaterialCardEditDialogView : UserControl
|
||||
{
|
||||
public RawMaterialCardEditDialogView()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,177 @@
|
||||
<UserControl x:Class="YY.Admin.Views.RawMaterialCard.RawMaterialCardListView"
|
||||
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:md="http://materialdesigninxaml.net/winfx/xaml/themes"
|
||||
xmlns:prism="http://prismlibrary.com/"
|
||||
prism:ViewModelLocator.AutoWireViewModel="True"
|
||||
mc:Ignorable="d">
|
||||
|
||||
<Grid Style="{StaticResource BaseViewStyle}">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!-- 搜索条件区域 -->
|
||||
<Border Grid.Row="0" CornerRadius="4" Margin="0 0 -10 0">
|
||||
<hc:Row>
|
||||
<hc:Col Layout="{hc:ColLayout Xs=12, Sm=8, Md=6, Lg=6, Xl=4}">
|
||||
<hc:TextBox Text="{Binding FilterBarcode, UpdateSourceTrigger=PropertyChanged}"
|
||||
Margin="0 0 10 10"
|
||||
hc:InfoElement.Title="条码"
|
||||
hc:InfoElement.TitlePlacement="Left"
|
||||
hc:InfoElement.TitleWidth="65"
|
||||
hc:InfoElement.Placeholder="请输入条码"
|
||||
hc:InfoElement.ShowClearButton="True"/>
|
||||
</hc:Col>
|
||||
<hc:Col Layout="{hc:ColLayout Xs=12, Sm=8, Md=6, Lg=6, Xl=4}">
|
||||
<hc:TextBox Text="{Binding FilterBatchNo, UpdateSourceTrigger=PropertyChanged}"
|
||||
Margin="0 0 10 10"
|
||||
hc:InfoElement.Title="批次号"
|
||||
hc:InfoElement.TitlePlacement="Left"
|
||||
hc:InfoElement.TitleWidth="65"
|
||||
hc:InfoElement.Placeholder="请输入批次号"
|
||||
hc:InfoElement.ShowClearButton="True"/>
|
||||
</hc:Col>
|
||||
<hc:Col Layout="{hc:ColLayout Xs=12, Sm=8, Md=6, Lg=6, Xl=4}">
|
||||
<hc:TextBox Text="{Binding FilterMaterialName, UpdateSourceTrigger=PropertyChanged}"
|
||||
Margin="0 0 10 10"
|
||||
hc:InfoElement.Title="物料名称"
|
||||
hc:InfoElement.TitlePlacement="Left"
|
||||
hc:InfoElement.TitleWidth="65"
|
||||
hc:InfoElement.Placeholder="请输入物料名称"
|
||||
hc:InfoElement.ShowClearButton="True"/>
|
||||
</hc:Col>
|
||||
<hc:Col Layout="{hc:ColLayout Xs=12, Sm=8, Md=6, Lg=6, Xl=4}">
|
||||
<hc:TextBox Text="{Binding FilterSupplierName, UpdateSourceTrigger=PropertyChanged}"
|
||||
Margin="0 0 10 10"
|
||||
hc:InfoElement.Title="供应商"
|
||||
hc:InfoElement.TitlePlacement="Left"
|
||||
hc:InfoElement.TitleWidth="65"
|
||||
hc:InfoElement.Placeholder="请输入供应商名称"
|
||||
hc:InfoElement.ShowClearButton="True"/>
|
||||
</hc:Col>
|
||||
<hc:Col Layout="{hc:ColLayout Xs=12, Sm=8, Md=6, Lg=6, Xl=4}">
|
||||
<hc:ComboBox SelectedValuePath="Value"
|
||||
DisplayMemberPath="Key"
|
||||
ItemsSource="{Binding StatusOptions}"
|
||||
SelectedValue="{Binding FilterStatus}"
|
||||
Margin="0 0 10 10"
|
||||
hc:InfoElement.Title="状态"
|
||||
hc:InfoElement.TitlePlacement="Left"
|
||||
hc:InfoElement.TitleWidth="65"
|
||||
hc:InfoElement.Placeholder="请选择状态"
|
||||
hc:InfoElement.ShowClearButton="True"/>
|
||||
</hc:Col>
|
||||
</hc:Row>
|
||||
</Border>
|
||||
|
||||
<!-- 操作工具栏 -->
|
||||
<Border Grid.Row="1" Margin="0,10">
|
||||
<hc:UniformSpacingPanel Spacing="10">
|
||||
<Button Style="{StaticResource ButtonPrimary}" Command="{Binding SearchCommand}">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<md:PackIcon Kind="Search"/>
|
||||
<TextBlock Text="搜索" Style="{StaticResource IconButtonStyle}"/>
|
||||
</StackPanel>
|
||||
</Button>
|
||||
<Button Style="{StaticResource ButtonDefault}" Command="{Binding ResetCommand}">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<md:PackIcon Kind="Refresh"/>
|
||||
<TextBlock Text="重置" Style="{StaticResource IconButtonStyle}"/>
|
||||
</StackPanel>
|
||||
</Button>
|
||||
<Button Style="{StaticResource ButtonPrimary}" Command="{Binding AddCommand}">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<md:PackIcon Kind="Plus"/>
|
||||
<TextBlock Text="新增" Style="{StaticResource IconButtonStyle}"/>
|
||||
</StackPanel>
|
||||
</Button>
|
||||
</hc:UniformSpacingPanel>
|
||||
</Border>
|
||||
|
||||
<!-- 数据表格 -->
|
||||
<DataGrid Grid.Row="2"
|
||||
ItemsSource="{Binding Cards}"
|
||||
AutoGenerateColumns="False"
|
||||
IsReadOnly="True"
|
||||
CanUserAddRows="False"
|
||||
SelectionMode="Extended"
|
||||
SelectionUnit="FullRow"
|
||||
RowHeaderWidth="55"
|
||||
GridLinesVisibility="Horizontal"
|
||||
HorizontalGridLinesBrush="#FFEDEDED"
|
||||
VerticalGridLinesBrush="Transparent"
|
||||
HeadersVisibility="All"
|
||||
ColumnHeaderStyle="{StaticResource CusDataGridColumnHeaderStyle}"
|
||||
Style="{StaticResource CusDataGridStyle}"
|
||||
hc:DataGridAttach.ShowSelectAllButton="True"
|
||||
VerticalScrollBarVisibility="Auto"
|
||||
HorizontalScrollBarVisibility="Auto">
|
||||
<DataGrid.RowHeaderTemplate>
|
||||
<DataTemplate>
|
||||
<CheckBox IsChecked="{Binding IsSelected, RelativeSource={RelativeSource AncestorType=DataGridRow}}"/>
|
||||
</DataTemplate>
|
||||
</DataGrid.RowHeaderTemplate>
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn Header="条码" Binding="{Binding Barcode}" CellStyle="{StaticResource CusDataGridCellStyle}" Width="150"/>
|
||||
<DataGridTextColumn Header="批次号" Binding="{Binding BatchNo}" CellStyle="{StaticResource CusDataGridCellStyle}" Width="130"/>
|
||||
<DataGridTextColumn Header="入场日期" Binding="{Binding EntryDateText}" CellStyle="{StaticResource CusDataGridCellStyle}" Width="100"/>
|
||||
<DataGridTextColumn Header="物料名称" Binding="{Binding MaterialName}" CellStyle="{StaticResource CusDataGridCellStyle}" Width="150"/>
|
||||
<DataGridTextColumn Header="供应商名称" Binding="{Binding SupplierName}" CellStyle="{StaticResource CusDataGridCellStyle}" Width="140"/>
|
||||
<DataGridTextColumn Header="厂家物料名称" Binding="{Binding ManufacturerMaterialName}" CellStyle="{StaticResource CusDataGridCellStyle}" Width="130"/>
|
||||
<DataGridTextColumn Header="保质期" Binding="{Binding ShelfLife}" CellStyle="{StaticResource CusDataGridCellStyle}" Width="90"/>
|
||||
<DataGridTextColumn Header="总重(kg)" Binding="{Binding TotalWeight, StringFormat=N3}" CellStyle="{StaticResource CusDataGridCellStyle}" Width="90"/>
|
||||
<DataGridTextColumn Header="剩余重量" Binding="{Binding RemainingWeight, StringFormat=N3}" CellStyle="{StaticResource CusDataGridCellStyle}" Width="90"/>
|
||||
<DataGridTextColumn Header="剩余数量" Binding="{Binding RemainingQuantity}" CellStyle="{StaticResource CusDataGridCellStyle}" Width="80"/>
|
||||
<DataGridTextColumn Header="状态" Binding="{Binding StatusText}" CellStyle="{StaticResource CusDataGridCellStyle}" Width="70"/>
|
||||
<DataGridTextColumn Header="检测结果" Binding="{Binding TestResultText}" CellStyle="{StaticResource CusDataGridCellStyle}" Width="80"/>
|
||||
<DataGridTextColumn Header="库区" Binding="{Binding WarehouseArea}" CellStyle="{StaticResource CusDataGridCellStyle}" Width="90"/>
|
||||
<DataGridTextColumn Header="卸货人" Binding="{Binding UnloadOperator}" CellStyle="{StaticResource CusDataGridCellStyle}" Width="80"/>
|
||||
<DataGridTemplateColumn Header="优先出库" Width="90">
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<CheckBox IsChecked="{Binding PriorityPickupBool, Mode=OneWay}"
|
||||
HorizontalAlignment="Center" VerticalAlignment="Center"
|
||||
Command="{Binding DataContext.TogglePriorityCommand, RelativeSource={RelativeSource AncestorType=DataGrid}}"
|
||||
CommandParameter="{Binding}"/>
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
<DataGridTemplateColumn Header="操作" Width="160">
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<hc:UniformSpacingPanel Spacing="6" HorizontalAlignment="Center">
|
||||
<Button Content="编辑"
|
||||
Style="{StaticResource ButtonPrimary}"
|
||||
FontSize="12" Height="26" Padding="8,0"
|
||||
Command="{Binding DataContext.EditCommand, RelativeSource={RelativeSource AncestorType=DataGrid}}"
|
||||
CommandParameter="{Binding}"/>
|
||||
<Button Content="删除"
|
||||
Style="{StaticResource ButtonDanger}"
|
||||
FontSize="12" Height="26" Padding="8,0"
|
||||
Command="{Binding DataContext.DeleteCommand, RelativeSource={RelativeSource AncestorType=DataGrid}}"
|
||||
CommandParameter="{Binding}"/>
|
||||
</hc:UniformSpacingPanel>
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
|
||||
<!-- 分页 -->
|
||||
<StackPanel Grid.Row="3" Orientation="Horizontal" HorizontalAlignment="Right" Margin="0,10,0,0">
|
||||
<TextBlock Text="{Binding Total, StringFormat=共 {0} 条}" VerticalAlignment="Center" Margin="0,0,16,0"
|
||||
Foreground="{DynamicResource SecondaryTextBrush}"/>
|
||||
<Button Content="上一页" Command="{Binding PrevPageCommand}" Style="{StaticResource ButtonDefault}" Margin="0,0,4,0" Width="80"/>
|
||||
<TextBlock Text="{Binding PageNo, StringFormat=第 {0} 页}" VerticalAlignment="Center" Margin="8,0"
|
||||
Foreground="{DynamicResource PrimaryTextBrush}"/>
|
||||
<Button Content="下一页" Command="{Binding NextPageCommand}" Style="{StaticResource ButtonDefault}" Width="80"/>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,11 @@
|
||||
using System.Windows.Controls;
|
||||
|
||||
namespace YY.Admin.Views.RawMaterialCard;
|
||||
|
||||
public partial class RawMaterialCardListView : UserControl
|
||||
{
|
||||
public RawMaterialCardListView()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
@@ -4,6 +4,7 @@
|
||||
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"
|
||||
@@ -109,16 +110,15 @@
|
||||
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}"/>
|
||||
<hc:DateTimePicker SelectedDateTime="{Binding Entry.EntryTime}"
|
||||
hc:InfoElement.Placeholder="请选择入场时间"
|
||||
hc:InfoElement.ShowClearButton="True"
|
||||
Height="34"/>
|
||||
<ctrls:DateTimeListPicker SelectedDateTime="{Binding Entry.EntryTime, Mode=TwoWay}"
|
||||
DateTimeFormat="yyyy-MM-dd HH:mm:ss"
|
||||
Placeholder="请选择入场时间"/>
|
||||
</DockPanel>
|
||||
</hc:Col>
|
||||
|
||||
@@ -219,47 +219,38 @@
|
||||
Margin="0,0,0,8"/>
|
||||
</hc:Col>
|
||||
|
||||
<!-- 总份数 -->
|
||||
<!-- 总份数 / 每份总重 / 每份包数:字段升级为字符串,支持多行明细拼接(如 20/1/) -->
|
||||
<hc:Col Span="8">
|
||||
<hc:NumericUpDown Value="{Binding TotalPortionsInput}"
|
||||
Minimum="0"
|
||||
DecimalPlaces="0"
|
||||
Height="34"
|
||||
Style="{StaticResource NumericUpDownPlus}"
|
||||
hc:InfoElement.Title="总份数"
|
||||
hc:InfoElement.TitleWidth="80"
|
||||
hc:InfoElement.TitlePlacement="Left"
|
||||
hc:InfoElement.Placeholder="请输入总份数"
|
||||
Margin="0,0,0,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>
|
||||
|
||||
<!-- 每份总重(KG) -->
|
||||
<hc:Col Span="8">
|
||||
<hc:NumericUpDown Value="{Binding Entry.PortionWeight}"
|
||||
Minimum="0"
|
||||
DecimalPlaces="2"
|
||||
Height="34"
|
||||
Style="{StaticResource NumericUpDownPlus}"
|
||||
hc:InfoElement.Title="每份总重(KG)"
|
||||
hc:InfoElement.TitleWidth="80"
|
||||
hc:InfoElement.TitlePlacement="Left"
|
||||
hc:InfoElement.Placeholder="自动按总重/总份数计算"
|
||||
IsReadOnly="True"
|
||||
Margin="0,0,0,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:NumericUpDown Value="{Binding Entry.PortionPackages}"
|
||||
Minimum="0"
|
||||
DecimalPlaces="0"
|
||||
Height="34"
|
||||
Style="{StaticResource NumericUpDownPlus}"
|
||||
hc:InfoElement.Title="每份包数"
|
||||
hc:InfoElement.TitleWidth="80"
|
||||
hc:InfoElement.TitlePlacement="Left"
|
||||
hc:InfoElement.Placeholder="请输入每份包数"
|
||||
Margin="0,0,0,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>
|
||||
|
||||
<!-- 检测结果 -->
|
||||
@@ -374,10 +365,9 @@
|
||||
<TextBlock DockPanel.Dock="Left" Text="特采时间" Width="80"
|
||||
VerticalAlignment="Center"
|
||||
Foreground="{DynamicResource PrimaryTextBrush}"/>
|
||||
<hc:DateTimePicker SelectedDateTime="{Binding Entry.SpecialAdoptionTime}"
|
||||
hc:InfoElement.Placeholder="请选择特采时间"
|
||||
hc:InfoElement.ShowClearButton="True"
|
||||
Height="34"/>
|
||||
<ctrls:DateTimeListPicker SelectedDateTime="{Binding Entry.SpecialAdoptionTime, Mode=TwoWay}"
|
||||
DateTimeFormat="yyyy-MM-dd HH:mm:ss"
|
||||
Placeholder="请选择特采时间"/>
|
||||
</DockPanel>
|
||||
</hc:Col>
|
||||
|
||||
|
||||
@@ -4,10 +4,38 @@
|
||||
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:core="clr-namespace:YY.Admin.Core.Entity;assembly=YY.Admin.Core"
|
||||
xmlns:prism="http://prismlibrary.com/"
|
||||
prism:ViewModelLocator.AutoWireViewModel="True"
|
||||
mc:Ignorable="d">
|
||||
|
||||
<UserControl.Resources>
|
||||
<!-- 右侧今日列表:单选行选中态浅蓝背景 -->
|
||||
<Style x:Key="TodayEntryListBoxItemStyle" TargetType="ListBoxItem">
|
||||
<Setter Property="Padding" Value="0"/>
|
||||
<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
|
||||
<Setter Property="Background" Value="Transparent"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="ListBoxItem">
|
||||
<Border x:Name="Bd" Background="{TemplateBinding Background}" Padding="6,4">
|
||||
<ContentPresenter/>
|
||||
</Border>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Setter TargetName="Bd" Property="Background" Value="#FFF5F5F5"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsSelected" Value="True">
|
||||
<Setter TargetName="Bd" Property="Background" Value="#E3F2FD"/>
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
</UserControl.Resources>
|
||||
|
||||
<Grid Style="{StaticResource BaseViewStyle}">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
@@ -15,38 +43,89 @@
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<hc:SimplePanel Margin="24,16,24,12">
|
||||
<Grid Grid.Row="0" Margin="24,16,24,12">
|
||||
<TextBlock FontSize="18"
|
||||
Foreground="{DynamicResource PrimaryTextBrush}"
|
||||
Text="新增原料入场记录"
|
||||
Text="{Binding DialogTitle}"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"/>
|
||||
</hc:SimplePanel>
|
||||
<!-- 收起/展开与右侧列表分离:置于页头右上,与标题同行 -->
|
||||
<!-- 显式绑定 UserControl.DataContext:避免页眉 DataContext 非本页 ViewModel 时 Toggle 无效 -->
|
||||
<Button HorizontalAlignment="Right"
|
||||
VerticalAlignment="Center"
|
||||
Command="{Binding DataContext.ToggleRightPanelCommand, RelativeSource={RelativeSource AncestorType=UserControl}}"
|
||||
Click="ToggleTodayPanelButton_OnClick"
|
||||
Padding="12,6"
|
||||
FontSize="12"
|
||||
MinHeight="32">
|
||||
<Button.Style>
|
||||
<Style TargetType="Button" BasedOn="{StaticResource ButtonDefault}">
|
||||
<Setter Property="Content" Value="收起"/>
|
||||
<Setter Property="ToolTip" Value="收起右侧「今日入场」列表"/>
|
||||
<Style.Triggers>
|
||||
<DataTrigger Binding="{Binding DataContext.IsRightPanelExpanded, RelativeSource={RelativeSource AncestorType=UserControl}}" Value="False">
|
||||
<Setter Property="Content" Value="展开"/>
|
||||
<Setter Property="ToolTip" Value="展开右侧「今日入场」列表"/>
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</Button.Style>
|
||||
</Button>
|
||||
</Grid>
|
||||
|
||||
<hc:ScrollViewer Grid.Row="1" IsInertiaEnabled="True" HorizontalScrollBarVisibility="Disabled">
|
||||
<Grid Grid.Row="1" x:Name="MainSplitRoot">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" MinWidth="320"/>
|
||||
<ColumnDefinition x:Name="SplitterCol" Width="4"/>
|
||||
<ColumnDefinition x:Name="RightPaneCol" Width="280" MinWidth="0"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<hc:ScrollViewer Grid.Column="0" IsInertiaEnabled="True" HorizontalScrollBarVisibility="Disabled">
|
||||
<StackPanel x:Name="RootPanel" Margin="24,8,24,8">
|
||||
<TextBlock Text="基础资料"
|
||||
FontSize="14"
|
||||
FontSize="13"
|
||||
FontWeight="SemiBold"
|
||||
Foreground="{DynamicResource PrimaryTextBrush}"
|
||||
Margin="0,0,0,6"/>
|
||||
<hc:Row Gutter="16">
|
||||
|
||||
<hc:Col Span="16">
|
||||
<Grid Margin="0,0,0,4">
|
||||
<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">
|
||||
<!-- 带横竖线的表格式表单 -->
|
||||
<Border BorderThickness="1" BorderBrush="{DynamicResource BorderBrush}" Margin="0,0,0,8">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="36"/> <!-- 密炼物料 -->
|
||||
<RowDefinition Height="38"/> <!-- 批次号 / 入场时间 -->
|
||||
<RowDefinition Height="36"/> <!-- 榜单号 -->
|
||||
<RowDefinition Height="36"/> <!-- 供料客户 / 供应商名称 -->
|
||||
<RowDefinition Height="36"/> <!-- 厂家物料名称 / 保质期 -->
|
||||
<RowDefinition Height="36"/> <!-- 总重 / 总份数 -->
|
||||
<RowDefinition Height="36"/> <!-- 每份总重 / 每份包数 -->
|
||||
<RowDefinition Height="36"/> <!-- 库位 / 卸货人 -->
|
||||
<RowDefinition Height="60"/> <!-- 备注 -->
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="90"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="90"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<!-- ===== Row 0: 密炼物料 ===== -->
|
||||
<Border Grid.Row="0" Grid.Column="0"
|
||||
Background="{DynamicResource SecondaryRegionBrush}"
|
||||
BorderThickness="0,0,1,1" BorderBrush="{DynamicResource BorderBrush}">
|
||||
<TextBlock Text="密炼物料" HorizontalAlignment="Center" VerticalAlignment="Center"
|
||||
FontSize="12" Foreground="{DynamicResource PrimaryTextBrush}"/>
|
||||
</Border>
|
||||
<Border Grid.Row="0" Grid.Column="1" Grid.ColumnSpan="3"
|
||||
BorderThickness="0,0,0,1" BorderBrush="{DynamicResource BorderBrush}" Padding="6,0">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Grid.Column="0" Text="{Binding SelectedMaterialDisplay}"
|
||||
VerticalAlignment="Center" FontSize="13" TextTrimming="CharacterEllipsis">
|
||||
<TextBlock.Style>
|
||||
<Style TargetType="TextBlock">
|
||||
<Setter Property="Foreground" Value="{DynamicResource SecondaryTextBrush}"/>
|
||||
@@ -58,243 +137,337 @@
|
||||
</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>
|
||||
<Button Grid.Column="1" Content="选 择"
|
||||
Command="{Binding OpenMaterialPickerCommand}"
|
||||
Style="{StaticResource ButtonPrimary}"
|
||||
Height="26" Margin="6,0,0,0" FontSize="12" Padding="10,0"/>
|
||||
<Button Grid.Column="2"
|
||||
Command="{Binding ClearMaterialCommand}"
|
||||
Style="{StaticResource ButtonIcon}"
|
||||
Height="26" Width="24" Margin="4,0,0,0" Padding="0"
|
||||
ToolTip="清除物料"
|
||||
Foreground="{DynamicResource SecondaryTextBrush}"
|
||||
hc:IconElement.Geometry="{StaticResource ErrorGeometry}"/>
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
<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,4"/>
|
||||
</hc:Col>
|
||||
<!-- ===== Row 1: 批次号 / 入场时间 ===== -->
|
||||
<Border Grid.Row="1" Grid.Column="0"
|
||||
Background="{DynamicResource SecondaryRegionBrush}"
|
||||
BorderThickness="0,0,1,1" BorderBrush="{DynamicResource BorderBrush}">
|
||||
<TextBlock Text="批次号" HorizontalAlignment="Center" VerticalAlignment="Center"
|
||||
FontSize="12" Foreground="{DynamicResource PrimaryTextBrush}"/>
|
||||
</Border>
|
||||
<Border Grid.Row="1" Grid.Column="1"
|
||||
BorderThickness="0,0,1,1" BorderBrush="{DynamicResource BorderBrush}" Padding="6,0">
|
||||
<TextBlock Text="{Binding Entry.BatchNo}" VerticalAlignment="Center" FontSize="13"
|
||||
Foreground="{DynamicResource SecondaryTextBrush}" TextTrimming="CharacterEllipsis"/>
|
||||
</Border>
|
||||
<Border Grid.Row="1" Grid.Column="2"
|
||||
Background="{DynamicResource SecondaryRegionBrush}"
|
||||
BorderThickness="0,0,1,1" BorderBrush="{DynamicResource BorderBrush}">
|
||||
<TextBlock Text="入场时间" HorizontalAlignment="Center" VerticalAlignment="Center"
|
||||
FontSize="12" Foreground="{DynamicResource PrimaryTextBrush}"/>
|
||||
</Border>
|
||||
<Border Grid.Row="1" Grid.Column="3"
|
||||
BorderThickness="0,0,0,1" BorderBrush="{DynamicResource BorderBrush}" Padding="4,3">
|
||||
<!-- 自定义日期时间选择器:日历 + 时/分/秒 三列 + 此刻/确定 -->
|
||||
<ctrls:DateTimeListPicker SelectedDateTime="{Binding Entry.EntryTime, Mode=TwoWay}"
|
||||
DateTimeFormat="yyyy-MM-dd HH:mm:ss"
|
||||
Placeholder="请选择入场时间"/>
|
||||
</Border>
|
||||
|
||||
<hc:Col Span="8">
|
||||
<hc:TextBox Text="{Binding Entry.Barcode, UpdateSourceTrigger=PropertyChanged}"
|
||||
Height="34"
|
||||
IsReadOnly="True"
|
||||
hc:InfoElement.Title="条码"
|
||||
hc:InfoElement.TitleWidth="80"
|
||||
hc:InfoElement.TitlePlacement="Left"
|
||||
hc:InfoElement.Placeholder="自动生成"
|
||||
hc:InfoElement.ShowClearButton="True"
|
||||
Margin="0,0,0,4"/>
|
||||
</hc:Col>
|
||||
|
||||
<hc:Col Span="8">
|
||||
<hc:TextBox Text="{Binding Entry.BatchNo, UpdateSourceTrigger=PropertyChanged}"
|
||||
Height="34"
|
||||
IsReadOnly="True"
|
||||
hc:InfoElement.Title="批次号"
|
||||
hc:InfoElement.TitleWidth="80"
|
||||
hc:InfoElement.TitlePlacement="Left"
|
||||
hc:InfoElement.Placeholder="自动生成"
|
||||
hc:InfoElement.ShowClearButton="True"
|
||||
Margin="0,0,0,4"/>
|
||||
</hc:Col>
|
||||
|
||||
<hc:Col Span="8">
|
||||
<DockPanel Margin="0,0,0,4" LastChildFill="True">
|
||||
<TextBlock DockPanel.Dock="Left" Text="入场时间" Width="80"
|
||||
VerticalAlignment="Center"
|
||||
Foreground="{DynamicResource PrimaryTextBrush}"/>
|
||||
<hc:DateTimePicker SelectedDateTime="{Binding Entry.EntryTime}"
|
||||
hc:InfoElement.Placeholder="请选择入场时间"
|
||||
hc:InfoElement.ShowClearButton="True"
|
||||
Height="34"/>
|
||||
</DockPanel>
|
||||
</hc:Col>
|
||||
|
||||
<hc:Col Span="8">
|
||||
<Grid Margin="0,0,0,4">
|
||||
<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"
|
||||
<!-- ===== Row 2: 榜单号 ===== -->
|
||||
<Border Grid.Row="2" Grid.Column="0"
|
||||
Background="{DynamicResource SecondaryRegionBrush}"
|
||||
BorderThickness="0,0,1,1" BorderBrush="{DynamicResource BorderBrush}">
|
||||
<TextBlock Text="榜单号" HorizontalAlignment="Center" VerticalAlignment="Center"
|
||||
FontSize="12" Foreground="{DynamicResource PrimaryTextBrush}"/>
|
||||
</Border>
|
||||
<Border Grid.Row="2" Grid.Column="1" Grid.ColumnSpan="3"
|
||||
BorderThickness="0,0,0,1" BorderBrush="{DynamicResource BorderBrush}" Padding="6,0">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Grid.Column="0" Text="{Binding Entry.BillNo}"
|
||||
VerticalAlignment="Center" 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>
|
||||
<Button Grid.Column="1" Content="选 择"
|
||||
Command="{Binding OpenWeightRecordPickerCommand}"
|
||||
Style="{StaticResource ButtonPrimary}"
|
||||
Height="26" Margin="6,0,0,0" FontSize="12" Padding="10,0"/>
|
||||
<Button Grid.Column="2"
|
||||
Command="{Binding ClearWeightRecordCommand}"
|
||||
Style="{StaticResource ButtonIcon}"
|
||||
Height="26" Width="24" Margin="4,0,0,0" Padding="0"
|
||||
ToolTip="清除榜单"
|
||||
Foreground="{DynamicResource SecondaryTextBrush}"
|
||||
hc:IconElement.Geometry="{StaticResource ErrorGeometry}"/>
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
<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,4"/>
|
||||
</hc:Col>
|
||||
<!-- ===== Row 3: 供料客户 / 供应商名称 ===== -->
|
||||
<Border Grid.Row="3" Grid.Column="0"
|
||||
Background="{DynamicResource SecondaryRegionBrush}"
|
||||
BorderThickness="0,0,1,1" BorderBrush="{DynamicResource BorderBrush}">
|
||||
<TextBlock Text="供料客户" HorizontalAlignment="Center" VerticalAlignment="Center"
|
||||
FontSize="12" Foreground="{DynamicResource PrimaryTextBrush}"/>
|
||||
</Border>
|
||||
<Border Grid.Row="3" Grid.Column="1"
|
||||
BorderThickness="0,0,1,1" BorderBrush="{DynamicResource BorderBrush}" Padding="4,0">
|
||||
<Grid>
|
||||
<TextBox Text="{Binding Entry.SupplyCustomer, UpdateSourceTrigger=PropertyChanged}"
|
||||
VerticalContentAlignment="Center" BorderThickness="0" Background="Transparent"
|
||||
FontSize="13" Foreground="{DynamicResource PrimaryTextBrush}"/>
|
||||
<TextBlock IsHitTestVisible="False" VerticalAlignment="Center" Margin="4,0"
|
||||
FontSize="13" Foreground="{DynamicResource SecondaryTextBrush}" Opacity="0.6"
|
||||
Text="请填写供料客户">
|
||||
<TextBlock.Style>
|
||||
<Style TargetType="TextBlock">
|
||||
<Setter Property="Visibility" Value="Collapsed"/>
|
||||
<Style.Triggers>
|
||||
<DataTrigger Binding="{Binding Entry.SupplyCustomer}" Value="">
|
||||
<Setter Property="Visibility" Value="Visible"/>
|
||||
</DataTrigger>
|
||||
<DataTrigger Binding="{Binding Entry.SupplyCustomer}" Value="{x:Null}">
|
||||
<Setter Property="Visibility" Value="Visible"/>
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</TextBlock.Style>
|
||||
</TextBlock>
|
||||
</Grid>
|
||||
</Border>
|
||||
<Border Grid.Row="3" Grid.Column="2"
|
||||
Background="{DynamicResource SecondaryRegionBrush}"
|
||||
BorderThickness="0,0,1,1" BorderBrush="{DynamicResource BorderBrush}">
|
||||
<TextBlock Text="供应商名称" HorizontalAlignment="Center" VerticalAlignment="Center"
|
||||
FontSize="12" Foreground="{DynamicResource PrimaryTextBrush}"/>
|
||||
</Border>
|
||||
<Border Grid.Row="3" Grid.Column="3"
|
||||
BorderThickness="0,0,0,1" BorderBrush="{DynamicResource BorderBrush}" Padding="4,0">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid Grid.Column="0">
|
||||
<TextBox Text="{Binding Entry.SupplierName, UpdateSourceTrigger=PropertyChanged}"
|
||||
VerticalContentAlignment="Center" BorderThickness="0" Background="Transparent"
|
||||
FontSize="13" Foreground="{DynamicResource PrimaryTextBrush}"/>
|
||||
<TextBlock IsHitTestVisible="False" VerticalAlignment="Center" Margin="4,0"
|
||||
FontSize="13" Foreground="{DynamicResource SecondaryTextBrush}" Opacity="0.6"
|
||||
Text="自动带出,或手动选择/填写">
|
||||
<TextBlock.Style>
|
||||
<Style TargetType="TextBlock">
|
||||
<Setter Property="Visibility" Value="Collapsed"/>
|
||||
<Style.Triggers>
|
||||
<DataTrigger Binding="{Binding Entry.SupplierName}" Value="">
|
||||
<Setter Property="Visibility" Value="Visible"/>
|
||||
</DataTrigger>
|
||||
<DataTrigger Binding="{Binding Entry.SupplierName}" Value="{x:Null}">
|
||||
<Setter Property="Visibility" Value="Visible"/>
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</TextBlock.Style>
|
||||
</TextBlock>
|
||||
</Grid>
|
||||
<Button Grid.Column="1" Content="选 择"
|
||||
Command="{Binding OpenSupplierPickerCommand}"
|
||||
Style="{StaticResource ButtonPrimary}"
|
||||
Height="26" Margin="4,0,0,0" FontSize="12" Padding="8,0"/>
|
||||
<Button Grid.Column="2"
|
||||
Command="{Binding ClearSupplierCommand}"
|
||||
Style="{StaticResource ButtonIcon}"
|
||||
Height="26" Width="24" Margin="2,0,0,0" Padding="0"
|
||||
ToolTip="清除供应商"
|
||||
Foreground="{DynamicResource SecondaryTextBrush}"
|
||||
hc:IconElement.Geometry="{StaticResource ErrorGeometry}"/>
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
<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,4"/>
|
||||
</hc:Col>
|
||||
<!-- ===== Row 4: 厂家物料名称 / 保质期 ===== -->
|
||||
<Border Grid.Row="4" Grid.Column="0"
|
||||
Background="{DynamicResource SecondaryRegionBrush}"
|
||||
BorderThickness="0,0,1,1" BorderBrush="{DynamicResource BorderBrush}">
|
||||
<TextBlock Text="厂家物料名称" HorizontalAlignment="Center" VerticalAlignment="Center"
|
||||
FontSize="11" Foreground="{DynamicResource PrimaryTextBrush}"
|
||||
TextWrapping="Wrap" TextAlignment="Center"/>
|
||||
</Border>
|
||||
<Border Grid.Row="4" Grid.Column="1"
|
||||
BorderThickness="0,0,1,1" BorderBrush="{DynamicResource BorderBrush}" Padding="6,0">
|
||||
<TextBlock Text="{Binding Entry.ManufacturerMaterialName}" VerticalAlignment="Center"
|
||||
FontSize="13" Foreground="{DynamicResource SecondaryTextBrush}" TextTrimming="CharacterEllipsis"/>
|
||||
</Border>
|
||||
<Border Grid.Row="4" Grid.Column="2"
|
||||
Background="{DynamicResource SecondaryRegionBrush}"
|
||||
BorderThickness="0,0,1,1" BorderBrush="{DynamicResource BorderBrush}">
|
||||
<TextBlock Text="保质期" HorizontalAlignment="Center" VerticalAlignment="Center"
|
||||
FontSize="12" Foreground="{DynamicResource PrimaryTextBrush}"/>
|
||||
</Border>
|
||||
<Border Grid.Row="4" Grid.Column="3"
|
||||
BorderThickness="0,0,0,1" BorderBrush="{DynamicResource BorderBrush}" Padding="6,0">
|
||||
<TextBlock Text="{Binding Entry.ShelfLife}" VerticalAlignment="Center" FontSize="13"
|
||||
Foreground="{DynamicResource SecondaryTextBrush}" TextTrimming="CharacterEllipsis"/>
|
||||
</Border>
|
||||
|
||||
<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,4"/>
|
||||
</hc:Col>
|
||||
<!-- ===== Row 5: 总重(KG) / 总份数 ===== -->
|
||||
<Border Grid.Row="5" Grid.Column="0"
|
||||
Background="{DynamicResource SecondaryRegionBrush}"
|
||||
BorderThickness="0,0,1,1" BorderBrush="{DynamicResource BorderBrush}">
|
||||
<TextBlock Text="总重(KG)" HorizontalAlignment="Center" VerticalAlignment="Center"
|
||||
FontSize="12" Foreground="{DynamicResource PrimaryTextBrush}"/>
|
||||
</Border>
|
||||
<Border Grid.Row="5" Grid.Column="1"
|
||||
BorderThickness="0,0,1,1" BorderBrush="{DynamicResource BorderBrush}" Padding="4,4">
|
||||
<hc:NumericUpDown Value="{Binding TotalWeightInput}"
|
||||
Minimum="0" DecimalPlaces="2"
|
||||
Style="{StaticResource NumericUpDownPlus}"
|
||||
hc:InfoElement.Placeholder="请输入总重"/>
|
||||
</Border>
|
||||
<Border Grid.Row="5" Grid.Column="2"
|
||||
Background="{DynamicResource SecondaryRegionBrush}"
|
||||
BorderThickness="0,0,1,1" BorderBrush="{DynamicResource BorderBrush}">
|
||||
<TextBlock Text="总份数" HorizontalAlignment="Center" VerticalAlignment="Center"
|
||||
FontSize="12" Foreground="{DynamicResource PrimaryTextBrush}"/>
|
||||
</Border>
|
||||
<Border Grid.Row="5" Grid.Column="3"
|
||||
BorderThickness="0,0,0,1" BorderBrush="{DynamicResource BorderBrush}" Padding="6,0">
|
||||
<TextBlock Text="{Binding SplitTotalPortionsDisplay}" VerticalAlignment="Center"
|
||||
FontSize="13" Foreground="{DynamicResource SecondaryTextBrush}"/>
|
||||
</Border>
|
||||
|
||||
<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,4"/>
|
||||
</hc:Col>
|
||||
<!-- ===== Row 6: 每份总重(KG) / 每份包数 ===== -->
|
||||
<Border Grid.Row="6" Grid.Column="0"
|
||||
Background="{DynamicResource SecondaryRegionBrush}"
|
||||
BorderThickness="0,0,1,1" BorderBrush="{DynamicResource BorderBrush}">
|
||||
<TextBlock Text="每份总重(KG)" HorizontalAlignment="Center" VerticalAlignment="Center"
|
||||
FontSize="11" Foreground="{DynamicResource PrimaryTextBrush}"
|
||||
TextWrapping="Wrap" TextAlignment="Center"/>
|
||||
</Border>
|
||||
<Border Grid.Row="6" Grid.Column="1"
|
||||
BorderThickness="0,0,1,1" BorderBrush="{DynamicResource BorderBrush}" Padding="6,0">
|
||||
<TextBlock Text="{Binding SplitPortionWeightDisplay}" VerticalAlignment="Center"
|
||||
FontSize="13" Foreground="{DynamicResource SecondaryTextBrush}"/>
|
||||
</Border>
|
||||
<Border Grid.Row="6" Grid.Column="2"
|
||||
Background="{DynamicResource SecondaryRegionBrush}"
|
||||
BorderThickness="0,0,1,1" BorderBrush="{DynamicResource BorderBrush}">
|
||||
<TextBlock Text="每份包数" HorizontalAlignment="Center" VerticalAlignment="Center"
|
||||
FontSize="12" Foreground="{DynamicResource PrimaryTextBrush}"/>
|
||||
</Border>
|
||||
<Border Grid.Row="6" Grid.Column="3"
|
||||
BorderThickness="0,0,0,1" BorderBrush="{DynamicResource BorderBrush}" Padding="6,0">
|
||||
<TextBlock Text="{Binding SplitPortionPackagesDisplay}" VerticalAlignment="Center"
|
||||
FontSize="13" Foreground="{DynamicResource SecondaryTextBrush}"/>
|
||||
</Border>
|
||||
|
||||
<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,4"/>
|
||||
</hc:Col>
|
||||
<!-- ===== Row 7: 库位 / 卸货人 ===== -->
|
||||
<Border Grid.Row="7" Grid.Column="0"
|
||||
Background="{DynamicResource SecondaryRegionBrush}"
|
||||
BorderThickness="0,0,1,1" BorderBrush="{DynamicResource BorderBrush}">
|
||||
<TextBlock Text="库位" HorizontalAlignment="Center" VerticalAlignment="Center"
|
||||
FontSize="12" Foreground="{DynamicResource PrimaryTextBrush}"/>
|
||||
</Border>
|
||||
<Border Grid.Row="7" Grid.Column="1"
|
||||
BorderThickness="0,0,1,1" BorderBrush="{DynamicResource BorderBrush}" Padding="4,0">
|
||||
<Grid>
|
||||
<TextBox Text="{Binding Entry.WarehouseLocation, UpdateSourceTrigger=PropertyChanged}"
|
||||
VerticalContentAlignment="Center" BorderThickness="0" Background="Transparent"
|
||||
FontSize="13" Foreground="{DynamicResource PrimaryTextBrush}"/>
|
||||
<TextBlock IsHitTestVisible="False" VerticalAlignment="Center" Margin="4,0"
|
||||
FontSize="13" Foreground="{DynamicResource SecondaryTextBrush}" Opacity="0.6"
|
||||
Text="请填写库位">
|
||||
<TextBlock.Style>
|
||||
<Style TargetType="TextBlock">
|
||||
<Setter Property="Visibility" Value="Collapsed"/>
|
||||
<Style.Triggers>
|
||||
<DataTrigger Binding="{Binding Entry.WarehouseLocation}" Value="">
|
||||
<Setter Property="Visibility" Value="Visible"/>
|
||||
</DataTrigger>
|
||||
<DataTrigger Binding="{Binding Entry.WarehouseLocation}" Value="{x:Null}">
|
||||
<Setter Property="Visibility" Value="Visible"/>
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</TextBlock.Style>
|
||||
</TextBlock>
|
||||
</Grid>
|
||||
</Border>
|
||||
<Border Grid.Row="7" Grid.Column="2"
|
||||
Background="{DynamicResource SecondaryRegionBrush}"
|
||||
BorderThickness="0,0,1,1" BorderBrush="{DynamicResource BorderBrush}">
|
||||
<TextBlock Text="卸货人" HorizontalAlignment="Center" VerticalAlignment="Center"
|
||||
FontSize="12" Foreground="{DynamicResource PrimaryTextBrush}"/>
|
||||
</Border>
|
||||
<Border Grid.Row="7" Grid.Column="3"
|
||||
BorderThickness="0,0,0,1" BorderBrush="{DynamicResource BorderBrush}" Padding="4,0">
|
||||
<Grid>
|
||||
<TextBox Text="{Binding Entry.UnloadOperator, UpdateSourceTrigger=PropertyChanged}"
|
||||
VerticalContentAlignment="Center" BorderThickness="0" Background="Transparent"
|
||||
FontSize="13" Foreground="{DynamicResource PrimaryTextBrush}"/>
|
||||
<TextBlock IsHitTestVisible="False" VerticalAlignment="Center" Margin="4,0"
|
||||
FontSize="13" Foreground="{DynamicResource SecondaryTextBrush}" Opacity="0.6"
|
||||
Text="请填写卸货人">
|
||||
<TextBlock.Style>
|
||||
<Style TargetType="TextBlock">
|
||||
<Setter Property="Visibility" Value="Collapsed"/>
|
||||
<Style.Triggers>
|
||||
<DataTrigger Binding="{Binding Entry.UnloadOperator}" Value="">
|
||||
<Setter Property="Visibility" Value="Visible"/>
|
||||
</DataTrigger>
|
||||
<DataTrigger Binding="{Binding Entry.UnloadOperator}" Value="{x:Null}">
|
||||
<Setter Property="Visibility" Value="Visible"/>
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</TextBlock.Style>
|
||||
</TextBlock>
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
<hc:Col Span="8">
|
||||
<hc:TextBox Text="{Binding SplitTotalPortionsDisplay, Mode=OneWay}"
|
||||
Height="34"
|
||||
hc:InfoElement.Title="总份数"
|
||||
hc:InfoElement.TitleWidth="80"
|
||||
hc:InfoElement.TitlePlacement="Left"
|
||||
hc:InfoElement.Placeholder="根据拆码明细自动拼接"
|
||||
IsReadOnly="True"
|
||||
Margin="0,0,0,4"/>
|
||||
</hc:Col>
|
||||
<!-- ===== Row 8: 备注(末行,无内部底边线) ===== -->
|
||||
<Border Grid.Row="8" Grid.Column="0"
|
||||
Background="{DynamicResource SecondaryRegionBrush}"
|
||||
BorderThickness="0,0,1,0" BorderBrush="{DynamicResource BorderBrush}">
|
||||
<TextBlock Text="备注" HorizontalAlignment="Center" VerticalAlignment="Center"
|
||||
FontSize="12" Foreground="{DynamicResource PrimaryTextBrush}"/>
|
||||
</Border>
|
||||
<Border Grid.Row="8" Grid.Column="1" Grid.ColumnSpan="3" Padding="4,4">
|
||||
<Grid>
|
||||
<TextBox Text="{Binding Entry.Remark, UpdateSourceTrigger=PropertyChanged}"
|
||||
TextWrapping="Wrap" AcceptsReturn="True"
|
||||
VerticalScrollBarVisibility="Auto"
|
||||
BorderThickness="0" Background="Transparent"
|
||||
FontSize="13" VerticalContentAlignment="Top"
|
||||
Foreground="{DynamicResource PrimaryTextBrush}"/>
|
||||
<TextBlock IsHitTestVisible="False" VerticalAlignment="Top" Margin="4,0"
|
||||
FontSize="13" Foreground="{DynamicResource SecondaryTextBrush}" Opacity="0.6"
|
||||
Text="请填写备注">
|
||||
<TextBlock.Style>
|
||||
<Style TargetType="TextBlock">
|
||||
<Setter Property="Visibility" Value="Collapsed"/>
|
||||
<Style.Triggers>
|
||||
<DataTrigger Binding="{Binding Entry.Remark}" Value="">
|
||||
<Setter Property="Visibility" Value="Visible"/>
|
||||
</DataTrigger>
|
||||
<DataTrigger Binding="{Binding Entry.Remark}" Value="{x:Null}">
|
||||
<Setter Property="Visibility" Value="Visible"/>
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</TextBlock.Style>
|
||||
</TextBlock>
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
<hc:Col Span="8">
|
||||
<hc:TextBox Text="{Binding SplitPortionWeightDisplay, Mode=OneWay}"
|
||||
Height="34"
|
||||
hc:InfoElement.Title="每份总重(KG)"
|
||||
hc:InfoElement.TitleWidth="80"
|
||||
hc:InfoElement.TitlePlacement="Left"
|
||||
hc:InfoElement.Placeholder="根据拆码明细自动拼接"
|
||||
IsReadOnly="True"
|
||||
Margin="0,0,0,4"/>
|
||||
</hc:Col>
|
||||
|
||||
<hc:Col Span="8">
|
||||
<hc:TextBox Text="{Binding SplitPortionPackagesDisplay, Mode=OneWay}"
|
||||
Height="34"
|
||||
hc:InfoElement.Title="每份包数"
|
||||
hc:InfoElement.TitleWidth="80"
|
||||
hc:InfoElement.TitlePlacement="Left"
|
||||
hc:InfoElement.Placeholder="根据拆码明细自动拼接"
|
||||
IsReadOnly="True"
|
||||
Margin="0,0,0,4"/>
|
||||
</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,4"/>
|
||||
</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,4"/>
|
||||
</hc:Col>
|
||||
|
||||
<hc:Col Span="8">
|
||||
<hc:ComboBox SelectedValuePath="Value"
|
||||
DisplayMemberPath="Key"
|
||||
ItemsSource="{Binding IsSpecialAdoptionOptions}"
|
||||
SelectedValue="{Binding IsSpecialAdoptionValue}"
|
||||
Height="34"
|
||||
hc:InfoElement.Title="是否特采"
|
||||
hc:InfoElement.TitleWidth="80"
|
||||
hc:InfoElement.TitlePlacement="Left"
|
||||
hc:InfoElement.Placeholder="请选择是否特采"
|
||||
Margin="0,0,0,4"/>
|
||||
</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,4"/>
|
||||
</hc:Col>
|
||||
|
||||
</hc:Row>
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
<StackPanel>
|
||||
<StackPanel.Style>
|
||||
@@ -325,10 +498,9 @@
|
||||
<TextBlock DockPanel.Dock="Left" Text="特采时间" Width="80"
|
||||
VerticalAlignment="Center"
|
||||
Foreground="{DynamicResource PrimaryTextBrush}"/>
|
||||
<hc:DateTimePicker SelectedDateTime="{Binding Entry.SpecialAdoptionTime}"
|
||||
hc:InfoElement.Placeholder="请选择特采时间"
|
||||
hc:InfoElement.ShowClearButton="True"
|
||||
Height="34"/>
|
||||
<ctrls:DateTimeListPicker SelectedDateTime="{Binding Entry.SpecialAdoptionTime, Mode=TwoWay}"
|
||||
DateTimeFormat="yyyy-MM-dd HH:mm:ss"
|
||||
Placeholder="请选择特采时间"/>
|
||||
</DockPanel>
|
||||
</hc:Col>
|
||||
</hc:Row>
|
||||
@@ -415,11 +587,11 @@
|
||||
</TextBlock.Style>
|
||||
</TextBlock>
|
||||
|
||||
<!-- 数据行 -->
|
||||
<!-- 数据行:行高对齐表头 40px,输入框给足上下边距避免边框被裁切 -->
|
||||
<ItemsControl ItemsSource="{Binding SplitCodeDetails}">
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Grid Height="36">
|
||||
<Grid Height="44">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="80"/>
|
||||
<ColumnDefinition Width="130"/>
|
||||
@@ -430,33 +602,38 @@
|
||||
<Border Grid.Column="0" BorderBrush="{DynamicResource BorderBrush}" BorderThickness="0,0,0,1">
|
||||
<TextBox Text="{Binding Portions, UpdateSourceTrigger=PropertyChanged}"
|
||||
HorizontalContentAlignment="Center" VerticalContentAlignment="Center"
|
||||
VerticalAlignment="Center" Height="32"
|
||||
BorderBrush="#D9D9D9" BorderThickness="1"
|
||||
Background="White" FontSize="13" Margin="4,4"/>
|
||||
Background="White" FontSize="13" Margin="4,0"/>
|
||||
</Border>
|
||||
<Border Grid.Column="1" BorderBrush="{DynamicResource BorderBrush}" BorderThickness="0,0,0,1">
|
||||
<TextBox Text="{Binding PortionWeight, UpdateSourceTrigger=PropertyChanged}"
|
||||
HorizontalContentAlignment="Center" VerticalContentAlignment="Center"
|
||||
VerticalAlignment="Center" Height="32"
|
||||
BorderBrush="#D9D9D9" BorderThickness="1"
|
||||
Background="White" FontSize="13" Margin="4,4"/>
|
||||
Background="White" FontSize="13" Margin="4,0"/>
|
||||
</Border>
|
||||
<Border Grid.Column="2" BorderBrush="{DynamicResource BorderBrush}" BorderThickness="0,0,0,1">
|
||||
<TextBox Text="{Binding PortionPackages, UpdateSourceTrigger=PropertyChanged}"
|
||||
HorizontalContentAlignment="Center" VerticalContentAlignment="Center"
|
||||
VerticalAlignment="Center" Height="32"
|
||||
BorderBrush="#D9D9D9" BorderThickness="1"
|
||||
Background="White" FontSize="13" Margin="4,4"/>
|
||||
Background="White" FontSize="13" Margin="4,0"/>
|
||||
</Border>
|
||||
<Border Grid.Column="3" BorderBrush="{DynamicResource BorderBrush}" BorderThickness="0,0,0,1">
|
||||
<TextBox Text="{Binding WarehouseLocation, UpdateSourceTrigger=PropertyChanged}"
|
||||
HorizontalContentAlignment="Center" VerticalContentAlignment="Center"
|
||||
HorizontalContentAlignment="Stretch" VerticalContentAlignment="Center"
|
||||
VerticalAlignment="Center" Height="32"
|
||||
BorderBrush="#D9D9D9" BorderThickness="1"
|
||||
Background="White" FontSize="13" Padding="8,0" Margin="4,4"/>
|
||||
Background="White" FontSize="13" Padding="8,0" Margin="4,0"/>
|
||||
</Border>
|
||||
<Border Grid.Column="4" BorderBrush="{DynamicResource BorderBrush}" BorderThickness="0,0,0,1">
|
||||
<Button Content="删除"
|
||||
Command="{Binding DataContext.RemoveSplitDetailCommand, RelativeSource={RelativeSource AncestorType=ItemsControl}}"
|
||||
CommandParameter="{Binding}"
|
||||
Style="{StaticResource ButtonDanger}"
|
||||
Padding="6,2" Margin="12,4" FontSize="11"/>
|
||||
VerticalAlignment="Center" Height="28"
|
||||
Padding="6,0" Margin="12,0" FontSize="11"/>
|
||||
</Border>
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
@@ -466,11 +643,96 @@
|
||||
</StackPanel>
|
||||
</Border>
|
||||
</StackPanel>
|
||||
</hc:ScrollViewer>
|
||||
</hc:ScrollViewer>
|
||||
|
||||
<GridSplitter x:Name="RightPaneSplitter"
|
||||
Grid.Column="1"
|
||||
Width="4"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Stretch"
|
||||
ResizeBehavior="PreviousAndNext"
|
||||
ShowsPreview="True"
|
||||
Cursor="SizeWE"
|
||||
Background="{DynamicResource RegionBrush}"
|
||||
PreviewStyle="{StaticResource GridSplitterPreviewStyle}"
|
||||
DragCompleted="RightPaneSplitter_OnDragCompleted"/>
|
||||
|
||||
<Border Grid.Column="2"
|
||||
BorderBrush="{DynamicResource BorderBrush}"
|
||||
BorderThickness="1,0,0,0"
|
||||
Background="{DynamicResource RegionBrush}">
|
||||
<DockPanel LastChildFill="True">
|
||||
<Border DockPanel.Dock="Top" BorderBrush="{DynamicResource BorderBrush}" BorderThickness="0,0,0,1" Padding="8,6">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<StackPanel Orientation="Vertical">
|
||||
<TextBlock Text="今日入场" FontWeight="SemiBold" FontSize="13"
|
||||
Foreground="{DynamicResource PrimaryTextBrush}"/>
|
||||
<TextBlock Text="按入场/创建日期为本日的记录" FontSize="11" Opacity="0.65"
|
||||
Foreground="{DynamicResource SecondaryTextBrush}" TextWrapping="Wrap"/>
|
||||
</StackPanel>
|
||||
<Button Grid.Column="1" Content="刷新" Margin="4,0"
|
||||
Command="{Binding RefreshTodayEntriesCommand}"
|
||||
Style="{StaticResource ButtonPrimary}" Padding="8,2" FontSize="11" Height="26"/>
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
<Border DockPanel.Dock="Top" Background="{DynamicResource SecondaryRegionBrush}" Height="28" Padding="8,0">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Text="条码" FontWeight="SemiBold" FontSize="11"
|
||||
VerticalAlignment="Center"
|
||||
Foreground="{DynamicResource PrimaryTextBrush}"/>
|
||||
<TextBlock Grid.Column="1" Text="物料" FontWeight="SemiBold" FontSize="11"
|
||||
Margin="6,0,0,0" VerticalAlignment="Center"
|
||||
Foreground="{DynamicResource PrimaryTextBrush}"/>
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
<ListBox ItemsSource="{Binding TodayEntries}"
|
||||
SelectedItem="{Binding SelectedTodayEntry, Mode=TwoWay}"
|
||||
ScrollViewer.HorizontalScrollBarVisibility="Disabled"
|
||||
BorderThickness="0"
|
||||
Background="Transparent"
|
||||
ItemContainerStyle="{StaticResource TodayEntryListBoxItemStyle}">
|
||||
<ListBox.ItemTemplate>
|
||||
<DataTemplate DataType="{x:Type core:MesXslRawMaterialEntry}">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Grid.Column="0" Text="{Binding Barcode}" FontSize="12"
|
||||
TextTrimming="CharacterEllipsis"
|
||||
Foreground="{DynamicResource PrimaryTextBrush}"
|
||||
ToolTip="{Binding Barcode}"/>
|
||||
<TextBlock Grid.Column="1" Text="{Binding MaterialName}" FontSize="12"
|
||||
TextTrimming="CharacterEllipsis" Margin="6,0,0,0"
|
||||
Foreground="{DynamicResource SecondaryTextBrush}"
|
||||
ToolTip="{Binding MaterialName}"/>
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
</ListBox.ItemTemplate>
|
||||
</ListBox>
|
||||
</DockPanel>
|
||||
</Border>
|
||||
</Grid>
|
||||
|
||||
<StackPanel Grid.Row="2" Orientation="Horizontal" HorizontalAlignment="Center" Margin="0,12,0,20">
|
||||
<Button Content="重置" Command="{Binding ResetCommand}" Style="{StaticResource ButtonDefault}" Margin="0,0,15,0" Width="100"/>
|
||||
<Button Content="保存" Command="{Binding SaveCommand}" Style="{StaticResource ButtonPrimary}" Width="100"/>
|
||||
<Button Content="保存" Command="{Binding SaveCommand}" Style="{StaticResource ButtonPrimary}" Width="100" Margin="0,0,15,0"/>
|
||||
<Button Content="生成原材料卡片"
|
||||
Command="{Binding GenerateRawMaterialCardsCommand}"
|
||||
Style="{StaticResource ButtonDefault}"
|
||||
Width="130"
|
||||
IsEnabled="{Binding CanGenerateCards}"
|
||||
ToolTip="根据拆码明细生成原材料卡片(需先保存入场记录)"/>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
|
||||
@@ -1,30 +1,118 @@
|
||||
using System.ComponentModel;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Controls.Primitives;
|
||||
using YY.Admin.ViewModels.RawMaterialEntry;
|
||||
|
||||
namespace YY.Admin.Views.RawMaterialEntry;
|
||||
|
||||
public partial class RawMaterialEntryOperationView : UserControl
|
||||
{
|
||||
private RawMaterialEntryOperationViewModel? _vm;
|
||||
private bool _initialized;
|
||||
|
||||
public RawMaterialEntryOperationView()
|
||||
{
|
||||
InitializeComponent();
|
||||
Loaded += OnLoaded;
|
||||
DataContextChanged += OnDataContextChanged;
|
||||
Unloaded += (_, _) => DetachVm();
|
||||
}
|
||||
|
||||
private void OnDataContextChanged(object sender, DependencyPropertyChangedEventArgs e)
|
||||
{
|
||||
DetachVm();
|
||||
if (DataContext is RawMaterialEntryOperationViewModel vm)
|
||||
{
|
||||
_vm = vm;
|
||||
vm.PropertyChanged += OnVmPropertyChanged;
|
||||
}
|
||||
|
||||
ApplySplitLayout();
|
||||
}
|
||||
|
||||
private void DetachVm()
|
||||
{
|
||||
if (_vm != null)
|
||||
{
|
||||
_vm.PropertyChanged -= OnVmPropertyChanged;
|
||||
_vm = null;
|
||||
}
|
||||
}
|
||||
|
||||
private void OnVmPropertyChanged(object? sender, PropertyChangedEventArgs e)
|
||||
{
|
||||
// null/空 表示“所有属性”通知(Prism/BindableBase 批量刷新时),需同步分割布局
|
||||
if (!string.IsNullOrEmpty(e.PropertyName)
|
||||
&& e.PropertyName is not nameof(RawMaterialEntryOperationViewModel.IsRightPanelExpanded)
|
||||
&& e.PropertyName is not nameof(RawMaterialEntryOperationViewModel.ExpandedRightPanelWidth))
|
||||
return;
|
||||
|
||||
_ = Dispatcher.InvokeAsync(ApplySplitLayout);
|
||||
}
|
||||
|
||||
/// <summary>按钮 Click 在 Command 之后执行,用于兜底刷新列宽(不重复切换状态)。</summary>
|
||||
private void ToggleTodayPanelButton_OnClick(object sender, RoutedEventArgs e) => ApplySplitLayout();
|
||||
|
||||
private void OnLoaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (_initialized)
|
||||
{
|
||||
return;
|
||||
}
|
||||
// 兜底:XAML 解析 prism:AutoWireViewModel 时设置 DataContext 早于构造函数订阅 DataContextChanged,
|
||||
// 首次进入页面 OnDataContextChanged 会错过回调,导致 _vm 为 null、PropertyChanged 未挂接,
|
||||
// 表现为「首次点击展开/收起按钮不生效」。这里在 Loaded 时补一次订阅。
|
||||
EnsureVmAttached();
|
||||
|
||||
if (DataContext is RawMaterialEntryEditDialogViewModel vm)
|
||||
ApplySplitLayout();
|
||||
|
||||
if (DataContext is RawMaterialEntryOperationViewModel vm && !_initialized)
|
||||
{
|
||||
vm.InitializeForAdd();
|
||||
_initialized = true;
|
||||
_ = vm.LoadTodayEntriesOnFirstShowAsync();
|
||||
}
|
||||
}
|
||||
|
||||
private void EnsureVmAttached()
|
||||
{
|
||||
if (_vm != null) return;
|
||||
if (DataContext is RawMaterialEntryOperationViewModel vm)
|
||||
{
|
||||
_vm = vm;
|
||||
vm.PropertyChanged += OnVmPropertyChanged;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据 ViewModel 同步右侧栏与分割条:展开时使用持久化宽度;折叠时右栏与分割条占宽均为 0(完全隐藏)。
|
||||
/// </summary>
|
||||
private void ApplySplitLayout()
|
||||
{
|
||||
var vm = _vm ?? DataContext as RawMaterialEntryOperationViewModel;
|
||||
if (vm == null) return;
|
||||
|
||||
if (vm.IsRightPanelExpanded)
|
||||
{
|
||||
RightPaneSplitter.Visibility = Visibility.Visible;
|
||||
SplitterCol.Width = new GridLength(4);
|
||||
RightPaneCol.Width = new GridLength(vm.ExpandedRightPanelWidth);
|
||||
}
|
||||
else
|
||||
{
|
||||
RightPaneSplitter.Visibility = Visibility.Collapsed;
|
||||
SplitterCol.Width = new GridLength(0);
|
||||
RightPaneCol.Width = new GridLength(0);
|
||||
}
|
||||
|
||||
MainSplitRoot.InvalidateMeasure();
|
||||
MainSplitRoot.UpdateLayout();
|
||||
}
|
||||
|
||||
private void RightPaneSplitter_OnDragCompleted(object sender, DragCompletedEventArgs e)
|
||||
{
|
||||
var vm = _vm ?? DataContext as RawMaterialEntryOperationViewModel;
|
||||
if (vm == null || !vm.IsRightPanelExpanded || e.Canceled) return;
|
||||
|
||||
var w = RightPaneCol.ActualWidth;
|
||||
if (w >= 120)
|
||||
vm.CommitRightPanelWidthFromView(w);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user