Browse Source

修复检验申请表-报检数量小数位数问题

LT069288 3 months ago
parent
commit
6ea897ec19

+ 2 - 1
UniformMaterialManagementSystem/ViewModels/InspectApplyPageViewModel.cs

@@ -689,6 +689,7 @@ namespace UniformMaterialManagementSystem.ViewModels
                     //扣减全部可报检数量
                     detail.ShareInspectQty = detail.UnInspectQty;
                     remainQty -= detail.UnInspectQty;
+                    remainQty = Math.Round(remainQty, 1);
                 }
                 else
                 {
@@ -761,7 +762,7 @@ namespace UniformMaterialManagementSystem.ViewModels
 
             TotalPackage = InspectApplyDetails.Count;
 
-            string result = InspectApplyUtil.ReplaceApplyDescription(ApplyDescription, "InspQuantity", $"[{sum}{SelectedMaterial?.MeasureUnit}]");
+            string result = InspectApplyUtil.ReplaceApplyDescription(ApplyDescription, "InspQuantity", $"[{InspQuantity}{SelectedMaterial?.MeasureUnit}]");
             ApplyDescription = InspectApplyUtil.ReplaceApplyDescription(result, "PackageQty", $"[{TotalPackage}]");
         }
 

+ 1 - 1
UniformMaterialManagementSystem/Views/InspectApplyPage.xaml

@@ -166,7 +166,7 @@
             BorderThickness="1">
             <ToolBarPanel>
                 <ToolBar Background="White" ToolBarTray.IsLocked="True">
-                    <Button Command="{Binding SaveInspectApplyCommand}">
+                    <Button Command="{Binding SaveInspectApplyCommand}" Click="Button_Click">
                         <Button.Template>
                             <ControlTemplate>
                                 <Border

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

@@ -98,7 +98,7 @@ namespace UniformMaterialManagementSystem.Views
                 sum += qty;
             }
 
-            InspQuantityText.Text = sum.ToString();
+            InspQuantityText.Text = Math.Round(sum,1).ToString();
             TotalPackageText.Text = DataGridDetail.Items.Count.ToString();
 
             string result = InspectApplyUtil.ReplaceApplyDescription(ApplyDescriptionTextBox.Text, "InspQuantity", "[" + InspQuantityText.Text + (MaterialComboBox.SelectedItem as Material)?.MeasureUnit + "]");
@@ -176,7 +176,7 @@ namespace UniformMaterialManagementSystem.Views
 
         private void AddButton_Click(object sender, RoutedEventArgs e)
         {
-            DataGridDetail.CommitEdit(DataGridEditingUnit.Cell, true);
+            DataGridDetail.CommitEdit(DataGridEditingUnit.Row, true);
         }
 
         /// <summary>
@@ -198,5 +198,10 @@ namespace UniformMaterialManagementSystem.Views
             }
 
         }
+
+        private void Button_Click(object sender, RoutedEventArgs e)
+        {
+            DataGridDetail.CommitEdit();
+        }
     }
 }