Excel 数据导入
This commit is contained in:
@@ -2,12 +2,13 @@
|
||||
x:Class="FATrace.WPLApp.Views.OEMOutboundView"
|
||||
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: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"
|
||||
d:DesignWidth="1280" d:DesignHeight="720">
|
||||
mc:Ignorable="d">
|
||||
<UserControl.Resources>
|
||||
<BooleanToVisibilityConverter x:Key="Bool2Vis" />
|
||||
</UserControl.Resources>
|
||||
@@ -26,8 +27,14 @@
|
||||
FontWeight="SemiBold"
|
||||
Text="OEM-出库" />
|
||||
|
||||
<!-- 查询条件区域 -->
|
||||
<Border Grid.Row="1" Padding="10" Background="#F9F9F9" BorderBrush="#DDDDDD" BorderThickness="1" CornerRadius="4">
|
||||
<!-- 查询条件区域 -->
|
||||
<Border
|
||||
Grid.Row="1"
|
||||
Padding="10"
|
||||
Background="#F9F9F9"
|
||||
BorderBrush="#DDDDDD"
|
||||
BorderThickness="1"
|
||||
CornerRadius="4">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="2*" />
|
||||
@@ -41,45 +48,88 @@
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!-- 第一行:产地、原料代码、原料名称、批号 -->
|
||||
<StackPanel Orientation="Horizontal" Grid.Row="0" Grid.Column="0" Margin="0,0,10,8">
|
||||
<!-- 第一行:产地、原料代码、原料名称、批号 -->
|
||||
<StackPanel
|
||||
Grid.Row="0"
|
||||
Grid.Column="0"
|
||||
Margin="0,0,10,8"
|
||||
Orientation="Horizontal">
|
||||
<TextBlock VerticalAlignment="Center" Text="产地:" />
|
||||
<TextBox Width="160" Text="{Binding Origin, UpdateSourceTrigger=PropertyChanged}" />
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal" Grid.Row="0" Grid.Column="1" Margin="0,0,10,8">
|
||||
<StackPanel
|
||||
Grid.Row="0"
|
||||
Grid.Column="1"
|
||||
Margin="0,0,10,8"
|
||||
Orientation="Horizontal">
|
||||
<TextBlock VerticalAlignment="Center" Text="原料代码:" />
|
||||
<TextBox Width="160" Text="{Binding RawCode, UpdateSourceTrigger=PropertyChanged}" />
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal" Grid.Row="0" Grid.Column="2" Margin="0,0,10,8">
|
||||
<StackPanel
|
||||
Grid.Row="0"
|
||||
Grid.Column="2"
|
||||
Margin="0,0,10,8"
|
||||
Orientation="Horizontal">
|
||||
<TextBlock VerticalAlignment="Center" Text="原料名称:" />
|
||||
<TextBox Width="160" Text="{Binding RawName, UpdateSourceTrigger=PropertyChanged}" />
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal" Grid.Row="0" Grid.Column="3" Margin="0,0,10,8">
|
||||
<StackPanel
|
||||
Grid.Row="0"
|
||||
Grid.Column="3"
|
||||
Margin="0,0,10,8"
|
||||
Orientation="Horizontal">
|
||||
<TextBlock VerticalAlignment="Center" Text="批号:" />
|
||||
<TextBox Width="160" Text="{Binding Batch, UpdateSourceTrigger=PropertyChanged}" />
|
||||
</StackPanel>
|
||||
|
||||
<!-- 第二行:日期范围(登录日期时间) -->
|
||||
<StackPanel Orientation="Horizontal" Grid.Row="1" Grid.Column="0" Margin="0,5,10,0">
|
||||
<!-- 第二行:日期范围(登录日期时间) -->
|
||||
<StackPanel
|
||||
Grid.Row="1"
|
||||
Grid.Column="0"
|
||||
Margin="0,5,10,0"
|
||||
Orientation="Horizontal">
|
||||
<TextBlock VerticalAlignment="Center" Text="开始日期:" />
|
||||
<DatePicker Width="160" SelectedDate="{Binding StartDate, Mode=TwoWay}" />
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal" Grid.Row="1" Grid.Column="1" Margin="0,5,10,0">
|
||||
<StackPanel
|
||||
Grid.Row="1"
|
||||
Grid.Column="1"
|
||||
Margin="0,5,10,0"
|
||||
Orientation="Horizontal">
|
||||
<TextBlock VerticalAlignment="Center" Text="结束日期:" />
|
||||
<DatePicker Width="160" SelectedDate="{Binding EndDate, Mode=TwoWay}" />
|
||||
</StackPanel>
|
||||
|
||||
<!-- 第三行:按钮 -->
|
||||
<StackPanel Orientation="Horizontal" Grid.Row="2" Grid.Column="3" Margin="0,5,10,0" HorizontalAlignment="Right">
|
||||
<Button Width="80" Margin="0,0,8,0" Command="{Binding SearchCommand}">
|
||||
<!-- 第三行:按钮 -->
|
||||
<StackPanel
|
||||
Grid.Row="2"
|
||||
Grid.Column="3"
|
||||
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
|
||||
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}">
|
||||
<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
|
||||
Margin="0,0,6,0"
|
||||
FontFamily="/Assets/Fonts/#iconfont"
|
||||
FontSize="16"
|
||||
Text="" />
|
||||
<TextBlock Text="清空" />
|
||||
</StackPanel>
|
||||
</Button>
|
||||
@@ -87,14 +137,16 @@
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
<!-- 列表区域 -->
|
||||
<DataGrid Grid.Row="2" Margin="0,10,0,10"
|
||||
ItemsSource="{Binding Items}"
|
||||
AutoGenerateColumns="False"
|
||||
CanUserAddRows="False"
|
||||
FontSize="15"
|
||||
IsReadOnly="True"
|
||||
RowHeight="34">
|
||||
<!-- 列表区域 -->
|
||||
<DataGrid
|
||||
Grid.Row="2"
|
||||
Margin="0,10,0,10"
|
||||
AutoGenerateColumns="False"
|
||||
CanUserAddRows="False"
|
||||
FontSize="15"
|
||||
IsReadOnly="True"
|
||||
ItemsSource="{Binding Items}"
|
||||
RowHeight="34">
|
||||
<DataGrid.ColumnHeaderStyle>
|
||||
<Style TargetType="DataGridColumnHeader">
|
||||
<Setter Property="FontSize" Value="18" />
|
||||
@@ -103,20 +155,50 @@
|
||||
</Style>
|
||||
</DataGrid.ColumnHeaderStyle>
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn Header="批号" Binding="{Binding Batch}" Width="120" />
|
||||
<DataGridTextColumn Header="重量" Binding="{Binding Weight}" Width="100" />
|
||||
<DataGridTextColumn Header="保质期" Binding="{Binding ShelfLife}" Width="80" />
|
||||
<DataGridTextColumn Header="产地" Binding="{Binding Origin}" Width="100" />
|
||||
<DataGridTextColumn Header="原料代码" Binding="{Binding RawCode}" Width="140" />
|
||||
<DataGridTextColumn Header="原料名称" Binding="{Binding RawName}" Width="180" />
|
||||
<DataGridTextColumn Header="序号" Binding="{Binding SequenceNo}" Width="80" />
|
||||
<DataGridTextColumn Header="登录日" Binding="{Binding LoginDate}" Width="120" />
|
||||
<DataGridTextColumn Header="登录时间" Binding="{Binding LoginTime}" Width="120" />
|
||||
<DataGridTextColumn Header="登录日期时间" Binding="{Binding LoginDateTime}" Width="180" />
|
||||
<DataGridTextColumn
|
||||
Width="120"
|
||||
Binding="{Binding Batch}"
|
||||
Header="批号" />
|
||||
<DataGridTextColumn
|
||||
Width="100"
|
||||
Binding="{Binding Weight}"
|
||||
Header="重量(g)" />
|
||||
<DataGridTextColumn
|
||||
Width="80"
|
||||
Binding="{Binding ShelfLife}"
|
||||
Header="保质期" />
|
||||
<DataGridTextColumn
|
||||
Width="100"
|
||||
Binding="{Binding Origin}"
|
||||
Header="产地" />
|
||||
<DataGridTextColumn
|
||||
Width="140"
|
||||
Binding="{Binding RawCode}"
|
||||
Header="原料代码" />
|
||||
<DataGridTextColumn
|
||||
Width="180"
|
||||
Binding="{Binding RawName}"
|
||||
Header="原料名称" />
|
||||
<DataGridTextColumn
|
||||
Width="80"
|
||||
Binding="{Binding SequenceNo}"
|
||||
Header="序号" />
|
||||
<DataGridTextColumn
|
||||
Width="120"
|
||||
Binding="{Binding LoginDate}"
|
||||
Header="登录日" />
|
||||
<DataGridTextColumn
|
||||
Width="120"
|
||||
Binding="{Binding LoginTime}"
|
||||
Header="登录时间" />
|
||||
<DataGridTextColumn
|
||||
Width="180"
|
||||
Binding="{Binding LoginDateTime}"
|
||||
Header="登录日期时间" />
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
|
||||
<!-- 状态栏 -->
|
||||
<!-- 状态栏 -->
|
||||
<StatusBar Grid.Row="3">
|
||||
<StatusBarItem>
|
||||
<TextBlock Text="本页:" />
|
||||
@@ -146,16 +228,32 @@
|
||||
<TextBlock Text="{Binding TotalPages}" />
|
||||
</StatusBarItem>
|
||||
<StatusBarItem>
|
||||
<Button Content="|<" Width="40" Margin="5,0" Command="{Binding FirstPageCommand}" />
|
||||
<Button
|
||||
Width="40"
|
||||
Margin="5,0"
|
||||
Command="{Binding FirstPageCommand}"
|
||||
Content="|<" />
|
||||
</StatusBarItem>
|
||||
<StatusBarItem>
|
||||
<Button Content="<" Width="40" Margin="5,0" Command="{Binding PrevPageCommand}" />
|
||||
<Button
|
||||
Width="40"
|
||||
Margin="5,0"
|
||||
Command="{Binding PrevPageCommand}"
|
||||
Content="<" />
|
||||
</StatusBarItem>
|
||||
<StatusBarItem>
|
||||
<Button Content=">" Width="40" Margin="5,0" Command="{Binding NextPageCommand}" />
|
||||
<Button
|
||||
Width="40"
|
||||
Margin="5,0"
|
||||
Command="{Binding NextPageCommand}"
|
||||
Content=">" />
|
||||
</StatusBarItem>
|
||||
<StatusBarItem>
|
||||
<Button Content=">|" Width="40" Margin="5,0" Command="{Binding LastPageCommand}" />
|
||||
<Button
|
||||
Width="40"
|
||||
Margin="5,0"
|
||||
Command="{Binding LastPageCommand}"
|
||||
Content=">|" />
|
||||
</StatusBarItem>
|
||||
<StatusBarItem>
|
||||
<Separator Width="20" />
|
||||
@@ -164,7 +262,10 @@
|
||||
<TextBlock Text="页大小:" />
|
||||
</StatusBarItem>
|
||||
<StatusBarItem>
|
||||
<ComboBox Width="80" SelectedValue="{Binding PageSize, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" SelectedValuePath="Content">
|
||||
<ComboBox
|
||||
Width="80"
|
||||
SelectedValue="{Binding PageSize, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
|
||||
SelectedValuePath="Content">
|
||||
<ComboBoxItem Content="10" />
|
||||
<ComboBoxItem Content="20" />
|
||||
<ComboBoxItem Content="50" />
|
||||
|
||||
Reference in New Issue
Block a user