Browse Source

抽样登记增加数量校验;检验报告、抽样登记、许可证中批准人、审核人等由文本框更换为下拉列表

LT069288 3 tháng trước cách đây
mục cha
commit
c53726f5df

+ 28 - 8
UniformMaterialManagementSystem/ViewModels/FactoryLicenseInputPageViewModel.cs

@@ -1,16 +1,15 @@
-using System.Collections.ObjectModel;
+using CommunityToolkit.Mvvm.ComponentModel;
+using CommunityToolkit.Mvvm.Input;
+using Microsoft.EntityFrameworkCore;
+using System.Collections.ObjectModel;
 using System.ComponentModel.DataAnnotations;
-using System.Printing;
 using System.Text;
 using System.Windows;
-using CommunityToolkit.Mvvm.ComponentModel;
-using CommunityToolkit.Mvvm.Input;
-using Microsoft.EntityFrameworkCore;
-using UniformMaterialManagementSystem.Custom;
 using UniformMaterialManagementSystem.Entities;
 using UniformMaterialManagementSystem.Models;
 using UniformMaterialManagementSystem.Services;
 using UniformMaterialManagementSystem.Utils;
+using ValidationResult = System.ComponentModel.DataAnnotations.ValidationResult;
 
 namespace UniformMaterialManagementSystem.ViewModels
 {
@@ -54,11 +53,15 @@ namespace UniformMaterialManagementSystem.ViewModels
 
         [ObservableProperty]
         [Required(ErrorMessage = "审核人不能为空")]
+        [CustomValidation(typeof(FactoryLicenseInputPageViewModel), nameof(ValidateAuditUser))]
         private string _auditUser = string.Empty;
 
         [ObservableProperty]
         private InspectApply? _inspectApply;
 
+        [ObservableProperty]
+        private List<string> _userNames = [];
+
         [ObservableProperty]
         private ObservableCollection<InspectApply> _inspectApplies = [];
 
@@ -69,13 +72,20 @@ namespace UniformMaterialManagementSystem.ViewModels
 
         private FactoryLicense? _factoryLicense;
 
-        public FactoryLicenseInputPageViewModel(IDataBaseService<InspectApply> inspectApplyService, IDataBaseService<InspectionReport> inspectionReportService, IDataBaseService<SampleRegistration> sampleRegistrationService, IDataBaseService<FactoryLicense> factoryLicenseService)
+        public FactoryLicenseInputPageViewModel(IDataBaseService<InspectApply> inspectApplyService, IDataBaseService<InspectionReport> inspectionReportService, IDataBaseService<SampleRegistration> sampleRegistrationService, IDataBaseService<FactoryLicense> factoryLicenseService, IDataBaseService<User> userService)
         {
             _inspectApplyService = inspectApplyService;
             _inspectionReportService = inspectionReportService;
             _sampleRegistrationService = sampleRegistrationService;
             _factoryLicenseService = factoryLicenseService;
 
+            //初始化用户
+            var users = userService.QueryNoTracking(x => x.IsEnabled && x.SupervisionUnitGuid == App.CurrentUser!.SupervisionUnitGuid).ToList();
+            foreach (var user in users)
+            {
+                UserNames.Add(user.UserName);
+            }
+
             LoadData();
         }
 
@@ -103,7 +113,7 @@ namespace UniformMaterialManagementSystem.ViewModels
             //校验是否选择检验申请单
             if (InspectApply == null)
             {
-                MessageBox.Show("请双击检验申请表行数据进行新增,再执行保存!","提示",MessageBoxButton.OK,MessageBoxImage.Warning);
+                MessageBox.Show("请双击检验申请表行数据进行新增,再执行保存!", "提示", MessageBoxButton.OK, MessageBoxImage.Warning);
                 return;
             }
 
@@ -250,5 +260,15 @@ namespace UniformMaterialManagementSystem.ViewModels
             EditUser = App.CurrentUser.UserName;
 
         }
