Pārlūkot izejas kodu

修复检验申请测试问题

LT069288 3 mēneši atpakaļ
vecāks
revīzija
d0be105902

+ 8 - 0
UniformMaterialManagementSystem/ViewModels/InspectApplyPageViewModel.cs

@@ -2,6 +2,7 @@
 using CommunityToolkit.Mvvm.Input;
 using Microsoft.Win32;
 using System.Collections.ObjectModel;
+using System.Collections.Specialized;
 using System.ComponentModel;
 using System.ComponentModel.DataAnnotations;
 using System.Data;
@@ -146,6 +147,13 @@ namespace UniformMaterialManagementSystem.ViewModels
 
             //默认情况说明
             _defaultApplyDescription = ApplyDescription = $"订购方送检的理化检测报告合格,报告号: [{InspReportNo}]{Environment.NewLine}按照生产工艺及标准规范要求,我公司对该产品的外观颜色、花型条干、实物质量、理化性能等自检合格,现依据监督检验有关要求,申请出厂检验。{Environment.NewLine}总包数: [{TotalPackage}] 包{Environment.NewLine}总数量: [{InspQuantity}] {Environment.NewLine}详见附表{Environment.NewLine}";
+
+            InspectApplyDetails.CollectionChanged += InspectApplyDetailsOnCollectionChanged;
+        }
+
+        private void InspectApplyDetailsOnCollectionChanged(object? sender, NotifyCollectionChangedEventArgs e)
+        {
+            CalculateDetailSummary();
         }
 
         #region 检验申请录入相关方法

+ 2 - 1
UniformMaterialManagementSystem/Views/InspectApplyPage.xaml

@@ -166,7 +166,7 @@
             BorderThickness="1">
             <ToolBarPanel>
                 <ToolBar Background="White" ToolBarTray.IsLocked="True">
-                    <Button Command="{Binding SaveInspectApplyCommand}" Click="Button_Click">
+                    <Button Click="Button_Click" Command="{Binding SaveInspectApplyCommand}">
                         <Button.Template>
                             <ControlTemplate>
                                 <Border
@@ -367,6 +367,7 @@
                                 Grid.Row="3"
                                 Grid.Column="1"
                                 Height="25"
+                                Background="White"
                                 DisplayMemberPath="Name"
                                 FontSize="14"
                                 ItemsSource="{Binding Materials}"

+ 2 - 0
UniformMaterialManagementSystem/Views/InspectApplyPage.xaml.cs

@@ -88,6 +88,8 @@ namespace UniformMaterialManagementSystem.Views
 
         private void DataGridDetail_CellEditEnding(object sender, DataGridCellEditEndingEventArgs e)
         {
+            if (e.Column.Header?.ToString() != "数量*")  return; 
+
             double sum = 0;
             for (int i = 0; i < DataGridDetail.Items.Count; i++)
             {