Hcsy 8 年之前
父节点
当前提交
55c413159d
共有 1 个文件被更改,包括 13 次插入10 次删除
  1. 13 10
      UAS-MES/FunctionCode/Make/Make_PackageCollectionWeigh.cs

+ 13 - 10
UAS-MES/FunctionCode/Make/Make_PackageCollectionWeigh.cs

@@ -348,23 +348,26 @@ namespace UAS_MES.Make
                                         }
                                         if (int.Parse(pa_currentqty.Text == "" ? "0" : pa_currentqty.Text) == int.Parse(pr_outboxinnerqty.Text))
                                         {
+                                            float weigh = float.Parse(weight.Text.Replace("kg", "").Trim());
                                             if (checkweight.Checked)
                                             {
                                                 //检查重量合格
-                                                float weigh = float.Parse(weight.Text.Replace("kg", "").Trim());
-                                                if (weigh > MinWeight && weigh < MaxWeight)
+                                   
+                                                if (!(weigh >= MinWeight && weigh <= MaxWeight))
                                                 {
-                                                    dh.UpdateByCondition("package", "pa_status=1,pa_totalqty=pa_currentqty,pa_packageqty=pa_currentqty,pa_weight='" + weigh + "'", "pa_outboxcode='" + pa_outboxcode.Text + "'");
-                                                    pa_standardqty.Text = "";
-                                                    pa_status.Text = "1";
-                                                    OperateResult.AppendText(">>箱号" + pa_outboxcode.Text + "称量合格\n", Color.Green);
-                                                    LastSncode = sn_code.Text;
-                                                    if (AutoPrint.Checked)
-                                                        Print_Click(new object(), new EventArgs());
+                                                    OperateResult.AppendText(">>箱号" + pa_outboxcode.Text + "重量不符合标准重量\n", Color.Red);
+                                                    return;
                                                 }
-                                                else OperateResult.AppendText(">>箱号" + pa_outboxcode.Text + "重量不符合标准重量\n", Color.Red);
                                             }
+                                            dh.UpdateByCondition("package", "pa_status=1,pa_totalqty=pa_currentqty,pa_packageqty=pa_currentqty,pa_weight='" + weigh + "'", "pa_outboxcode='" + pa_outboxcode.Text + "'");
+                                            pa_standardqty.Text = "";
+                                            pa_status.Text = "1";
+                                            OperateResult.AppendText(">>箱号" + pa_outboxcode.Text + "称量合格\n", Color.Green);
+                                            LastSncode = sn_code.Text;
+                                            if (AutoPrint.Checked)
+                                                Print_Click(new object(), new EventArgs());
                                         }
+
                                         LoadGridData();
                                         sn_code.Clear();
                                     }