Browse Source

Merge branch 'master' of https://git.xxb.lttc.cn/wangbc/UniformMaterialManagementSystem

宝臣 王 3 months ago
parent
commit
3a782cc753

+ 348 - 346
UniformMaterialManagementSystem/Views/ContractPage.xaml

@@ -439,7 +439,7 @@
                         Height="2"
                         Height="2"
                         HorizontalAlignment="Stretch" />
                         HorizontalAlignment="Stretch" />
                     <ScrollViewer Grid.Row="3">
                     <ScrollViewer Grid.Row="3">
-                        <Grid Grid.Row="3">
+                        <Grid>
                             <Grid.RowDefinitions>
                             <Grid.RowDefinitions>
                                 <RowDefinition Height="*" />
                                 <RowDefinition Height="*" />
                             </Grid.RowDefinitions>
                             </Grid.RowDefinitions>
@@ -450,7 +450,7 @@
                                     <RowDefinition Height="42" />
                                     <RowDefinition Height="42" />
                                     <RowDefinition Height="42" />
                                     <RowDefinition Height="42" />
                                     <RowDefinition Height="70" />
                                     <RowDefinition Height="70" />
-                                    <RowDefinition Height="*" MinHeight="200" />
+                                    <RowDefinition Height="*" MinHeight="300" />
                                 </Grid.RowDefinitions>
                                 </Grid.RowDefinitions>
                                 <Grid.ColumnDefinitions>
                                 <Grid.ColumnDefinitions>
                                     <ColumnDefinition Width="200" />
                                     <ColumnDefinition Width="200" />
@@ -1159,6 +1159,7 @@
                         ItemsSource="{Binding Contracts}"
                         ItemsSource="{Binding Contracts}"
                         RowHeaderStyle="{StaticResource CustomRowHeaderStyle}"
                         RowHeaderStyle="{StaticResource CustomRowHeaderStyle}"
                         RowStyle="{StaticResource CustomRowStyle}"
                         RowStyle="{StaticResource CustomRowStyle}"
+                        SelectionChanged="DataGridContractList_SelectionChanged"
                         SelectionMode="Single"
                         SelectionMode="Single"
                         ShowRowsCount="True"
                         ShowRowsCount="True"
                         ShowStatusBar="True"
                         ShowStatusBar="True"
@@ -1269,356 +1270,357 @@
                         Grid.Row="2"
                         Grid.Row="2"
                         Height="2"
                         Height="2"
                         HorizontalAlignment="Stretch" />
                         HorizontalAlignment="Stretch" />
