Browse Source

增加检验报告录入

LT069288 3 months ago
parent
commit
b29d29d626

+ 5 - 2
UniformMaterialManagementSystem/App.xaml.cs

@@ -9,6 +9,7 @@ using UniformMaterialManagementSystem.Models;
 using UniformMaterialManagementSystem.Services;
 using UniformMaterialManagementSystem.ViewModels;
 using UniformMaterialManagementSystem.Views;
+using UniformMaterialManagementSystem.Views.InspectionReport;
 using UniformMaterialManagementSystem.Views.LoginAndRegister;
 
 namespace UniformMaterialManagementSystem
@@ -69,11 +70,12 @@ namespace UniformMaterialManagementSystem
             services.AddKeyedTransient<UserControl, InspectionRecordPage>("InspectionRecordPage");
             services.AddKeyedTransient<UserControl, ContractPage>("ContractPage");
             services.AddKeyedTransient<UserControl, DeliveryReceiptControl>("DeliveryReceiptControl");
+            services.AddKeyedTransient<UserControl, InspectionReportInputPage>("InspectionReportInputPage");
+            services.AddKeyedTransient<UserControl, InspectionReportManagePage>("InspectionReportManagePage");
             services.AddKeyedTransient<UserControl, InspectionReportPage>("InspectionReportPage");
             services.AddKeyedTransient<UserControl, SampleRegistrationPage>("SampleRegistrationPage");
             services.AddKeyedTransient<UserControl, SelectApplyContractDialog>("SelectApplyContractDialog");
             services.AddKeyedTransient<UserControl, InspectionOrganizationPage>("InspectionOrganizationPage");
-            services.AddKeyedTransient<UserControl, InspectionOrganizationPage>("InspectionOrganizationPage");
             services.AddKeyedTransient<UserControl, FactoryLicensePage>("FactoryLicensePage");
             services.AddKeyedTransient<UserControl, MaterialDeliveryPage>("MaterialDeliveryPage");
             services.AddKeyedTransient<UserControl, MaterialReceiptPage>("MaterialReceiptPage");
@@ -99,7 +101,8 @@ namespace UniformMaterialManagementSystem
             services.AddTransient<InspectionRecordPageViewModel>();
             services.AddTransient<ContractPageViewModel>();
             services.AddTransient<DeliveryReceiptViewModel>();
-            services.AddTransient<InspectionReportPageViewModel>();
+            services.AddTransient<InspectionReportManagePageViewModel>();
+            services.AddTransient<InspectionReportInputPageViewModel>();
             services.AddTransient<SampleRegistrationPageViewModel>();
             services.AddTransient<InspectionOrganizationPageViewModel>();
             services.AddTransient<FactoryLicensePageViewModel>();

+ 11 - 10
UniformMaterialManagementSystem/Converters/InspectCategoryToBoolConverter.cs → UniformMaterialManagementSystem/Converters/ContentToBoolConverter.cs

