Przeglądaj źródła

小数BUG调整

章政 7 lat temu
rodzic
commit
5161e275d1

+ 11 - 7
UAS-出货标签管理(泽天)/UAS_出货标签管理.cs

@@ -404,8 +404,8 @@ namespace UAS_LabelMachine
                 GridPrcode.Rows[GridPrcode.SelectedRows[0].Index].Cells["CollectedNum"].Value = collectqty;
                 for (int i = 0; i < GridPrcode.Rows.Count; i++)
                 {
-                    CollectNum += int.Parse(GridPrcode.Rows[i].Cells["CollectedNum"].Value.ToString());
-                    OutNum += int.Parse(GridPrcode.Rows[i].Cells["pd_outqty"].Value.ToString());
+                    CollectNum += float.Parse(GridPrcode.Rows[i].Cells["CollectedNum"].Value.ToString());
+                    OutNum += float.Parse(GridPrcode.Rows[i].Cells["pd_outqty"].Value.ToString());
                 }
             }
             ProcessCount.Text = CollectNum + "/" + OutNum;
@@ -548,7 +548,7 @@ namespace UAS_LabelMachine
 
             ComBoxClickChangeLabelDoc = true;
         }
-
+        bool LoadCheck = true;
         /// <summary>
         /// 出入库单录入框的回车事件
         /// </summary>
@@ -558,8 +558,10 @@ namespace UAS_LabelMachine
         {
             if (e.KeyCode == Keys.Enter)
             {
+                LoadCheck = false;
                 Combindetail.Checked = false;
                 CombindetailTwo.Checked = false;
+                LoadCheck = true;
                 Input.Clear();
                 sql.Clear();
                 sql.Append("select pi_id,pi_cardcode,pi_title,to_char(pi_date,'yyyymmdd')pi_date from prodinout where pi_inoutno='" + pi_inoutno.Text + "' and pi_invostatuscode='AUDITED'");
@@ -1391,8 +1393,8 @@ namespace UAS_LabelMachine
             }
             else
             {
-                CollectNum = int.Parse(CSPrcode.Compute("sum(CollectedNum)", "1=1").ToString());
-                OutNum = int.Parse(CSPrcode.Compute("sum(pd_outqty)", "1=1").ToString());
+                CollectNum = float.Parse(CSPrcode.Compute("sum(CollectedNum)", "1=1").ToString());
+                OutNum = float.Parse(CSPrcode.Compute("sum(pd_outqty)", "1=1").ToString());
             }
             ProcessCount.Text = CollectNum + "/" + OutNum;
             if (GridPrcode.Rows.Count > 0)
@@ -1785,7 +1787,8 @@ namespace UAS_LabelMachine
             {
                 CombindetailTwo.Checked = false;
             }
-            LoadPrcodeData();
+            if (LoadCheck)
+                LoadPrcodeData();
         }
         private void CombindetailTwo_CheckedChanged(object sender, EventArgs e)
         {
@@ -1793,7 +1796,8 @@ namespace UAS_LabelMachine
             {
                 Combindetail.Checked = false;
             }
-            LoadPrcodeData();
+            if (LoadCheck)
+                LoadPrcodeData();
         }
         string SelectProdcode = "";
         int SelectRowIndex = -1;