+
+        public static ValidationResult? ValidateAuditUser(string auditUser, ValidationContext context)
+        {
+            var instance = (FactoryLicenseInputPageViewModel)context.ObjectInstance;
+            if (!string.IsNullOrEmpty(instance.EditUser) && !string.IsNullOrEmpty(auditUser) && instance.EditUser == auditUser)
+            {
+                return new ValidationResult("审核人不能为承办人");
+            }
+            return ValidationResult.Success;
+        }
     }
 }

+ 61 - 12
UniformMaterialManagementSystem/ViewModels/InspectionReportInputPageViewModel.cs

@@ -5,7 +5,6 @@ using System.Collections.ObjectModel;
 using System.ComponentModel.DataAnnotations;
 using System.Text;
 using System.Windows;
-using UniformMaterialManagementSystem.Custom;
 using UniformMaterialManagementSystem.Entities;
 using UniformMaterialManagementSystem.Models;
 using UniformMaterialManagementSystem.Services;
@@ -79,6 +78,13 @@ namespace UniformMaterialManagementSystem.ViewModels
 
         private InspectionReport? _inspectionReport;
 
+        public const string ReportDescOne = "共抽检()包,平均幅宽()厘米,与标样对比色差()级,抽检产品外观质量、实物质量及包装符合标准要求。\r\n备注:随机数(),随机抽取()米(生产日期(),批号(),包号())送()进行理化性能检测,另同包抽取2份备用。";
+        public const string ReportDescTwo = "共抽检()包,平均幅宽()厘米,与标样对比色差()级,抽检产品外观质量、实物质量及包装符合标准要求。\r\n备注:理化检测同(XXXX年XX月XX日)送检……";
+        public const string ConclusionDescOne = "不合格检验情况说明……\r\n综合检验情况,该批抽样产品出厂检验不合格。按要求下达处理意见告知书,要求整改。整改完成后申请二次检验。";
+        public const string ConclusionDescTwo = "经我单位对该批产品抽样检验,抽检产品外观实物质量符合规范要求,待理化检测合格具备出厂条件后,准予出厂。产品出厂后,材料企业依法承担产品生产质量责任。";
+        public const string ConclusionDescThree = "经我单位对该批出厂产品抽样检验,确认具备出厂条件,准予出厂。产品出厂后,材料企业依法承担产品生产质量责任。";
+        public const string ConclusionDescFour = "未抽样,不合格的检验结论描述……";
+
         public InspectionReportInputPageViewModel(IDataBaseService<InspectApply> inspectApplyService, IDataBaseService<User> userService, IDataBaseService<InspectionReport> inspectionReportService)
         {
             _inspectApplyService = inspectApplyService;
@@ -90,7 +96,7 @@ namespace UniformMaterialManagementSystem.ViewModels
 
             //姓名
             var users = userService.QueryNoTracking(
-                x => x.IsEnabled && x.SupervisionUnitGuid == App.CurrentUser.SupervisionUnitGuid).ToList();
+                x => x.IsEnabled && x.SupervisionUnitGuid == App.CurrentUser!.SupervisionUnitGuid).ToList();
             foreach (var user in users)
             {
                 UserNames.Add(user.UserName);
@@ -99,6 +105,24 @@ namespace UniformMaterialManagementSystem.ViewModels
             LoadData();
         }
 
+        /// <summary>
+        /// 是否抽样发生改变时触发
+        /// </summary>
+        partial void OnIsSampleChanged(bool value)
+        {
+            SetReportDesc(value);
+            SetConclusionDesc(value, Conclusion);
+        }
+
+        /// <summary>
+        /// 检验结论发生改变时触发
+        /// </summary>
+        partial void OnConclusionChanged(string value)
+        {
+            SetReportDesc(IsSample);
+            SetConclusionDesc(IsSample, value);
+        }
+
         /// <summary>
         /// 刷新
         /// </summary>
@@ -108,7 +132,7 @@ namespace UniformMaterialManagementSystem.ViewModels
             var inspectApplyList = _inspectApplyService.QueryNoTracking()
                 .Include(x => x.Material)
                 .Include(x => x.InspectApplyContractDetails)
-                .Where(x => x.Year == App.CurrentUser.WorkYear && !x.ReportStatus).ToList();
+                .Where(x => x.Year == App.CurrentUser!.WorkYear && !x.ReportStatus).ToList();
 
             InspectApplies.Clear();
             foreach (var inspectApply in inspectApplyList)
