|
@@ -4,15 +4,710 @@
|
|
|
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:utils="clr-namespace:UniformMaterialManagementSystem.Utils"
|
|
|
+ xmlns:fdg="http://FilterDataGrid.Control.com/2024"
|
|
|
mc:Ignorable="d"
|
|
|
d:DesignHeight="450" d:DesignWidth="800">
|
|
|
+ <UserControl.Resources>
|
|
|
+ <!-- 工具栏按钮模板 -->
|
|
|
+ <ControlTemplate x:Key="CustomToolBarButtonTemplate" 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>
|
|
|
+ <Trigger Property="IsEnabled" Value="False">
|
|
|
+ <Setter Property="Foreground" Value="Gray" />
|
|
|
+ </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>
|
|
|
+
|
|
|
+ <!-- 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>
|
|
|
+
|
|
|
+ <!-- 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>
|
|
|
+
|
|
|
+ <!-- 按钮模板 -->
|
|
|
+ <ControlTemplate x:Key="CustomButtonTemplate" TargetType="Button">
|
|
|
+ <Border Width="auto"
|
|
|
+ BorderBrush="Gray"
|
|
|
+ BorderThickness="1"
|
|
|
+ Background="{TemplateBinding Background}"
|
|
|
+ CornerRadius="5">
|
|
|
+ <StackPanel HorizontalAlignment="Center" Orientation="Horizontal">
|
|
|
+ <TextBlock HorizontalAlignment="Center"
|
|
|
+ FontFamily="{StaticResource FluentSystemIconsRegular}"
|
|
|
+ FontSize="20"
|
|
|
+ VerticalAlignment="Center"
|
|
|
+ Text="{TemplateBinding Tag}" />
|
|
|
+ <TextBlock Text="{TemplateBinding Content}"
|
|
|
+ VerticalAlignment="Center"
|
|
|
+ FontSize="14"
|
|
|
+ Padding="5 0 5 0" />
|
|
|
+ </StackPanel>
|
|
|
+ </Border>
|
|
|
+ <ControlTemplate.Triggers>
|
|
|
+ <Trigger Property="IsMouseOver" Value="True">
|
|
|
+ <Setter Property="Background" Value="LightGray" />
|
|
|
+ </Trigger>
|
|
|
+ <Trigger Property="IsEnabled" Value="False">
|
|
|
+ <Setter Property="Foreground" Value="Gray" />
|
|
|
+ </Trigger>
|
|
|
+ </ControlTemplate.Triggers>
|
|
|
+ </ControlTemplate>
|
|
|
+
|
|
|
+ <!-- 转换器 -->
|
|
|
+ <!--<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 x:Name="btnSave"
|
|
|
+ Content="保存"
|
|
|
+ Tag="{x:Static utils:RegularFontUtil.Save_32}"
|
|
|
+ Template="{StaticResource CustomToolBarButtonTemplate}"
|
|
|
+ Command="{Binding SaveCommand}"
|
|
|
+ CommandParameter="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type UserControl}}}" />
|
|
|
+ <Separator x:Name="sep1" />
|
|
|
+ <Button x:Name="btnExportFour"
|
|
|
+ Content="导出附件4"
|
|
|
+ Tag="{x:Static utils:RegularFontUtil.Arrow_Turn_Right_48}"
|
|
|
+ Template="{StaticResource CustomToolBarButtonTemplate}"
|
|
|
+ Command="{Binding ExportFourCommand}"
|
|
|
+ CommandParameter="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type UserControl}}}" />
|
|
|
+ <Separator x:Name="sep2" />
|
|
|
+ <Button Content="导出数据包"
|
|
|
+ Tag="{x:Static utils:RegularFontUtil.Arrow_Export_Up_24}"
|
|
|
+ Template="{StaticResource CustomToolBarButtonTemplate}"
|
|
|
+ Command="{Binding ExportDBCommand}"
|
|
|
+ CommandParameter="{Binding ElementName=fdgDelivery}"/>
|
|
|
+ <Button Content="导入数据包"
|
|
|
+ Tag="{x:Static utils:RegularFontUtil.Arrow_Download_24}"
|
|
|
+ Template="{StaticResource CustomToolBarButtonTemplate}"
|
|
|
+ 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"
|
|
|
+ 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, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}"
|
|
|
+ ItemsSource="{Binding DeliveryReceipts, Mode=TwoWay}">
|
|
|
+
|
|
|
+ <!-- DataGrid 事件 -->
|
|
|
+ <b:Interaction.Triggers>
|
|
|
+ <!-- 选择行切换事件 -->
|
|
|
+ <b:EventTrigger EventName="SelectionChanged">
|
|
|
+ <b:CallMethodAction TargetObject="{Binding }"
|
|
|
+ MethodName="FdgDelivery_SelectionChanged" />
|
|
|
+ <b:InvokeCommandAction Command="{Binding DeliverySelectionChangedCommand}"
|
|
|
+ CommandParameter="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type UserControl}}}"/>
|
|
|
+ </b:EventTrigger>
|
|
|
+ </b:Interaction.Triggers>
|
|
|
+
|
|
|
+ <!-- 数据结构 -->
|
|
|
+ <fdg:FilterDataGrid.Columns>
|
|
|
+ <!--<fdg:FilterDataGridCheckBoxColumn Header=" " Width="30"
|
|
|
+ ElementStyle="{StaticResource CheckBoxColumnElementStyle}"
|
|
|
+ EditingElementStyle="{StaticResource CheckBoxColumnElementStyle}"
|
|
|
+ Binding="{Binding IsSelected, UpdateSourceTrigger=PropertyChanged}"/>-->
|
|
|
+ <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:FilterDataGridCheckBoxColumn Header="是否导出附件4" Width="100"
|
|
|
+ Binding="{Binding IsExportUsage}"
|
|
|
+ IsReadOnly="True">
|
|
|
+ <fdg:FilterDataGridCheckBoxColumn.ElementStyle>
|
|
|
+ <Style TargetType="CheckBox">
|
|
|
+ <Setter Property="HorizontalAlignment" Value="Center" />
|
|
|
+ <Setter Property="VerticalAlignment" Value="Center" />
|
|
|
+ <Setter Property="IsEnabled" Value="False" />
|
|
|
+ </Style>
|
|
|
+ </fdg:FilterDataGridCheckBoxColumn.ElementStyle>
|
|
|
+ </fdg:FilterDataGridCheckBoxColumn>
|
|
|
+
|
|
|
+ </fdg:FilterDataGrid.Columns>
|
|
|
+ </fdg:FilterDataGrid>
|
|
|
+
|
|
|
+ <!-- todo 拖动限制:左右拖动至少留出检验申请/发货单的一部分,上下拖动至少;留出主表列标题/子表工具栏+列标题 -->
|
|
|
+ <!-- 水平拖动分割线 -->
|
|
|
+ <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}" />
|
|
|
+ <TextBlock x:Name="tBlkLicence"
|
|
|
+ Text="许可证*:"
|
|
|
+ Style="{StaticResource CustomTextBlockStyle}" />
|
|
|
+ <!-- 不能设置 Background 否则会识别不到 MouseHover 事件;默认颜色是 Gainsboro -->
|
|
|
+ <Button x:Name="btnUploadLic"
|
|
|
+ Margin="5"
|
|
|
+ Height="30"
|
|
|
+ Content="上传许可证"
|
|
|
+ Tag="{x:Static utils:RegularFontUtil.Document_Add_24}"
|
|
|
+ Template="{StaticResource CustomButtonTemplate}"
|
|
|
+ Command="{Binding UploadLicenceCommand}" />
|
|
|
+ <Button x:Name="btnDownloadLic"
|
|
|
+ Margin="5"
|
|
|
+ Height="30"
|
|
|
+ Content="下载许可证"
|
|
|
+ Tag="{x:Static utils:RegularFontUtil.Document_Arrow_Down_24}"
|
|
|
+ Template="{StaticResource CustomButtonTemplate}"
|
|
|
+ Command="{Binding DownloadLicenceCommand}" />
|
|
|
+ <!--<TextBlock x:Name="tBlkLicIcon"
|
|
|
+ Width="auto"
|
|
|
+ FontSize="18"
|
|
|
+ VerticalAlignment="Center"
|
|
|
+ Margin="1"
|
|
|
+ FontFamily="{StaticResource FluentSystemIconsRegular}"
|
|
|
+ Text="{x:Static utils:RegularFontUtil.Attach_24}" />
|
|
|
+ <TextBlock x:Name="tBlkLicHint"
|
|
|
+ Width="auto"
|
|
|
+ FontSize="12"
|
|
|
+ VerticalAlignment="Center"
|
|
|
+ Margin="1"
|
|
|
+ Text="许可证未上传"
|
|
|
+ Foreground="Red" />-->
|
|
|
+ </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 Tag="发运承办人:"
|
|
|
+ Text="{Binding CurrDeliveryReceipt.ShippedMan}"
|
|
|
+ IsEnabled="False"
|
|
|
+ Style="{StaticResource CustomFieldTextBoxStyle}" />
|
|
|
+ <TextBox 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}" />
|
|
|
+ <TextBox Tag="接收时间:"
|
|
|
+ Text="{Binding CurrDeliveryReceipt.ReceivedDate, StringFormat= 'yyyy/MM/dd'}"
|
|
|
+ IsEnabled="False"
|
|
|
+ Style="{StaticResource CustomFieldTextBoxStyle}" />
|
|
|
+ <TextBox Tag="接收承办人:"
|
|
|
+ Text="{Binding CurrDeliveryReceipt.ReceivedMan}"
|
|
|
+ IsEnabled="False"
|
|
|
+ Style="{StaticResource CustomFieldTextBoxStyle}" />
|
|
|
+ <TextBox Tag="联系电话:"
|
|
|
+ Text="{Binding CurrDeliveryReceipt.ReceivedTel}"
|
|
|
+ IsEnabled="False"
|
|
|
+ Style="{StaticResource CustomFieldTextBoxStyle}" />
|
|
|
+ <TextBox Tag="收货单状态:"
|
|
|
+ Text="{Binding CurrDeliveryReceipt.ReceivedStatus}"
|
|
|
+ IsEnabled="False"
|
|
|
+ Style="{StaticResource CustomFieldTextBoxStyle}" />
|
|
|
+ </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 x:Name="btnUseAll"
|
|
|
+ Content="全部使用"
|
|
|
+ Tag="{x:Static utils:RegularFontUtil.Box_Checkmark_24}"
|
|
|
+ Template="{StaticResource CustomToolBarButtonTemplate}"
|
|
|
+ Command="{Binding UseAllCommand}"
|
|
|
+ CommandParameter="{Binding ElementName=fdgDeliveryDetail}" />
|
|
|
+ </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 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}"
|
|
|
+ Binding="{Binding BatchNo, UpdateSourceTrigger=PropertyChanged}"
|
|
|
+ IsReadOnly="True" />
|
|
|
+ <fdg:FilterDataGridTextColumn Header="包号" Width="100"
|
|
|
+ ElementStyle="{StaticResource TextColumnElementStyle}"
|
|
|
+ Binding="{Binding PacketNo, UpdateSourceTrigger=PropertyChanged}"
|
|
|
+ IsReadOnly="True" />
|
|
|
+ <fdg:FilterDataGridTextColumn Header="发运数量" Width="100"
|
|
|
+ ElementStyle="{StaticResource TextColumnElementStyle}"
|
|
|
+ Binding="{Binding ShippedQuantity, UpdateSourceTrigger=PropertyChanged, StringFormat='#0.0'}"
|
|
|
+ IsReadOnly="True" />
|
|
|
+ <fdg:FilterDataGridTextColumn Header="接收数量" Width="100"
|
|
|
+ ElementStyle="{StaticResource TextColumnElementStyle}"
|
|
|
+ Binding="{Binding ReceiveQuantity, UpdateSourceTrigger=PropertyChanged, StringFormat='#0.0'}"
|
|
|
+ IsReadOnly="True" />
|
|
|
+ <fdg:FilterDataGridTextColumn Header="使用数量*" Width="100"
|
|
|
+ ElementStyle="{StaticResource TextColumnElementStyle}"
|
|
|
+ EditingElementStyle="{StaticResource TextColumnEditingStyle}"
|
|
|
+ Binding="{Binding UsageQuantity, UpdateSourceTrigger=PropertyChanged, StringFormat='#0.0'}" />
|
|
|
+ <fdg:FilterDataGridTextColumn Header="使用状态" Width="100"
|
|
|
+ ElementStyle="{StaticResource TextColumnElementStyle}"
|
|
|
+ Binding="{Binding UsageStatus, UpdateSourceTrigger=PropertyChanged}"
|
|
|
+ IsReadOnly="True" />
|
|
|
+ <fdg:FilterDataGridTextColumn Header="备注" Width="200"
|
|
|
+ ElementStyle="{StaticResource TextColumnElementStyle}"
|
|
|
+ EditingElementStyle="{StaticResource TextColumnEditingStyle}"
|
|
|
+ Binding="{Binding ShipNote, UpdateSourceTrigger=PropertyChanged}" />
|
|
|
+ </fdg:FilterDataGrid.Columns>
|
|
|
+ </fdg:FilterDataGrid>
|
|
|
</Grid>
|
|
|
+
|
|
|
</UserControl>
|