-                    <Border
-                        Grid.Row="3"
-                        BorderBrush="LightSlateGray"
-                        BorderThickness="1">
-                        <Grid Background="White">
-                            <Grid.RowDefinitions>
-                                <RowDefinition Height="60" />
-                                <RowDefinition Height="35" />
-                                <RowDefinition Height="35" />
-                                <RowDefinition Height="35" />
-                                <RowDefinition Height="50" />
-                                <RowDefinition Height="*" />
-                            </Grid.RowDefinitions>
-                            <Grid.ColumnDefinitions>
-                                <ColumnDefinition Width="200" />
-                                <ColumnDefinition Width="300" />
-                                <ColumnDefinition Width="*" />
-                                <ColumnDefinition Width="300" />
-                                <ColumnDefinition Width="*" />
-                            </Grid.ColumnDefinitions>
-                            <TextBlock
-                                Grid.Row="0"
-                                Grid.Column="0"
-                                Grid.ColumnSpan="4"
-                                HorizontalAlignment="Center"
-                                VerticalAlignment="Center"
-                                FontSize="25"
-                                Text="材料采购合同" />
-                            <TextBlock
-                                Grid.Row="1"
-                                Grid.Column="0"
-                                HorizontalAlignment="Right"
-                                Text="*成品企业名称:" />
-                            <TextBox
-                                Grid.Row="1"
-                                Grid.Column="1"
-                                VerticalContentAlignment="Center"
-                                IsReadOnly="True"
-                                Text="{Binding SelectedContract.PurchaseCompany.Name}" />
-                            <TextBlock
-                                Grid.Row="1"
-                                Grid.Column="2"
-                                HorizontalAlignment="Right"
-                                Text="*材料企业名称:" />
-                            <TextBox
-                                Grid.Row="1"
-                                Grid.Column="3"
-                                VerticalContentAlignment="Center"
-                                IsReadOnly="True"
-                                Text="{Binding SelectedContract.Company.Name}" />
-                            <TextBlock
-                                Grid.Row="2"
-                                Grid.Column="0"
-                                HorizontalAlignment="Right"
-                                Text="*材料合同号:" />
-                            <TextBox
-                                Grid.Row="2"
-                                Grid.Column="1"
-                                VerticalContentAlignment="Center"
-                                IsReadOnly="True"
-                                Text="{Binding SelectedContract.ContractNo}" />
-                            <TextBlock
-                                Grid.Row="2"
-                                Grid.Column="2"
-                                HorizontalAlignment="Right"
-                                Text="*签订时间:" />
-                            <DatePicker
-                                Grid.Row="2"
-                                Grid.Column="3"
-                                Height="25"
-                                IsEnabled="False"
-                                Text="{Binding SelectedContract.SigningDate}" />
-                            <TextBlock
-                                Grid.Row="3"
-                                Grid.Column="0"
-                                HorizontalAlignment="Right"
-                                Text="*填报人:" />
-                            <TextBox
-                                Grid.Row="3"
-                                Grid.Column="1"
-                                VerticalContentAlignment="Center"
-                                IsReadOnly="True"
-                                Text="{Binding SelectedContract.EditUser}" />
-                            <TextBlock
-                                Grid.Row="3"
-                                Grid.Column="2"
-                                HorizontalAlignment="Right"
-                                Text="*联系电话:" />
-                            <TextBox
-                                Grid.Row="3"
-                                Grid.Column="3"
-                                VerticalContentAlignment="Center"
-                                IsReadOnly="True"
-                                Text="{Binding SelectedContract.Telephone}" />
+                    <ScrollViewer Grid.Row="3" VerticalScrollBarVisibility="Auto">
+                        <Border BorderBrush="LightSlateGray" BorderThickness="1">
+                            <Grid Background="White">
+                                <Grid.RowDefinitions>
+                                    <RowDefinition Height="60" />
+                                    <RowDefinition Height="35" />
+                                    <RowDefinition Height="35" />
+                                    <RowDefinition Height="35" />
+                                    <RowDefinition Height="50" />
+                                    <RowDefinition Height="*" MinHeight="300" />
+                                </Grid.RowDefinitions>
+                                <Grid.ColumnDefinitions>
+                                    <ColumnDefinition Width="200" />
+                                    <ColumnDefinition Width="300" />
+                                    <ColumnDefinition Width="*" />
+                                    <ColumnDefinition Width="300" />
+                                    <ColumnDefinition Width="*" />
+                                </Grid.ColumnDefinitions>
+                                <TextBlock
+                                    Grid.Row="0"
+                                    Grid.Column="0"
+                                    Grid.ColumnSpan="4"
+                                    HorizontalAlignment="Center"
+                                    VerticalAlignment="Center"
+                                    FontSize="25"
+                                    Text="材料采购合同" />
+                                <TextBlock
+                                    Grid.Row="1"
+                                    Grid.Column="0"
+                                    HorizontalAlignment="Right"
+                                    Text="*成品企业名称:" />
+                                <TextBox
+                                    Grid.Row="1"
+                                    Grid.Column="1"
+                                    VerticalContentAlignment="Center"
+                                    IsReadOnly="True"
+                                    Text="{Binding SelectedContract.PurchaseCompany.Name}" />
+                                <TextBlock
+                                    Grid.Row="1"
+                                    Grid.Column="2"
+                                    HorizontalAlignment="Right"
+                                    Text="*材料企业名称:" />
+                                <TextBox
+                                    Grid.Row="1"
+                                    Grid.Column="3"
+                                    VerticalContentAlignment="Center"
+                                    IsReadOnly="True"
+                                    Text="{Binding SelectedContract.Company.Name}" />
+                                <TextBlock
+                                    Grid.Row="2"
+                                    Grid.Column="0"
+                                    HorizontalAlignment="Right"
+                                    Text="*材料合同号:" />
+                                <TextBox
+                                    Grid.Row="2"
+                                    Grid.Column="1"
+                                    VerticalContentAlignment="Center"
+                                    IsReadOnly="True"
+                                    Text="{Binding SelectedContract.ContractNo}" />
+                                <TextBlock
+                                    Grid.Row="2"
+                                    Grid.Column="2"
+                                    HorizontalAlignment="Right"
+                                    Text="*签订时间:" />
+                                <DatePicker
+                                    Grid.Row="2"
+                                    Grid.Column="3"
+                                    Height="25"
+                                    IsEnabled="False"
+                                    Text="{Binding SelectedContract.SigningDate}" />
+                                <TextBlock
+                                    Grid.Row="3"
+                                    Grid.Column="0"
+                                    HorizontalAlignment="Right"
+                                    Text="*填报人:" />
+                                <TextBox
+                                    Grid.Row="3"
+                                    Grid.Column="1"
+                                    VerticalContentAlignment="Center"
+                                    IsReadOnly="True"
+                                    Text="{Binding SelectedContract.EditUser}" />
+                                <TextBlock
+                                    Grid.Row="3"
+                                    Grid.Column="2"
+                                    HorizontalAlignment="Right"
+                                    Text="*联系电话:" />
+                                <TextBox
+                                    Grid.Row="3"
+                                    Grid.Column="3"
+                                    VerticalContentAlignment="Center"
+                                    IsReadOnly="True"
+                                    Text="{Binding SelectedContract.Telephone}" />
 
 
-                            <TextBlock
-                                Grid.Row="4"
-                                Grid.Column="0"
-                                HorizontalAlignment="Right"
-                                Text="*合同附件:" />
-                            <StackPanel
-                                Grid.Row="4"
-                                Grid.Column="1"
-                                FlowDirection="LeftToRight"
-                                Orientation="Horizontal">
+                                <TextBlock
+                                    Grid.Row="4"
+                                    Grid.Column="0"
+                                    HorizontalAlignment="Right"
+                                    Text="*合同附件:" />
+                                <StackPanel
+                                    Grid.Row="4"
+                                    Grid.Column="1"
+                                    FlowDirection="LeftToRight"
+                                    Orientation="Horizontal">
 
 
-                                <Button
-                                    x:Name="ListDownLoadApplyAttachmentButton"
-                                    Margin="3"
-                                    Command="{Binding DownLoadSelectedAttachmentCommand}">
-                                    <Button.Template>
-                                        <ControlTemplate>
-                                            <Border
-                                                Width="60"
-                                                Height="40"
-                                                Background="{TemplateBinding Background}"
-                                                CornerRadius="5">
-                                                <StackPanel HorizontalAlignment="Center" Orientation="Vertical">
-                                                    <TextBlock
-                                                        HorizontalAlignment="Center"
-                                                        FontFamily="{StaticResource FluentSystemIconsRegular}"
-                                                        FontSize="20"
-                                                        Text="{x:Static utils:RegularFontUtil.Document_Arrow_Down_16}" />
-                                                    <TextBlock Text="下载附件" />
-                                                </StackPanel>
-                                            </Border>
-                                            <ControlTemplate.Triggers>
-                                                <Trigger Property="IsMouseOver" Value="True">
-                                                    <Setter Property="Background" Value="LightGray" />
-                                                </Trigger>
-                                            </ControlTemplate.Triggers>
-                                        </ControlTemplate>
-                                    </Button.Template>
-                                </Button>
-                                <Separator />
+                                    <Button
+                                        x:Name="ListDownLoadApplyAttachmentButton"
+                                        Margin="3"
+                                        Command="{Binding DownLoadSelectedAttachmentCommand}">
+                                        <Button.Template>
+                                            <ControlTemplate>
+                                                <Border
+                                                    Width="60"
+                                                    Height="40"
+                                                    Background="{TemplateBinding Background}"
+                                                    CornerRadius="5">
+                                                    <StackPanel HorizontalAlignment="Center" Orientation="Vertical">
+                                                        <TextBlock
+                                                            HorizontalAlignment="Center"
+                                                            FontFamily="{StaticResource FluentSystemIconsRegular}"
+                                                            FontSize="20"
+                                                            Text="{x:Static utils:RegularFontUtil.Document_Arrow_Down_16}" />
+                                                        <TextBlock Text="下载附件" />
+                                                    </StackPanel>
+                                                </Border>
+                                                <ControlTemplate.Triggers>
+                                                    <Trigger Property="IsMouseOver" Value="True">
+                                                        <Setter Property="Background" Value="LightGray" />
+                                                    </Trigger>
+                                                </ControlTemplate.Triggers>
+                                            </ControlTemplate>
+                                        </Button.Template>
+                                    </Button>
+                                    <Separator />
 
 
-                                <Border CornerRadius="5" FlowDirection="LeftToRight">
-                                    <StackPanel HorizontalAlignment="Center" Orientation="Horizontal">
-                                        <TextBlock
-                                            x:Name="ListApplyAttachmentText"
-                                            HorizontalAlignment="Center"
-                                            FontFamily="{StaticResource FluentSystemIconsRegular}"
-                                            FontSize="20"
-                                            Text="{x:Static utils:RegularFontUtil.Attach_24}" />
-                                        <TextBlock
-                                            x:Name="ListApplyUploadedText"
-                                            FontSize="12"
-                                            FontWeight="Bold"
-                                            Foreground="Green"
-                                            Text="附件" />
-                                    </StackPanel>
-                                </Border>
-                            </StackPanel>
-                            <TextBlock
-                                Grid.Row="4"
-                                Grid.Column="2"
-                                HorizontalAlignment="Right"
-                                Text="*合同变更申请:" />
-                            <StackPanel
-                                Grid.Row="4"
-                                Grid.Column="3"
-                                FlowDirection="LeftToRight"
-                                Orientation="Horizontal">
+                                    <Border CornerRadius="5" FlowDirection="LeftToRight">
+                                        <StackPanel HorizontalAlignment="Center" Orientation="Horizontal">
+                                            <TextBlock
+                                                x:Name="ListApplyAttachmentText"
+                                                HorizontalAlignment="Center"
+                                                FontFamily="{StaticResource FluentSystemIconsRegular}"
+                                                FontSize="20"
+                                                Text="{x:Static utils:RegularFontUtil.Attach_24}" />
+                                            <TextBlock
+                                                x:Name="ListApplyUploadedText"
+                                                FontSize="12"
+                                                FontWeight="Bold"
+                                                Foreground="Green"
+                                                Text="附件" />
+                                        </StackPanel>
+                                    </Border>
+                                </StackPanel>
+                                <TextBlock
+                                    x:Name="ListApplyText"
+                                    Grid.Row="4"
+                                    Grid.Column="2"
+                                    HorizontalAlignment="Right"
+                                    Text="*合同变更申请:" />
+                                <StackPanel
+                                    x:Name="ListApplyStackPanel"
+                                    Grid.Row="4"
+                                    Grid.Column="3"
+                                    FlowDirection="LeftToRight"
+                                    Orientation="Horizontal">
 
 
-                                <Button
-                                    x:Name="ListDownLoadAttachmentButton"
-                                    Margin="3"
-                                    Command="{Binding DownLoadSelectedApplyAttachmentCommand}">
-                                    <Button.Template>
-                                        <ControlTemplate>
-                                            <Border
-                                                Width="60"
-                                                Height="40"
-                                                Background="{TemplateBinding Background}"
-                                                CornerRadius="5">
-                                                <StackPanel HorizontalAlignment="Center" Orientation="Vertical">
-                                                    <TextBlock
-                                                        HorizontalAlignment="Center"
-                                                        FontFamily="{StaticResource FluentSystemIconsRegular}"
-                                                        FontSize="20"
-                                                        Text="{x:Static utils:RegularFontUtil.Document_Arrow_Down_16}" />
-                                                    <TextBlock Text="下载附件" />
-                                                </StackPanel>
-                                            </Border>
-                                            <ControlTemplate.Triggers>
-                                                <Trigger Property="IsMouseOver" Value="True">
-                                                    <Setter Property="Background" Value="LightGray" />
-                                                </Trigger>
-                                            </ControlTemplate.Triggers>
-                                        </ControlTemplate>
-                                    </Button.Template>
-                                </Button>
-                                <Separator />
+                                    <Button
+                                        x:Name="ListDownLoadAttachmentButton"
+                                        Margin="3"
+                                        Command="{Binding DownLoadSelectedApplyAttachmentCommand}">
+                                        <Button.Template>
+                                            <ControlTemplate>
+                                                <Border
+                                                    Width="60"
+                                                    Height="40"
+                                                    Background="{TemplateBinding Background}"
+                                                    CornerRadius="5">
+                                                    <StackPanel HorizontalAlignment="Center" Orientation="Vertical">
+                                                        <TextBlock
+                                                            HorizontalAlignment="Center"
+                                                            FontFamily="{StaticResource FluentSystemIconsRegular}"
+                                                            FontSize="20"
+                                                            Text="{x:Static utils:RegularFontUtil.Document_Arrow_Down_16}" />
+                                                        <TextBlock Text="下载附件" />
+                                                    </StackPanel>
+                                                </Border>
+                                                <ControlTemplate.Triggers>
+                                                    <Trigger Property="IsMouseOver" Value="True">
+                                                        <Setter Property="Background" Value="LightGray" />
+                                                    </Trigger>
+                                                </ControlTemplate.Triggers>
+                                            </ControlTemplate>
+                                        </Button.Template>
+                                    </Button>
+                                    <Separator />
 
 
-                                <Border CornerRadius="5" FlowDirection="LeftToRight">
-                                    <StackPanel HorizontalAlignment="Center" Orientation="Horizontal">
-                                        <TextBlock
-                                            x:Name="ListAttachmentText"
-                                            HorizontalAlignment="Center"
-                                            FontFamily="{StaticResource FluentSystemIconsRegular}"
-                                            FontSize="20"
-                                            Text="{x:Static utils:RegularFontUtil.Attach_24}" />
-                                        <TextBlock
-                                            x:Name="ListUploadedText"
-                                            FontSize="12"
-                                            FontWeight="Bold"
-                                            Foreground="Green"
-                                            Text="附件" />
-                                    </StackPanel>
-                                </Border>
-                            </StackPanel>
-                            <TextBlock
-                                Grid.Row="5"
-                                Grid.Column="0"
-                                HorizontalAlignment="Right"
-                                Text="*合同明细:" />
-                            <control:FilterDataGrid
-                                x:Name="DataGridDetail"
-                                Grid.Row="5"
-                                Grid.Column="1"
-                                Grid.ColumnSpan="3"
-                                behaviors:DataGridBehavior.RowNumbers="True"
-                                AutoGenerateColumns="False"
-                                Background="White"
-                                CanUserAddRows="False"
-                                CellStyle="{StaticResource CustomCellStyle}"
-                                ColumnHeaderStyle="{StaticResource CustomColumnHeaderStyle}"
-                                FilterLanguage="SimplifiedChinese"
-                                HeadersVisibility="All"
-                                HorizontalGridLinesBrush="LightSlateGray"
-                                ItemsSource="{Binding SelectedContract.ContractDetails}"
-                                RowHeaderStyle="{StaticResource CustomRowHeaderStyle}"
-                                RowStyle="{StaticResource CustomRowStyle}"
-                                SelectionMode="Single"
-                                ShowRowsCount="True"
-                                ShowStatusBar="True"
-                                VerticalGridLinesBrush="LightSlateGray">
-                                <control:FilterDataGrid.Resources>
-                                    <!--  非编辑模式下文本居中的样式  -->
-                                    <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="TextColumnEditingElementStyle" TargetType="TextBox">
-                                        <Setter Property="HorizontalAlignment" Value="Stretch" />
-                                        <Setter Property="VerticalAlignment" Value="Stretch" />
-                                        <Setter Property="VerticalContentAlignment" Value="Center" />
-                                    </Style>
+                                    <Border CornerRadius="5" FlowDirection="LeftToRight">
+                                        <StackPanel HorizontalAlignment="Center" Orientation="Horizontal">
+                                            <TextBlock
+                                                x:Name="ListAttachmentText"
+                                                HorizontalAlignment="Center"
+                                                FontFamily="{StaticResource FluentSystemIconsRegular}"
+                                                FontSize="20"
+                                                Text="{x:Static utils:RegularFontUtil.Attach_24}" />
+                                            <TextBlock
+                                                x:Name="ListUploadedText"
+                                                FontSize="12"
+                                                FontWeight="Bold"
+                                                Foreground="Green"
+                                                Text="附件" />
+                                        </StackPanel>
+                                    </Border>
+                                </StackPanel>
+                                <TextBlock
+                                    Grid.Row="5"
+                                    Grid.Column="0"
+                                    HorizontalAlignment="Right"
+                                    Text="*合同明细:" />
+                                <control:FilterDataGrid
+                                    x:Name="DataGridDetail"
+                                    Grid.Row="5"
+                                    Grid.Column="1"
+                                    Grid.ColumnSpan="3"
+                                    behaviors:DataGridBehavior.RowNumbers="True"
+                                    AutoGenerateColumns="False"
+                                    Background="White"
+                                    CanUserAddRows="False"
+                                    CellStyle="{StaticResource CustomCellStyle}"
+                                    ColumnHeaderStyle="{StaticResource CustomColumnHeaderStyle}"
+                                    FilterLanguage="SimplifiedChinese"
+                                    HeadersVisibility="All"
+                                    HorizontalGridLinesBrush="LightSlateGray"
+                                    ItemsSource="{Binding SelectedContract.ContractDetails}"
+                                    RowHeaderStyle="{StaticResource CustomRowHeaderStyle}"
+                                    RowStyle="{StaticResource CustomRowStyle}"
+                                    SelectionMode="Single"
+                                    ShowRowsCount="True"
+                                    ShowStatusBar="True"
+                                    VerticalGridLinesBrush="LightSlateGray">
+                                    <control:FilterDataGrid.Resources>
+                                        <!--  非编辑模式下文本居中的样式  -->
+                                        <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="TextColumnEditingElementStyle" TargetType="TextBox">
+                                            <Setter Property="HorizontalAlignment" Value="Stretch" />
+                                            <Setter Property="VerticalAlignment" Value="Stretch" />
+                                            <Setter Property="VerticalContentAlignment" Value="Center" />
+                                        </Style>
 
 
-                                    <Style x:Key="CheckBoxColumnElementStyle" TargetType="CheckBox">
-                                        <Setter Property="HorizontalAlignment" Value="Center" />
-                                        <Setter Property="VerticalAlignment" Value="Center" />
-                                        <Setter Property="IsEnabled" Value="False" />
-                                    </Style>
-                                </control:FilterDataGrid.Resources>
-                                <control:FilterDataGrid.Columns>
-                                    <control:FilterDataGridTextColumn
-                                        Width="300"
-                                        Binding="{Binding Material.Name}"
-                                        EditingElementStyle="{StaticResource TextColumnEditingElementStyle}"
-                                        ElementStyle="{StaticResource TextColumnElementStyle}"
-                                        Header="材料名称"
-                                        IsColumnFiltered="True"
-                                        IsReadOnly="True" />
-                                    <control:FilterDataGridNumericColumn
-                                        Width="150"
-                                        Binding="{Binding ContractQty, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
-                                        DecimalInputLimit="1"
-                                        EditingElementStyle="{StaticResource TextColumnEditingElementStyle}"
-                                        ElementStyle="{StaticResource TextColumnElementStyle}"
-                                        Header="成交数量"
-                                        IsColumnFiltered="True"
-                                        IsInteger="False"
-                                        IsReadOnly="True"
-                                        StringFormat="{}{0:F1}" />
-                                    <control:FilterDataGridTextColumn
-                                        Width="80"
-                                        Binding="{Binding Material.MeasureUnit}"
-                                        EditingElementStyle="{StaticResource TextColumnEditingElementStyle}"
-                                        ElementStyle="{StaticResource TextColumnElementStyle}"
-                                        Header="计量单位"
-                                        IsColumnFiltered="True"
-                                        IsReadOnly="True" />
-                                    <control:FilterDataGridTextColumn
-                                        Width="150"
-                                        Binding="{Binding DeliveryTime, StringFormat=yyyy-MM-dd}"
-                                        EditingElementStyle="{StaticResource TextColumnEditingElementStyle}"
-                                        ElementStyle="{StaticResource TextColumnElementStyle}"
-                                        Header="交货时限"
-                                        IsColumnFiltered="True"
-                                        IsReadOnly="True" />
-                                    <control:FilterDataGridNumericColumn
-                                        Width="100"
-                                        Binding="{Binding UnitPrice}"
-                                        DecimalInputLimit="2"
-                                        EditingElementStyle="{StaticResource TextColumnEditingElementStyle}"
-                                        ElementStyle="{StaticResource TextColumnElementStyle}"
-                                        Header="单价"
-                                        IsColumnFiltered="True"
-                                        IsInteger="False"
-                                        IsReadOnly="True"
-                                        StringFormat="{}{0:F2}" />
-                                    <control:FilterDataGridNumericColumn
-                                        Width="100"
-                                        Binding="{Binding ShippedQuantity}"
-                                        EditingElementStyle="{StaticResource TextColumnEditingElementStyle}"
-                                        ElementStyle="{StaticResource TextColumnElementStyle}"
-                                        Header="已发货数量"
-                                        IsColumnFiltered="True"
-                                        IsReadOnly="True" />
-                                    <control:FilterDataGridCheckBoxColumn
-                                        Width="100"
-                                        Binding="{Binding ShippedStatus}"
-                                        ElementStyle="{StaticResource CheckBoxColumnElementStyle}"
-                                        Header="发货完结状态"
-                                        IsColumnFiltered="True"
-                                        IsReadOnly="True" />
-                                    <control:FilterDataGridNumericColumn
-                                        Width="150"
-                                        Binding="{Binding ReduceQuantity}"
-                                        DecimalInputLimit="1"
-                                        EditingElementStyle="{StaticResource TextColumnEditingElementStyle}"
-                                        ElementStyle="{StaticResource TextColumnElementStyle}"
-                                        Header="调减数量"
-                                        IsColumnFiltered="True"
-                                        IsInteger="False"
-                                        IsReadOnly="True"
-                                        StringFormat="{}{0:F1}" />
-                                    <control:FilterDataGridNumericColumn
-                                        Width="100"
-                                        Binding="{Binding InspectedQty}"
-                                        EditingElementStyle="{StaticResource TextColumnEditingElementStyle}"
-                                        ElementStyle="{StaticResource TextColumnElementStyle}"
-                                        Header="已报检数量"
-                                        IsColumnFiltered="True"
-                                        IsReadOnly="True" />
-                                    <control:FilterDataGridTextColumn
-                                        Width="130"
-                                        Binding="{Binding InspectStatus}"
-                                        EditingElementStyle="{StaticResource TextColumnEditingElementStyle}"
-                                        ElementStyle="{StaticResource TextColumnElementStyle}"
-                                        Header="报检状态"
-                                        IsColumnFiltered="True"
-                                        IsReadOnly="True" />
-                                </control:FilterDataGrid.Columns>
-                            </control:FilterDataGrid>
-                        </Grid>
-                    </Border>
+                                        <Style x:Key="CheckBoxColumnElementStyle" TargetType="CheckBox">
+                                            <Setter Property="HorizontalAlignment" Value="Center" />
+                                            <Setter Property="VerticalAlignment" Value="Center" />
+                                            <Setter Property="IsEnabled" Value="False" />
+                                        </Style>
+                                    </control:FilterDataGrid.Resources>
+                                    <control:FilterDataGrid.Columns>
+                                        <control:FilterDataGridTextColumn
+                                            Width="300"
+                                            Binding="{Binding Material.Name}"
+                                            EditingElementStyle="{StaticResource TextColumnEditingElementStyle}"
+                                            ElementStyle="{StaticResource TextColumnElementStyle}"
+                                            Header="材料名称"
+                                            IsColumnFiltered="True"
+                                            IsReadOnly="True" />
+                                        <control:FilterDataGridNumericColumn
+                                            Width="150"
+                                            Binding="{Binding ContractQty, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
+                                            DecimalInputLimit="1"
+                                            EditingElementStyle="{StaticResource TextColumnEditingElementStyle}"
+                                            ElementStyle="{StaticResource TextColumnElementStyle}"
+                                            Header="成交数量"
+                                            IsColumnFiltered="True"
+                                            IsInteger="False"
+                                            IsReadOnly="True"
+                                            StringFormat="{}{0:F1}" />
+                                        <control:FilterDataGridTextColumn
+                                            Width="80"
+                                            Binding="{Binding Material.MeasureUnit}"
+                                            EditingElementStyle="{StaticResource TextColumnEditingElementStyle}"
+                                            ElementStyle="{StaticResource TextColumnElementStyle}"
+                                            Header="计量单位"
+                                            IsColumnFiltered="True"
+                                            IsReadOnly="True" />
+                                        <control:FilterDataGridTextColumn
+                                            Width="150"
+                                            Binding="{Binding DeliveryTime, StringFormat=yyyy-MM-dd}"
+                                            EditingElementStyle="{StaticResource TextColumnEditingElementStyle}"
+                                            ElementStyle="{StaticResource TextColumnElementStyle}"
+                                            Header="交货时限"
+                                            IsColumnFiltered="True"
+                                            IsReadOnly="True" />
+                                        <control:FilterDataGridNumericColumn
+                                            Width="100"
+                                            Binding="{Binding UnitPrice}"
+                                            DecimalInputLimit="2"
+                                            EditingElementStyle="{StaticResource TextColumnEditingElementStyle}"
+                                            ElementStyle="{StaticResource TextColumnElementStyle}"
+                                            Header="单价"
+                                            IsColumnFiltered="True"
+                                            IsInteger="False"
+                                            IsReadOnly="True"
+                                            StringFormat="{}{0:F2}" />
+                                        <control:FilterDataGridNumericColumn
+                                            Width="100"
+                                            Binding="{Binding ShippedQuantity}"
+                                            EditingElementStyle="{StaticResource TextColumnEditingElementStyle}"
+                                            ElementStyle="{StaticResource TextColumnElementStyle}"
+                                            Header="已发货数量"
+                                            IsColumnFiltered="True"
+                                            IsReadOnly="True" />
+                                        <control:FilterDataGridCheckBoxColumn
+                                            Width="100"
+                                            Binding="{Binding ShippedStatus}"
+                                            ElementStyle="{StaticResource CheckBoxColumnElementStyle}"
+                                            Header="发货完结状态"
+                                            IsColumnFiltered="True"
+                                            IsReadOnly="True" />
+                                        <control:FilterDataGridNumericColumn
+                                            Width="150"
+                                            Binding="{Binding ReduceQuantity}"
+                                            DecimalInputLimit="1"
+                                            EditingElementStyle="{StaticResource TextColumnEditingElementStyle}"
+                                            ElementStyle="{StaticResource TextColumnElementStyle}"
+                                            Header="调减数量"
+                                            IsColumnFiltered="True"
+                                            IsInteger="False"
+                                            IsReadOnly="True"
+                                            StringFormat="{}{0:F1}" />
+                                        <control:FilterDataGridNumericColumn
+                                            Width="100"
+                                            Binding="{Binding InspectedQty}"
+                                            EditingElementStyle="{StaticResource TextColumnEditingElementStyle}"
+                                            ElementStyle="{StaticResource TextColumnElementStyle}"
+                                            Header="已报检数量"
+                                            IsColumnFiltered="True"
+                                            IsReadOnly="True" />
+                                        <control:FilterDataGridTextColumn
+                                            Width="130"
+                                            Binding="{Binding InspectStatus}"
+                                            EditingElementStyle="{StaticResource TextColumnEditingElementStyle}"
+                                            ElementStyle="{StaticResource TextColumnElementStyle}"
+                                            Header="报检状态"
+                                            IsColumnFiltered="True"
+                                            IsReadOnly="True" />
+                                    </control:FilterDataGrid.Columns>
+                                </control:FilterDataGrid>
+                            </Grid>
+                        </Border>
+                    </ScrollViewer>
                 </Grid>
                 </Grid>
             </TabItem>
             </TabItem>
         </TabControl>
         </TabControl>