@@ -3,7 +3,7 @@ using System.Windows.Data;
 
 namespace UniformMaterialManagementSystem.Converters
 {
-    public class InspectCategoryToBoolConverter: IValueConverter
+    public class ContentToBoolConverter: IValueConverter
     {
         public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
         {
@@ -19,16 +19,17 @@ namespace UniformMaterialManagementSystem.Converters
 
         public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
         {
-            if (value == null || parameter == null)
-            {
-                return null;
-            }
+            //if (value == null || parameter == null)
+            //{
+            //    return null;
+            //}
 
-            if ((bool)value)
-            {
-                return parameter.ToString();
-            }
-            return null;
+            //if ((bool)value)
+            //{
+            //    return parameter.ToString();
+            //}
+            //return null;
+            return (bool)value ? parameter : Binding.DoNothing;
         }
     }
 }

BIN
UniformMaterialManagementSystem/Resources/Pictures/MaterialReceipt.png


BIN
UniformMaterialManagementSystem/Resources/Pictures/MaterialUsage.png


+ 6 - 4
UniformMaterialManagementSystem/UniformMaterialManagementSystem.csproj

@@ -13,16 +13,12 @@
 	<ItemGroup>
 	  <Compile Remove="Views\InspectApplyAndInspectionRecord\**" />
 	  <Compile Remove="Views\新文件夹1\**" />
-	  <Compile Remove="Views\新文件夹\**" />
 	  <EmbeddedResource Remove="Views\InspectApplyAndInspectionRecord\**" />
 	  <EmbeddedResource Remove="Views\新文件夹1\**" />
-	  <EmbeddedResource Remove="Views\新文件夹\**" />
 	  <None Remove="Views\InspectApplyAndInspectionRecord\**" />
 	  <None Remove="Views\新文件夹1\**" />
-	  <None Remove="Views\新文件夹\**" />
 	  <Page Remove="Views\InspectApplyAndInspectionRecord\**" />
 	  <Page Remove="Views\新文件夹1\**" />
-	  <Page Remove="Views\新文件夹\**" />
 	</ItemGroup>
 
 	<ItemGroup>
@@ -93,6 +89,12 @@
 	  <ProjectReference Include="..\UniformMaterialManagementSystem.FilterDataGrid\UniformMaterialManagementSystem.FilterDataGrid.csproj" />
 	</ItemGroup>
 
+	<ItemGroup>
+	  <Compile Update="Views\InspectionReport\InspectionReportManagePage.xaml.cs">
+	    <SubType>Code</SubType>
+	  </Compile>
+	</ItemGroup>
+
 	<ItemGroup>
 		<None Update="Template\军需物资质量检验出厂许可证.docx">
 		  <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>

+ 160 - 0
UniformMaterialManagementSystem/ViewModels/InspectionReportInputPageViewModel.cs

@@ -0,0 +1,160 @@
+using System.Collections.ObjectModel;
+using System.Text;
+using CommunityToolkit.Mvvm.ComponentModel;
+using CommunityToolkit.Mvvm.Input;
+using Microsoft.EntityFrameworkCore;
+using UniformMaterialManagementSystem.Entities;
+using UniformMaterialManagementSystem.Services;
+
+namespace UniformMaterialManagementSystem.ViewModels
+{
+    public partial class InspectionReportInputPageViewModel : ObservableObject
+    {
+        [ObservableProperty]
+        private string _reportNo;
+
+        [ObservableProperty]
+        private string _department;
+
+        [ObservableProperty]
+        private DateTime _reportTime;
+
+        [ObservableProperty]
+        private string _inspectCategory;
+
+        [ObservableProperty]
+        private string? _purchaseCompanyNames;
+
+        [ObservableProperty]
+        private string? _contractNos;
+
+        [ObservableProperty]
+        private string? _reportBasis;
+
+        [ObservableProperty]
+        private bool _isSample;
+
+        [ObservableProperty]
+        private string _reportDesc;
+
+        [ObservableProperty]
+        private string _conclusion;
+
+        [ObservableProperty]
+        private string _conclusionDesc;
+
+
+
+        [ObservableProperty]
+        private ObservableCollection<InspectApply> _inspectApplies = [];
+
+        [ObservableProperty]
+        private InspectApply? _selectedInspectApply;
+
+        private readonly IDataBaseService<InspectApply> _inspectApplyService;
+
+        public InspectionReportInputPageViewModel(IDataBaseService<InspectApply> inspectApplyService)
+        {
+            _inspectApplyService = inspectApplyService;
+
+            LoadData();
+        }
+
+        /// <summary>
+        /// 刷新
+        /// </summary>
+        [RelayCommand]
+        private void LoadData()
+        {
+            var inspectApplyList = _inspectApplyService.QueryNoTracking()
+                .Include(x => x.Material)
+                .Include(x=>x.InspectApplyContractDetails)
+                .Where(x => x.Year == App.CurrentUser.WorkYear && !x.ReportStatus).ToList();
+
+            InspectApplies.Clear();
+            foreach (var inspectApply in inspectApplyList)
+            {
+                InspectApplies.Add(inspectApply);
+            }
+        }
+
+        /// <summary>
+        /// 保存
+        /// </summary>
+        [RelayCommand]
+        private void SaveInspectionReport()
+        {
+            int i = 0;
+        }
+
+        /// <summary>
+        /// 选择检验申请单行改变事件
+        /// </summary>
+        [RelayCommand]
+        private void InspectApplySelectionChanged(InspectApply inspectApply)
+        {
+            SelectedInspectApply = inspectApply;
+        }
+
+        /// <summary>
+        /// 鼠标双击事件
+        /// </summary>
+        [RelayCommand]
+        private void MouseDoubleClick(InspectApply inspectApply)
+        {
+            SelectedInspectApply = inspectApply;
+
+            ReportNo = inspectApply.ApplyNo.Replace("申请", "");
+            Department = App.CurrentUser.SupervisionUnit.Name;
+            ReportTime = DateTime.Now;
+            InspectCategory = inspectApply.InspCategory;
+            PurchaseCompanyNames = GetPurchaseCompanyNames(inspectApply);
+            ContractNos = GetContractNos(inspectApply);
+            ReportBasis = "依据" + inspectApply.Material.NormName;
+            IsSample = false;
+            Conclusion = "合格";
+            ReportDesc = "检验情况及主要问题";
+            ConclusionDesc = "请录入检验结论";
+
+        }
+
+        /// <summary>
+        /// 新增检验组
+        /// </summary>
+        [RelayCommand]
+        private void AddInspectionReportDetail()
+        {
+
+        }
+
+        /// <summary>
+        /// 删除检验组
+        /// </summary>
+        [RelayCommand]
+        private void RemoveInspectionReportDetail()
+        {
+
+        }
+
+        private string GetPurchaseCompanyNames(InspectApply inspectApply)
+        {
+            StringBuilder sb = new StringBuilder();
+            foreach (var contractDetail in inspectApply.InspectApplyContractDetails)
+            {
+                sb.AppendLine(contractDetail.PurchaseCompany);
+            }
+            return sb.ToString();
+        }
+
+        private string GetContractNos(InspectApply inspectApply)
+        {
+            StringBuilder sb = new StringBuilder();
+            foreach (var contractDetail in inspectApply.InspectApplyContractDetails)
+            {
+                sb.AppendLine(contractDetail.ContractNo);
+            }
+            return sb.ToString();
+        }
+
+    }
+}

+ 2 - 2
UniformMaterialManagementSystem/ViewModels/InspectionReportPageViewModel.cs → UniformMaterialManagementSystem/ViewModels/InspectionReportManagePageViewModel.cs

@@ -14,7 +14,7 @@ using UniformMaterialManagementSystem.Views;
 
 namespace UniformMaterialManagementSystem.ViewModels
 {
-    public partial class InspectionReportPageViewModel : ObservableValidator
+    public partial class InspectionReportManagePageViewModel : ObservableValidator
     {
 
         [ObservableProperty]
@@ -43,7 +43,7 @@ namespace UniformMaterialManagementSystem.ViewModels
 
         private readonly IDataBaseService<InspectApply> _inspectApplyService;
 
-        public InspectionReportPageViewModel(IDataBaseService<InspectionReport> inspectionReportService, IDataBaseService<InspectionReportDetail> inspectionReportDetailService, IDataBaseService<InspectApply> inspectApplyService, IDataBaseService<User> userService)
+        public InspectionReportManagePageViewModel(IDataBaseService<InspectionReport> inspectionReportService, IDataBaseService<InspectionReportDetail> inspectionReportDetailService, IDataBaseService<InspectApply> inspectApplyService, IDataBaseService<User> userService)
         {
             _inspectionReportService = inspectionReportService;
             _inspectionReportDetailService = inspectionReportDetailService;

+ 4 - 0
UniformMaterialManagementSystem/ViewModels/RolePageViewModel.cs

@@ -202,6 +202,10 @@ namespace UniformMaterialManagementSystem.ViewModels
             if (state != EntityState.Detached)  //新增行
             {
                 //查询菜单项
+                var roles = _roleService.Query().Include(r => r.RoleMenus).ThenInclude(rm => rm.MenuItem).Include(ro => ro.Menus)
+                    .ToList();
+                roleMenu = roles.First(r => r.Guid == role.Guid);
+
                 //using (SqliteContext context = new SqliteContext())
                 //{
                 //    var roles = context.Roles.Include(r => r.RoleMenus)

+ 868 - 0
UniformMaterialManagementSystem/Views/InspectionReport/InspectionReportInputPage.xaml

@@ -0,0 +1,868 @@
+<UserControl
+    x:Class="UniformMaterialManagementSystem.Views.InspectionReport.InspectionReportInputPage"
+    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+    xmlns:b="http://schemas.microsoft.com/xaml/behaviors"
+    xmlns:behaviors="clr-namespace:UniformMaterialManagementSystem.Behaviors"
+    xmlns:control="http://FilterDataGrid.Control.com/2024"
+    xmlns:converters="clr-namespace:UniformMaterialManagementSystem.Converters"
+    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+    xmlns:filterDataGrid="http://FilterDataGrid.Control.com/2024"
+    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+    xmlns:utils="clr-namespace:UniformMaterialManagementSystem.Utils"
+    d:DesignHeight="450"
+    d:DesignWidth="800"
+    mc:Ignorable="d">
+    <UserControl.Resources>
+        <converters:ContentToBoolConverter x:Key="ContentToBoolConverter" />
+        <!--  定义一个全局的TextBlock样式  -->
+        <Style TargetType="TextBlock">
+            <Setter Property="FontSize" Value="14" />
+            <Setter Property="Margin" Value="5" />
+            <Setter Property="VerticalAlignment" Value="Center" />
+            <Setter Property="Validation.ErrorTemplate" Value="{StaticResource ValidationErrorTemplate}" />
+        </Style>
+        <Style TargetType="RadioButton">
+            <Setter Property="FontSize" Value="14" />
+            <Setter Property="VerticalAlignment" Value="Center" />
+        </Style>
+        <Style TargetType="ComboBox">
+            <Setter Property="Validation.ErrorTemplate" Value="{StaticResource ValidationErrorTemplate}" />
+        </Style>
+        <Style TargetType="DatePicker">
+            <Setter Property="Height" Value="25" />
+            <Setter Property="FontSize" Value="14" />
+            <Setter Property="Validation.ErrorTemplate" Value="{StaticResource ValidationErrorTemplate}" />
+        </Style>
+        <Style TargetType="TextBox">
+            <Setter Property="Height" Value="25" />
+            <Setter Property="FontSize" Value="14" />
+            <Setter Property="VerticalContentAlignment" Value="Center" />
+            <Setter Property="Validation.ErrorTemplate" Value="{StaticResource ValidationErrorTemplate}" />
+        </Style>
+        <ControlTemplate x:Key="CustomColumnHeaderTemplate" TargetType="DataGridColumnHeader">
+            <Border BorderBrush="LightSlateGray" BorderThickness="0,0,1,1">
+                <Grid>
+                    <Grid.ColumnDefinitions>
+                        <ColumnDefinition />
+                        <ColumnDefinition Width="Auto" />
+                        <ColumnDefinition Width="Auto" />
+                    </Grid.ColumnDefinitions>
+                    <Border
+                        Grid.Column="0"
+                        BorderBrush="#E9ECF1"
+                        BorderThickness="0,0,0,1">
+                        <ContentPresenter
+                            Margin="5,0"
+                            HorizontalAlignment="Center"
+                            VerticalAlignment="Center" />
+                    </Border>
+                    <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" />
+                    <Thumb
+                        x:Name="PART_RightHeaderGripper"
+                        Grid.Column="2"
+                        Width="1"
+                        Height="25"
+                        HorizontalAlignment="Right"
+                        VerticalAlignment="Center"
+                        BorderBrush="#E9ECF1"
+                        BorderThickness="1"
+                        Cursor="SizeWE" />
+                </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">
+            <Setter Property="Background" Value="White" />
+            <Setter Property="Foreground" Value="Black" />
+            <Setter Property="BorderThickness" Value="0,0,1,1" />
+            <Setter Property="BorderBrush" Value="LightSlateGray" />
+            <Setter Property="Padding" Value="5,0,5,0" />
+        </Style>
+
+        <Style x:Key="CustomRowStyle" TargetType="DataGridRow">
+            <Setter Property="Background" Value="White" />
+            <Setter Property="FontSize" Value="13" />
+            <Setter Property="Height" Value="26" />
+
+            <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>
+        <Style
+            x:Key="CustomCellStyle"
+            BasedOn="{StaticResource {x:Type DataGridCell}}"
+            TargetType="DataGridCell">
+            <Setter Property="Background" Value="White" />
+            <Setter Property="HorizontalContentAlignment" Value="Center" />
+            <Setter Property="VerticalContentAlignment" Value="Center" />
+            <Setter Property="Padding" Value="10" />
+            <Style.Triggers>
+                <Trigger Property="IsSelected" Value="True">
+                    <Setter Property="Background" Value="LightBlue" />
+                    <Setter Property="Foreground" Value="Black" />
+                </Trigger>
+            </Style.Triggers>
+        </Style>
+
+    </UserControl.Resources>
+    <Grid>
+        <Grid.ColumnDefinitions>
+            <ColumnDefinition Width="*" />
+            <ColumnDefinition Width="Auto" />
+            <ColumnDefinition Width="2*" />
+        </Grid.ColumnDefinitions>
+        <Grid Grid.Column="0">
+            <Grid.RowDefinitions>
+                <RowDefinition Height="Auto" />
+                <RowDefinition Height="*" />
+            </Grid.RowDefinitions>
+            <Grid Grid.Row="0">
+                <!--  菜单项  -->
+                <Border
+                    Grid.Row="0"
+                    BorderBrush="Gray"
+                    BorderThickness="1">
+                    <Grid Background="White">
+                        <Grid.ColumnDefinitions>
+                            <ColumnDefinition Width="Auto" />
+                            <ColumnDefinition Width="*" />
+                        </Grid.ColumnDefinitions>
+                        <StackPanel
+                            Grid.Column="0"
+                            FlowDirection="LeftToRight"
+                            Orientation="Horizontal" />
+                        <ToolBarPanel Grid.Column="1">
+                            <ToolBar Background="White" ToolBarTray.IsLocked="True">
+                                <Button Command="{Binding LoadDataCommand}">
+                                    <Button.Template>
+                                        <ControlTemplate>
+                                            <Border
+                                                Width="45"
+                                                Background="{TemplateBinding Background}"
+                                                CornerRadius="5">
+                                                <StackPanel HorizontalAlignment="Center" Orientation="Vertical">
+                                                    <TextBlock
+                                                        HorizontalAlignment="Center"
+                                                        FontFamily="{StaticResource FluentSystemIconsRegular}"
+                                                        FontSize="20"
+                                                        Text="{x:Static utils:RegularFontUtil.Document_Search_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="SaveButton" Command="{Binding SaveInspectionReportCommand}">
+                                    <Button.Template>
+                                        <ControlTemplate>
+                                            <Border
+                                                Width="70"
+                                                Background="{TemplateBinding Background}"
+                                                CornerRadius="5">
+                                                <StackPanel HorizontalAlignment="Center" Orientation="Vertical">
+                                                    <TextBlock
+                                                        HorizontalAlignment="Center"
+                                                        FontFamily="{StaticResource FluentSystemIconsRegular}"
+                                                        FontSize="20"
+                                                        Text="{x:Static utils:RegularFontUtil.Save_32}" />
+                                                    <TextBlock Text="保存并导出" />
+                                                </StackPanel>
+                                            </Border>
+                                            <ControlTemplate.Triggers>
+                                                <Trigger Property="IsMouseOver" Value="True">
+                                                    <Setter Property="Background" Value="LightGray" />
+                                                </Trigger>
+                                            </ControlTemplate.Triggers>
+                                        </ControlTemplate>
+                                    </Button.Template>
+                                </Button>
+                            </ToolBar>
+                        </ToolBarPanel>
+                    </Grid>
+                </Border>
+            </Grid>
+            <filterDataGrid:FilterDataGrid
+                x:Name="DataGridMain"
+                Grid.Row="1"
+                behaviors:DataGridBehavior.RowNumbers="True"
+                AutoGenerateColumns="False"
+                Background="White"
+                CanUserAddRows="False"
+                CanUserReorderColumns="True"
+                CanUserResizeColumns="True"
+                CanUserResizeRows="False"
+                CellStyle="{StaticResource CustomCellStyle}"
+                ColumnHeaderStyle="{StaticResource CustomColumnHeaderStyle}"
+                FilterLanguage="SimplifiedChinese"
+                HeadersVisibility="All"
+                HorizontalGridLinesBrush="LightSlateGray"
+                ItemsSource="{Binding InspectApplies, Mode=TwoWay}"
+                RowHeaderStyle="{StaticResource CustomRowHeaderStyle}"
+                RowStyle="{StaticResource CustomRowStyle}"
+                SelectionMode="Single"
+                ShowRowsCount="True"
+                ShowStatusBar="True"
+                VerticalGridLinesBrush="LightSlateGray">
+
+                <!--  选择行事件  -->
+                <b:Interaction.Triggers>
+                    <!--<b:EventTrigger EventName="SelectionChanged">
+                        <b:InvokeCommandAction Command="{Binding InspectApplySelectionChangedCommand}" CommandParameter="{Binding ElementName=DataGridMain, Path=SelectedItem}" />
+                    </b:EventTrigger>-->
+
+                    <b:EventTrigger EventName="MouseDoubleClick">
+                        <b:InvokeCommandAction Command="{Binding MouseDoubleClickCommand}" CommandParameter="{Binding ElementName=DataGridMain, Path=SelectedItem}" />
+                    </b:EventTrigger>
+                </b:Interaction.Triggers>
+
+
+
+                <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>
+                </control:FilterDataGrid.Resources>
+
+                <control:FilterDataGrid.Columns>
+                    <control:FilterDataGridTextColumn
+                        Width="300"
+                        Binding="{Binding ApplyNo}"
+                        EditingElementStyle="{StaticResource TextColumnEditingElementStyle}"
+                        ElementStyle="{StaticResource TextColumnElementStyle}"
+                        Header="申请表编号"
+                        IsColumnFiltered="True"
+                        IsReadOnly="True" />
+                    <control:FilterDataGridTextColumn
+                        Width="120"
+                        Binding="{Binding InspCategory}"
+                        EditingElementStyle="{StaticResource TextColumnEditingElementStyle}"
+                        ElementStyle="{StaticResource TextColumnElementStyle}"
+                        Header="检验类别"
+                        IsColumnFiltered="True"
+                        IsReadOnly="True" />
+                    <control:FilterDataGridTextColumn
+                        Width="200"
+                        Binding="{Binding ProductName}"
+                        EditingElementStyle="{StaticResource TextColumnEditingElementStyle}"
+                        ElementStyle="{StaticResource TextColumnElementStyle}"
+                        Header="产品名称"
+                        IsColumnFiltered="True"
+                        IsReadOnly="True" />
+                    <control:FilterDataGridTextColumn
+                        Width="200"
+                        Binding="{Binding Company}"
+                        EditingElementStyle="{StaticResource TextColumnEditingElementStyle}"
+                        ElementStyle="{StaticResource TextColumnElementStyle}"
+                        Header="生产企业"
+                        IsColumnFiltered="True"
+                        IsReadOnly="True" />
+                    <control:FilterDataGridTextColumn
+                        Width="200"
+                        Binding="{Binding BatchNo}"
+                        EditingElementStyle="{StaticResource TextColumnEditingElementStyle}"
+                        ElementStyle="{StaticResource TextColumnElementStyle}"
+                        Header="材料批号"
+                        IsColumnFiltered="True"
+                        IsReadOnly="True" />
+                    <control:FilterDataGridTextColumn
+                        Width="100"
+                        Binding="{Binding InspQuantity}"
+                        EditingElementStyle="{StaticResource TextColumnEditingElementStyle}"
+                        ElementStyle="{StaticResource TextColumnElementStyle}"
+                        Header="报检数量"
+                        IsColumnFiltered="True"
+                        IsReadOnly="True" />
+                    <control:FilterDataGridTextColumn
+                        Width="150"
+                        Binding="{Binding InspDate, StringFormat=yyyy-MM-dd}"
+                        EditingElementStyle="{StaticResource TextColumnEditingElementStyle}"
+                        ElementStyle="{StaticResource TextColumnElementStyle}"
+                        Header="申请检验日期"
+                        IsColumnFiltered="True"
+                        IsReadOnly="True" />
+                    <control:FilterDataGridTextColumn
+                        Width="100"
+                        Binding="{Binding ApplyUser}"
+                        EditingElementStyle="{StaticResource TextColumnEditingElementStyle}"
+                        ElementStyle="{StaticResource TextColumnElementStyle}"
+                        Header="申请人"
+                        IsColumnFiltered="True"
+                        IsReadOnly="True" />
+
+                </control:FilterDataGrid.Columns>
+            </filterDataGrid:FilterDataGrid>
+        </Grid>
+
+        <GridSplitter
+            Grid.Column="1"
+            Width="2"
+            HorizontalAlignment="Stretch" />
+        <Grid Grid.Column="2" Background="White">
+            <ScrollViewer>
+                <Grid Background="White">
+                    <Grid.RowDefinitions>
+                        <RowDefinition Height="50" />
+                        <RowDefinition Height="40" />
+                        <RowDefinition Height="40" />
+                        <RowDefinition Height="40" />
+                        <RowDefinition Height="40" />
+                        <RowDefinition Height="40" />
+                        <RowDefinition Height="60" />
+                        <RowDefinition Height="40" />
+                        <RowDefinition Height="150" />
+                        <RowDefinition Height="170" />
+                        <RowDefinition Height="200" />
+                        <RowDefinition Height="40" />
+                    </Grid.RowDefinitions>
+                    <Grid.ColumnDefinitions>
+                        <ColumnDefinition Width="2*" />
+                        <ColumnDefinition Width="3*" />
+                        <ColumnDefinition Width="3*" />
+                        <ColumnDefinition Width="3*" />
+                        <ColumnDefinition Width="*" />
+                    </Grid.ColumnDefinitions>
+
+                    <TextBlock
+                        Grid.Row="0"
+                        Grid.Column="0"
+                        Grid.ColumnSpan="5"
+                        HorizontalAlignment="Center"
+                        VerticalAlignment="Center"
+                        FontSize="25"
+                        Text="军需物资质量监督检验报告" />
+                    <TextBlock
+                        Grid.Row="1"
+                        Grid.Column="0"
+                        HorizontalAlignment="Right"
+                        Text="检验报告编号:"
+                        TextWrapping="Wrap" />
+                    <TextBlock
+                        Grid.Row="1"
+                        Grid.Column="1"
+                        Grid.ColumnSpan="3"
+                        Text="{Binding ReportNo}" />
+                    <TextBlock
+                        Grid.Row="2"
+                        Grid.Column="0"
+                        HorizontalAlignment="Right"
+                        Text="*检验部门:" />
+                    <TextBox
+                        Grid.Row="2"
+                        Grid.Column="1"
+                        Text="{Binding Department, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
+                    <TextBlock
+                        Grid.Row="2"
+                        Grid.Column="2"
+                        HorizontalAlignment="Right"
+                        Text="*检验时间:" />
+                    <DatePicker
+                        Grid.Row="2"
+                        Grid.Column="3"
+                        Text="{Binding ReportTime, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
+                    <TextBlock
+                        Grid.Row="3"
+                        Grid.Column="0"
+                        HorizontalAlignment="Right"
+                        Text="检验类别:" />
+                    <StackPanel
+                        Grid.Row="3"
+                        Grid.Column="1"
+                        Grid.ColumnSpan="3"
+                        VerticalAlignment="Center">
+                        <Grid VerticalAlignment="Center" Background="White">
+                            <Grid.ColumnDefinitions>
+                                <ColumnDefinition Width="*" />
+                                <ColumnDefinition Width="*" />
+                                <ColumnDefinition Width="*" />
+                                <ColumnDefinition Width="*" />
+                            </Grid.ColumnDefinitions>
+                            <RadioButton
+                                Grid.Column="0"
+                                Content="报样检验"
+                                GroupName="InspectType"
+                                IsChecked="{Binding InspectCategory, Mode=OneWay, Converter={StaticResource ContentToBoolConverter}, ConverterParameter=报样检验}"
+                                IsEnabled="False" />
+                            <RadioButton
+                                Grid.Column="1"
+                                Content="首批检验"
+                                GroupName="InspectType"
+                                IsChecked="{Binding InspectCategory, Mode=OneWay, Converter={StaticResource ContentToBoolConverter}, ConverterParameter=首批检验}"
+                                IsEnabled="False" />
+                            <RadioButton
+                                Grid.Column="2"
+                                Content="生产过程"
+                                GroupName="InspectType"
+                                IsChecked="{Binding InspectCategory, Mode=OneWay, Converter={StaticResource ContentToBoolConverter}, ConverterParameter=生产过程}"
+                                IsEnabled="False" />
+                            <RadioButton
+                                Grid.Column="3"
+                                Content="出厂检验"
+                                GroupName="InspectType"
+                                IsChecked="{Binding InspectCategory, Mode=OneWay, Converter={StaticResource ContentToBoolConverter}, ConverterParameter=出厂检验}"
+                                IsEnabled="False" />
+
+                        </Grid>
+                    </StackPanel>
+                    <TextBlock
+                        Grid.Row="4"
+                        Grid.Column="0"
+                        HorizontalAlignment="Right"
+                        Text="产品名称:" />
+                    <TextBlock
+                        Grid.Row="4"
+                        Grid.Column="1"
+                        Text="{Binding SelectedInspectApply.Material.Name}"
+                        TextWrapping="Wrap" />
+                    <TextBlock
+                        Grid.Row="4"
+                        Grid.Column="2"
+                        HorizontalAlignment="Right"
+                        Text="生产企业:" />
+                    <TextBlock
+                        Grid.Row="4"
+                        Grid.Column="3"
+                        Text="{Binding SelectedInspectApply.Company}"
+                        TextWrapping="Wrap" />
+                    <TextBlock
+                        Grid.Row="5"
+                        Grid.Column="0"
+                        HorizontalAlignment="Right"
+                        Text="产品数量:"
+                        TextWrapping="Wrap" />
+                    <Grid
+                        Grid.Row="5"
+                        Grid.Column="1"
+                        Background="White">
+                        <Grid.ColumnDefinitions>
+                            <ColumnDefinition Width="Auto" />
+                            <ColumnDefinition Width="*" />
+                        </Grid.ColumnDefinitions>
+                        <TextBlock Grid.Column="0" Text="{Binding SelectedInspectApply.InspQuantity}" />
+                        <TextBlock Grid.Column="1" Text="{Binding SelectedInspectApply.Material.MeasureUnit}" />
+                    </Grid>
+                    <TextBlock
+                        Grid.Row="5"
+                        Grid.Column="2"
+                        HorizontalAlignment="Right"
+                        Text="生产日期:" />
+                    <Grid
+                        Grid.Row="5"
+                        Grid.Column="3"
+                        Background="White">
+                        <Grid.ColumnDefinitions>
+                            <ColumnDefinition Width="*" />
+                            <ColumnDefinition Width="Auto" />
+                            <ColumnDefinition Width="*" />
+                        </Grid.ColumnDefinitions>
+                        <TextBlock
+                            Grid.Column="0"
+                            Text="{Binding SelectedInspectApply.StartProductDate, StringFormat=yyyy-MM-dd}"
+                            TextWrapping="Wrap" />
+                        <TextBlock Grid.Column="1" Text="至" />
+                        <TextBlock
+                            Grid.Column="2"
+                            Text="{Binding SelectedInspectApply.EndProductDate, StringFormat=yyyy-MM-dd}"
+                            TextWrapping="Wrap" />
+                    </Grid>
+                    <TextBlock
+                        Grid.Row="6"
+                        Grid.Column="0"
+                        HorizontalAlignment="Right"
+                        Text="采购机构:" />
+                    <TextBox
+                        Grid.Row="6"
+                        Grid.Column="1"
+                        Height="60"
+                        IsReadOnly="True"
+                        Text="{Binding PurchaseCompanyNames}"
+                        TextWrapping="Wrap"
+                        VerticalScrollBarVisibility="Auto" />
+                    <TextBlock
+                        Grid.Row="6"
+                        Grid.Column="2"
+                        HorizontalAlignment="Right"
+                        Text="合同编号:" />
+                    <TextBox
+                        Grid.Row="6"
+                        Grid.Column="3"
+                        Height="60"
+                        IsReadOnly="True"
+                        Text="{Binding ContractNos}"
+                        TextWrapping="Wrap"
+                        VerticalScrollBarVisibility="Auto" />
+                    <TextBlock
+                        Grid.Row="7"
+                        Grid.Column="0"
+                        HorizontalAlignment="Right"
+                        Text="*检验依据:" />
+                    <TextBox
+                        Grid.Row="7"
+                        Grid.Column="1"
+                        Grid.ColumnSpan="3"
+                        HorizontalScrollBarVisibility="Auto"
+                        Text="{Binding ReportBasis, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
+                        TextWrapping="Wrap" />
+                    <TextBlock
+                        Grid.Row="8"
+                        Grid.Column="0"
+                        HorizontalAlignment="Right"
+                        VerticalAlignment="Center"
+                        Text="*检验情况及主要问题:"
+                        TextWrapping="Wrap" />
+                    <Grid
+                        Grid.Row="8"
+                        Grid.Column="1"
+                        Grid.ColumnSpan="3"
+                        Background="White">
+                        <Grid.RowDefinitions>
+                            <RowDefinition Height="30" />
+                            <RowDefinition Height="*" />
+                        </Grid.RowDefinitions>
+                        <Grid.ColumnDefinitions>
+                            <ColumnDefinition Width="Auto" />
+                            <ColumnDefinition Width="Auto" />
+                            <ColumnDefinition Width="*" />
+                        </Grid.ColumnDefinitions>
+                        <RadioButton
+                            Grid.Row="0"
+                            Grid.Column="0"
+                            Padding="10,0,10,0"
+                            VerticalContentAlignment="Center"
+                            Content="抽样送检"
+                            Foreground="Red"
+                            GroupName="IsSampleGroup"
+                            IsChecked="{Binding IsSample, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
+                        <RadioButton
+                            Grid.Row="0"
+                            Grid.Column="1"
+                            Padding="10,0,10,0"
+                            VerticalContentAlignment="Center"
+                            Content="未抽样送检"
+                            GroupName="IsSampleGroup"
+                            IsChecked="True" />
+                        <TextBox
+                            Grid.Row="1"
+                            Grid.Column="0"
+                            Grid.ColumnSpan="3"
+                            Height="120"
+                            HorizontalContentAlignment="Left"
+                            VerticalContentAlignment="Top"
+                            AcceptsReturn="True"
+                            Text="{Binding ReportDesc, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
+                            TextWrapping="Wrap"
+                            VerticalScrollBarVisibility="Auto" />
+                    </Grid>
+                    <TextBlock
+                        Grid.Row="9"
+                        Grid.Column="0"
+                        HorizontalAlignment="Right"
+                        Text="*检验结论:" />
+                    <Grid
+                        Grid.Row="9"
+                        Grid.Column="1"
+                        Grid.ColumnSpan="3"
+                        Background="White">
+                        <Grid.RowDefinitions>
+                            <RowDefinition Height="30" />
+                            <RowDefinition Height="*" />
+                        </Grid.RowDefinitions>
+                        <Grid.ColumnDefinitions>
+                            <ColumnDefinition Width="Auto" />
+                            <ColumnDefinition Width="Auto" />
+                            <ColumnDefinition Width="*" />
+                        </Grid.ColumnDefinitions>
+                        <RadioButton
+                            x:Name="FirstQualifiedRadioButton"
+                            Grid.Row="0"
+                            Grid.Column="0"
+                            Padding="10,0,10,0"
+                            VerticalContentAlignment="Center"
+                            Content="合格"
+                            Foreground="Green"
+                            GroupName="ConclusionGroup"
+                            IsChecked="{Binding Conclusion, Mode=TwoWay, Converter={StaticResource ContentToBoolConverter}, ConverterParameter=合格}" />
+                        <RadioButton
+                            x:Name="SecondQualifiedRadioButton"
+                            Grid.Row="0"
+                            Grid.Column="1"
+                            Padding="10,0,10,0"
+                            VerticalContentAlignment="Center"
+                            Content="合格(初测不合格,复测合格)"
+                            Foreground="DarkOrange"
+                            GroupName="ConclusionGroup"
+                            IsChecked="{Binding Conclusion, Mode=TwoWay, Converter={StaticResource ContentToBoolConverter}, ConverterParameter=合格(初测不合格,复测合格)}" />
+                        <RadioButton
+                            x:Name="UnQualifiedRadioButton"
+                            Grid.Row="0"
+                            Grid.Column="2"
+                            Padding="10,0,10,0"
+                            VerticalContentAlignment="Center"
+                            Content="不合格"
+                            Foreground="Red"
+                            GroupName="ConclusionGroup"
+                            IsChecked="{Binding Conclusion, Mode=TwoWay, Converter={StaticResource ContentToBoolConverter}, ConverterParameter=不合格}" />
+
+                        <TextBox
+                            Grid.Row="1"
+                            Grid.Column="0"
+                            Grid.ColumnSpan="3"
+                            Height="120"
+                            HorizontalContentAlignment="Left"
+                            VerticalContentAlignment="Top"
+                            AcceptsReturn="True"
+                            Text="{Binding ConclusionDesc, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
+                            TextWrapping="Wrap"
+                            VerticalScrollBarVisibility="Auto" />
+                    </Grid>
+                    <TextBlock
+                        Grid.Row="10"
+                        Grid.Column="0"
+                        HorizontalAlignment="Right"
+                        VerticalAlignment="Center"
+                        Text="*验收组:" />
+                    <Grid
+                        Grid.Row="10"
+                        Grid.Column="1"
+                        Grid.ColumnSpan="3"
+                        Background="White">
+                        <Grid.RowDefinitions>
+                            <RowDefinition Height="Auto" />
+                            <RowDefinition Height="*" />
+                        </Grid.RowDefinitions>
+                        <!--  子菜单项  -->
+                        <Border
+                            Grid.Row="0"
+                            BorderBrush="Gray"
+                            BorderThickness="1">
+                            <ToolBarPanel>
+                                <ToolBar Background="White" ToolBarTray.IsLocked="True">
+                                    <Button HorizontalContentAlignment="Center" Command="{Binding AddInspectionReportDetailCommand}">
+                                        <Button.Template>
+                                            <ControlTemplate>
+                                                <Border
+                                                    Width="40"
+                                                    Background="{TemplateBinding Background}"
+                                                    CornerRadius="5">
+                                                    <StackPanel HorizontalAlignment="Center" Orientation="Vertical">
+                                                        <TextBlock
+                                                            HorizontalAlignment="Center"
+                                                            FontFamily="{StaticResource FluentSystemIconsRegular}"
+                                                            FontSize="20"
+                                                            Text="{x:Static utils:RegularFontUtil.Add_Square_20}" />
+                                                        <TextBlock Text="新增" />
+                                                    </StackPanel>
+                                                </Border>
+                                                <ControlTemplate.Triggers>
+                                                    <Trigger Property="IsMouseOver" Value="True">
+                                                        <Setter Property="Background" Value="LightGray" />
+                                                    </Trigger>
+                                                </ControlTemplate.Triggers>
+                                            </ControlTemplate>
+                                        </Button.Template>
+                                    </Button>
+                                    <Button Command="{Binding RemoveInspectionReportDetailCommand}">
+                                        <Button.Template>
+                                            <ControlTemplate>
+                                                <Border
+                                                    Width="40"
+                                                    Background="{TemplateBinding Background}"
+                                                    CornerRadius="5">
+                                                    <StackPanel HorizontalAlignment="Center" Orientation="Vertical">
+                                                        <TextBlock
+                                                            HorizontalAlignment="Center"
+                                                            FontFamily="{StaticResource FluentSystemIconsRegular}"
+                                                            FontSize="20"
+                                                            Text="{x:Static utils:RegularFontUtil.Dismiss_Square_20}" />
+                                                        <TextBlock Text="删除" />
+                                                    </StackPanel>
+                                                </Border>
+                                                <ControlTemplate.Triggers>
+                                                    <Trigger Property="IsMouseOver" Value="True">
+                                                        <Setter Property="Background" Value="LightGray" />
+                                                    </Trigger>
+                                                </ControlTemplate.Triggers>
+                                            </ControlTemplate>
+                                        </Button.Template>
+                                    </Button>
+                                </ToolBar>
+                            </ToolBarPanel>
+                        </Border>
+                        <DataGrid
+                            x:Name="DataGridDetail"
+                            Grid.Row="1"
+                            behaviors:DataGridBehavior.RowNumbers="True"
+                            AutoGenerateColumns="False"
+                            Background="White"
+                            CanUserAddRows="False"
+                            CanUserReorderColumns="True"
+                            CellStyle="{StaticResource CustomCellStyle}"
+                            ColumnHeaderStyle="{StaticResource CustomColumnHeaderStyle}"
+                            HeadersVisibility="All"
+                            HorizontalGridLinesBrush="LightSlateGray"
+                            ItemsSource="{Binding SelectedInspectionReport.InspectionReportDetails, Mode=TwoWay}"
+                            RowHeaderStyle="{StaticResource CustomRowHeaderStyle}"
+                            RowStyle="{StaticResource CustomRowStyle}"
+                            SelectionMode="Single"
+                            VerticalGridLinesBrush="LightSlateGray">
+                            <!--  选择行事件  -->
+                            <b:Interaction.Triggers>
+                                <b:EventTrigger EventName="SelectionChanged">
+                                    <b:InvokeCommandAction Command="{Binding SelectedInspectionReportDetailChangedCommand}" CommandParameter="{Binding ElementName=DataGridDetail, Path=SelectedItem}" />
+                                </b:EventTrigger>
+                            </b:Interaction.Triggers>
+
+                            <DataGrid.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>
+                            </DataGrid.Resources>
+                            <DataGrid.Columns>
+                                <DataGridTemplateColumn Width="100" Header="检验组">
+                                    <DataGridTemplateColumn.CellTemplate>
+                                        <DataTemplate>
+                                            <TextBlock
+                                                HorizontalAlignment="Center"
+                                                VerticalAlignment="Center"
+                                                Text="{Binding JobCategory}" />
+                                        </DataTemplate>
+                                    </DataGridTemplateColumn.CellTemplate>
+                                    <DataGridTemplateColumn.CellEditingTemplate>
+                                        <DataTemplate>
+                                            <ComboBox
+                                                Height="25"
+                                                Background="White"
+                                                ItemsSource="{Binding DataContext.JobCategories, RelativeSource={RelativeSource AncestorType=UserControl}}"
+                                                SelectedItem="{Binding JobCategory, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
+                                        </DataTemplate>
+                                    </DataGridTemplateColumn.CellEditingTemplate>
+                                </DataGridTemplateColumn>
+
+                                <!--<DataGridTextColumn
+                                Width="100"
+                                Binding="{Binding JobCategory, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
+                                EditingElementStyle="{StaticResource TextColumnEditingElementStyle}"
+                                ElementStyle="{StaticResource TextColumnElementStyle}"
+                                Header="检验组" />-->
+
+                                <DataGridTextColumn
+                                    Width="300"
+                                    Binding="{Binding SupervisionUnit, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
+                                    EditingElementStyle="{StaticResource TextColumnEditingElementStyle}"
+                                    ElementStyle="{StaticResource TextColumnElementStyle}"
+                                    Header="单位" />
+
+                                <!--<DataGridTextColumn
+                                Width="100"
+                                Binding="{Binding Inspector, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
+                                EditingElementStyle="{StaticResource TextColumnEditingElementStyle}"
+                                ElementStyle="{StaticResource TextColumnElementStyle}"
+                                Header="姓名" />-->
+                                <DataGridTemplateColumn Width="100" Header="姓名">
+                                    <DataGridTemplateColumn.CellTemplate>
+                                        <DataTemplate>
+                                            <TextBlock
+                                                HorizontalAlignment="Center"
+                                                VerticalAlignment="Center"
+                                                Text="{Binding Inspector}" />
+                                        </DataTemplate>
+                                    </DataGridTemplateColumn.CellTemplate>
+                                    <DataGridTemplateColumn.CellEditingTemplate>
+                                        <DataTemplate>
+                                            <ComboBox
+                                                x:Name="Name"
+                                                Height="25"
+                                                Background="White"
+                                                IsEditable="True"
+                                                ItemsSource="{Binding DataContext.UserNames, RelativeSource={RelativeSource AncestorType=UserControl}}"
+                                                SelectedItem="{Binding Inspector, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
+                                        </DataTemplate>
+                                    </DataGridTemplateColumn.CellEditingTemplate>
+                                </DataGridTemplateColumn>
+                            </DataGrid.Columns>
+                        </DataGrid>
+                    </Grid>
+                    <TextBlock
+                        Grid.Row="11"
+                        Grid.Column="0"
+                        HorizontalAlignment="Right"
+                        Text="承办人:" />
+
+                    <!--<ComboBox
+                    x:Name="EditUserComboBox"
+                    Grid.Row="11"
+                    Grid.Column="1"
+                    Height="25"
+                    IsEditable="True"
+                    ItemsSource="{Binding DataContext.UserNames, RelativeSource={RelativeSource AncestorType=UserControl}}"
+                    LostFocus="Name_OnLostFocus"
+                    SelectedItem="{Binding SelectedInspectionReport.EditUser, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />-->
+                    <TextBox
+                        Grid.Row="11"
+                        Grid.Column="1"
+                        Text="{Binding SelectedInspectionReport.EditUser, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
+                </Grid>
+            </ScrollViewer>
+        </Grid>
+    </Grid>
+</UserControl>

+ 19 - 0
UniformMaterialManagementSystem/Views/InspectionReport/InspectionReportInputPage.xaml.cs

@@ -0,0 +1,19 @@
+using Microsoft.Extensions.DependencyInjection;
+using System.Windows.Controls;
+using UniformMaterialManagementSystem.ViewModels;
+
+namespace UniformMaterialManagementSystem.Views.InspectionReport
+{
+    /// <summary>
+    /// InspectionReportInputPage.xaml 的交互逻辑
+    /// </summary>
+    public partial class InspectionReportInputPage : UserControl
+    {
+        public InspectionReportInputPage()
+        {
+            InitializeComponent();
+
+            this.DataContext = App.Current.Services.GetService<InspectionReportInputPageViewModel>();
+        }
+    }
+}

+ 920 - 0
UniformMaterialManagementSystem/Views/InspectionReport/InspectionReportManagePage.xaml

@@ -0,0 +1,920 @@
+<UserControl
+    x:Class="UniformMaterialManagementSystem.Views.InspectionReport.InspectionReportManagePage"
+    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+    xmlns:b="http://schemas.microsoft.com/xaml/behaviors"
+    xmlns:behaviors="clr-namespace:UniformMaterialManagementSystem.Behaviors"
+    xmlns:control="http://FilterDataGrid.Control.com/2024"
+    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+    xmlns:filterDataGrid="http://FilterDataGrid.Control.com/2024"
+    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+    xmlns:utils="clr-namespace:UniformMaterialManagementSystem.Utils"
+    d:DesignHeight="450"
+    d:DesignWidth="800"
+    mc:Ignorable="d">
+
+    <UserControl.Resources>
+        <!--  定义一个全局的TextBlock样式  -->
+        <Style TargetType="TextBlock">
+            <Setter Property="FontSize" Value="14" />
+            <Setter Property="Margin" Value="5" />
+            <Setter Property="VerticalAlignment" Value="Center" />
+            <Setter Property="Validation.ErrorTemplate" Value="{StaticResource ValidationErrorTemplate}" />
+        </Style>
+        <Style TargetType="RadioButton">
+            <Setter Property="FontSize" Value="14" />
+            <Setter Property="VerticalAlignment" Value="Center" />
+        </Style>
+        <Style TargetType="ComboBox">
+            <Setter Property="Validation.ErrorTemplate" Value="{StaticResource ValidationErrorTemplate}" />
+        </Style>
+        <Style TargetType="DatePicker">
+            <Setter Property="Height" Value="25" />
+            <Setter Property="FontSize" Value="14" />
+            <Setter Property="Validation.ErrorTemplate" Value="{StaticResource ValidationErrorTemplate}" />
+        </Style>
+        <Style TargetType="TextBox">
+            <Setter Property="Height" Value="25" />
+            <Setter Property="FontSize" Value="14" />
+            <Setter Property="VerticalContentAlignment" Value="Center" />
+            <Setter Property="Validation.ErrorTemplate" Value="{StaticResource ValidationErrorTemplate}" />
+        </Style>
+        <ControlTemplate x:Key="CustomColumnHeaderTemplate" TargetType="DataGridColumnHeader">
+            <Border BorderBrush="LightSlateGray" BorderThickness="0,0,1,1">
+                <Grid>
+                    <Grid.ColumnDefinitions>
+                        <ColumnDefinition />
+                        <ColumnDefinition Width="Auto" />
+                        <ColumnDefinition Width="Auto" />
+                    </Grid.ColumnDefinitions>
+                    <Border
+                        Grid.Column="0"
+                        BorderBrush="#E9ECF1"
+                        BorderThickness="0,0,0,1">
+                        <ContentPresenter
+                            Margin="5,0"
+                            HorizontalAlignment="Center"
+                            VerticalAlignment="Center" />
+                    </Border>
+                    <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" />
+                    <Thumb
+                        x:Name="PART_RightHeaderGripper"
+                        Grid.Column="2"
+                        Width="1"
+                        Height="25"
+                        HorizontalAlignment="Right"
+                        VerticalAlignment="Center"
+                        BorderBrush="#E9ECF1"
+                        BorderThickness="1"
+                        Cursor="SizeWE" />
+                </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">
+            <Setter Property="Background" Value="White" />
+            <Setter Property="Foreground" Value="Black" />
+            <Setter Property="BorderThickness" Value="0,0,1,1" />
+            <Setter Property="BorderBrush" Value="LightSlateGray" />
+            <Setter Property="Padding" Value="5,0,5,0" />
+        </Style>
+
+        <Style x:Key="CustomRowStyle" TargetType="DataGridRow">
+            <Setter Property="Background" Value="White" />
+            <Setter Property="FontSize" Value="13" />
+            <Setter Property="Height" Value="26" />
+
+            <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>
+        <Style
+            x:Key="CustomCellStyle"
+            BasedOn="{StaticResource {x:Type DataGridCell}}"
+            TargetType="DataGridCell">
+            <Setter Property="Background" Value="White" />
+            <Setter Property="HorizontalContentAlignment" Value="Center" />
+            <Setter Property="VerticalContentAlignment" Value="Center" />
+            <Setter Property="Padding" Value="10" />
+            <Style.Triggers>
+                <Trigger Property="IsSelected" Value="True">
+                    <Setter Property="Background" Value="LightBlue" />
+                    <Setter Property="Foreground" Value="Black" />
+                </Trigger>
+            </Style.Triggers>
+        </Style>
+
+    </UserControl.Resources>
+    <Grid>
+        <Grid.ColumnDefinitions>
+            <ColumnDefinition Width="*" />
+            <ColumnDefinition Width="Auto" />
+            <ColumnDefinition Width="2*" />
+        </Grid.ColumnDefinitions>
+        <Grid Grid.Column="0">
+            <Grid.RowDefinitions>
+                <RowDefinition Height="Auto" />
+                <RowDefinition Height="*" />
+            </Grid.RowDefinitions>
+            <Grid Grid.Row="0">
+                <!--  菜单项  -->
+                <Border
+                    Grid.Row="0"
+                    BorderBrush="Gray"
+                    BorderThickness="1">
+                    <Grid Background="White">
+                        <Grid.ColumnDefinitions>
+                            <ColumnDefinition Width="Auto" />
+                            <ColumnDefinition Width="*" />
+                        </Grid.ColumnDefinitions>
+                        <StackPanel
+                            Grid.Column="0"
+                            FlowDirection="LeftToRight"
+                            Orientation="Horizontal">
+
+                            <TextBlock Text="工作年度:" />
+                            <ComboBox
+                                Width="120"
+                                Height="23"
+                                IsEditable="True"
+                                ItemsSource="{Binding Years}"
+                                SelectedItem="{Binding SelectedYear, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
+
+                        </StackPanel>
+                        <ToolBarPanel Grid.Column="1">
+                            <ToolBar Background="White" ToolBarTray.IsLocked="True">
+
+                                <Button Command="{Binding LoadDataCommand}">
+                                    <Button.Template>
+                                        <ControlTemplate>
+                                            <Border
+                                                Width="45"
+                                                Background="{TemplateBinding Background}"
+                                                CornerRadius="5">
+                                                <StackPanel HorizontalAlignment="Center" Orientation="Vertical">
+                                                    <TextBlock
+                                                        HorizontalAlignment="Center"
+                                                        FontFamily="{StaticResource FluentSystemIconsRegular}"
+                                                        FontSize="20"
+                                                        Text="{x:Static utils:RegularFontUtil.Document_Search_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 Command="{Binding AddInspectionReportCommand}">
+                                    <Button.Template>
+                                        <ControlTemplate>
+                                            <Border
+                                                Width="40"
+                                                Background="{TemplateBinding Background}"
+                                                CornerRadius="5">
+                                                <StackPanel HorizontalAlignment="Center" Orientation="Vertical">
+                                                    <TextBlock
+                                                        HorizontalAlignment="Center"
+                                                        FontFamily="{StaticResource FluentSystemIconsRegular}"
+                                                        FontSize="20"
+                                                        Text="{x:Static utils:RegularFontUtil.Add_Circle_32}" />
+                                                    <TextBlock Text="新增" />
+                                                </StackPanel>
+                                            </Border>
+                                            <ControlTemplate.Triggers>
+                                                <Trigger Property="IsMouseOver" Value="True">
+                                                    <Setter Property="Background" Value="LightGray" />
+                                                </Trigger>
+                                            </ControlTemplate.Triggers>
+                                        </ControlTemplate>
+                                    </Button.Template>
+                                </Button>
+                                <Button
+                                    x:Name="SaveButton"
+                                    Click="SaveButton_OnClick"
+                                    Command="{Binding SaveInspectionReportCommand}">
+                                    <Button.Template>
+                                        <ControlTemplate>
+                                            <Border
+                                                Width="40"
+                                                Background="{TemplateBinding Background}"
+                                                CornerRadius="5">
+                                                <StackPanel HorizontalAlignment="Center" Orientation="Vertical">
+                                                    <TextBlock
+                                                        HorizontalAlignment="Center"
+                                                        FontFamily="{StaticResource FluentSystemIconsRegular}"
+                                                        FontSize="20"
+                                                        Text="{x:Static utils:RegularFontUtil.Save_32}" />
+                                                    <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 Command="{Binding ExportInspectionReportCommand}">
+                                    <Button.Template>
+                                        <ControlTemplate>
+                                            <Border
+                                                Width="60"
+                                                Background="{TemplateBinding Background}"
+                                                CornerRadius="5">
+                                                <StackPanel HorizontalAlignment="Center" Orientation="Vertical">
+                                                    <TextBlock
+                                                        HorizontalAlignment="Center"
+                                                        FontFamily="{StaticResource FluentSystemIconsRegular}"
+                                                        FontSize="20"
+                                                        Text="{x:Static utils:RegularFontUtil.Dock_20}" />
+                                                    <TextBlock Text="导出报告" />
+                                                </StackPanel>
+                                            </Border>
+                                            <ControlTemplate.Triggers>
+                                                <Trigger Property="IsMouseOver" Value="True">
+                                                    <Setter Property="Background" Value="LightGray" />
+                                                </Trigger>
+                                            </ControlTemplate.Triggers>
+                                        </ControlTemplate>
+                                    </Button.Template>
+                                </Button>
+
+                            </ToolBar>
+                        </ToolBarPanel>
+                    </Grid>
+                </Border>
+            </Grid>
+            <filterDataGrid:FilterDataGrid
+                x:Name="DataGridMain"
+                Grid.Row="1"
+                behaviors:DataGridBehavior.RowNumbers="True"
+                AutoGenerateColumns="False"
+                Background="White"
+                CanUserAddRows="False"
+                CanUserReorderColumns="True"
+                CanUserResizeColumns="True"
+                CanUserResizeRows="False"
+                CellStyle="{StaticResource CustomCellStyle}"
+                ColumnHeaderStyle="{StaticResource CustomColumnHeaderStyle}"
+                FilterLanguage="SimplifiedChinese"
+                HeadersVisibility="All"
+                HorizontalGridLinesBrush="LightSlateGray"
+                ItemsSource="{Binding InspectionReports, Mode=TwoWay}"
+                RowHeaderStyle="{StaticResource CustomRowHeaderStyle}"
+                RowStyle="{StaticResource CustomRowStyle}"
+                SelectedItem="{Binding SelectedInspectionReport, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
+                SelectionMode="Single"
+                ShowRowsCount="True"
+                ShowStatusBar="True"
+                VerticalGridLinesBrush="LightSlateGray">
+
+                <!--  选择行事件  -->
+                <!--<b:Interaction.Triggers>
+                    <b:EventTrigger EventName="SelectionChanged">
+                        <b:InvokeCommandAction Command="{Binding InspectionReportSelectionChangedCommand}" CommandParameter="{Binding ElementName=DataGridMain, Path=SelectedItem}" />
+                    </b:EventTrigger>
+                </b:Interaction.Triggers>-->
+
+                <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>
+                </control:FilterDataGrid.Resources>
+
+                <control:FilterDataGrid.Columns>
+                    <DataGridTextColumn
+                        Width="60"
+                        Binding="{Binding InspectApply.Year}"
+                        EditingElementStyle="{StaticResource TextColumnEditingElementStyle}"
+                        ElementStyle="{StaticResource TextColumnElementStyle}"
+                        Header="工作年度"
+                        IsReadOnly="True" />
+                    <control:FilterDataGridTextColumn
+                        Width="300"
+                        Binding="{Binding ReportNo}"
+                        EditingElementStyle="{StaticResource TextColumnEditingElementStyle}"
+                        ElementStyle="{StaticResource TextColumnElementStyle}"
+                        Header="检验报告编号"
+                        IsColumnFiltered="True"
+                        IsReadOnly="True" />
+                    <control:FilterDataGridTextColumn
+                        Width="120"
+                        Binding="{Binding ReportTime}"
+                        EditingElementStyle="{StaticResource TextColumnEditingElementStyle}"
+                        ElementStyle="{StaticResource TextColumnElementStyle}"
+                        Header="检验时间"
+                        IsColumnFiltered="True"
+                        IsReadOnly="True" />
+                    <control:FilterDataGridTextColumn
+                        Width="100"
+                        Binding="{Binding Conclusion}"
+                        EditingElementStyle="{StaticResource TextColumnEditingElementStyle}"
+                        ElementStyle="{StaticResource TextColumnElementStyle}"
+                        Header="检验结论"
+                        IsColumnFiltered="True"
+                        IsReadOnly="True" />
+                    <control:FilterDataGridTextColumn
+                        Width="100"
+                        Binding="{Binding EditUser}"
+                        EditingElementStyle="{StaticResource TextColumnEditingElementStyle}"
+                        ElementStyle="{StaticResource TextColumnElementStyle}"
+                        Header="承办人"
+                        IsColumnFiltered="True"
+                        IsReadOnly="True" />
+
+                </control:FilterDataGrid.Columns>
+            </filterDataGrid:FilterDataGrid>
+        </Grid>
+
+        <GridSplitter
+            Grid.Column="1"
+            Width="2"
+            HorizontalAlignment="Stretch" />
+        <Grid Grid.Column="2" Background="White">
+            <ScrollViewer>
+                <Grid Background="White">
+                    <Grid.RowDefinitions>
+                        <RowDefinition Height="50" />
+                        <RowDefinition Height="40" />
+                        <RowDefinition Height="40" />
+                        <RowDefinition Height="40" />
+                        <RowDefinition Height="40" />
+                        <RowDefinition Height="40" />
+                        <RowDefinition Height="60" />
+                        <RowDefinition Height="40" />
+                        <RowDefinition Height="150" />
+                        <RowDefinition Height="170" />
+                        <RowDefinition Height="200" />
+                        <RowDefinition Height="40" />
+                    </Grid.RowDefinitions>
+                    <Grid.ColumnDefinitions>
+                        <ColumnDefinition Width="2*" />
+                        <ColumnDefinition Width="3*" />
+                        <ColumnDefinition Width="3*" />
+                        <ColumnDefinition Width="3*" />
+                        <ColumnDefinition Width="*" />
+                    </Grid.ColumnDefinitions>
+
+                    <TextBlock
+                        Grid.Row="0"
+                        Grid.Column="0"
+                        Grid.ColumnSpan="5"
+                        HorizontalAlignment="Center"
+                        VerticalAlignment="Center"
+                        FontSize="25"
+                        Text="军需物资质量监督检验报告" />
+                    <TextBlock
+                        Grid.Row="1"
+                        Grid.Column="0"
+                        HorizontalAlignment="Right"
+                        Text="检验报告编号:"
+                        TextWrapping="Wrap" />
+                    <TextBlock
+                        Grid.Row="1"
+                        Grid.Column="1"
+                        Grid.ColumnSpan="3"
+                        Text="{Binding SelectedInspectionReport.ReportNo}" />
+                    <TextBlock
+                        Grid.Row="2"
+                        Grid.Column="0"
+                        HorizontalAlignment="Right"
+                        Text="*检验部门:" />
+                    <TextBox
+                        Grid.Row="2"
+                        Grid.Column="1"
+                        Text="{Binding SelectedInspectionReport.Department, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
+                    <TextBlock
+                        Grid.Row="2"
+                        Grid.Column="2"
+                        HorizontalAlignment="Right"
+                        Text="*检验时间:" />
+                    <DatePicker
+                        Grid.Row="2"
+                        Grid.Column="3"
+                        Text="{Binding SelectedInspectionReport.ReportTime, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
+                    <TextBlock
+                        Grid.Row="3"
+                        Grid.Column="0"
+                        HorizontalAlignment="Right"
+                        Text="检验类别:" />
+                    <StackPanel
+                        Grid.Row="3"
+                        Grid.Column="1"
+                        Grid.ColumnSpan="3"
+                        VerticalAlignment="Center">
+                        <Grid VerticalAlignment="Center" Background="White">
+                            <Grid.ColumnDefinitions>
+                                <ColumnDefinition Width="*" />
+                                <ColumnDefinition Width="*" />
+                                <ColumnDefinition Width="*" />
+                                <ColumnDefinition Width="*" />
+                            </Grid.ColumnDefinitions>
+                            <RadioButton
+                                x:Name="FirstRadioButton"
+                                Grid.Column="0"
+                                Content="报样检验"
+                                GroupName="InspectType"
+                                IsEnabled="False" />
+                            <RadioButton
+                                x:Name="SecondRadioButton"
+                                Grid.Column="1"
+                                Content="首批检验"
+                                GroupName="InspectType"
+                                IsEnabled="False" />
+                            <RadioButton
+                                x:Name="ThirdRadioButton"
+                                Grid.Column="2"
+                                Content="生产过程"
+                                GroupName="InspectType"
+                                IsEnabled="False" />
+                            <RadioButton
+                                x:Name="ForthRadioButton"
+                                Grid.Column="3"
+                                Content="出厂检验"
+                                GroupName="InspectType"
+                                IsEnabled="False" />
+                            <TextBox
+                                x:Name="InspectTypeText"
+                                Grid.Column="0"
+                                Text="{Binding SelectedInspectionReport.InspectApply.InspCategory, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
+                                TextChanged="InspectTypeText_TextChanged"
+                                Visibility="Collapsed" />
+                        </Grid>
+                    </StackPanel>
+                    <TextBlock
+                        Grid.Row="4"
+                        Grid.Column="0"
+                        HorizontalAlignment="Right"
+                        Text="产品名称:" />
+                    <TextBlock
+                        Grid.Row="4"
+                        Grid.Column="1"
+                        Text="{Binding SelectedInspectionReport.InspectApply.Material.Name}"
+                        TextWrapping="Wrap" />
+                    <TextBlock
+                        Grid.Row="4"
+                        Grid.Column="2"
+                        HorizontalAlignment="Right"
+                        Text="生产企业:" />
+                    <TextBlock
+                        Grid.Row="4"
+                        Grid.Column="3"
+                        Text="{Binding SelectedInspectionReport.InspectApply.Company}"
+                        TextWrapping="Wrap" />
+                    <TextBlock
+                        Grid.Row="5"
+                        Grid.Column="0"
+                        HorizontalAlignment="Right"
+                        Text="产品数量:"
+                        TextWrapping="Wrap" />
+                    <Grid
+                        Grid.Row="5"
+                        Grid.Column="1"
+                        Background="White">
+                        <Grid.ColumnDefinitions>
+                            <ColumnDefinition Width="Auto" />
+                            <ColumnDefinition Width="*" />
+                        </Grid.ColumnDefinitions>
+                        <TextBlock Grid.Column="0" Text="{Binding SelectedInspectionReport.InspectApply.InspQuantity}" />
+                        <TextBlock Grid.Column="1" Text="{Binding SelectedInspectionReport.InspectApply.Material.MeasureUnit}" />
+                    </Grid>
+                    <TextBlock
+                        Grid.Row="5"
+                        Grid.Column="2"
+                        HorizontalAlignment="Right"
+                        Text="生产日期:" />
+                    <Grid
+                        Grid.Row="5"
+                        Grid.Column="3"
+                        Background="White">
+                        <Grid.ColumnDefinitions>
+                            <ColumnDefinition Width="*" />
+                            <ColumnDefinition Width="Auto" />
+                            <ColumnDefinition Width="*" />
+                        </Grid.ColumnDefinitions>
+                        <TextBlock
+                            Grid.Column="0"
+                            Text="{Binding SelectedInspectionReport.InspectApply.StartProductDate, StringFormat=yyyy-MM-dd}"
+                            TextWrapping="Wrap" />
+                        <TextBlock Grid.Column="1" Text="至" />
+                        <TextBlock
+                            Grid.Column="2"
+                            Text="{Binding SelectedInspectionReport.InspectApply.EndProductDate, StringFormat=yyyy-MM-dd}"
+                            TextWrapping="Wrap" />
+                    </Grid>
+                    <TextBlock
+                        Grid.Row="6"
+                        Grid.Column="0"
+                        HorizontalAlignment="Right"
+                        Text="采购机构:" />
+                    <TextBox
+                        Grid.Row="6"
+                        Grid.Column="1"
+                        Height="60"
+                        IsReadOnly="True"
+                        Text="{Binding SelectedInspectionReport.PurchaseCompanyNames}"
+                        TextWrapping="Wrap"
+                        VerticalScrollBarVisibility="Auto" />
+                    <TextBlock
+                        Grid.Row="6"
+                        Grid.Column="2"
+                        HorizontalAlignment="Right"
+                        Text="合同编号:" />
+                    <TextBox
+                        Grid.Row="6"
+                        Grid.Column="3"
+                        Height="60"
+                        IsReadOnly="True"
+                        Text="{Binding SelectedInspectionReport.ContractNos}"
+                        TextWrapping="Wrap"
+                        VerticalScrollBarVisibility="Auto" />
+                    <TextBlock
+                        Grid.Row="7"
+                        Grid.Column="0"
+                        HorizontalAlignment="Right"
+                        Text="*检验依据:" />
+                    <TextBox
+                        Grid.Row="7"
+                        Grid.Column="1"
+                        Grid.ColumnSpan="3"
+                        HorizontalScrollBarVisibility="Auto"
+                        Text="{Binding SelectedInspectionReport.ReportBasis, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
+                        TextWrapping="Wrap" />
+                    <TextBlock
+                        Grid.Row="8"
+                        Grid.Column="0"
+                        HorizontalAlignment="Right"
+                        VerticalAlignment="Center"
+                        Text="*检验情况及主要问题:"
+                        TextWrapping="Wrap" />
+                    <Grid
+                        Grid.Row="8"
+                        Grid.Column="1"
+                        Grid.ColumnSpan="3"
+                        Background="White">
+                        <Grid.RowDefinitions>
+                            <RowDefinition Height="30" />
+                            <RowDefinition Height="*" />
+                        </Grid.RowDefinitions>
+                        <Grid.ColumnDefinitions>
+                            <ColumnDefinition Width="Auto" />
+                            <ColumnDefinition Width="Auto" />
+                            <ColumnDefinition Width="*" />
+                        </Grid.ColumnDefinitions>
+                        <RadioButton
+                            x:Name="IsSampleRadioButton"
+                            Grid.Row="0"
+                            Grid.Column="0"
+                            Padding="10,0,10,0"
+                            VerticalContentAlignment="Center"
+                            Content="抽样送检"
+                            Foreground="Red"
+                            GroupName="IsSampleGroup" />
+                        <RadioButton
+                            x:Name="NotSampleRadioButton"
+                            Grid.Row="0"
+                            Grid.Column="1"
+                            Padding="10,0,10,0"
+                            VerticalContentAlignment="Center"
+                            Content="未抽样送检"
+                            GroupName="IsSampleGroup" />
+                        <TextBox
+                            x:Name="IsSampleTextBox"
+                            Grid.Row="0"
+                            Grid.Column="2"
+                            Text="{Binding SelectedInspectionReport.IsSample, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
+                            TextChanged="IsSampleTextBox_TextChanged"
+                            Visibility="Collapsed" />
+                        <TextBox
+                            Grid.Row="1"
+                            Grid.Column="0"
+                            Grid.ColumnSpan="3"
+                            Height="120"
+                            HorizontalContentAlignment="Left"
+                            VerticalContentAlignment="Top"
+                            AcceptsReturn="True"
+                            Text="{Binding SelectedInspectionReport.ReportDesc, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
+                            TextWrapping="Wrap"
+                            VerticalScrollBarVisibility="Auto" />
+                    </Grid>
+                    <TextBlock
+                        Grid.Row="9"
+                        Grid.Column="0"
+                        HorizontalAlignment="Right"
+                        Text="*检验结论:" />
+                    <Grid
+                        Grid.Row="9"
+                        Grid.Column="1"
+                        Grid.ColumnSpan="3"
+                        Background="White">
+                        <Grid.RowDefinitions>
+                            <RowDefinition Height="30" />
+                            <RowDefinition Height="*" />
+                        </Grid.RowDefinitions>
+                        <Grid.ColumnDefinitions>
+                            <ColumnDefinition Width="Auto" />
+                            <ColumnDefinition Width="Auto" />
+                            <ColumnDefinition Width="*" />
+                        </Grid.ColumnDefinitions>
+                        <RadioButton
+                            x:Name="FirstQualifiedRadioButton"
+                            Grid.Row="0"
+                            Grid.Column="0"
+                            Padding="10,0,10,0"
+                            VerticalContentAlignment="Center"
+                            Checked="ConclusionGroupRadioButton_Checked"
+                            Content="合格"
+                            Foreground="Green"
+                            GroupName="ConclusionGroup"
+                            IsChecked="True" />
+                        <RadioButton
+                            x:Name="SecondQualifiedRadioButton"
+                            Grid.Row="0"
+                            Grid.Column="1"
+                            Padding="10,0,10,0"
+                            VerticalContentAlignment="Center"
+                            Checked="ConclusionGroupRadioButton_Checked"
+                            Content="合格(初测不合格,复测合格)"
+                            Foreground="DarkOrange"
+                            GroupName="ConclusionGroup" />
+                        <RadioButton
+                            x:Name="UnQualifiedRadioButton"
+                            Grid.Row="0"
+                            Grid.Column="2"
+                            Padding="10,0,10,0"
+                            VerticalContentAlignment="Center"
+                            Checked="ConclusionGroupRadioButton_Checked"
+                            Content="不合格"
+                            Foreground="Red"
+                            GroupName="ConclusionGroup" />
+                        <TextBox
+                            x:Name="ConclusionTextBox"
+                            Grid.Row="0"
+                            Grid.Column="2"
+                            Text="{Binding SelectedInspectionReport.Conclusion, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
+                            TextChanged="ConclusionTextBox_TextChanged"
+                            Visibility="Collapsed" />
+                        <TextBox
+                            Grid.Row="1"
+                            Grid.Column="0"
+                            Grid.ColumnSpan="3"
+                            Height="120"
+                            HorizontalContentAlignment="Left"
+                            VerticalContentAlignment="Top"
+                            AcceptsReturn="True"
+                            Text="{Binding SelectedInspectionReport.ConclusionDesc, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
+                            TextWrapping="Wrap"
+                            VerticalScrollBarVisibility="Auto" />
+                    </Grid>
+                    <TextBlock
+                        Grid.Row="10"
+                        Grid.Column="0"
+                        HorizontalAlignment="Right"
+                        VerticalAlignment="Center"
+                        Text="*验收组:" />
+                    <Grid
+                        Grid.Row="10"
+                        Grid.Column="1"
+                        Grid.ColumnSpan="3"
+                        Background="White">
+                        <Grid.RowDefinitions>
+                            <RowDefinition Height="Auto" />
+                            <RowDefinition Height="*" />
+                        </Grid.RowDefinitions>
+                        <!--  子菜单项  -->
+                        <Border
+                            Grid.Row="0"
+                            BorderBrush="Gray"
+                            BorderThickness="1">
+                            <ToolBarPanel>
+                                <ToolBar Background="White" ToolBarTray.IsLocked="True">
+                                    <Button HorizontalContentAlignment="Center" Command="{Binding AddInspectionReportDetailCommand}">
+                                        <Button.Template>
+                                            <ControlTemplate>
+                                                <Border
+                                                    Width="40"
+                                                    Background="{TemplateBinding Background}"
+                                                    CornerRadius="5">
+                                                    <StackPanel HorizontalAlignment="Center" Orientation="Vertical">
+                                                        <TextBlock
+                                                            HorizontalAlignment="Center"
+                                                            FontFamily="{StaticResource FluentSystemIconsRegular}"
+                                                            FontSize="20"
+                                                            Text="{x:Static utils:RegularFontUtil.Add_Square_20}" />
+                                                        <TextBlock Text="新增" />
+                                                    </StackPanel>
+                                                </Border>
+                                                <ControlTemplate.Triggers>
+                                                    <Trigger Property="IsMouseOver" Value="True">
+                                                        <Setter Property="Background" Value="LightGray" />
+                                                    </Trigger>
+                                                </ControlTemplate.Triggers>
+                                            </ControlTemplate>
+                                        </Button.Template>
+                                    </Button>
+                                    <Button Command="{Binding RemoveInspectionReportDetailCommand}">
+                                        <Button.Template>
+                                            <ControlTemplate>
+                                                <Border
+                                                    Width="40"
+                                                    Background="{TemplateBinding Background}"
+                                                    CornerRadius="5">
+                                                    <StackPanel HorizontalAlignment="Center" Orientation="Vertical">
+                                                        <TextBlock
+                                                            HorizontalAlignment="Center"
+                                                            FontFamily="{StaticResource FluentSystemIconsRegular}"
+                                                            FontSize="20"
+                                                            Text="{x:Static utils:RegularFontUtil.Dismiss_Square_20}" />
+                                                        <TextBlock Text="删除" />
+                                                    </StackPanel>
+                                                </Border>
+                                                <ControlTemplate.Triggers>
+                                                    <Trigger Property="IsMouseOver" Value="True">
+                                                        <Setter Property="Background" Value="LightGray" />
+                                                    </Trigger>
+                                                </ControlTemplate.Triggers>
+                                            </ControlTemplate>
+                                        </Button.Template>
+                                    </Button>
+                                </ToolBar>
+                            </ToolBarPanel>
+                        </Border>
+                        <DataGrid
+                            x:Name="DataGridDetail"
+                            Grid.Row="1"
+                            behaviors:DataGridBehavior.RowNumbers="True"
+                            AutoGenerateColumns="False"
+                            Background="White"
+                            CanUserAddRows="False"
+                            CanUserReorderColumns="True"
+                            CellStyle="{StaticResource CustomCellStyle}"
+                            ColumnHeaderStyle="{StaticResource CustomColumnHeaderStyle}"
+                            HeadersVisibility="All"
+                            HorizontalGridLinesBrush="LightSlateGray"
+                            ItemsSource="{Binding SelectedInspectionReport.InspectionReportDetails, Mode=TwoWay}"
+                            RowHeaderStyle="{StaticResource CustomRowHeaderStyle}"
+                            RowStyle="{StaticResource CustomRowStyle}"
+                            SelectionMode="Single"
+                            VerticalGridLinesBrush="LightSlateGray">
+                            <!--  选择行事件  -->
+                            <b:Interaction.Triggers>
+                                <b:EventTrigger EventName="SelectionChanged">
+                                    <b:InvokeCommandAction Command="{Binding SelectedInspectionReportDetailChangedCommand}" CommandParameter="{Binding ElementName=DataGridDetail, Path=SelectedItem}" />
+                                </b:EventTrigger>
+                            </b:Interaction.Triggers>
+
+                            <DataGrid.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>
+                            </DataGrid.Resources>
+                            <DataGrid.Columns>
+                                <DataGridTemplateColumn Width="100" Header="检验组">
+                                    <DataGridTemplateColumn.CellTemplate>
+                                        <DataTemplate>
+                                            <TextBlock
+                                                HorizontalAlignment="Center"
+                                                VerticalAlignment="Center"
+                                                Text="{Binding JobCategory}" />
+                                        </DataTemplate>
+                                    </DataGridTemplateColumn.CellTemplate>
+                                    <DataGridTemplateColumn.CellEditingTemplate>
+                                        <DataTemplate>
+                                            <ComboBox
+                                                Height="25"
+                                                Background="White"
+                                                ItemsSource="{Binding DataContext.JobCategories, RelativeSource={RelativeSource AncestorType=UserControl}}"
+                                                SelectedItem="{Binding JobCategory, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
+                                        </DataTemplate>
+                                    </DataGridTemplateColumn.CellEditingTemplate>
+                                </DataGridTemplateColumn>
+
+                                <!--<DataGridTextColumn
+                                    Width="100"
+                                    Binding="{Binding JobCategory, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
+                                    EditingElementStyle="{StaticResource TextColumnEditingElementStyle}"
+                                    ElementStyle="{StaticResource TextColumnElementStyle}"
+                                    Header="检验组" />-->
+
+                                <DataGridTextColumn
+                                    Width="300"
+                                    Binding="{Binding SupervisionUnit, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
+                                    EditingElementStyle="{StaticResource TextColumnEditingElementStyle}"
+                                    ElementStyle="{StaticResource TextColumnElementStyle}"
+                                    Header="单位" />
+
+                                <!--<DataGridTextColumn
+                                    Width="100"
+                                    Binding="{Binding Inspector, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
+                                    EditingElementStyle="{StaticResource TextColumnEditingElementStyle}"
+                                    ElementStyle="{StaticResource TextColumnElementStyle}"
+                                    Header="姓名" />-->
+                                <DataGridTemplateColumn Width="100" Header="姓名">
+                                    <DataGridTemplateColumn.CellTemplate>
+                                        <DataTemplate>
+                                            <TextBlock
+                                                HorizontalAlignment="Center"
+                                                VerticalAlignment="Center"
+                                                Text="{Binding Inspector}" />
+                                        </DataTemplate>
+                                    </DataGridTemplateColumn.CellTemplate>
+                                    <DataGridTemplateColumn.CellEditingTemplate>
+                                        <DataTemplate>
+                                            <ComboBox
+                                                x:Name="Name"
+                                                Height="25"
+                                                Background="White"
+                                                IsEditable="True"
+                                                ItemsSource="{Binding DataContext.UserNames, RelativeSource={RelativeSource AncestorType=UserControl}}"
+                                                LostFocus="Name_OnLostFocus"
+                                                SelectedItem="{Binding Inspector, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
+                                        </DataTemplate>
+                                    </DataGridTemplateColumn.CellEditingTemplate>
+                                </DataGridTemplateColumn>
+                            </DataGrid.Columns>
+                        </DataGrid>
+                    </Grid>
+                    <TextBlock
+                        Grid.Row="11"
+                        Grid.Column="0"
+                        HorizontalAlignment="Right"
+                        Text="承办人:" />
+
+                    <!--<ComboBox
+                        x:Name="EditUserComboBox"
+                        Grid.Row="11"
+                        Grid.Column="1"
+                        Height="25"
+                        IsEditable="True"
+                        ItemsSource="{Binding DataContext.UserNames, RelativeSource={RelativeSource AncestorType=UserControl}}"
+                        LostFocus="Name_OnLostFocus"
+                        SelectedItem="{Binding SelectedInspectionReport.EditUser, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />-->
+                    <TextBox
+                        Grid.Row="11"
+                        Grid.Column="1"
+                        Text="{Binding SelectedInspectionReport.EditUser, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
+                </Grid>
+            </ScrollViewer>
+        </Grid>
+    </Grid>
+</UserControl>

+ 99 - 0
UniformMaterialManagementSystem/Views/InspectionReport/InspectionReportManagePage.xaml.cs

@@ -0,0 +1,99 @@
+using System.Windows;
+using Microsoft.Extensions.DependencyInjection;
+using System.Windows.Controls;
+using UniformMaterialManagementSystem.ViewModels;
+
+namespace UniformMaterialManagementSystem.Views.InspectionReport
+{
+    /// <summary>
+    /// InspectionReportManagePage.xaml 的交互逻辑
+    /// </summary>
+    public partial class InspectionReportManagePage : UserControl
+    {
+        public InspectionReportManagePage()
+        {
+            InitializeComponent();
+
+            this.DataContext = App.Current.Services.GetService<InspectionReportManagePageViewModel>();
+
+        }
+
+        private void InspectTypeText_TextChanged(object sender, TextChangedEventArgs e)
+        {
+            var inspectType = InspectTypeText.Text;
+            switch (inspectType)
+            {
+                case "报样检验":
+                    FirstRadioButton.IsChecked = true;
+                    break;
+                case "首批检验":
+                    SecondRadioButton.IsChecked = true;
+                    break;
+                case "过程检验":
+                    ThirdRadioButton.IsChecked = true;
+                    break;
+                case "出厂检验":
+                    ForthRadioButton.IsChecked = true;
+                    break;
+            }
+        }
+
+        private void IsSampleTextBox_TextChanged(object sender, TextChangedEventArgs e)
+        {
+            var isSample = IsSampleTextBox.Text;
+            if (!string.IsNullOrEmpty(isSample) && bool.Parse(isSample))
+            {
+                IsSampleRadioButton.IsChecked = true;
+            }
+            else
+            {
+                NotSampleRadioButton.IsChecked = true;
+            }
+        }
+
+        private void ConclusionTextBox_TextChanged(object sender, TextChangedEventArgs e)
+        {
+            var conclusion = ConclusionTextBox.Text;
+            switch (conclusion)
+            {
+                case "合格":
+                    FirstQualifiedRadioButton.IsChecked = true;
+                    break;
+                case "合格(初测不合格,复测合格)":
+                    SecondQualifiedRadioButton.IsChecked = true;
+                    break;
+                case "不合格":
+                    UnQualifiedRadioButton.IsChecked = true;
+                    break;
+            }
+        }
+
+        private void ConclusionGroupRadioButton_Checked(object sender, System.Windows.RoutedEventArgs e)
+        {
+            var radioButton = (RadioButton)sender;
+            if (radioButton.GroupName == "ConclusionGroup")
+            {
+                if (radioButton.Content != null && ConclusionTextBox != null)
+                {
+                    ConclusionTextBox.Text = radioButton.Content.ToString();
+                }
+            }
+        }
+
+        private void Name_OnLostFocus(object sender, RoutedEventArgs e)
+        {
+            if (sender is not ComboBox comboBox) return;
+            var text = comboBox.Text;
+
+            if (string.IsNullOrWhiteSpace(text) || comboBox.Items.Contains(text) || comboBox.ItemsSource is not List<string> names) return;
+
+            names.Add(text);
+            comboBox.SelectedItem = text;
+        }
+
+        private void SaveButton_OnClick(object sender, RoutedEventArgs e)
+        {
+            DataGridDetail.CommitEdit();
+        }
+    }
+}

+ 10 - 903
UniformMaterialManagementSystem/Views/InspectionReportPage.xaml

@@ -7,914 +7,21 @@
     xmlns:control="http://FilterDataGrid.Control.com/2024"
     xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
     xmlns:filterDataGrid="http://FilterDataGrid.Control.com/2024"
+    xmlns:inspectionReport="clr-namespace:UniformMaterialManagementSystem.Views.InspectionReport"
     xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
     xmlns:utils="clr-namespace:UniformMaterialManagementSystem.Utils"
     d:DesignHeight="450"
     d:DesignWidth="800"
     mc:Ignorable="d">
 
-    <UserControl.Resources>
-        <!--  定义一个全局的TextBlock样式  -->
-        <Style TargetType="TextBlock">
-            <Setter Property="FontSize" Value="14" />
-            <Setter Property="Margin" Value="5" />
-            <Setter Property="VerticalAlignment" Value="Center" />
-            <Setter Property="Validation.ErrorTemplate" Value="{StaticResource ValidationErrorTemplate}" />
-        </Style>
-        <Style TargetType="RadioButton">
-            <Setter Property="FontSize" Value="14" />
-            <Setter Property="VerticalAlignment" Value="Center" />
-        </Style>
-        <Style TargetType="ComboBox">
-            <Setter Property="Validation.ErrorTemplate" Value="{StaticResource ValidationErrorTemplate}" />
-        </Style>
-        <Style TargetType="DatePicker">
-            <Setter Property="Height" Value="25" />
-            <Setter Property="FontSize" Value="14" />
-            <Setter Property="Validation.ErrorTemplate" Value="{StaticResource ValidationErrorTemplate}" />
-        </Style>
-        <Style TargetType="TextBox">
-            <Setter Property="Height" Value="25" />
-            <Setter Property="FontSize" Value="14" />
-            <Setter Property="VerticalContentAlignment" Value="Center" />
-            <Setter Property="Validation.ErrorTemplate" Value="{StaticResource ValidationErrorTemplate}" />
-        </Style>
-        <ControlTemplate x:Key="CustomColumnHeaderTemplate" TargetType="DataGridColumnHeader">
-            <Border BorderBrush="LightSlateGray" BorderThickness="0,0,1,1">
-                <Grid>
-                    <Grid.ColumnDefinitions>
-                        <ColumnDefinition />
-                        <ColumnDefinition Width="Auto" />
-                        <ColumnDefinition Width="Auto" />
-                    </Grid.ColumnDefinitions>
-                    <Border
-                        Grid.Column="0"
-                        BorderBrush="#E9ECF1"
-                        BorderThickness="0,0,0,1">
-                        <ContentPresenter
-                            Margin="5,0"
-                            HorizontalAlignment="Center"
-                            VerticalAlignment="Center" />
-                    </Border>
-                    <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" />
-                    <Thumb
-                        x:Name="PART_RightHeaderGripper"
-                        Grid.Column="2"
-                        Width="1"
-                        Height="25"
-                        HorizontalAlignment="Right"
-                        VerticalAlignment="Center"
-                        BorderBrush="#E9ECF1"
-                        BorderThickness="1"
-                        Cursor="SizeWE" />
-                </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">
-            <Setter Property="Background" Value="White" />
-            <Setter Property="Foreground" Value="Black" />
-            <Setter Property="BorderThickness" Value="0,0,1,1" />
-            <Setter Property="BorderBrush" Value="LightSlateGray" />
-            <Setter Property="Padding" Value="5,0,5,0" />
-        </Style>
-
-        <Style x:Key="CustomRowStyle" TargetType="DataGridRow">
-            <Setter Property="Background" Value="White" />
-            <Setter Property="FontSize" Value="13" />
-            <Setter Property="Height" Value="26" />
-
-            <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>
-        <Style
-            x:Key="CustomCellStyle"
-            BasedOn="{StaticResource {x:Type DataGridCell}}"
-            TargetType="DataGridCell">
-            <Setter Property="Background" Value="White" />
-            <Setter Property="HorizontalContentAlignment" Value="Center" />
-            <Setter Property="VerticalContentAlignment" Value="Center" />
-            <Setter Property="Padding" Value="10" />
-            <Style.Triggers>
-                <Trigger Property="IsSelected" Value="True">
-                    <Setter Property="Background" Value="LightBlue" />
-                    <Setter Property="Foreground" Value="Black" />
-                </Trigger>
-            </Style.Triggers>
-        </Style>
-
-    </UserControl.Resources>
-    <Grid>
-        <Grid.ColumnDefinitions>
-            <ColumnDefinition Width="*" />
-            <ColumnDefinition Width="Auto" />
-            <ColumnDefinition Width="2*" />
-        </Grid.ColumnDefinitions>
-        <Grid Grid.Column="0">
-            <Grid.RowDefinitions>
-                <RowDefinition Height="Auto" />
-                <RowDefinition Height="*" />
-            </Grid.RowDefinitions>
-            <Grid Grid.Row="0">
-                <!--  菜单项  -->
-                <Border
-                    Grid.Row="0"
-                    BorderBrush="Gray"
-                    BorderThickness="1">
-                    <Grid Background="White">
-                        <Grid.ColumnDefinitions>
-                            <ColumnDefinition Width="Auto" />
-                            <ColumnDefinition Width="*" />
-                        </Grid.ColumnDefinitions>
-                        <StackPanel
-                            Grid.Column="0"
-                            FlowDirection="LeftToRight"
-                            Orientation="Horizontal">
-
-                            <TextBlock Text="工作年度:" />
-                            <ComboBox
-                                Width="120"
-                                Height="23"
-                                IsEditable="True"
-                                ItemsSource="{Binding Years}"
-                                SelectedItem="{Binding SelectedYear, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
-
-                        </StackPanel>
-                        <ToolBarPanel Grid.Column="1">
-                            <ToolBar Background="White" ToolBarTray.IsLocked="True">
-
-                                <Button Command="{Binding LoadDataCommand}">
-                                    <Button.Template>
-                                        <ControlTemplate>
-                                            <Border
-                                                Width="45"
-                                                Background="{TemplateBinding Background}"
-                                                CornerRadius="5">
-                                                <StackPanel HorizontalAlignment="Center" Orientation="Vertical">
-                                                    <TextBlock
-                                                        HorizontalAlignment="Center"
-                                                        FontFamily="{StaticResource FluentSystemIconsRegular}"
-                                                        FontSize="20"
-                                                        Text="{x:Static utils:RegularFontUtil.Document_Search_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 Command="{Binding AddInspectionReportCommand}">
-                                    <Button.Template>
-                                        <ControlTemplate>
-                                            <Border
-                                                Width="40"
-                                                Background="{TemplateBinding Background}"
-                                                CornerRadius="5">
-                                                <StackPanel HorizontalAlignment="Center" Orientation="Vertical">
-                                                    <TextBlock
-                                                        HorizontalAlignment="Center"
-                                                        FontFamily="{StaticResource FluentSystemIconsRegular}"
-                                                        FontSize="20"
-                                                        Text="{x:Static utils:RegularFontUtil.Add_Circle_32}" />
-                                                    <TextBlock Text="新增" />
-                                                </StackPanel>
-                                            </Border>
-                                            <ControlTemplate.Triggers>
-                                                <Trigger Property="IsMouseOver" Value="True">
-                                                    <Setter Property="Background" Value="LightGray" />
-                                                </Trigger>
-                                            </ControlTemplate.Triggers>
-                                        </ControlTemplate>
-                                    </Button.Template>
-                                </Button>
-                                <Button
-                                    x:Name="SaveButton"
-                                    Click="SaveButton_OnClick"
-                                    Command="{Binding SaveInspectionReportCommand}">
-                                    <Button.Template>
-                                        <ControlTemplate>
-                                            <Border
-                                                Width="40"
-                                                Background="{TemplateBinding Background}"
-                                                CornerRadius="5">
-                                                <StackPanel HorizontalAlignment="Center" Orientation="Vertical">
-                                                    <TextBlock
-                                                        HorizontalAlignment="Center"
-                                                        FontFamily="{StaticResource FluentSystemIconsRegular}"
-                                                        FontSize="20"
-                                                        Text="{x:Static utils:RegularFontUtil.Save_32}" />
-                                                    <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 Command="{Binding ExportInspectionReportCommand}">
-                                    <Button.Template>
-                                        <ControlTemplate>
-                                            <Border
-                                                Width="60"
-                                                Background="{TemplateBinding Background}"
-                                                CornerRadius="5">
-                                                <StackPanel HorizontalAlignment="Center" Orientation="Vertical">
-                                                    <TextBlock
-                                                        HorizontalAlignment="Center"
-                                                        FontFamily="{StaticResource FluentSystemIconsRegular}"
-                                                        FontSize="20"
-                                                        Text="{x:Static utils:RegularFontUtil.Dock_20}" />
-                                                    <TextBlock Text="导出报告" />
-                                                </StackPanel>
-                                            </Border>
-                                            <ControlTemplate.Triggers>
-                                                <Trigger Property="IsMouseOver" Value="True">
-                                                    <Setter Property="Background" Value="LightGray" />
-                                                </Trigger>
-                                            </ControlTemplate.Triggers>
-                                        </ControlTemplate>
-                                    </Button.Template>
-                                </Button>
-
-                            </ToolBar>
-                        </ToolBarPanel>
-                    </Grid>
-                </Border>
-            </Grid>
-            <filterDataGrid:FilterDataGrid
-                x:Name="DataGridMain"
-                Grid.Row="1"
-                behaviors:DataGridBehavior.RowNumbers="True"
-                AutoGenerateColumns="False"
-                Background="White"
-                CanUserAddRows="False"
-                CanUserReorderColumns="True"
-                CanUserResizeColumns="True"
-                CanUserResizeRows="False"
-                CellStyle="{StaticResource CustomCellStyle}"
-                ColumnHeaderStyle="{StaticResource CustomColumnHeaderStyle}"
-                FilterLanguage="SimplifiedChinese"
-                HeadersVisibility="All"
-                HorizontalGridLinesBrush="LightSlateGray"
-                ItemsSource="{Binding InspectionReports, Mode=TwoWay}"
-                RowHeaderStyle="{StaticResource CustomRowHeaderStyle}"
-                RowStyle="{StaticResource CustomRowStyle}"
-                SelectedItem="{Binding SelectedInspectionReport, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
-                SelectionMode="Single"
-                ShowRowsCount="True"
-                ShowStatusBar="True"
-                VerticalGridLinesBrush="LightSlateGray">
-
-                <!--  选择行事件  -->
-                <!--<b:Interaction.Triggers>
-                    <b:EventTrigger EventName="SelectionChanged">
-                        <b:InvokeCommandAction Command="{Binding InspectionReportSelectionChangedCommand}" CommandParameter="{Binding ElementName=DataGridMain, Path=SelectedItem}" />
-                    </b:EventTrigger>
-                </b:Interaction.Triggers>-->
-
-                <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>
-                </control:FilterDataGrid.Resources>
-
-                <control:FilterDataGrid.Columns>
-                    <DataGridTextColumn
-                        Width="60"
-                        Binding="{Binding InspectApply.Year}"
-                        EditingElementStyle="{StaticResource TextColumnEditingElementStyle}"
-                        ElementStyle="{StaticResource TextColumnElementStyle}"
-                        Header="工作年度"
-                        IsReadOnly="True" />
-                    <control:FilterDataGridTextColumn
-                        Width="300"
-                        Binding="{Binding ReportNo}"
-                        EditingElementStyle="{StaticResource TextColumnEditingElementStyle}"
-                        ElementStyle="{StaticResource TextColumnElementStyle}"
-                        Header="检验报告编号"
-                        IsColumnFiltered="True"
-                        IsReadOnly="True" />
-                    <control:FilterDataGridTextColumn
-                        Width="120"
-                        Binding="{Binding ReportTime}"
-                        EditingElementStyle="{StaticResource TextColumnEditingElementStyle}"
-                        ElementStyle="{StaticResource TextColumnElementStyle}"
-                        Header="检验时间"
-                        IsColumnFiltered="True"
-                        IsReadOnly="True" />
-                    <control:FilterDataGridTextColumn
-                        Width="100"
-                        Binding="{Binding Conclusion}"
-                        EditingElementStyle="{StaticResource TextColumnEditingElementStyle}"
-                        ElementStyle="{StaticResource TextColumnElementStyle}"
-                        Header="检验结论"
-                        IsColumnFiltered="True"
-                        IsReadOnly="True" />
-                    <control:FilterDataGridTextColumn
-                        Width="100"
-                        Binding="{Binding EditUser}"
-                        EditingElementStyle="{StaticResource TextColumnEditingElementStyle}"
-                        ElementStyle="{StaticResource TextColumnElementStyle}"
-                        Header="承办人"
-                        IsColumnFiltered="True"
-                        IsReadOnly="True" />
-
-                </control:FilterDataGrid.Columns>
-            </filterDataGrid:FilterDataGrid>
-        </Grid>
-
-        <GridSplitter
-            Grid.Column="1"
-            Width="2"
-            HorizontalAlignment="Stretch" />
-        <Grid Grid.Column="2" Background="White">
-            <ScrollViewer>
-                <Grid Background="White">
-                    <Grid.RowDefinitions>
-                        <RowDefinition Height="50" />
-                        <RowDefinition Height="40" />
-                        <RowDefinition Height="40" />
-                        <RowDefinition Height="40" />
-                        <RowDefinition Height="40" />
-                        <RowDefinition Height="40" />
-                        <RowDefinition Height="60" />
-                        <RowDefinition Height="40" />
-                        <RowDefinition Height="150" />
-                        <RowDefinition Height="170" />
-                        <RowDefinition Height="200" />
-                        <RowDefinition Height="40" />
-                    </Grid.RowDefinitions>
-                    <Grid.ColumnDefinitions>
-                        <ColumnDefinition Width="2*" />
-                        <ColumnDefinition Width="3*" />
-                        <ColumnDefinition Width="3*" />
-                        <ColumnDefinition Width="3*" />
-                        <ColumnDefinition Width="*" />
-                    </Grid.ColumnDefinitions>
-
-                    <TextBlock
-                        Grid.Row="0"
-                        Grid.Column="0"
-                        Grid.ColumnSpan="5"
-                        HorizontalAlignment="Center"
-                        VerticalAlignment="Center"
-                        FontSize="25"
-                        Text="军需物资质量监督检验报告" />
-                    <TextBlock
-                        Grid.Row="1"
-                        Grid.Column="0"
-                        HorizontalAlignment="Right"
-                        Text="检验报告编号:"
-                        TextWrapping="Wrap" />
-                    <TextBlock
-                        Grid.Row="1"
-                        Grid.Column="1"
-                        Grid.ColumnSpan="3"
-                        Text="{Binding SelectedInspectionReport.ReportNo}" />
-                    <TextBlock
-                        Grid.Row="2"
-                        Grid.Column="0"
-                        HorizontalAlignment="Right"
-                        Text="*检验部门:" />
-                    <TextBox
-                        Grid.Row="2"
-                        Grid.Column="1"
-                        Text="{Binding SelectedInspectionReport.Department, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
-                    <TextBlock
-                        Grid.Row="2"
-                        Grid.Column="2"
-                        HorizontalAlignment="Right"
-                        Text="*检验时间:" />
-                    <DatePicker
-                        Grid.Row="2"
-                        Grid.Column="3"
-                        Text="{Binding SelectedInspectionReport.ReportTime, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
-                    <TextBlock
-                        Grid.Row="3"
-                        Grid.Column="0"
-                        HorizontalAlignment="Right"
-                        Text="检验类别:" />
-                    <StackPanel
-                        Grid.Row="3"
-                        Grid.Column="1"
-                        Grid.ColumnSpan="3"
-                        VerticalAlignment="Center">
-                        <Grid VerticalAlignment="Center" Background="White">
-                            <Grid.ColumnDefinitions>
-                                <ColumnDefinition Width="*" />
-                                <ColumnDefinition Width="*" />
-                                <ColumnDefinition Width="*" />
-                                <ColumnDefinition Width="*" />
-                            </Grid.ColumnDefinitions>
-                            <RadioButton
-                                x:Name="FirstRadioButton"
-                                Grid.Column="0"
-                                Content="报样检验"
-                                GroupName="InspectType"
-                                IsEnabled="False" />
-                            <RadioButton
-                                x:Name="SecondRadioButton"
-                                Grid.Column="1"
-                                Content="首批检验"
-                                GroupName="InspectType"
-                                IsEnabled="False" />
-                            <RadioButton
-                                x:Name="ThirdRadioButton"
-                                Grid.Column="2"
-                                Content="生产过程"
-                                GroupName="InspectType"
-                                IsEnabled="False" />
-                            <RadioButton
-                                x:Name="ForthRadioButton"
-                                Grid.Column="3"
-                                Content="出厂检验"
-                                GroupName="InspectType"
-                                IsEnabled="False" />
-                            <TextBox
-                                x:Name="InspectTypeText"
-                                Grid.Column="0"
-                                Text="{Binding SelectedInspectionReport.InspectApply.InspCategory, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
-                                TextChanged="InspectTypeText_TextChanged"
-                                Visibility="Collapsed" />
-                        </Grid>
-                    </StackPanel>
-                    <TextBlock
-                        Grid.Row="4"
-                        Grid.Column="0"
-                        HorizontalAlignment="Right"
-                        Text="产品名称:" />
-                    <TextBlock
-                        Grid.Row="4"
-                        Grid.Column="1"
-                        Text="{Binding SelectedInspectionReport.InspectApply.Material.Name}"
-                        TextWrapping="Wrap" />
-                    <TextBlock
-                        Grid.Row="4"
-                        Grid.Column="2"
-                        HorizontalAlignment="Right"
-                        Text="生产企业:" />
-                    <TextBlock
-                        Grid.Row="4"
-                        Grid.Column="3"
-                        Text="{Binding SelectedInspectionReport.InspectApply.Company}"
-                        TextWrapping="Wrap" />
-                    <TextBlock
-                        Grid.Row="5"
-                        Grid.Column="0"
-                        HorizontalAlignment="Right"
-                        Text="产品数量:"
-                        TextWrapping="Wrap" />
-                    <Grid
-                        Grid.Row="5"
-                        Grid.Column="1"
-                        Background="White">
-                        <Grid.ColumnDefinitions>
-                            <ColumnDefinition Width="Auto" />
-                            <ColumnDefinition Width="*" />
-                        </Grid.ColumnDefinitions>
-                        <TextBlock Grid.Column="0" Text="{Binding SelectedInspectionReport.InspectApply.InspQuantity}" />
-                        <TextBlock Grid.Column="1" Text="{Binding SelectedInspectionReport.InspectApply.Material.MeasureUnit}" />
-                    </Grid>
-                    <TextBlock
-                        Grid.Row="5"
-                        Grid.Column="2"
-                        HorizontalAlignment="Right"
-                        Text="生产日期:" />
-                    <Grid
-                        Grid.Row="5"
-                        Grid.Column="3"
-                        Background="White">
-                        <Grid.ColumnDefinitions>
-                            <ColumnDefinition Width="*" />
-                            <ColumnDefinition Width="Auto" />
-                            <ColumnDefinition Width="*" />
-                        </Grid.ColumnDefinitions>
-                        <TextBlock
-                            Grid.Column="0"
-                            Text="{Binding SelectedInspectionReport.InspectApply.StartProductDate, StringFormat=yyyy-MM-dd}"
-                            TextWrapping="Wrap" />
-                        <TextBlock Grid.Column="1" Text="至" />
-                        <TextBlock
-                            Grid.Column="2"
-                            Text="{Binding SelectedInspectionReport.InspectApply.EndProductDate, StringFormat=yyyy-MM-dd}"
-                            TextWrapping="Wrap" />
-                    </Grid>
-                    <TextBlock
-                        Grid.Row="6"
-                        Grid.Column="0"
-                        HorizontalAlignment="Right"
-                        Text="采购机构:" />
-                    <TextBox
-                        Grid.Row="6"
-                        Grid.Column="1"
-                        Height="60"
-                        IsReadOnly="True"
-                        Text="{Binding SelectedInspectionReport.PurchaseCompanyNames}"
-                        TextWrapping="Wrap"
-                        VerticalScrollBarVisibility="Auto" />
-                    <TextBlock
-                        Grid.Row="6"
-                        Grid.Column="2"
-                        HorizontalAlignment="Right"
-                        Text="合同编号:" />
-                    <TextBox
-                        Grid.Row="6"
-                        Grid.Column="3"
-                        Height="60"
-                        IsReadOnly="True"
-                        Text="{Binding SelectedInspectionReport.ContractNos}"
-                        TextWrapping="Wrap"
-                        VerticalScrollBarVisibility="Auto" />
-                    <TextBlock
-                        Grid.Row="7"
-                        Grid.Column="0"
-                        HorizontalAlignment="Right"
-                        Text="*检验依据:" />
-                    <TextBox
-                        Grid.Row="7"
-                        Grid.Column="1"
-                        Grid.ColumnSpan="3"
-                        HorizontalScrollBarVisibility="Auto"
-                        Text="{Binding SelectedInspectionReport.ReportBasis, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
-                        TextWrapping="Wrap" />
-                    <TextBlock
-                        Grid.Row="8"
-                        Grid.Column="0"
-                        HorizontalAlignment="Right"
-                        VerticalAlignment="Center"
-                        Text="*检验情况及主要问题:"
-                        TextWrapping="Wrap" />
-                    <Grid
-                        Grid.Row="8"
-                        Grid.Column="1"
-                        Grid.ColumnSpan="3"
-                        Background="White">
-                        <Grid.RowDefinitions>
-                            <RowDefinition Height="30" />
-                            <RowDefinition Height="*" />
-                        </Grid.RowDefinitions>
-                        <Grid.ColumnDefinitions>
-                            <ColumnDefinition Width="Auto" />
-                            <ColumnDefinition Width="Auto" />
-                            <ColumnDefinition Width="*" />
-                        </Grid.ColumnDefinitions>
-                        <RadioButton
-                            x:Name="IsSampleRadioButton"
-                            Grid.Row="0"
-                            Grid.Column="0"
-                            Padding="10,0,10,0"
-                            VerticalContentAlignment="Center"
-                            Content="抽样送检"
-                            Foreground="Red"
-                            GroupName="IsSampleGroup" />
-                        <RadioButton
-                            x:Name="NotSampleRadioButton"
-                            Grid.Row="0"
-                            Grid.Column="1"
-                            Padding="10,0,10,0"
-                            VerticalContentAlignment="Center"
-                            Content="未抽样送检"
-                            GroupName="IsSampleGroup" />
-                        <TextBox
-                            x:Name="IsSampleTextBox"
-                            Grid.Row="0"
-                            Grid.Column="2"
-                            Text="{Binding SelectedInspectionReport.IsSample, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
-                            TextChanged="IsSampleTextBox_TextChanged"
-                            Visibility="Collapsed" />
-                        <TextBox
-                            Grid.Row="1"
-                            Grid.Column="0"
-                            Grid.ColumnSpan="3"
-                            Height="120"
-                            HorizontalContentAlignment="Left"
-                            VerticalContentAlignment="Top"
-                            AcceptsReturn="True"
-                            Text="{Binding SelectedInspectionReport.ReportDesc, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
-                            TextWrapping="Wrap"
-                            VerticalScrollBarVisibility="Auto" />
-                    </Grid>
-                    <TextBlock
-                        Grid.Row="9"
-                        Grid.Column="0"
-                        HorizontalAlignment="Right"
-                        Text="*检验结论:" />
-                    <Grid
-                        Grid.Row="9"
-                        Grid.Column="1"
-                        Grid.ColumnSpan="3"
-                        Background="White">
-                        <Grid.RowDefinitions>
-                            <RowDefinition Height="30" />
-                            <RowDefinition Height="*" />
-                        </Grid.RowDefinitions>
-                        <Grid.ColumnDefinitions>
-                            <ColumnDefinition Width="Auto" />
-                            <ColumnDefinition Width="Auto" />
-                            <ColumnDefinition Width="*" />
-                        </Grid.ColumnDefinitions>
-                        <RadioButton
-                            x:Name="FirstQualifiedRadioButton"
-                            Grid.Row="0"
-                            Grid.Column="0"
-                            Padding="10,0,10,0"
-                            VerticalContentAlignment="Center"
-                            Checked="ConclusionGroupRadioButton_Checked"
-                            Content="合格"
-                            Foreground="Green"
-                            GroupName="ConclusionGroup"
-                            IsChecked="True" />
-                        <RadioButton
-                            x:Name="SecondQualifiedRadioButton"
-                            Grid.Row="0"
-                            Grid.Column="1"
-                            Padding="10,0,10,0"
-                            VerticalContentAlignment="Center"
-                            Checked="ConclusionGroupRadioButton_Checked"
-                            Content="合格(初测不合格,复测合格)"
-                            Foreground="DarkOrange"
-                            GroupName="ConclusionGroup" />
-                        <RadioButton
-                            x:Name="UnQualifiedRadioButton"
-                            Grid.Row="0"
-                            Grid.Column="2"
-                            Padding="10,0,10,0"
-                            VerticalContentAlignment="Center"
-                            Checked="ConclusionGroupRadioButton_Checked"
-                            Content="不合格"
-                            Foreground="Red"
-                            GroupName="ConclusionGroup" />
-                        <TextBox
-                            x:Name="ConclusionTextBox"
-                            Grid.Row="0"
-                            Grid.Column="2"
-                            Text="{Binding SelectedInspectionReport.Conclusion, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
-                            TextChanged="ConclusionTextBox_TextChanged"
-                            Visibility="Collapsed" />
-                        <TextBox
-                            Grid.Row="1"
-                            Grid.Column="0"
-                            Grid.ColumnSpan="3"
-                            Height="120"
-                            HorizontalContentAlignment="Left"
-                            VerticalContentAlignment="Top"
-                            AcceptsReturn="True"
-                            Text="{Binding SelectedInspectionReport.ConclusionDesc, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
-                            TextWrapping="Wrap"
-                            VerticalScrollBarVisibility="Auto" />
-                    </Grid>
-                    <TextBlock
-                        Grid.Row="10"
-                        Grid.Column="0"
-                        HorizontalAlignment="Right"
-                        VerticalAlignment="Center"
-                        Text="*验收组:" />
-                    <Grid
-                        Grid.Row="10"
-                        Grid.Column="1"
-                        Grid.ColumnSpan="3"
-                        Background="White">
-                        <Grid.RowDefinitions>
-                            <RowDefinition Height="Auto" />
-                            <RowDefinition Height="*" />
-                        </Grid.RowDefinitions>
-                        <!--  子菜单项  -->
-                        <Border
-                            Grid.Row="0"
-                            BorderBrush="Gray"
-                            BorderThickness="1">
-                            <ToolBarPanel>
-                                <ToolBar Background="White" ToolBarTray.IsLocked="True">
-                                    <Button HorizontalContentAlignment="Center" Command="{Binding AddInspectionReportDetailCommand}">
-                                        <Button.Template>
-                                            <ControlTemplate>
-                                                <Border
-                                                    Width="40"
-                                                    Background="{TemplateBinding Background}"
-                                                    CornerRadius="5">
-                                                    <StackPanel HorizontalAlignment="Center" Orientation="Vertical">
-                                                        <TextBlock
-                                                            HorizontalAlignment="Center"
-                                                            FontFamily="{StaticResource FluentSystemIconsRegular}"
-                                                            FontSize="20"
-                                                            Text="{x:Static utils:RegularFontUtil.Add_Square_20}" />
-                                                        <TextBlock Text="新增" />
-                                                    </StackPanel>
-                                                </Border>
-                                                <ControlTemplate.Triggers>
-                                                    <Trigger Property="IsMouseOver" Value="True">
-                                                        <Setter Property="Background" Value="LightGray" />
-                                                    </Trigger>
-                                                </ControlTemplate.Triggers>
-                                            </ControlTemplate>
-                                        </Button.Template>
-                                    </Button>
-                                    <Button Command="{Binding RemoveInspectionReportDetailCommand}">
-                                        <Button.Template>
-                                            <ControlTemplate>
-                                                <Border
-                                                    Width="40"
-                                                    Background="{TemplateBinding Background}"
-                                                    CornerRadius="5">
-                                                    <StackPanel HorizontalAlignment="Center" Orientation="Vertical">
-                                                        <TextBlock
-                                                            HorizontalAlignment="Center"
-                                                            FontFamily="{StaticResource FluentSystemIconsRegular}"
-                                                            FontSize="20"
-                                                            Text="{x:Static utils:RegularFontUtil.Dismiss_Square_20}" />
-                                                        <TextBlock Text="删除" />
-                                                    </StackPanel>
-                                                </Border>
-                                                <ControlTemplate.Triggers>
-                                                    <Trigger Property="IsMouseOver" Value="True">
-                                                        <Setter Property="Background" Value="LightGray" />
-                                                    </Trigger>
-                                                </ControlTemplate.Triggers>
-                                            </ControlTemplate>
-                                        </Button.Template>
-                                    </Button>
-                                </ToolBar>
-                            </ToolBarPanel>
-                        </Border>
-                        <DataGrid
-                            x:Name="DataGridDetail"
-                            Grid.Row="1"
-                            behaviors:DataGridBehavior.RowNumbers="True"
-                            AutoGenerateColumns="False"
-                            Background="White"
-                            CanUserAddRows="False"
-                            CanUserReorderColumns="True"
-                            CellStyle="{StaticResource CustomCellStyle}"
-                            ColumnHeaderStyle="{StaticResource CustomColumnHeaderStyle}"
-                            HeadersVisibility="All"
-                            HorizontalGridLinesBrush="LightSlateGray"
-                            ItemsSource="{Binding SelectedInspectionReport.InspectionReportDetails, Mode=TwoWay}"
-                            RowHeaderStyle="{StaticResource CustomRowHeaderStyle}"
-                            RowStyle="{StaticResource CustomRowStyle}"
-                            SelectionMode="Single"
-                            VerticalGridLinesBrush="LightSlateGray">
-                            <!--  选择行事件  -->
-                            <b:Interaction.Triggers>
-                                <b:EventTrigger EventName="SelectionChanged">
-                                    <b:InvokeCommandAction Command="{Binding SelectedInspectionReportDetailChangedCommand}" CommandParameter="{Binding ElementName=DataGridDetail, Path=SelectedItem}" />
-                                </b:EventTrigger>
-                            </b:Interaction.Triggers>
-
-                            <DataGrid.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>
-                            </DataGrid.Resources>
-                            <DataGrid.Columns>
-                                <DataGridTemplateColumn Width="100" Header="检验组">
-                                    <DataGridTemplateColumn.CellTemplate>
-                                        <DataTemplate>
-                                            <TextBlock
-                                                HorizontalAlignment="Center"
-                                                VerticalAlignment="Center"
-                                                Text="{Binding JobCategory}" />
-                                        </DataTemplate>
-                                    </DataGridTemplateColumn.CellTemplate>
-                                    <DataGridTemplateColumn.CellEditingTemplate>
-                                        <DataTemplate>
-                                            <ComboBox
-                                                Height="25"
-                                                Background="White"
-                                                ItemsSource="{Binding DataContext.JobCategories, RelativeSource={RelativeSource AncestorType=UserControl}}"
-                                                SelectedItem="{Binding JobCategory, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
-                                        </DataTemplate>
-                                    </DataGridTemplateColumn.CellEditingTemplate>
-                                </DataGridTemplateColumn>
-
-                                <!--<DataGridTextColumn
-                                    Width="100"
-                                    Binding="{Binding JobCategory, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
-                                    EditingElementStyle="{StaticResource TextColumnEditingElementStyle}"
-                                    ElementStyle="{StaticResource TextColumnElementStyle}"
-                                    Header="检验组" />-->
-
-                                <DataGridTextColumn
-                                    Width="300"
-                                    Binding="{Binding SupervisionUnit, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
-                                    EditingElementStyle="{StaticResource TextColumnEditingElementStyle}"
-                                    ElementStyle="{StaticResource TextColumnElementStyle}"
-                                    Header="单位" />
-
-                                <!--<DataGridTextColumn
-                                    Width="100"
-                                    Binding="{Binding Inspector, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
-                                    EditingElementStyle="{StaticResource TextColumnEditingElementStyle}"
-                                    ElementStyle="{StaticResource TextColumnElementStyle}"
-                                    Header="姓名" />-->
-                                <DataGridTemplateColumn Width="100" Header="姓名">
-                                    <DataGridTemplateColumn.CellTemplate>
-                                        <DataTemplate>
-                                            <TextBlock
-                                                HorizontalAlignment="Center"
-                                                VerticalAlignment="Center"
-                                                Text="{Binding Inspector}" />
-                                        </DataTemplate>
-                                    </DataGridTemplateColumn.CellTemplate>
-                                    <DataGridTemplateColumn.CellEditingTemplate>
-                                        <DataTemplate>
-                                            <ComboBox
-                                                x:Name="Name"
-                                                Height="25"
-                                                Background="White"
-                                                IsEditable="True"
-                                                ItemsSource="{Binding DataContext.UserNames, RelativeSource={RelativeSource AncestorType=UserControl}}"
-                                                LostFocus="Name_OnLostFocus"
-                                                SelectedItem="{Binding Inspector, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
-                                        </DataTemplate>
-                                    </DataGridTemplateColumn.CellEditingTemplate>
-                                </DataGridTemplateColumn>
-                            </DataGrid.Columns>
-                        </DataGrid>
-                    </Grid>
-                    <TextBlock
-                        Grid.Row="11"
-                        Grid.Column="0"
-                        HorizontalAlignment="Right"
-                        Text="承办人:" />
-
-                    <!--<ComboBox
-                        x:Name="EditUserComboBox"
-                        Grid.Row="11"
-                        Grid.Column="1"
-                        Height="25"
-                        IsEditable="True"
-                        ItemsSource="{Binding DataContext.UserNames, RelativeSource={RelativeSource AncestorType=UserControl}}"
-                        LostFocus="Name_OnLostFocus"
-                        SelectedItem="{Binding SelectedInspectionReport.EditUser, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />-->
-                    <TextBox
-                        Grid.Row="11"
-                        Grid.Column="1"
-                        Text="{Binding SelectedInspectionReport.EditUser, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
-                </Grid>
-            </ScrollViewer>
-        </Grid>
+    <Grid Background="White">
+        <TabControl>
+            <TabItem Header="检验报告录入">
+                <inspectionReport:InspectionReportInputPage />
+            </TabItem>
+            <TabItem Header="检验报告管理">
+                <inspectionReport:InspectionReportManagePage />
+            </TabItem>
+        </TabControl>
     </Grid>
 </UserControl>

+ 1 - 80
UniformMaterialManagementSystem/Views/InspectionReportPage.xaml.cs

@@ -6,7 +6,7 @@ using UniformMaterialManagementSystem.ViewModels;
 namespace UniformMaterialManagementSystem.Views
 {
     /// <summary>
-    /// InspectionReportPage.xaml 的交互逻辑
+    /// InspectionReportManagePage.xaml 的交互逻辑
     /// </summary>
     public partial class InspectionReportPage : UserControl
     {
@@ -14,86 +14,7 @@ namespace UniformMaterialManagementSystem.Views
         {
             InitializeComponent();
 
-            this.DataContext = App.Current.Services.GetService<InspectionReportPageViewModel>();
-
-        }
-
-        private void InspectTypeText_TextChanged(object sender, TextChangedEventArgs e)
-        {
-            var inspectType = InspectTypeText.Text;
-            switch (inspectType)
-            {
-                case "报样检验":
-                    FirstRadioButton.IsChecked = true;
-                    break;
-                case "首批检验":
-                    SecondRadioButton.IsChecked = true;
-                    break;
-                case "过程检验":
-                    ThirdRadioButton.IsChecked = true;
-                    break;
-                case "出厂检验":
-                    ForthRadioButton.IsChecked = true;
-                    break;
-            }
-        }
-
-        private void IsSampleTextBox_TextChanged(object sender, TextChangedEventArgs e)
-        {
-            var isSample = IsSampleTextBox.Text;
-            if (!string.IsNullOrEmpty(isSample) && bool.Parse(isSample))
-            {
-                IsSampleRadioButton.IsChecked = true;
-            }
-            else
-            {
-                NotSampleRadioButton.IsChecked = true;
-            }
-        }
-
-        private void ConclusionTextBox_TextChanged(object sender, TextChangedEventArgs e)
-        {
-            var conclusion = ConclusionTextBox.Text;
-            switch (conclusion)
-            {
-                case "合格":
-                    FirstQualifiedRadioButton.IsChecked = true;
-                    break;
-                case "合格(初测不合格,复测合格)":
-                    SecondQualifiedRadioButton.IsChecked = true;
-                    break;
-                case "不合格":
-                    UnQualifiedRadioButton.IsChecked = true;
-                    break;
-            }
         }
 
-        private void ConclusionGroupRadioButton_Checked(object sender, System.Windows.RoutedEventArgs e)
-        {
-            var radioButton = (RadioButton)sender;
-            if (radioButton.GroupName == "ConclusionGroup")
-            {
-                if (radioButton.Content != null && ConclusionTextBox != null)
-                {
-                    ConclusionTextBox.Text = radioButton.Content.ToString();
-                }
-            }
-        }
-
-        private void Name_OnLostFocus(object sender, RoutedEventArgs e)
-        {
-            if (sender is not ComboBox comboBox) return;
-            var text = comboBox.Text;
-
-            if (string.IsNullOrWhiteSpace(text) || comboBox.Items.Contains(text) || comboBox.ItemsSource is not List<string> names) return;
-
-            names.Add(text);
-            comboBox.SelectedItem = text;
-        }
-
-        private void SaveButton_OnClick(object sender, RoutedEventArgs e)
-        {
-            DataGridDetail.CommitEdit();
-        }
     }
 }