@@ -179,7 +203,7 @@ namespace UniformMaterialManagementSystem.ViewModels
 
         private void GenerateDocument()
         {
-            if (_inspectionReport == null) return;
+            if (_inspectionReport == null || SelectedInspectApply == null) return;
 
             _inspectionReport.InspectApply = SelectedInspectApply;
 
@@ -208,6 +232,7 @@ namespace UniformMaterialManagementSystem.ViewModels
 
         private void AddInspectionReportAndDetail()
         {
+            if (SelectedInspectApply == null) return;
             _inspectionReport = new()
             {
                 InspectApplyGuid = SelectedInspectApply.Guid,
@@ -242,7 +267,7 @@ namespace UniformMaterialManagementSystem.ViewModels
 
             //校验验收组
             var details = InspectionReportDetails;
-            if (details == null || details.Count == 0)
+            if (details.Count == 0)
             {
                 errorMessage.Append("验收组不允许为空!\n");
             }
@@ -288,7 +313,7 @@ namespace UniformMaterialManagementSystem.ViewModels
             }
 
             var isRepeat = InspectionReportDetails.GroupBy(x => x.Inspector).Any(g => g.Count() > 1);
-            if (isRepeat != null && (bool)isRepeat)
+            if (isRepeat)
             {
                 errorMessage.Append("验收组姓名有重复,请检查!\n");
             }
@@ -297,9 +322,9 @@ namespace UniformMaterialManagementSystem.ViewModels
             return result;
         }
 
-        /// <summary>
-        /// 选择检验申请单行改变事件
-        /// </summary>
+        ///// <summary>
+        ///// 选择检验申请单行改变事件
+        ///// </summary>
         //[RelayCommand]
         //private void InspectApplySelectionChanged(InspectApply inspectApply)
         //{
@@ -323,8 +348,8 @@ namespace UniformMaterialManagementSystem.ViewModels
             ReportBasis = "依据" + inspectApply.Material.NormName;
             IsSample = true;
             Conclusion = "合格";
-            ReportDesc = "检验情况及主要问题";
-            ConclusionDesc = "请录入检验结论";
+            ReportDesc = ReportDescOne;
+            ConclusionDesc = ConclusionDescTwo;
             EditUser = App.CurrentUser.UserName;
         }
 
@@ -336,7 +361,7 @@ namespace UniformMaterialManagementSystem.ViewModels
         {
             InspectionReportDetail detail = new InspectionReportDetail()
             {
-                SupervisionUnit = App.CurrentUser.SupervisionUnit.Name,
+                SupervisionUnit = App.CurrentUser!.SupervisionUnit.Name,
             };
 
             InspectionReportDetails.Add(detail);
@@ -383,5 +408,29 @@ namespace UniformMaterialManagementSystem.ViewModels
             return sb.ToString();
         }
 
+        private void SetReportDesc(bool isSample)
+        {
+            ReportDesc = isSample ? ReportDescOne : ReportDescTwo;
+        }
+
+        private void SetConclusionDesc(bool isSample, string conclusion)
+        {
+            if (isSample && (conclusion == "合格" || conclusion == "合格(初测不合格,复测合格)"))
+            {
+                ConclusionDesc = ConclusionDescTwo;
+            }
+            else if (isSample && conclusion == "不合格")
+            {
+                ConclusionDesc = ConclusionDescOne;
+            }
+            else if (!isSample && (conclusion == "合格" || conclusion == "合格(初测不合格,复测合格)"))
+            {
+                ConclusionDesc = ConclusionDescThree;
+            }
+            else if (!isSample && conclusion == "不合格")
+            {
+                ConclusionDesc = ConclusionDescFour;
+            }
+        }
     }
 }

+ 34 - 6
UniformMaterialManagementSystem/ViewModels/SampleRegistrationInputPageViewModel.cs

@@ -39,7 +39,8 @@ namespace UniformMaterialManagementSystem.ViewModels
 
         [ObservableProperty]
         [Required(ErrorMessage = "数量不能为空")]