+ 20 - 0
UniformMaterialManagementSystem/Views/ContractPage.xaml.cs

@@ -2,6 +2,7 @@
 using Microsoft.Extensions.DependencyInjection;
 using Microsoft.Extensions.DependencyInjection;
 using System.Windows.Controls;
 using System.Windows.Controls;
 using System.Windows.Media;
 using System.Windows.Media;
+using UniformMaterialManagementSystem.Entities;
 using UniformMaterialManagementSystem.Models;
 using UniformMaterialManagementSystem.Models;
 using UniformMaterialManagementSystem.Utils;
 using UniformMaterialManagementSystem.Utils;
 using UniformMaterialManagementSystem.ViewModels;
 using UniformMaterialManagementSystem.ViewModels;
@@ -195,6 +196,25 @@ namespace UniformMaterialManagementSystem.Views
             }
             }
         }
         }
 
 
+        private void DataGridContractList_SelectionChanged(object sender, SelectionChangedEventArgs e)
+        {
+            int i = 0;
+            var grid = sender as FilterDataGrid.FilterDataGrid;
+            if (grid == null) return;
+            var contract = grid.SelectedItem as Contract;
+            if (contract == null) return;
+            if (contract.ChangedStatus)
+            {
+                ListApplyText.Visibility = Visibility.Visible;
+                ListApplyStackPanel.Visibility = Visibility.Visible;
+            }
+            else
+            {
+                ListApplyText.Visibility = Visibility.Collapsed;
+                ListApplyStackPanel.Visibility = Visibility.Collapsed;
+            }
+        }
+
         //private void DataGridUnExportContractList_CurrentCellChanged(object sender, EventArgs e)
         //private void DataGridUnExportContractList_CurrentCellChanged(object sender, EventArgs e)
         //{
         //{
         //    var grid = sender as FilterDataGrid.FilterDataGrid;
         //    var grid = sender as FilterDataGrid.FilterDataGrid;