|
@@ -4,14 +4,655 @@
|
|
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
|
xmlns:local="clr-namespace:UniformMaterialManagementSystem.Views"
|
|
|
+ xmlns:b="http://schemas.microsoft.com/xaml/behaviors"
|
|
|
+ xmlns:behavoirs="clr-namespace:UniformMaterialManagementSystem.Behaviors"
|
|
|
+ xmlns:utils="clr-namespace:UniformMaterialManagementSystem.Utils"
|
|
|
+ xmlns:converters="clr-namespace:UniformMaterialManagementSystem.Converters"
|
|
|
+ xmlns:fdg="http://FilterDataGrid.Control.com/2024"
|
|
|
+ xmlns:custom="clr-namespace:UniformMaterialManagementSystem.Custom"
|
|
|
mc:Ignorable="d"
|
|
|
d:DesignHeight="450" d:DesignWidth="800">
|
|
|
+
|
|
|
+ <UserControl.Resources>
|
|
|
+ <!-- 工具栏按钮模板 -->
|
|
|
+ <ControlTemplate x:Key="CustomToolBarButtomTemplate" TargetType="Button">
|
|
|
+ <!-- 按钮文本超出2个字,设置 Width 宽度自适应。再设置 Padding ,增加按钮左右的空白 -->
|
|
|
+ <Border Width="auto"
|
|
|
+ Background="{TemplateBinding Background}"
|
|
|
+ CornerRadius="5">
|
|
|
+ <StackPanel HorizontalAlignment="Center" Orientation="Vertical">
|
|
|
+ <TextBlock HorizontalAlignment="Center"
|
|
|
+ FontFamily="{StaticResource FluentSystemIconsRegular}"
|
|
|
+ FontSize="20"
|
|
|
+ Text="{TemplateBinding Tag}" />
|
|
|
+ <TextBlock Text="{TemplateBinding Content}"
|
|
|
+ Padding="5 0 5 0" />
|
|
|
+ </StackPanel>
|
|
|
+ </Border>
|
|
|
+ <ControlTemplate.Triggers>
|
|
|
+ <Trigger Property="IsMouseOver" Value="True">
|
|
|
+ <Setter Property="Background" Value="LightGray" />
|
|
|
+ </Trigger>
|
|
|
+ </ControlTemplate.Triggers>
|
|
|
+ </ControlTemplate>
|
|
|
+
|
|
|
+ <!-- 列标题模板:必须在列标题样式引用之前定义 -->
|
|
|
+ <ControlTemplate x:Key="CustomColumnHeaderTemplate" TargetType="DataGridColumnHeader">
|
|
|
+ <!-- BorderThickness 分别设置左,上,右,下的边框宽度。 -->
|
|
|
+ <Border BorderThickness="0, 0, 1, 1" BorderBrush="Black">
|
|
|
+ <Grid>
|
|
|
+ <Grid.ColumnDefinitions>
|
|
|
+ <ColumnDefinition />
|
|
|
+ <ColumnDefinition Width="Auto" />
|
|
|
+ </Grid.ColumnDefinitions>
|
|
|
+ <!-- 重定义控件模板,在 Style 中设置的居中属性会被覆盖,所以在这里也需要设置居中 -->
|
|
|
+ <ContentPresenter Grid.Column="0"
|
|
|
+ HorizontalAlignment="Center" VerticalAlignment="Center" />
|
|
|
+ <!-- 列排序图标 -->
|
|
|
+ <Path x:Name="SortArrow"
|
|
|
+ Grid.Column="1"
|
|
|
+ Margin="0,0,5,0"
|
|
|
+ VerticalAlignment="Center"
|
|
|
+ Data="M 0 0 L 10 0 L 5 5 Z"
|
|
|
+ Fill="Gray"
|
|
|
+ Visibility="Collapsed" />
|
|
|
+ </Grid>
|
|
|
+ </Border>
|
|
|
+ <!-- 列排序按钮 -->
|
|
|
+ <ControlTemplate.Triggers>
|
|
|
+ <Trigger Property="SortDirection" Value="Ascending">
|
|
|
+ <Setter TargetName="SortArrow" Property="Data" Value="M 0 5 L 10 5 L 5 0 Z" />
|
|
|
+ <Setter TargetName="SortArrow" Property="Visibility" Value="Visible" />
|
|
|
+ </Trigger>
|
|
|
+ <Trigger Property="SortDirection" Value="Descending">
|
|
|
+ <Setter TargetName="SortArrow" Property="Data" Value="M 0 0 L 10 0 L 5 5 Z" />
|
|
|
+ <Setter TargetName="SortArrow" Property="Visibility" Value="Visible" />
|
|
|
+ </Trigger>
|
|
|
+ </ControlTemplate.Triggers>
|
|
|
+ </ControlTemplate>
|
|
|
+
|
|
|
+ <!-- 列标题样式 -->
|
|
|
+ <Style x:Key="CustomColumnHeaderStyle" TargetType="DataGridColumnHeader">
|
|
|
+ <Setter Property="Background" Value="White" />
|
|
|
+ <Setter Property="Foreground" Value="Black" />
|
|
|
+ <Setter Property="FontWeight" Value="Bold" />
|
|
|
+ <Setter Property="HorizontalContentAlignment" Value="Center" />
|
|
|
+ <Setter Property="VerticalContentAlignment" Value="Center" />
|
|
|
+ <Setter Property="Height" Value="40" />
|
|
|
+ <Setter Property="Template" Value="{StaticResource CustomColumnHeaderTemplate}" />
|
|
|
+ </Style>
|
|
|
+
|
|
|
+ <!-- 行标题样式 -->
|
|
|
+ <Style x:Key="CustomRowHeaderStyle" TargetType="DataGridRowHeader">
|
|
|
+ <!-- 通过 Template 设置行号、居中、边框 -->
|
|
|
+ <Setter Property="Template">
|
|
|
+ <Setter.Value>
|
|
|
+ <ControlTemplate TargetType="DataGridRowHeader">
|
|
|
+ <!-- 在这里设置 Width 会受到 DataGrid.RowHeaderWidth 的限制,显示不全 -->
|
|
|
+ <Label Width="30"
|
|
|
+ Background="White"
|
|
|
+ BorderBrush="Black"
|
|
|
+ BorderThickness="0 0 1 1"
|
|
|
+ Content="{Binding Path=Header, RelativeSource={RelativeSource AncestorType=DataGridRow}}"
|
|
|
+ HorizontalContentAlignment="Center" />
|
|
|
+ </ControlTemplate>
|
|
|
+ </Setter.Value>
|
|
|
+ </Setter>
|
|
|
+ </Style>
|
|
|
+
|
|
|
+ <!-- DataGrid 左上角样式 -->
|
|
|
+ <Style TargetType="Button"
|
|
|
+ x:Key="{ComponentResourceKey ResourceId=DataGridSelectAllButtonStyle, TypeInTargetAssembly={x:Type DataGrid}}">
|
|
|
+ <!-- 模板里面放 Border 添加边框 -->
|
|
|
+ <Setter Property="Template">
|
|
|
+ <Setter.Value>
|
|
|
+ <ControlTemplate TargetType="Button">
|
|
|
+ <Border Background="White"
|
|
|
+ BorderBrush="Black"
|
|
|
+ BorderThickness="0 0 1 1" />
|
|
|
+ </ControlTemplate>
|
|
|
+ </Setter.Value>
|
|
|
+ </Setter>
|
|
|
+ </Style>
|
|
|
+
|
|
|
+ <!-- 行样式 -->
|
|
|
+ <Style x:Key="CustomRowStyle" TargetType="DataGridRow">
|
|
|
+ <Setter Property="Background" Value="White" />
|
|
|
+ <Setter Property="FontSize" Value="14" />
|
|
|
+ <Setter Property="Height" Value="30" />
|
|
|
+
|
|
|
+ <Style.Triggers>
|
|
|
+ <Trigger Property="AlternationIndex" Value="1">
|
|
|
+ <Setter Property="Background" Value="WhiteSmoke" />
|
|
|
+ </Trigger>
|
|
|
+ <Trigger Property="IsSelected" Value="True">
|
|
|
+ <Setter Property="Background" Value="LightBlue" />
|
|
|
+ </Trigger>
|
|
|
+ </Style.Triggers>
|
|
|
+ </Style>
|
|
|
+
|
|
|
+ <!-- todo 为什么必须设置文本列样式之后才能居中,单元格设置不起作用? -->
|
|
|
+ <!-- 单元格样式 -->
|
|
|
+ <Style x:Key="CustomCellStyle" TargetType="DataGridCell"
|
|
|
+ BasedOn="{StaticResource {x:Type DataGridCell}}">
|
|
|
+ <Setter Property="Background" Value="White" />
|
|
|
+ <Setter Property="HorizontalContentAlignment" Value="Center" />
|
|
|
+ <Setter Property="VerticalContentAlignment" Value="Center" />
|
|
|
+ <Setter Property="Padding" Value="10" />
|
|
|
+ <Setter Property="BorderThickness" Value="0" />
|
|
|
+ <Style.Triggers>
|
|
|
+ <Trigger Property="IsSelected" Value="True">
|
|
|
+ <Setter Property="Background" Value="LightBlue" />
|
|
|
+ <Setter Property="Foreground" Value="Black" />
|
|
|
+ </Trigger>
|
|
|
+ </Style.Triggers>
|
|
|
+ </Style>
|
|
|
+
|
|
|
+ <!-- 文本列居中 -->
|
|
|
+ <Style x:Key="TextColumnElementStyle" TargetType="TextBlock">
|
|
|
+ <Setter Property="HorizontalAlignment" Value="Center" />
|
|
|
+ <Setter Property="VerticalAlignment" Value="Center" />
|
|
|
+ <Setter Property="TextAlignment" Value="Center" />
|
|
|
+ </Style>
|
|
|
+
|
|
|
+ <!-- 文本列编辑状态居左 -->
|
|
|
+ <Style x:Key="TextColumnEditingStyle" TargetType="TextBox">
|
|
|
+ <Setter Property="HorizontalContentAlignment" Value="Left" />
|
|
|
+ <Setter Property="VerticalContentAlignment" Value="Center" />
|
|
|
+ </Style>
|
|
|
+
|
|
|
+ <!-- 复选框列居中 -->
|
|
|
+ <Style x:Key="CheckBoxColumnElementStyle" TargetType="CheckBox">
|
|
|
+ <Setter Property="HorizontalAlignment" Value="Center" />
|
|
|
+ <Setter Property="VerticalAlignment" Value="Center" />
|
|
|
+ <Setter Property="Padding" Value="0, 5, 0, 5" />
|
|
|
+ </Style>
|
|
|
+
|
|
|
+ <!-- Label 样式:自带边框 -->
|
|
|
+ <Style x:Key="CustomLabelStyle" TargetType="Label">
|
|
|
+ <Setter Property="BorderBrush" Value="Gray" />
|
|
|
+ <Setter Property="BorderThickness" Value="1 0 1 0" />
|
|
|
+ <Setter Property="Width" Value="100" />
|
|
|
+ <Setter Property="FontWeight" Value="Bold" />
|
|
|
+ <Setter Property="VerticalAlignment" Value="Stretch" />
|
|
|
+ <Setter Property="HorizontalContentAlignment" Value="Center" />
|
|
|
+ <Setter Property="VerticalContentAlignment" Value="Center" />
|
|
|
+ <!--<Setter Property="FontSize" Value="14" />-->
|
|
|
+ </Style>
|
|
|
+
|
|
|
+ <!-- todo Template 里的使用样式;特殊的字段单独设置样式和模板 -->
|
|
|
+ <!-- 编辑界面字段 -->
|
|
|
+ <Style x:Key="CustomFieldTextBoxStyle" TargetType="TextBox">
|
|
|
+ <Setter Property="Template" >
|
|
|
+ <Setter.Value>
|
|
|
+ <ControlTemplate>
|
|
|
+ <StackPanel Orientation="Horizontal">
|
|
|
+ <TextBlock Text="{Binding Tag, RelativeSource={RelativeSource TemplatedParent}}"
|
|
|
+ Width="100"
|
|
|
+ Height="20"
|
|
|
+ FontSize="14"
|
|
|
+ VerticalAlignment="Center"
|
|
|
+ TextAlignment="Right"
|
|
|
+ Margin="5" />
|
|
|
+ <TextBox Text="{Binding Text, RelativeSource={RelativeSource TemplatedParent}}"
|
|
|
+ IsEnabled="{Binding IsEnabled, RelativeSource={RelativeSource TemplatedParent}}"
|
|
|
+ BorderBrush="Gray"
|
|
|
+ BorderThickness="1"
|
|
|
+ Width="250"
|
|
|
+ Height="30"
|
|
|
+ FontSize="14"
|
|
|
+ HorizontalContentAlignment="Center"
|
|
|
+ VerticalContentAlignment="Center"
|
|
|
+ Margin="0 5 0 5" />
|
|
|
+ </StackPanel>
|
|
|
+ </ControlTemplate>
|
|
|
+ </Setter.Value>
|
|
|
+ </Setter>
|
|
|
+ </Style>
|
|
|
+
|
|
|
+ <!-- TextBlock 样式 -->
|
|
|
+ <Style x:Key="CustomTextBlockStyle" TargetType="TextBlock">
|
|
|
+ <Setter Property="Width" Value="100" />
|
|
|
+ <Setter Property="Height" Value="20" />
|
|
|
+ <Setter Property="FontSize" Value="14" />
|
|
|
+ <Setter Property="VerticalAlignment" Value="Center" />
|
|
|
+ <Setter Property="TextAlignment" Value="Right" />
|
|
|
+ <Setter Property="Margin" Value="5" />
|
|
|
+ </Style>
|
|
|
+
|
|
|
+ <!-- 转换器 -->
|
|
|
+ <converters:MultiParamConverter x:Key="MultiParamConverter" />
|
|
|
+
|
|
|
+ </UserControl.Resources>
|
|
|
+
|
|
|
<Grid>
|
|
|
- <Border BorderBrush="Gray"
|
|
|
- BorderThickness="1"
|
|
|
- Background="White">
|
|
|
- <ContentControl x:Name="currContentControl" />
|
|
|
+ <Grid.ColumnDefinitions>
|
|
|
+ <ColumnDefinition Width="*" />
|
|
|
+ <ColumnDefinition Width="*" />
|
|
|
+ </Grid.ColumnDefinitions>
|
|
|
+ <Grid.RowDefinitions>
|
|
|
+ <RowDefinition Height="auto" />
|
|
|
+ <RowDefinition Height="auto" />
|
|
|
+ <RowDefinition Height="auto" />
|
|
|
+ <RowDefinition Height="auto" />
|
|
|
+ <RowDefinition Height="*" />
|
|
|
+ </Grid.RowDefinitions>
|
|
|
+
|
|
|
+ <!-- 主表工具栏 -->
|
|
|
+ <Border x:Name="toolBarDelivery"
|
|
|
+ Grid.Row="0"
|
|
|
+ Grid.Column="0"
|
|
|
+ Grid.ColumnSpan="2"
|
|
|
+ BorderBrush="Gray"
|
|
|
+ BorderThickness="1">
|
|
|
+ <ToolBar Background="White"
|
|
|
+ ToolBarTray.IsLocked="True">
|
|
|
+ <Button Content="保存"
|
|
|
+ Tag="{x:Static utils:RegularFontUtil.Save_32}"
|
|
|
+ Template="{StaticResource CustomToolBarButtomTemplate}"
|
|
|
+ Command="{Binding SaveCommand}"
|
|
|
+ CommandParameter="{Binding ElementName=cbReceivedStatus}" />
|
|
|
+ <Separator />
|
|
|
+ <Button x:Name="btnCheck"
|
|
|
+ Content="复核"
|
|
|
+ Tag="{x:Static utils:RegularFontUtil.Clipboard_Checkmark_24}"
|
|
|
+ Template="{StaticResource CustomToolBarButtomTemplate}"
|
|
|
+ Command="{Binding CheckCommand}"
|
|
|
+ CommandParameter="{Binding ElementName=cbReceivedStatus}" />
|
|
|
+ <Separator />
|
|
|
+ <Button x:Name="btnExportThree"
|
|
|
+ Content="导出附件3"
|
|
|
+ Tag="{x:Static utils:RegularFontUtil.Open_32}"
|
|
|
+ Template="{StaticResource CustomToolBarButtomTemplate}"
|
|
|
+ Command="{Binding ExportThreeCommand}" />
|
|
|
+ <Separator />
|
|
|
+ <Button Content="导出数据包"
|
|
|
+ Tag="{x:Static utils:RegularFontUtil.Arrow_Export_Up_24}"
|
|
|
+ Template="{StaticResource CustomToolBarButtomTemplate}"
|
|
|
+ Command="{Binding ExportDBCommand}" />
|
|
|
+ <Button Content="导入数据包"
|
|
|
+ Tag="{x:Static utils:RegularFontUtil.Arrow_Download_24}"
|
|
|
+ Template="{StaticResource CustomToolBarButtomTemplate}"
|
|
|
+ Command="{Binding ImportDBCommand}" />
|
|
|
+
|
|
|
+ </ToolBar>
|
|
|
+ </Border>
|
|
|
+
|
|
|
+ <!-- 主表 -->
|
|
|
+ <fdg:FilterDataGrid x:Name="fdgDelivery"
|
|
|
+ Grid.Row="1"
|
|
|
+ Grid.Column="0"
|
|
|
+ Grid.ColumnSpan="2"
|
|
|
+ FilterLanguage="SimplifiedChinese"
|
|
|
+ Background="White"
|
|
|
+ AutoGenerateColumns="False"
|
|
|
+ CanUserAddRows="False"
|
|
|
+ CanUserResizeRows="False"
|
|
|
+ CanUserResizeColumns="True"
|
|
|
+ SelectionMode="Single"
|
|
|
+ SelectionUnit="FullRow"
|
|
|
+ HeadersVisibility="All"
|
|
|
+ ShowRowsCount="True"
|
|
|
+ RowHeaderWidth="30"
|
|
|
+ LoadingRow="DataGrid_LoadingRow"
|
|
|
+ ColumnHeaderStyle="{StaticResource CustomColumnHeaderStyle}"
|
|
|
+ RowHeaderStyle="{StaticResource CustomRowHeaderStyle}"
|
|
|
+ RowStyle="{StaticResource CustomRowStyle}"
|
|
|
+ CellStyle="{StaticResource CustomCellStyle}"
|
|
|
+ IsReadOnly="True"
|
|
|
+ MinHeight="200"
|
|
|
+ SelectedItem="{Binding CurrDeliveryReceipt, Mode=TwoWay}"
|
|
|
+ ItemsSource="{Binding DeliveryReceipts, Mode=TwoWay}">
|
|
|
+
|
|
|
+ <!-- DataGrid 事件 -->
|
|
|
+ <b:Interaction.Triggers>
|
|
|
+ <b:EventTrigger EventName="SelectionChanged">
|
|
|
+ <b:CallMethodAction TargetObject="{Binding }"
|
|
|
+ MethodName="FdgDelivery_SelectionChanged" />
|
|
|
+ </b:EventTrigger>
|
|
|
+ </b:Interaction.Triggers>
|
|
|
+
|
|
|
+ <!-- 数据结构 -->
|
|
|
+ <fdg:FilterDataGrid.Columns>
|
|
|
+ <fdg:FilterDataGridTextColumn Header="合同编号" Width="200"
|
|
|
+ IsColumnFiltered="True"
|
|
|
+ ElementStyle="{StaticResource TextColumnElementStyle}"
|
|
|
+ Binding="{Binding ContractNo}" />
|
|
|
+ <fdg:FilterDataGridTextColumn Header="产品名称" Width="250"
|
|
|
+ IsColumnFiltered="True"
|
|
|
+ ElementStyle="{StaticResource TextColumnElementStyle}"
|
|
|
+ Binding="{Binding ProductName}" />
|
|
|
+ <fdg:FilterDataGridTextColumn Header="生产企业" Width="250"
|
|
|
+ IsColumnFiltered="True"
|
|
|
+ ElementStyle="{StaticResource TextColumnElementStyle}"
|
|
|
+ Binding="{Binding CompanyName}" />
|
|
|
+ <fdg:FilterDataGridTextColumn Header="接收单位" Width="250"
|
|
|
+ IsColumnFiltered="True"
|
|
|
+ ElementStyle="{StaticResource TextColumnElementStyle}"
|
|
|
+ Binding="{Binding ReceivedCompanyName}" />
|
|
|
+ <fdg:FilterDataGridTextColumn Header="发运包数" Width="100"
|
|
|
+ IsColumnFiltered="True"
|
|
|
+ ElementStyle="{StaticResource TextColumnElementStyle}"
|
|
|
+ Binding="{Binding ShippedPackets}" />
|
|
|
+ <fdg:FilterDataGridTextColumn Header="发运数量" Width="100"
|
|
|
+ IsColumnFiltered="True"
|
|
|
+ ElementStyle="{StaticResource TextColumnElementStyle}"
|
|
|
+ Binding="{Binding ShippedQty}" />
|
|
|
+ <fdg:FilterDataGridTextColumn Header="发运时间" Width="100"
|
|
|
+ IsColumnFiltered="True"
|
|
|
+ ElementStyle="{StaticResource TextColumnElementStyle}"
|
|
|
+ Binding="{Binding ShippedDate, StringFormat='yyyy/MM/dd'}" />
|
|
|
+ <fdg:FilterDataGridTextColumn Header="发运承办人" Width="100"
|
|
|
+ IsColumnFiltered="True"
|
|
|
+ ElementStyle="{StaticResource TextColumnElementStyle}"
|
|
|
+ Binding="{Binding ShippedMan}" />
|
|
|
+ <fdg:FilterDataGridTextColumn Header="发运联系电话" Width="200"
|
|
|
+ IsColumnFiltered="True"
|
|
|
+ ElementStyle="{StaticResource TextColumnElementStyle}"
|
|
|
+ Binding="{Binding ShippedTel}" />
|
|
|
+ <fdg:FilterDataGridTextColumn Header="接收包数" Width="100"
|
|
|
+ IsColumnFiltered="True"
|
|
|
+ ElementStyle="{StaticResource TextColumnElementStyle}"
|
|
|
+ Binding="{Binding ReceivedPackets}" />
|
|
|
+ <fdg:FilterDataGridTextColumn Header="接收数量" Width="100"
|
|
|
+ IsColumnFiltered="True"
|
|
|
+ ElementStyle="{StaticResource TextColumnElementStyle}"
|
|
|
+ Binding="{Binding ReceivedQty}" />
|
|
|
+ <fdg:FilterDataGridTextColumn Header="接收时间" Width="100"
|
|
|
+ IsColumnFiltered="True"
|
|
|
+ ElementStyle="{StaticResource TextColumnElementStyle}"
|
|
|
+ Binding="{Binding ReceivedDate, StringFormat='yyyy/MM/dd'}" />
|
|
|
+ <fdg:FilterDataGridTextColumn Header="接收承办人" Width="100"
|
|
|
+ IsColumnFiltered="True"
|
|
|
+ ElementStyle="{StaticResource TextColumnElementStyle}"
|
|
|
+ Binding="{Binding ReceivedMan}" />
|
|
|
+ <fdg:FilterDataGridTextColumn Header="接收联系电话" Width="200"
|
|
|
+ IsColumnFiltered="True"
|
|
|
+ ElementStyle="{StaticResource TextColumnElementStyle}"
|
|
|
+ Binding="{Binding ReceivedTel}" />
|
|
|
+ <fdg:FilterDataGridTextColumn Header="接收状态" Width="100"
|
|
|
+ IsColumnFiltered="True"
|
|
|
+ ElementStyle="{StaticResource TextColumnElementStyle}"
|
|
|
+ Binding="{Binding ReceivedStatus}" />
|
|
|
+ </fdg:FilterDataGrid.Columns>
|
|
|
+ </fdg:FilterDataGrid>
|
|
|
+
|
|
|
+ <!-- 水平拖动分割线 -->
|
|
|
+ <GridSplitter Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="2" Height="5" HorizontalAlignment="Stretch" />
|
|
|
+
|
|
|
+ <!-- 发货单信息界面 -->
|
|
|
+ <Border Grid.Row="3"
|
|
|
+ Grid.RowSpan="2"
|
|
|
+ Grid.Column="0"
|
|
|
+ BorderBrush="Gray"
|
|
|
+ BorderThickness="1">
|
|
|
+ <Grid Background="White">
|
|
|
+ <Grid.RowDefinitions>
|
|
|
+ <RowDefinition Height="*" />
|
|
|
+ <RowDefinition Height="auto" />
|
|
|
+ <RowDefinition Height="auto" />
|
|
|
+ <RowDefinition Height="auto" />
|
|
|
+ <RowDefinition Height="auto" />
|
|
|
+ <RowDefinition Height="*" />
|
|
|
+ </Grid.RowDefinitions>
|
|
|
|
|
|
+ <!-- 表头信息 -->
|
|
|
+ <Border Grid.Row="1"
|
|
|
+ BorderBrush="Gray"
|
|
|
+ BorderThickness="1">
|
|
|
+ <Grid Background="White">
|
|
|
+ <Grid.ColumnDefinitions>
|
|
|
+ <ColumnDefinition Width="auto" />
|
|
|
+ <ColumnDefinition Width="*" />
|
|
|
+ </Grid.ColumnDefinitions>
|
|
|
+
|
|
|
+ <Label Grid.Column="0" Content="表头信息"
|
|
|
+ Style="{StaticResource CustomLabelStyle}" />
|
|
|
+
|
|
|
+ <WrapPanel Grid.Column="1"
|
|
|
+ Orientation="Horizontal">
|
|
|
+ <TextBox Tag="产品名称:"
|
|
|
+ Text="{Binding CurrDeliveryReceipt.ProductName}"
|
|
|
+ IsEnabled="False"
|
|
|
+ Style="{StaticResource CustomFieldTextBoxStyle}" />
|
|
|
+ <TextBox Tag="生产企业:"
|
|
|
+ Text="{Binding CurrDeliveryReceipt.CompanyName}"
|
|
|
+ IsEnabled="False"
|
|
|
+ Style="{StaticResource CustomFieldTextBoxStyle}" />
|
|
|
+
|
|
|
+ </WrapPanel>
|
|
|
+ </Grid>
|
|
|
+
|
|
|
+ </Border>
|
|
|
+
|
|
|
+ <!-- 合同信息 -->
|
|
|
+ <Border Grid.Row="2"
|
|
|
+ BorderBrush="Gray"
|
|
|
+ BorderThickness="1">
|
|
|
+ <Grid Background="White">
|
|
|
+ <Grid.ColumnDefinitions>
|
|
|
+ <ColumnDefinition Width="auto" />
|
|
|
+ <ColumnDefinition Width="*" />
|
|
|
+ </Grid.ColumnDefinitions>
|
|
|
+
|
|
|
+ <Label Grid.Column="0" Content="合同信息"
|
|
|
+ Style="{StaticResource CustomLabelStyle}" />
|
|
|
+
|
|
|
+ <WrapPanel Grid.Column="1"
|
|
|
+ Orientation="Horizontal">
|
|
|
+ <TextBox Tag="合同编号:"
|
|
|
+ Text="{Binding CurrDeliveryReceipt.ContractNo}"
|
|
|
+ IsEnabled="False"
|
|
|
+ Style="{StaticResource CustomFieldTextBoxStyle}" />
|
|
|
+ <TextBox Tag="采购机构:"
|
|
|
+ Text="{Binding CurrDeliveryReceipt.PurchaseCompanyName}"
|
|
|
+ IsEnabled="False"
|
|
|
+ Style="{StaticResource CustomFieldTextBoxStyle}" />
|
|
|
+ <TextBox Tag="合同数量:"
|
|
|
+ Text="{Binding CurrDeliveryReceipt.ContractQty}"
|
|
|
+ IsEnabled="False"
|
|
|
+ Style="{StaticResource CustomFieldTextBoxStyle}" />
|
|
|
+ <TextBox Tag="合同时间:"
|
|
|
+ Text="{Binding CurrDeliveryReceipt.ContractSigningDate, StringFormat='yyyy/MM/dd'}"
|
|
|
+ IsEnabled="False"
|
|
|
+ Style="{StaticResource CustomFieldTextBoxStyle}" />
|
|
|
+
|
|
|
+ </WrapPanel>
|
|
|
+ </Grid>
|
|
|
+
|
|
|
+ </Border>
|
|
|
+
|
|
|
+ <!-- 发运信息 -->
|
|
|
+ <Border Grid.Row="3"
|
|
|
+ BorderBrush="Gray"
|
|
|
+ BorderThickness="1">
|
|
|
+ <Grid Background="White">
|
|
|
+ <Grid.ColumnDefinitions>
|
|
|
+ <ColumnDefinition Width="auto" />
|
|
|
+ <ColumnDefinition Width="*" />
|
|
|
+ </Grid.ColumnDefinitions>
|
|
|
+
|
|
|
+ <Label Grid.Column="0" Content="发运信息"
|
|
|
+ Style="{StaticResource CustomLabelStyle}" />
|
|
|
+
|
|
|
+ <WrapPanel Grid.Column="1"
|
|
|
+ Orientation="Horizontal">
|
|
|
+ <TextBox Tag="接收单位:"
|
|
|
+ Text="{Binding CurrDeliveryReceipt.ReceivedCompanyName}"
|
|
|
+ IsEnabled="False"
|
|
|
+ Style="{StaticResource CustomFieldTextBoxStyle}" />
|
|
|
+ <TextBox Tag="发运包数:"
|
|
|
+ Text="{Binding CurrDeliveryReceipt.ShippedPackets}"
|
|
|
+ IsEnabled="False"
|
|
|
+ Style="{StaticResource CustomFieldTextBoxStyle}" />
|
|
|
+ <TextBox Tag="发运数量:"
|
|
|
+ Text="{Binding CurrDeliveryReceipt.ShippedQty}"
|
|
|
+ IsEnabled="False"
|
|
|
+ Style="{StaticResource CustomFieldTextBoxStyle}" />
|
|
|
+ <TextBox Tag="发运时间:"
|
|
|
+ Text="{Binding CurrDeliveryReceipt.ShippedDate, StringFormat= 'yyyy/MM/dd'}"
|
|
|
+ IsEnabled="False"
|
|
|
+ Style="{StaticResource CustomFieldTextBoxStyle}" />
|
|
|
+ <TextBox x:Name="fieldShippedMan"
|
|
|
+ Tag="发运承办人:"
|
|
|
+ Text="{Binding CurrDeliveryReceipt.ShippedMan}"
|
|
|
+ IsEnabled="False"
|
|
|
+ Style="{StaticResource CustomFieldTextBoxStyle}" />
|
|
|
+ <TextBox x:Name="fieldShippedTel"
|
|
|
+ Tag="联系电话:"
|
|
|
+ Text="{Binding CurrDeliveryReceipt.ShippedTel}"
|
|
|
+ IsEnabled="False"
|
|
|
+ Style="{StaticResource CustomFieldTextBoxStyle}" />
|
|
|
+ </WrapPanel>
|
|
|
+ </Grid>
|
|
|
+
|
|
|
+ </Border>
|
|
|
+
|
|
|
+ <!-- 接收信息 -->
|
|
|
+ <Border x:Name="borderReceipt"
|
|
|
+ Grid.Row="4"
|
|
|
+ BorderBrush="Gray"
|
|
|
+ BorderThickness="1">
|
|
|
+ <Grid Background="White">
|
|
|
+ <Grid.ColumnDefinitions>
|
|
|
+ <ColumnDefinition Width="auto" />
|
|
|
+ <ColumnDefinition Width="*" />
|
|
|
+ </Grid.ColumnDefinitions>
|
|
|
+
|
|
|
+ <Label Grid.Column="0" Content="接收信息"
|
|
|
+ Style="{StaticResource CustomLabelStyle}" />
|
|
|
+
|
|
|
+ <WrapPanel Grid.Column="1"
|
|
|
+ Orientation="Horizontal">
|
|
|
+ <TextBox Tag="接收包数:"
|
|
|
+ Text="{Binding CurrDeliveryReceipt.ReceivedPackets}"
|
|
|
+ IsEnabled="False"
|
|
|
+ Style="{StaticResource CustomFieldTextBoxStyle}" />
|
|
|
+ <TextBox Tag="接收数量:"
|
|
|
+ Text="{Binding CurrDeliveryReceipt.ReceivedQty}"
|
|
|
+ IsEnabled="False"
|
|
|
+ Style="{StaticResource CustomFieldTextBoxStyle}" />
|
|
|
+
|
|
|
+ <!-- 接收时间 -->
|
|
|
+ <StackPanel Orientation="Horizontal">
|
|
|
+ <TextBlock Text="接收时间:"
|
|
|
+ Foreground="Black"
|
|
|
+ Style="{StaticResource CustomTextBlockStyle}" />
|
|
|
+ <DatePicker x:Name="dpReceivedDate"
|
|
|
+ Width="250"
|
|
|
+ Text="{Binding CurrDeliveryReceipt.ReceivedDate, Mode=TwoWay}"
|
|
|
+ SelectedDateFormat="Short"
|
|
|
+ HorizontalContentAlignment="Center"
|
|
|
+ VerticalContentAlignment="Center"
|
|
|
+ Height="30"
|
|
|
+ FontSize="14" />
|
|
|
+ </StackPanel>
|
|
|
+
|
|
|
+ <TextBox x:Name="fieldReceivedMan"
|
|
|
+ Tag="接收承办人:"
|
|
|
+ Text="{Binding CurrDeliveryReceipt.ReceivedMan}"
|
|
|
+ IsEnabled="True"
|
|
|
+ Style="{StaticResource CustomFieldTextBoxStyle}" />
|
|
|
+ <TextBox x:Name="fieldReceivedTel"
|
|
|
+ Tag="联系电话:"
|
|
|
+ Text="{Binding CurrDeliveryReceipt.ReceivedTel}"
|
|
|
+ IsEnabled="True"
|
|
|
+ Style="{StaticResource CustomFieldTextBoxStyle}" />
|
|
|
+
|
|
|
+ <!-- 收货单状态 -->
|
|
|
+ <StackPanel Orientation="Horizontal">
|
|
|
+ <TextBlock x:Name="tBlkReceivedStatus"
|
|
|
+ Text="收货单状态*:"
|
|
|
+ Foreground="Black"
|
|
|
+ Style="{StaticResource CustomTextBlockStyle}" />
|
|
|
+ <ComboBox x:Name="cbReceivedStatus"
|
|
|
+ Width="250"
|
|
|
+ Height="30"
|
|
|
+ FontSize="14"
|
|
|
+ HorizontalContentAlignment="Center"
|
|
|
+ VerticalContentAlignment="Center"
|
|
|
+ ItemsSource="{Binding StatusItems}"
|
|
|
+ SelectedItem="{Binding CurrDeliveryReceipt.ReceivedStatus}" />
|
|
|
+ </StackPanel>
|
|
|
+ </WrapPanel>
|
|
|
+ </Grid>
|
|
|
+ </Border>
|
|
|
+
|
|
|
+ </Grid>
|
|
|
</Border>
|
|
|
+
|
|
|
+ <!-- 明细表工具栏 -->
|
|
|
+ <Border Grid.Row="3"
|
|
|
+ Grid.Column="1"
|
|
|
+ BorderBrush="Gray"
|
|
|
+ BorderThickness="1"
|
|
|
+ Height="{Binding Path=ActualHeight,ElementName=toolBarDelivery}">
|
|
|
+ <ToolBar Background="White"
|
|
|
+ ToolBarTray.IsLocked="True">
|
|
|
+ <Button Content="全部接收"
|
|
|
+ Tag="{x:Static utils:RegularFontUtil.Clipboard_Checkmark_24}"
|
|
|
+ Template="{StaticResource CustomToolBarButtomTemplate}"
|
|
|
+ Command="{Binding ReceiveAllCommand}"
|
|
|
+ CommandParameter="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type UserControl}}}" />
|
|
|
+ </ToolBar>
|
|
|
+ </Border>
|
|
|
+
|
|
|
+ <!-- 明细表 -->
|
|
|
+ <fdg:FilterDataGrid x:Name="fdgDeliveryDetail"
|
|
|
+ Grid.Row="4"
|
|
|
+ Grid.Column="1"
|
|
|
+ Background="White"
|
|
|
+ AutoGenerateColumns="False"
|
|
|
+ CanUserAddRows="False"
|
|
|
+ CanUserResizeRows="False"
|
|
|
+ SelectionMode="Extended"
|
|
|
+ SelectionUnit="CellOrRowHeader"
|
|
|
+ HeadersVisibility="All"
|
|
|
+ GridLinesVisibility="All"
|
|
|
+ ShowRowsCount="True"
|
|
|
+ RowHeaderWidth="30"
|
|
|
+ LoadingRow="DataGrid_LoadingRow"
|
|
|
+ ColumnHeaderStyle="{StaticResource CustomColumnHeaderStyle}"
|
|
|
+ RowHeaderStyle="{StaticResource CustomRowHeaderStyle}"
|
|
|
+ RowStyle="{StaticResource CustomRowStyle}"
|
|
|
+ CellStyle="{StaticResource CustomCellStyle}"
|
|
|
+ ItemsSource="{Binding CurrDeliveryReceipt.DeliveryReceiptDetails, Mode=TwoWay}">
|
|
|
+
|
|
|
+ <!-- DataGrid 事件 -->
|
|
|
+ <b:Interaction.Triggers>
|
|
|
+ <b:EventTrigger EventName="SelectedCellsChanged">
|
|
|
+ <b:CallMethodAction TargetObject="{Binding }"
|
|
|
+ MethodName="FdgDeliveryDetail_SelectedCellsChanged" />
|
|
|
+ </b:EventTrigger>
|
|
|
+ </b:Interaction.Triggers>
|
|
|
+
|
|
|
+ <!-- 数据结构 -->
|
|
|
+ <fdg:FilterDataGrid.Columns>
|
|
|
+ <fdg:FilterDataGridTextColumn Header="材料批号" Width="200"
|
|
|
+ ElementStyle="{StaticResource TextColumnElementStyle}"
|
|
|
+ EditingElementStyle="{StaticResource TextColumnEditingStyle}"
|
|
|
+ Binding="{Binding BatchNo}"
|
|
|
+ IsReadOnly="True" />
|
|
|
+ <fdg:FilterDataGridTextColumn Header="包号" Width="100"
|
|
|
+ ElementStyle="{StaticResource TextColumnElementStyle}"
|
|
|
+ EditingElementStyle="{StaticResource TextColumnEditingStyle}"
|
|
|
+ Binding="{Binding PacketNo}"
|
|
|
+ IsReadOnly="True" />
|
|
|
+ <fdg:FilterDataGridTextColumn Header="发运数量" Width="100"
|
|
|
+ ElementStyle="{StaticResource TextColumnElementStyle}"
|
|
|
+ EditingElementStyle="{StaticResource TextColumnEditingStyle}"
|
|
|
+ Binding="{Binding ShippedQuantity}"
|
|
|
+ IsReadOnly="True" />
|
|
|
+ <fdg:FilterDataGridTextColumn Header="接收数量*" Width="100"
|
|
|
+ ElementStyle="{StaticResource TextColumnElementStyle}"
|
|
|
+ EditingElementStyle="{StaticResource TextColumnEditingStyle}"
|
|
|
+ Binding="{Binding ReceiveQuantity, UpdateSourceTrigger=PropertyChanged, StringFormat='#0.0'}" />
|
|
|
+ <fdg:FilterDataGridTextColumn Header="备注" Width="200"
|
|
|
+ ElementStyle="{StaticResource TextColumnElementStyle}"
|
|
|
+ EditingElementStyle="{StaticResource TextColumnEditingStyle}"
|
|
|
+ Binding="{Binding ShipNote, UpdateSourceTrigger=PropertyChanged}" />
|
|
|
+ </fdg:FilterDataGrid.Columns>
|
|
|
+ </fdg:FilterDataGrid>
|
|
|
</Grid>
|
|
|
+
|
|
|
</UserControl>
|