-        [Range(0.1,double.MaxValue,ErrorMessage = "数量必须大于0")]
+        [CustomValidation(typeof(SampleRegistrationInputPageViewModel), nameof(ValidateQuantity))]
+        [Range(0.1, double.MaxValue, ErrorMessage = "数量必须大于0")]
         private decimal _quantity;
 
         [ObservableProperty]
@@ -71,6 +72,9 @@ namespace UniformMaterialManagementSystem.ViewModels
         [ObservableProperty]
         private InspectApply? _inspectApply;
 
+        [ObservableProperty]
+        private List<string> _userNames = [];
+
         [ObservableProperty]
         private ObservableCollection<InspectApply> _inspectApplies = [];
 
@@ -81,13 +85,21 @@ namespace UniformMaterialManagementSystem.ViewModels
         private readonly IDataBaseService<InspectionOrganization> _organizationService;
         private readonly IDataBaseService<SampleRegistration> _sampleRegistrationService;
 
-        public SampleRegistrationInputPageViewModel(IDataBaseService<InspectApply> inspectApplyService, IDataBaseService<InspectionOrganization> organizationService, IDataBaseService<InspectApplyDetail> inspectApplyDetailService,IDataBaseService<SampleRegistration> sampleRegistrationService)
+        public SampleRegistrationInputPageViewModel(IDataBaseService<InspectApply> inspectApplyService, IDataBaseService<InspectionOrganization> organizationService, IDataBaseService<InspectApplyDetail> inspectApplyDetailService, IDataBaseService<SampleRegistration> sampleRegistrationService,IDataBaseService<User> userService)
         {
             _inspectApplyService = inspectApplyService;
             _inspectApplyDetailService = inspectApplyDetailService;
             _organizationService = organizationService;
             _sampleRegistrationService = sampleRegistrationService;
 
+            //初始化人员
+            var users = userService.QueryNoTracking(x =>
+                x.IsEnabled && x.SupervisionUnitGuid == App.CurrentUser!.SupervisionUnitGuid).ToList();
+            foreach (var user in users)
+            {
+                UserNames.Add(user.UserName);
+            }
+
             //加载数据
             LoadData();
         }
@@ -213,7 +225,7 @@ namespace UniformMaterialManagementSystem.ViewModels
             SampleNo = string.Empty;
             Department = string.Empty;
             EditTime = DateTime.Now;
-            ProductDate = DateTime.Now; ;
+            ProductDate = DateTime.Now;
             BatchNo = string.Empty;
             PacketNo = string.Empty;
             Quantity = 0;
@@ -223,6 +235,7 @@ namespace UniformMaterialManagementSystem.ViewModels
             ProductUsers = string.Empty;
             EditUser = string.Empty;
             Telephone = string.Empty;
+            RandomTip = string.Empty;
         }
 
         private void AddSampleRegistration()
@@ -252,13 +265,28 @@ namespace UniformMaterialManagementSystem.ViewModels
         public static ValidationResult? ValidatePacketNo(string packetNo, ValidationContext context)
         {
             var instance = (SampleRegistrationInputPageViewModel)context.ObjectInstance;
-            if (instance.InspectApply == null) return ValidationResult.Success;
-            
+            if (instance.InspectApply == null) return new ValidationResult("检验申请为空");
+
             var detail = instance._inspectApplyDetailService.QueryNoTracking(x => x.ApplyGuid == instance.InspectApply.Guid).FirstOrDefault(x => x.PacketNo == packetNo);
 
             return detail == null ? new ValidationResult("包号不存在") : ValidationResult.Success;
         }
 
+        public static ValidationResult? ValidateQuantity(decimal quantity, ValidationContext context)
+        {
+            var instance = (SampleRegistrationInputPageViewModel)context.ObjectInstance;
+            if (instance.InspectApply == null) return new ValidationResult("检验申请为空");
+
+            var detail = instance._inspectApplyDetailService.QueryNoTracking(x => x.ApplyGuid == instance.InspectApply.Guid).FirstOrDefault(x => x.PacketNo == instance.PacketNo);
+
+            if (detail != null && quantity * 3 > detail.Quantity)
+            {
+                return new ValidationResult("抽样总数量不允许超出包号数量");
+            }
+
+            return ValidationResult.Success;
+        }
+
         public static ValidationResult? ValidateSingleIndexItem(string singleIndexItem, ValidationContext context)
         {
             var instance = (SampleRegistrationInputPageViewModel)context.ObjectInstance;
@@ -269,7 +297,7 @@ namespace UniformMaterialManagementSystem.ViewModels
                 return new ValidationResult("单项指标内容不能为空");
             }
 
