358 lines
15 KiB
XML
358 lines
15 KiB
XML
<UserControl
|
|
x:Class="FATrace.WPLApp.Views.RawProUseView"
|
|
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:prism="http://prismlibrary.com/"
|
|
d:DesignHeight="720"
|
|
d:DesignWidth="1280"
|
|
prism:ViewModelLocator.AutoWireViewModel="True"
|
|
mc:Ignorable="d">
|
|
<UserControl.Resources>
|
|
<!-- 布尔到可见性转换器,用于显示忙碌状态 -->
|
|
<BooleanToVisibilityConverter x:Key="Bool2Vis" />
|
|
</UserControl.Resources>
|
|
<Grid Margin="10">
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="Auto" />
|
|
<RowDefinition Height="Auto" />
|
|
<RowDefinition Height="*" />
|
|
<RowDefinition Height="Auto" />
|
|
</Grid.RowDefinitions>
|
|
|
|
<TextBlock
|
|
Grid.Row="0"
|
|
Margin="0,0,0,8"
|
|
FontSize="20"
|
|
FontWeight="SemiBold"
|
|
Text="原料使用查询" />
|
|
|
|
<!-- 查询条件区域 -->
|
|
<Border
|
|
Grid.Row="1"
|
|
Padding="10"
|
|
Background="#F9F9F9"
|
|
BorderBrush="#DDDDDD"
|
|
BorderThickness="1"
|
|
CornerRadius="4">
|
|
<Grid>
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="2*" />
|
|
<ColumnDefinition Width="2*" />
|
|
<ColumnDefinition Width="2*" />
|
|
<ColumnDefinition Width="2*" />
|
|
<ColumnDefinition Width="2*" />
|
|
</Grid.ColumnDefinitions>
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="Auto" />
|
|
<RowDefinition Height="Auto" />
|
|
<RowDefinition Height="Auto" />
|
|
</Grid.RowDefinitions>
|
|
|
|
<!-- 第一行:编码/名称/批号 -->
|
|
<StackPanel
|
|
Grid.Row="0"
|
|
Grid.Column="0"
|
|
Margin="0,0,10,8"
|
|
Orientation="Horizontal">
|
|
<TextBlock VerticalAlignment="Center" Text="原料编号:" />
|
|
<TextBox Width="160" Text="{Binding RawCode, UpdateSourceTrigger=PropertyChanged}" />
|
|
</StackPanel>
|
|
<StackPanel
|
|
Grid.Row="0"
|
|
Grid.Column="1"
|
|
Margin="0,0,10,8"
|
|
Orientation="Horizontal">
|
|
<TextBlock VerticalAlignment="Center" Text="原料名称:" />
|
|
<TextBox Width="160" Text="{Binding RawName, UpdateSourceTrigger=PropertyChanged}" />
|
|
</StackPanel>
|
|
<StackPanel
|
|
Grid.Row="0"
|
|
Grid.Column="2"
|
|
Margin="0,0,10,8"
|
|
Orientation="Horizontal">
|
|
<TextBlock VerticalAlignment="Center" Text="批号:" />
|
|
<TextBox Width="160" Text="{Binding Batch, UpdateSourceTrigger=PropertyChanged}" />
|
|
</StackPanel>
|
|
<StackPanel
|
|
Grid.Row="0"
|
|
Grid.Column="3"
|
|
Margin="0,0,10,8"
|
|
Orientation="Horizontal">
|
|
<TextBlock VerticalAlignment="Center" Text="操作者:" />
|
|
<TextBox Width="140" Text="{Binding OpUser, UpdateSourceTrigger=PropertyChanged}" />
|
|
</StackPanel>
|
|
<StackPanel
|
|
Grid.Row="0"
|
|
Grid.Column="4"
|
|
Margin="0,0,10,8"
|
|
Orientation="Horizontal">
|
|
<TextBlock VerticalAlignment="Center" Text="确认者:" />
|
|
<TextBox Width="140" Text="{Binding CheckUser, UpdateSourceTrigger=PropertyChanged}" />
|
|
</StackPanel>
|
|
|
|
<!-- 第二行:扫码条件 -->
|
|
<StackPanel
|
|
Grid.Row="1"
|
|
Grid.Column="0"
|
|
Margin="0,0,10,8"
|
|
Orientation="Horizontal">
|
|
<TextBlock VerticalAlignment="Center" Text="内袋二维码:" />
|
|
<TextBox Width="160" Text="{Binding InBagCode, UpdateSourceTrigger=PropertyChanged}" />
|
|
</StackPanel>
|
|
<StackPanel
|
|
Grid.Row="1"
|
|
Grid.Column="1"
|
|
Margin="0,0,10,8"
|
|
Orientation="Horizontal">
|
|
<TextBlock VerticalAlignment="Center" Text="外箱二维码:" />
|
|
<TextBox Width="160" Text="{Binding BoxCode, UpdateSourceTrigger=PropertyChanged}" />
|
|
</StackPanel>
|
|
|
|
<!-- 第三行:时间范围与操作按钮 -->
|
|
<StackPanel
|
|
Grid.Row="2"
|
|
Grid.Column="0"
|
|
Margin="0,5,10,0"
|
|
Orientation="Horizontal">
|
|
<TextBlock VerticalAlignment="Center" Text="开始:" />
|
|
<DatePicker Width="160" SelectedDate="{Binding StartTime, Mode=TwoWay}" />
|
|
</StackPanel>
|
|
<StackPanel
|
|
Grid.Row="2"
|
|
Grid.Column="1"
|
|
Margin="0,5,10,0"
|
|
Orientation="Horizontal">
|
|
<TextBlock VerticalAlignment="Center" Text="结束:" />
|
|
<DatePicker Width="160" SelectedDate="{Binding EndTime, Mode=TwoWay}" />
|
|
</StackPanel>
|
|
<StackPanel
|
|
Grid.Row="2"
|
|
Grid.Column="3"
|
|
Grid.ColumnSpan="2"
|
|
Margin="0,5,10,0"
|
|
HorizontalAlignment="Right"
|
|
Orientation="Horizontal">
|
|
<Button
|
|
Width="80"
|
|
Margin="0,0,8,0"
|
|
Command="{Binding SearchCommand}">
|
|
<StackPanel Orientation="Horizontal">
|
|
<TextBlock
|
|
Margin="0,0,6,0"
|
|
FontFamily="/Assets/Fonts/#iconfont"
|
|
FontSize="16"
|
|
Text="" />
|
|
<TextBlock Text="查询" />
|
|
</StackPanel>
|
|
</Button>
|
|
<Button
|
|
Width="80"
|
|
Margin="0,0,8,0"
|
|
Command="{Binding ClearCommand}">
|
|
<StackPanel Orientation="Horizontal">
|
|
<TextBlock
|
|
Margin="0,0,6,0"
|
|
FontFamily="/Assets/Fonts/#iconfont"
|
|
FontSize="16"
|
|
Text="" />
|
|
<TextBlock Text="清空" />
|
|
</StackPanel>
|
|
</Button>
|
|
<Button Width="100" Command="{Binding ExportCommand}">
|
|
<StackPanel Orientation="Horizontal">
|
|
<TextBlock
|
|
Margin="0,0,6,0"
|
|
FontFamily="/Assets/Fonts/#iconfont"
|
|
FontSize="16"
|
|
Text="" />
|
|
<TextBlock Text="导出Excel" />
|
|
</StackPanel>
|
|
</Button>
|
|
|
|
</StackPanel>
|
|
</Grid>
|
|
</Border>
|
|
|
|
<!-- 列表区域 -->
|
|
<DataGrid
|
|
Grid.Row="2"
|
|
Margin="0,10,0,10"
|
|
AutoGenerateColumns="False"
|
|
CanUserAddRows="False"
|
|
FontSize="16"
|
|
IsReadOnly="True"
|
|
ItemsSource="{Binding Items}"
|
|
RowHeight="34">
|
|
<DataGrid.RowStyle>
|
|
<Style BasedOn="{StaticResource {x:Type DataGridRow}}" TargetType="DataGridRow">
|
|
<Setter Property="Background" Value="LimeGreen" />
|
|
<Style.Triggers>
|
|
<DataTrigger Binding="{Binding OutTime.Year}" Value="1970">
|
|
<Setter Property="Background" Value="White" />
|
|
</DataTrigger>
|
|
<Trigger Property="IsSelected" Value="True">
|
|
<Setter Property="Background" Value="#FFBEE6FD" />
|
|
</Trigger>
|
|
</Style.Triggers>
|
|
</Style>
|
|
</DataGrid.RowStyle>
|
|
<DataGrid.CellStyle>
|
|
<Style BasedOn="{StaticResource {x:Type DataGridCell}}" TargetType="DataGridCell">
|
|
<Setter Property="Background" Value="{Binding RelativeSource={RelativeSource AncestorType=DataGridRow}, Path=Background}" />
|
|
<Style.Triggers>
|
|
<Trigger Property="IsSelected" Value="True">
|
|
<Setter Property="Background" Value="#FFBEE6FD" />
|
|
</Trigger>
|
|
</Style.Triggers>
|
|
</Style>
|
|
</DataGrid.CellStyle>
|
|
<DataGrid.ColumnHeaderStyle>
|
|
<Style TargetType="DataGridColumnHeader">
|
|
<Setter Property="FontSize" Value="18" />
|
|
<Setter Property="FontWeight" Value="Bold" />
|
|
<Setter Property="HorizontalContentAlignment" Value="Center" />
|
|
</Style>
|
|
</DataGrid.ColumnHeaderStyle>
|
|
<DataGrid.Columns>
|
|
<DataGridTextColumn
|
|
Width="120"
|
|
Binding="{Binding RawCode}"
|
|
Header="原料编号" />
|
|
<DataGridTextColumn
|
|
Width="160"
|
|
Binding="{Binding RawName}"
|
|
Header="原料名称" />
|
|
<DataGridTextColumn
|
|
Width="280"
|
|
Binding="{Binding InBagCode}"
|
|
Header="内袋二维码" />
|
|
<DataGridTextColumn
|
|
Width="300"
|
|
Binding="{Binding BoxCode}"
|
|
Header="外箱二维码" />
|
|
<DataGridTextColumn
|
|
Width="120"
|
|
Binding="{Binding Batch}"
|
|
Header="批号" />
|
|
<DataGridTextColumn
|
|
Width="100"
|
|
Binding="{Binding ShelfLife}"
|
|
Header="保质期(月)" />
|
|
<DataGridTextColumn
|
|
Width="120"
|
|
Binding="{Binding Weight}"
|
|
Header="称重重量(g)" />
|
|
<DataGridTextColumn
|
|
Width="120"
|
|
Binding="{Binding RemainWeight, StringFormat=F5}"
|
|
Header="剩余重量(Kg)" />
|
|
<DataGridTextColumn
|
|
Width="140"
|
|
Binding="{Binding StockWeight}"
|
|
Header="入库总重量(Kg)" />
|
|
<DataGridTextColumn
|
|
Width="160"
|
|
Binding="{Binding WeightTime, StringFormat=yyyy-MM-dd HH:mm:ss}"
|
|
Header="称重时间" />
|
|
<DataGridTextColumn
|
|
Width="100"
|
|
Binding="{Binding OpUser}"
|
|
Header="操作者" />
|
|
<DataGridTextColumn
|
|
Width="150"
|
|
Binding="{Binding CheckUser}"
|
|
Header="确认者" />
|
|
<DataGridTextColumn
|
|
Width="160"
|
|
Binding="{Binding OutTime, StringFormat=yyyy-MM-dd HH:mm:ss}"
|
|
Header="出库时间" />
|
|
<!--<DataGridTextColumn
|
|
Width="160"
|
|
Binding="{Binding CreateTime, StringFormat=yyyy-MM-dd HH:mm:ss}"
|
|
Header="创建时间" />-->
|
|
</DataGrid.Columns>
|
|
</DataGrid>
|
|
|
|
<!-- 状态栏 -->
|
|
<StatusBar Grid.Row="3">
|
|
<StatusBarItem>
|
|
<TextBlock Text="本页:" />
|
|
</StatusBarItem>
|
|
<StatusBarItem>
|
|
<TextBlock Text="{Binding Items.Count}" />
|
|
</StatusBarItem>
|
|
<StatusBarItem>
|
|
<TextBlock Text=" 总数:" />
|
|
</StatusBarItem>
|
|
<StatusBarItem>
|
|
<TextBlock Text="{Binding TotalCount}" />
|
|
</StatusBarItem>
|
|
<StatusBarItem>
|
|
<Separator Width="20" />
|
|
</StatusBarItem>
|
|
<StatusBarItem>
|
|
<TextBlock Text="页码:" />
|
|
</StatusBarItem>
|
|
<StatusBarItem>
|
|
<TextBlock Text="{Binding PageIndex}" />
|
|
</StatusBarItem>
|
|
<StatusBarItem>
|
|
<TextBlock Text="/" />
|
|
</StatusBarItem>
|
|
<StatusBarItem>
|
|
<TextBlock Text="{Binding TotalPages}" />
|
|
</StatusBarItem>
|
|
<StatusBarItem>
|
|
<Button
|
|
Width="40"
|
|
Margin="5,0"
|
|
Command="{Binding FirstPageCommand}"
|
|
Content="|<" />
|
|
</StatusBarItem>
|
|
<StatusBarItem>
|
|
<Button
|
|
Width="40"
|
|
Margin="5,0"
|
|
Command="{Binding PrevPageCommand}"
|
|
Content="<" />
|
|
</StatusBarItem>
|
|
<StatusBarItem>
|
|
<Button
|
|
Width="40"
|
|
Margin="5,0"
|
|
Command="{Binding NextPageCommand}"
|
|
Content=">" />
|
|
</StatusBarItem>
|
|
<StatusBarItem>
|
|
<Button
|
|
Width="40"
|
|
Margin="5,0"
|
|
Command="{Binding LastPageCommand}"
|
|
Content=">|" />
|
|
</StatusBarItem>
|
|
<StatusBarItem>
|
|
<Separator Width="20" />
|
|
</StatusBarItem>
|
|
<StatusBarItem>
|
|
<TextBlock Text="页大小:" />
|
|
</StatusBarItem>
|
|
<StatusBarItem>
|
|
<ComboBox
|
|
Width="80"
|
|
SelectedValue="{Binding PageSize, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
|
|
SelectedValuePath="Content">
|
|
<ComboBoxItem Content="10" />
|
|
<ComboBoxItem Content="20" />
|
|
<ComboBoxItem Content="50" />
|
|
<ComboBoxItem Content="100" />
|
|
</ComboBox>
|
|
</StatusBarItem>
|
|
<StatusBarItem HorizontalAlignment="Right">
|
|
<TextBlock Text="正在处理..." Visibility="{Binding IsBusy, Converter={StaticResource Bool2Vis}}" />
|
|
</StatusBarItem>
|
|
</StatusBar>
|
|
</Grid>
|
|
</UserControl>
|