-            return  ValidationResult.Success;
+            return ValidationResult.Success;
         }
 
     }

+ 24 - 15
UniformMaterialManagementSystem/Views/FactoryLicense/FactoryLicenseInputPage.xaml

@@ -262,12 +262,6 @@
                         <Setter Property="VerticalAlignment" Value="Stretch" />
                         <Setter Property="VerticalContentAlignment" Value="Center" />
                     </Style>
-
-                    <Style x:Key="CheckBoxColumnElementStyle" TargetType="CheckBox">
-                        <Setter Property="HorizontalAlignment" Value="Center" />
-                        <Setter Property="VerticalAlignment" Value="Center" />
-                        <Setter Property="IsEnabled" Value="False" />
-                    </Style>
                 </control:FilterDataGrid.Resources>
 
                 <control:FilterDataGrid.Columns>
@@ -346,7 +340,7 @@
             HorizontalAlignment="Stretch" />
         <Grid Grid.Column="2" Background="White">
             <ScrollViewer>
-                <Grid Grid.Background="White">
+                <Grid Background="White">
                     <Grid.RowDefinitions>
                         <RowDefinition Height="50" />
                         <RowDefinition Height="40" />
@@ -545,7 +539,7 @@
                         Grid.Row="8"
                         Grid.Column="1"
                         VerticalAlignment="Center"
-                        Text="{Binding Department}" />
+                        Text="{Binding Department, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
                     <TextBlock
                         Grid.Row="8"
                         Grid.Column="2"
@@ -557,7 +551,7 @@
                         Grid.Row="8"
                         Grid.Column="3"
                         VerticalAlignment="Center"
-                        Text="{Binding SignDate}" />
+                        Text="{Binding SignDate, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
                     <TextBlock
                         Grid.Row="9"
                         Grid.Column="0"
@@ -565,11 +559,16 @@
                         VerticalAlignment="Center"
                         Text="*承办人:"
                         TextWrapping="Wrap" />
-                    <TextBox
+                    <ComboBox
                         Grid.Row="9"
                         Grid.Column="1"
+                        Height="25"
                         VerticalAlignment="Center"
-                        Text="{Binding EditUser}" />
+                        VerticalContentAlignment="Center"
+                        FontSize="13"
+                        IsEditable="True"
+                        ItemsSource="{Binding UserNames}"
+                        Text="{Binding EditUser, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
                     <TextBlock
                         Grid.Row="9"
                         Grid.Column="2"
@@ -577,11 +576,16 @@
                         VerticalAlignment="Center"
                         Text="*批准人:"
                         TextWrapping="Wrap" />
-                    <TextBox
+                    <ComboBox
                         Grid.Row="9"
                         Grid.Column="3"
+                        Height="25"
                         VerticalAlignment="Center"
-                        Text="{Binding ApproveUser}" />
+                        VerticalContentAlignment="Center"
+                        FontSize="13"
+                        IsEditable="True"
+                        ItemsSource="{Binding UserNames}"
+                        Text="{Binding ApproveUser, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
                     <TextBlock
                         Grid.Row="10"
                         Grid.Column="0"
@@ -589,11 +593,16 @@
                         VerticalAlignment="Center"
                         Text="*审核人:"
                         TextWrapping="Wrap" />
-                    <TextBox
+                    <ComboBox
                         Grid.Row="10"
                         Grid.Column="1"
+                        Height="25"
                         VerticalAlignment="Center"
-                        Text="{Binding AuditUser}" />
+                        VerticalContentAlignment="Center"
+                        FontSize="13"
+                        IsEditable="True"
+                        ItemsSource="{Binding UserNames}"
+                        Text="{Binding AuditUser, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
                 </Grid>
             </ScrollViewer>
         </Grid>

+ 7 - 10
UniformMaterialManagementSystem/Views/InspectionReport/InspectionReportInputPage.xaml

@@ -838,18 +838,15 @@
                         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
+                    <ComboBox
+                        x:Name="EditUserComboBox"
                         Grid.Row="11"
                         Grid.Column="1"
+                        Height="25"
+                        VerticalContentAlignment="Center"
+                        FontSize="13"
+                        IsEditable="True"
+                        ItemsSource="{Binding UserNames}"
                         Text="{Binding EditUser, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
                 </Grid>
             </ScrollViewer>

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

@@ -941,6 +941,7 @@
                     <TextBox
                         Grid.Row="11"
                         Grid.Column="1"
+                        IsReadOnly="True"
                         Text="{Binding SelectedInspectionReport.EditUser, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
                 </Grid>
             </ScrollViewer>

+ 8 - 7
UniformMaterialManagementSystem/Views/SampleRegistration/SampleRegistrationInputPage.xaml

@@ -254,12 +254,6 @@
                         <Setter Property="VerticalAlignment" Value="Stretch" />
                         <Setter Property="VerticalContentAlignment" Value="Center" />
                     </Style>
-
-                    <Style x:Key="CheckBoxColumnElementStyle" TargetType="CheckBox">
-                        <Setter Property="HorizontalAlignment" Value="Center" />
-                        <Setter Property="VerticalAlignment" Value="Center" />
-                        <Setter Property="IsEnabled" Value="False" />
-                    </Style>
                 </control:FilterDataGrid.Resources>
 
                 <control:FilterDataGrid.Columns>
@@ -506,9 +500,11 @@
                         <Grid.ColumnDefinitions>
                             <ColumnDefinition Width="*" />
                             <ColumnDefinition Width="Auto" />
+                            <ColumnDefinition Width="Auto" />
                         </Grid.ColumnDefinitions>
                         <TextBox Grid.Column="0" Text="{Binding Quantity, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
                         <TextBlock Grid.Column="1" Text="{Binding InspectApply.Material.MeasureUnit}" />
+                        <TextBlock Grid.Column="2" Text="共3份" />
                     </Grid>
 
                     <TextBlock
@@ -650,9 +646,14 @@
                         VerticalAlignment="Center"
                         Text="*承办人:"
                         TextWrapping="Wrap" />
-                    <TextBox
+                    <ComboBox
                         Grid.Row="11"
                         Grid.Column="1"
+                        Height="25"
+                        VerticalContentAlignment="Center"
+                        FontSize="13"
+                        IsEditable="True"
+                        ItemsSource="{Binding UserNames}"
                         Text="{Binding EditUser, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
                     <TextBlock
                         Grid.Row="11"

+ 2 - 6
UniformMaterialManagementSystem/Views/SampleRegistration/SampleRegistrationManagePage.xaml

@@ -330,12 +330,6 @@
                         <Setter Property="VerticalAlignment" Value="Stretch" />
                         <Setter Property="VerticalContentAlignment" Value="Center" />
                     </Style>
-
-                    <Style x:Key="CheckBoxColumnElementStyle" TargetType="CheckBox">
-                        <Setter Property="HorizontalAlignment" Value="Center" />
-                        <Setter Property="VerticalAlignment" Value="Center" />
-                        <Setter Property="IsEnabled" Value="False" />
-                    </Style>
                 </control:FilterDataGrid.Resources>
 
                 <control:FilterDataGrid.Columns>
@@ -573,12 +567,14 @@
                         <Grid.ColumnDefinitions>
                             <ColumnDefinition Width="*" />
                             <ColumnDefinition Width="Auto" />
+                            <ColumnDefinition Width="Auto" />
                         </Grid.ColumnDefinitions>
                         <TextBox
                             Grid.Column="0"
                             IsReadOnly="True"
                             Text="{Binding SelectedSampleRegistration.Quantity, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
                         <TextBlock Grid.Column="1" Text="{Binding SelectedSampleRegistration.InspectApply.Material.MeasureUnit}" />
+                        <TextBlock Grid.Column="2" Text="共3份" />
                     </Grid>
                     <TextBlock
                         Grid.Row="7"