瀏覽代碼

卡通箱装箱界面以及装箱称重界面逻辑优化

Hcsy 7 年之前
父節點
當前提交
de36dbd19f

+ 40 - 29
UAS-MES/FunctionCode/Make/Make_PackageCollection.cs

@@ -429,7 +429,7 @@ namespace UAS_MES.Make
                                     if (int.Parse(pa_currentqty.Text == "" ? "0" : pa_currentqty.Text) == int.Parse(pr_outboxinnerqty.Text))
                                     {
                                         dh.UpdateByCondition("package", "pa_status=1,pa_packageqty=pa_currentqty,pa_totalqty=pa_currentqty", "pa_outboxcode='" + pa_outboxcode.Text + "'");
-                                        OperateResult.AppendText(">>箱号" + pa_outboxcode.Text + "满箱采集完成,封箱成功\n", Color.Green);
+                                     
                                         pa_status.Text = "1";
                                         pa_standardqty.Text = "";
                                         if (AutoPrint.Checked)
@@ -459,7 +459,10 @@ namespace UAS_MES.Make
                                         }
                                         if (CollecRemark.Checked && pa_remark.Text == "")
                                         {
+                                            dh.UpdateByCondition("package", "pa_status=0", "pa_outboxcode='" + pa_outboxcode.Text + "'");
                                             OperateResult.AppendText(">已勾选采集备注,备注信息必须填写,如不需采集,请取消勾选", Color.Red, sn_code);
+                                            pa_remark.SelectAll();
+                                            pa_remark.Focus();
                                             return;
                                         }
                                         if (LogicHandler.OutBoxStepPass(pa_outboxcode.Text, ms_makecode, User.UserSourceCode, User.UserCode, "卡通箱:" + pa_outboxcode.Text + "整箱过站", "卡通箱整箱过站", out ErrorMessage))
@@ -470,6 +473,7 @@ namespace UAS_MES.Make
                                         {
                                             OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red);
                                         }
+                                        OperateResult.AppendText(">>箱号" + pa_outboxcode.Text + "满箱采集完成,封箱成功\n", Color.Green);
                                         LoadCollectedNum();
                                         LoadCheckQTY();
                                     }
@@ -572,6 +576,8 @@ namespace UAS_MES.Make
                     if (CollecRemark.Checked && pa_remark.Text == "")
                     {
                         OperateResult.AppendText(">已勾选采集备注,备注信息必须填写,如不需采集,请取消勾选", Color.Red, sn_code);
+                        pa_remark.SelectAll();
+                        pa_remark.Focus();
                         return;
                     }
                     OperateResult.AppendText(">>箱号" + pa_outboxcode.Text + "采集完成,手动封箱成功\n", Color.Green);
@@ -579,6 +585,8 @@ namespace UAS_MES.Make
                     pa_status.Text = "1";
                     pa_standardqty.Text = "";
                     LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, pa_makecode.Text, User.UserLineCode, User.UserSourceCode, "装箱采集", "卡通箱" + pa_outboxcode.Text + "封箱成功", pa_outboxcode.Text, "");
+                    if (AutoPrint.Checked)
+                        Print_Click(new object(), new EventArgs());
                     if (!CollecRemark.Checked)
                     {
                         if (!AutoGenBoxCode.Checked)
@@ -930,47 +938,50 @@ namespace UAS_MES.Make
         {
             if (Keys.Enter == e.KeyCode)
             {
-                if (dh.CheckExist("package", "pa_outboxcode='" + pa_outboxcode.Text + "'"))
+                if (pa_remark.Text.Trim(' ') != "")
                 {
-                    if (Remark_PreFix.Text != "")
+                    if (dh.CheckExist("package", "pa_outboxcode='" + pa_outboxcode.Text + "'"))
                     {
-                        try
+                        if (Remark_PreFix.Text != "")
                         {
-                            if (pa_remark.Text.Substring(0, Remark_PreFix.Text.Length) != Remark_PreFix.Text)
+                            try
+                            {
+                                if (pa_remark.Text.Substring(0, Remark_PreFix.Text.Length) != Remark_PreFix.Text)
+                                {
+                                    OperateResult.AppendText(">>备注前缀不匹配,请重新输入备注信息\n", Color.Red);
+                                    return;
+                                }
+                            }
+                            catch (Exception)
                             {
                                 OperateResult.AppendText(">>备注前缀不匹配,请重新输入备注信息\n", Color.Red);
                                 return;
                             }
                         }
-                        catch (Exception)
+                        if (!AllowRepeat.Checked)
                         {
-                            OperateResult.AppendText(">>备注前缀不匹配,请重新输入备注信息\n", Color.Red);
-                            return;
+                            DataTable dt = (DataTable)dh.ExecuteSql("select pa_outboxcode from package where pa_remark='" + pa_remark.Text.ToUpper() + "'", "select");
+                            if (dt.Rows.Count > 0)
+                            {
+                                OperateResult.AppendText(">>箱号" + dt.Rows[0][0].ToString() + "已采集关联信息" + pa_remark.Text + "\n", Color.Red);
+                                return;
+                            }
                         }
-                    }
-                    if (!AllowRepeat.Checked)
-                    {
-                        DataTable dt = (DataTable)dh.ExecuteSql("select pa_outboxcode from package where pa_remark='" + pa_remark.Text.ToUpper() + "'", "select");
-                        if (dt.Rows.Count > 0)
+                        dh.UpdateByCondition("package", "pa_remark='" + pa_remark.Text.ToUpper() + "'", "pa_outboxcode='" + pa_outboxcode.Text + "'");
+                        OperateResult.AppendText(">>箱号" + pa_outboxcode.Text + "关联信息" + pa_remark.Text + "采集成功\n", Color.Green);
+                        pa_remark.Text = "";
+                        if (!AutoGenBoxCode.Checked)
                         {
-                            OperateResult.AppendText(">>箱号" + dt.Rows[0][0].ToString() + "已采集关联信息" + pa_remark.Text + "\n", Color.Red);
-                            return;
+                            pa_outboxcode.SelectAll();
+                            pa_outboxcode.Focus();
+                        }
+                        else
+                        {
+                            sn_code.Focus();
                         }
                     }
-                    dh.UpdateByCondition("package", "pa_remark='" + pa_remark.Text.ToUpper() + "'", "pa_outboxcode='" + pa_outboxcode.Text + "'");
-                    OperateResult.AppendText(">>箱号" + pa_outboxcode.Text + "关联信息" + pa_remark.Text + "采集成功\n", Color.Green);
-                    pa_remark.Text = "";
-                    if (!AutoGenBoxCode.Checked)
-                    {
-                        pa_outboxcode.SelectAll();
-                        pa_outboxcode.Focus();
-                    }
-                    else
-                    {
-                        sn_code.Focus();
-                    }
-                }
-                else OperateResult.AppendText(">>请先采集箱内数据\n", Color.Red);
+                    else OperateResult.AppendText(">>请先采集箱内数据\n", Color.Red);
+                }else OperateResult.AppendText(">>备注信息不可为空\n", Color.Red);
             }
         }
 

+ 32 - 32
UAS-MES/FunctionCode/Make/Make_PackageCollectionWeigh.Designer.cs

@@ -143,7 +143,7 @@
             // 
             this.pa_code_label.AutoSize = true;
             this.pa_code_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pa_code_label.Location = new System.Drawing.Point(3, 46);
+            this.pa_code_label.Location = new System.Drawing.Point(2, 45);
             this.pa_code_label.Name = "pa_code_label";
             this.pa_code_label.Size = new System.Drawing.Size(42, 21);
             this.pa_code_label.TabIndex = 113;
@@ -153,7 +153,7 @@
             // 
             this.PrintList_label.AutoSize = true;
             this.PrintList_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.PrintList_label.Location = new System.Drawing.Point(5, 51);
+            this.PrintList_label.Location = new System.Drawing.Point(4, 50);
             this.PrintList_label.Name = "PrintList_label";
             this.PrintList_label.Size = new System.Drawing.Size(90, 21);
             this.PrintList_label.TabIndex = 116;
@@ -163,7 +163,7 @@
             // 
             this.PrintNum_label.AutoSize = true;
             this.PrintNum_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.PrintNum_label.Location = new System.Drawing.Point(190, 126);
+            this.PrintNum_label.Location = new System.Drawing.Point(189, 125);
             this.PrintNum_label.Name = "PrintNum_label";
             this.PrintNum_label.Size = new System.Drawing.Size(42, 21);
             this.PrintNum_label.TabIndex = 124;
@@ -206,7 +206,7 @@
             // 
             this.label3.AutoSize = true;
             this.label3.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label3.Location = new System.Drawing.Point(5, 89);
+            this.label3.Location = new System.Drawing.Point(4, 88);
             this.label3.Name = "label3";
             this.label3.Size = new System.Drawing.Size(74, 21);
             this.label3.TabIndex = 160;
@@ -426,7 +426,7 @@
             // 
             this.PreFix_label.AutoSize = true;
             this.PreFix_label.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.PreFix_label.Location = new System.Drawing.Point(175, 14);
+            this.PreFix_label.Location = new System.Drawing.Point(174, 13);
             this.PreFix_label.Name = "PreFix_label";
             this.PreFix_label.Size = new System.Drawing.Size(37, 20);
             this.PreFix_label.TabIndex = 205;
@@ -456,7 +456,7 @@
             this.locksalecode.CheckState = System.Windows.Forms.CheckState.Checked;
             this.locksalecode.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.locksalecode.ForeColor = System.Drawing.Color.Red;
-            this.locksalecode.Location = new System.Drawing.Point(297, 14);
+            this.locksalecode.Location = new System.Drawing.Point(296, 13);
             this.locksalecode.Name = "locksalecode";
             this.locksalecode.Size = new System.Drawing.Size(96, 16);
             this.locksalecode.TabIndex = 203;
@@ -467,7 +467,7 @@
             // 
             this.label5.AutoSize = true;
             this.label5.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label5.Location = new System.Drawing.Point(209, 134);
+            this.label5.Location = new System.Drawing.Point(208, 133);
             this.label5.Name = "label5";
             this.label5.Size = new System.Drawing.Size(74, 21);
             this.label5.TabIndex = 188;
@@ -477,7 +477,7 @@
             // 
             this.ms_makecode_label.AutoSize = true;
             this.ms_makecode_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ms_makecode_label.Location = new System.Drawing.Point(3, 134);
+            this.ms_makecode_label.Location = new System.Drawing.Point(2, 133);
             this.ms_makecode_label.Name = "ms_makecode_label";
             this.ms_makecode_label.Size = new System.Drawing.Size(58, 21);
             this.ms_makecode_label.TabIndex = 189;
@@ -487,7 +487,7 @@
             // 
             this.ms_salecode.AutoSize = true;
             this.ms_salecode.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ms_salecode.Location = new System.Drawing.Point(293, 134);
+            this.ms_salecode.Location = new System.Drawing.Point(292, 133);
             this.ms_salecode.Name = "ms_salecode";
             this.ms_salecode.Size = new System.Drawing.Size(0, 21);
             this.ms_salecode.TabIndex = 191;
@@ -496,7 +496,7 @@
             // 
             this.ms_makecode.AutoSize = true;
             this.ms_makecode.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ms_makecode.Location = new System.Drawing.Point(84, 134);
+            this.ms_makecode.Location = new System.Drawing.Point(83, 133);
             this.ms_makecode.MaximumSize = new System.Drawing.Size(150, 0);
             this.ms_makecode.Name = "ms_makecode";
             this.ms_makecode.Size = new System.Drawing.Size(0, 21);
@@ -506,7 +506,7 @@
             // 
             this.OutBoxLength_label.AutoSize = true;
             this.OutBoxLength_label.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.OutBoxLength_label.Location = new System.Drawing.Point(84, 14);
+            this.OutBoxLength_label.Location = new System.Drawing.Point(83, 13);
             this.OutBoxLength_label.Name = "OutBoxLength_label";
             this.OutBoxLength_label.Size = new System.Drawing.Size(37, 20);
             this.OutBoxLength_label.TabIndex = 187;
@@ -568,7 +568,7 @@
             // 
             this.pa_currentqty_label.AutoSize = true;
             this.pa_currentqty_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pa_currentqty_label.Location = new System.Drawing.Point(209, 76);
+            this.pa_currentqty_label.Location = new System.Drawing.Point(208, 75);
             this.pa_currentqty_label.Name = "pa_currentqty_label";
             this.pa_currentqty_label.Size = new System.Drawing.Size(74, 21);
             this.pa_currentqty_label.TabIndex = 175;
@@ -578,7 +578,7 @@
             // 
             this.pr_detail_label.AutoSize = true;
             this.pr_detail_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pr_detail_label.Location = new System.Drawing.Point(209, 104);
+            this.pr_detail_label.Location = new System.Drawing.Point(208, 103);
             this.pr_detail_label.Name = "pr_detail_label";
             this.pr_detail_label.Size = new System.Drawing.Size(74, 21);
             this.pr_detail_label.TabIndex = 173;
@@ -588,7 +588,7 @@
             // 
             this.pa_currentqty.AutoSize = true;
             this.pa_currentqty.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pa_currentqty.Location = new System.Drawing.Point(293, 76);
+            this.pa_currentqty.Location = new System.Drawing.Point(292, 75);
             this.pa_currentqty.Name = "pa_currentqty";
             this.pa_currentqty.Size = new System.Drawing.Size(0, 21);
             this.pa_currentqty.TabIndex = 179;
@@ -597,7 +597,7 @@
             // 
             this.pr_code_label.AutoSize = true;
             this.pr_code_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pr_code_label.Location = new System.Drawing.Point(3, 105);
+            this.pr_code_label.Location = new System.Drawing.Point(2, 104);
             this.pr_code_label.Name = "pr_code_label";
             this.pr_code_label.Size = new System.Drawing.Size(74, 21);
             this.pr_code_label.TabIndex = 174;
@@ -607,7 +607,7 @@
             // 
             this.pr_detail.AutoSize = true;
             this.pr_detail.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pr_detail.Location = new System.Drawing.Point(293, 104);
+            this.pr_detail.Location = new System.Drawing.Point(292, 103);
             this.pr_detail.Name = "pr_detail";
             this.pr_detail.Size = new System.Drawing.Size(0, 21);
             this.pr_detail.TabIndex = 178;
@@ -616,7 +616,7 @@
             // 
             this.pr_outboxinnerqty_label.AutoSize = true;
             this.pr_outboxinnerqty_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pr_outboxinnerqty_label.Location = new System.Drawing.Point(3, 73);
+            this.pr_outboxinnerqty_label.Location = new System.Drawing.Point(2, 72);
             this.pr_outboxinnerqty_label.Name = "pr_outboxinnerqty_label";
             this.pr_outboxinnerqty_label.Size = new System.Drawing.Size(74, 21);
             this.pr_outboxinnerqty_label.TabIndex = 176;
@@ -626,7 +626,7 @@
             // 
             this.pr_code.AutoSize = true;
             this.pr_code.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pr_code.Location = new System.Drawing.Point(84, 105);
+            this.pr_code.Location = new System.Drawing.Point(83, 104);
             this.pr_code.MaximumSize = new System.Drawing.Size(150, 0);
             this.pr_code.Name = "pr_code";
             this.pr_code.Size = new System.Drawing.Size(0, 21);
@@ -636,7 +636,7 @@
             // AutoGenBoxCode
             // 
             this.AutoGenBoxCode.AutoSize = true;
-            this.AutoGenBoxCode.Location = new System.Drawing.Point(241, 44);
+            this.AutoGenBoxCode.Location = new System.Drawing.Point(240, 43);
             this.AutoGenBoxCode.Margin = new System.Windows.Forms.Padding(2);
             this.AutoGenBoxCode.Name = "AutoGenBoxCode";
             this.AutoGenBoxCode.Size = new System.Drawing.Size(93, 25);
@@ -708,7 +708,7 @@
             // 
             this.label1.AutoSize = true;
             this.label1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label1.Location = new System.Drawing.Point(268, 21);
+            this.label1.Location = new System.Drawing.Point(267, 20);
             this.label1.Name = "label1";
             this.label1.Size = new System.Drawing.Size(74, 21);
             this.label1.TabIndex = 180;
@@ -719,7 +719,7 @@
             this.checkweightlabel.AutoSize = true;
             this.checkweightlabel.CutLength = null;
             this.checkweightlabel.ForeColor = System.Drawing.Color.Black;
-            this.checkweightlabel.Location = new System.Drawing.Point(14, 15);
+            this.checkweightlabel.Location = new System.Drawing.Point(13, 14);
             this.checkweightlabel.MaximumSize = new System.Drawing.Size(200, 0);
             this.checkweightlabel.Name = "checkweightlabel";
             this.checkweightlabel.Size = new System.Drawing.Size(0, 21);
@@ -729,7 +729,7 @@
             // 
             this.ob_nowcheckqty.AutoSize = true;
             this.ob_nowcheckqty.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ob_nowcheckqty.Location = new System.Drawing.Point(349, 91);
+            this.ob_nowcheckqty.Location = new System.Drawing.Point(348, 90);
             this.ob_nowcheckqty.Name = "ob_nowcheckqty";
             this.ob_nowcheckqty.Size = new System.Drawing.Size(0, 21);
             this.ob_nowcheckqty.TabIndex = 178;
@@ -738,7 +738,7 @@
             // 
             this.ob_batchqty.AutoSize = true;
             this.ob_batchqty.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ob_batchqty.Location = new System.Drawing.Point(349, 55);
+            this.ob_batchqty.Location = new System.Drawing.Point(348, 54);
             this.ob_batchqty.Name = "ob_batchqty";
             this.ob_batchqty.Size = new System.Drawing.Size(0, 21);
             this.ob_batchqty.TabIndex = 177;
@@ -747,7 +747,7 @@
             // 
             this.ob_nowcheckqty_label.AutoSize = true;
             this.ob_nowcheckqty_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ob_nowcheckqty_label.Location = new System.Drawing.Point(268, 91);
+            this.ob_nowcheckqty_label.Location = new System.Drawing.Point(267, 90);
             this.ob_nowcheckqty_label.Name = "ob_nowcheckqty_label";
             this.ob_nowcheckqty_label.Size = new System.Drawing.Size(74, 21);
             this.ob_nowcheckqty_label.TabIndex = 176;
@@ -757,7 +757,7 @@
             // 
             this.ob_batchqty_label.AutoSize = true;
             this.ob_batchqty_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ob_batchqty_label.Location = new System.Drawing.Point(268, 55);
+            this.ob_batchqty_label.Location = new System.Drawing.Point(267, 54);
             this.ob_batchqty_label.Name = "ob_batchqty_label";
             this.ob_batchqty_label.Size = new System.Drawing.Size(74, 21);
             this.ob_batchqty_label.TabIndex = 175;
@@ -806,7 +806,7 @@
             // 
             this.ob_checkno.AutoSize = true;
             this.ob_checkno.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ob_checkno.Location = new System.Drawing.Point(349, 21);
+            this.ob_checkno.Location = new System.Drawing.Point(348, 20);
             this.ob_checkno.Name = "ob_checkno";
             this.ob_checkno.Size = new System.Drawing.Size(0, 21);
             this.ob_checkno.TabIndex = 175;
@@ -877,7 +877,7 @@
             // 
             this.pr_cartonunit1.AutoSize = true;
             this.pr_cartonunit1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pr_cartonunit1.Location = new System.Drawing.Point(76, 121);
+            this.pr_cartonunit1.Location = new System.Drawing.Point(75, 120);
             this.pr_cartonunit1.Name = "pr_cartonunit1";
             this.pr_cartonunit1.Size = new System.Drawing.Size(20, 21);
             this.pr_cartonunit1.TabIndex = 184;
@@ -889,7 +889,7 @@
             // 
             this.pr_cartonunit.AutoSize = true;
             this.pr_cartonunit.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pr_cartonunit.Location = new System.Drawing.Point(45, 18);
+            this.pr_cartonunit.Location = new System.Drawing.Point(44, 17);
             this.pr_cartonunit.Name = "pr_cartonunit";
             this.pr_cartonunit.Size = new System.Drawing.Size(20, 21);
             this.pr_cartonunit.TabIndex = 183;
@@ -900,7 +900,7 @@
             // 
             this.pr_cartonboxgw.AutoSize = true;
             this.pr_cartonboxgw.Font = new System.Drawing.Font("微软雅黑", 25F);
-            this.pr_cartonboxgw.Location = new System.Drawing.Point(11, 158);
+            this.pr_cartonboxgw.Location = new System.Drawing.Point(10, 157);
             this.pr_cartonboxgw.Name = "pr_cartonboxgw";
             this.pr_cartonboxgw.Size = new System.Drawing.Size(0, 45);
             this.pr_cartonboxgw.TabIndex = 182;
@@ -909,7 +909,7 @@
             // 
             this.label4.AutoSize = true;
             this.label4.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label4.Location = new System.Drawing.Point(3, 121);
+            this.label4.Location = new System.Drawing.Point(2, 120);
             this.label4.Name = "label4";
             this.label4.Size = new System.Drawing.Size(74, 21);
             this.label4.TabIndex = 181;
@@ -920,7 +920,7 @@
             this.weight.AutoSize = true;
             this.weight.Font = new System.Drawing.Font("微软雅黑", 35F);
             this.weight.ForeColor = System.Drawing.Color.DarkGreen;
-            this.weight.Location = new System.Drawing.Point(9, 52);
+            this.weight.Location = new System.Drawing.Point(8, 51);
             this.weight.Name = "weight";
             this.weight.Size = new System.Drawing.Size(0, 60);
             this.weight.TabIndex = 180;
@@ -929,7 +929,7 @@
             // 
             this.label2.AutoSize = true;
             this.label2.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label2.Location = new System.Drawing.Point(3, 18);
+            this.label2.Location = new System.Drawing.Point(2, 17);
             this.label2.Name = "label2";
             this.label2.Size = new System.Drawing.Size(42, 21);
             this.label2.TabIndex = 179;

+ 42 - 33
UAS-MES/FunctionCode/Make/Make_PackageCollectionWeigh.cs

@@ -471,17 +471,19 @@ namespace UAS_MES.Make
                                                 return;
                                             }
                                         }
+                                        if (CollecRemark.Checked && pa_remark.Text == "")
+                                        {
+                                            OperateResult.AppendText(">已勾选采集备注,备注信息必须填写,如不需采集,请取消勾选", Color.Red, sn_code);
+                                            pa_remark.SelectAll();
+                                            pa_remark.Focus();
+                                            return;
+                                        }
                                         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);
                                         LogicHandler.RecordProdWeight(pa_outboxcode.Text, "CARTON", float.Parse(ActWeigh.ToString()), "kg", User.UserLineCode, pr_code.Text, User.UserSourceCode, User.UserName);
                                         LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, pa_makecode.Text, User.UserLineCode, User.UserSourceCode, "卡通箱称重", "称量完成:" + weight.Text.Trim(), pa_outboxcode.Text, "");
-                                        if (CollecRemark.Checked && pa_remark.Text == "")
-                                        {
-                                            OperateResult.AppendText(">已勾选采集备注,备注信息必须填写,如不需采集,请取消勾选", Color.Red, sn_code);
-                                            return;
-                                        }
                                         if (LogicHandler.OutBoxStepPass(pa_outboxcode.Text, ms_makecode, User.UserSourceCode, User.UserCode, "卡通箱:" + pa_outboxcode.Text + "整箱过站", "卡通箱整箱过站", out ErrorMessage))
                                         {
                                             dh.UpdateByCondition("package", "pa_nextstep='" + dh.getFieldDataByCondition("packagedetail left join makeserial on ms_sncode=pd_barcode and ms_makecode=pd_makecode", "max(ms_nextstepcode)", "pd_outboxcode='" + pa_outboxcode.Text + "'").ToString() + "', PA_CURRENTSTEP = '' ", "pa_outboxcode='" + pa_outboxcode.Text + "'");
@@ -612,6 +614,8 @@ namespace UAS_MES.Make
                     if (CollecRemark.Checked && pa_remark.Text == "")
                     {
                         OperateResult.AppendText(">已勾选采集备注,备注信息必须填写,如不需采集,请取消勾选", Color.Red, sn_code);
+                        pa_remark.SelectAll();
+                        pa_remark.Focus();
                         return;
                     }
                     dh.UpdateByCondition("package", "pa_status=1,pa_totalqty=pa_currentqty,pa_packageqty=pa_currentqty,pa_weight=" + weigh + "", "pa_outboxcode='" + pa_outboxcode.Text + "'");
@@ -635,6 +639,8 @@ namespace UAS_MES.Make
                     {
                         OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red);
                     }
+                    if (AutoPrint.Checked)
+                        Print_Click(new object(), new EventArgs());
                     LoadCheckQTY();
                     if (!CollecRemark.Checked)
                     {
@@ -950,47 +956,50 @@ namespace UAS_MES.Make
         {
             if (Keys.Enter == e.KeyCode)
             {
-                if (dh.CheckExist("package", "pa_outboxcode='" + pa_outboxcode.Text + "'"))
+                if (pa_remark.Text.Trim(' ') != "")
                 {
-                    if (Remark_PreFix.Text != "")
+                    if (dh.CheckExist("package", "pa_outboxcode='" + pa_outboxcode.Text + "'"))
                     {
-                        try
+                        if (Remark_PreFix.Text != "")
                         {
-                            if (pa_remark.Text.Substring(0, Remark_PreFix.Text.Length) != Remark_PreFix.Text)
+                            try
+                            {
+                                if (pa_remark.Text.Substring(0, Remark_PreFix.Text.Length) != Remark_PreFix.Text)
+                                {
+                                    OperateResult.AppendText(">>备注前缀不匹配,请重新输入备注信息\n", Color.Red);
+                                    return;
+                                }
+                            }
+                            catch (Exception)
                             {
                                 OperateResult.AppendText(">>备注前缀不匹配,请重新输入备注信息\n", Color.Red);
                                 return;
                             }
                         }
-                        catch (Exception)
+                        if (!AllowRepeat.Checked)
                         {
-                            OperateResult.AppendText(">>备注前缀不匹配,请重新输入备注信息\n", Color.Red);
-                            return;
+                            DataTable dt = (DataTable)dh.ExecuteSql("select pa_outboxcode from package where pa_remark='" + pa_remark.Text.ToUpper() + "'", "select");
+                            if (dt.Rows.Count > 0)
+                            {
+                                OperateResult.AppendText(">>箱号" + dt.Rows[0][0].ToString() + "已采集关联信息" + pa_remark.Text + "\n", Color.Red);
+                                return;
+                            }
                         }
-                    }
-                    if (!AllowRepeat.Checked)
-                    {
-                        DataTable dt = (DataTable)dh.ExecuteSql("select pa_outboxcode from package where pa_remark='" + pa_remark.Text.ToUpper() + "'", "select");
-                        if (dt.Rows.Count > 0)
+                        dh.UpdateByCondition("package", "pa_remark='" + pa_remark.Text.ToUpper() + "'", "pa_outboxcode='" + pa_outboxcode.Text + "'");
+                        OperateResult.AppendText(">>箱号" + pa_outboxcode.Text + "关联信息" + pa_remark.Text + "采集成功\n", Color.Green);
+                        pa_remark.Text = "";
+                        if (!AutoGenBoxCode.Checked)
                         {
-                            OperateResult.AppendText(">>箱号" + dt.Rows[0][0].ToString() + "已采集关联信息" + pa_remark.Text + "\n", Color.Red);
-                            return;
+                            pa_outboxcode.SelectAll();
+                            pa_outboxcode.Focus();
+                        }
+                        else
+                        {
+                            sn_code.Focus();
                         }
                     }
-                    dh.UpdateByCondition("package", "pa_remark='" + pa_remark.Text.ToUpper() + "'", "pa_outboxcode='" + pa_outboxcode.Text + "'");
-                    OperateResult.AppendText(">>箱号" + pa_outboxcode.Text + "关联信息" + pa_remark.Text + "采集成功\n", Color.Green);
-                    pa_remark.Text = "";
-                    if (!AutoGenBoxCode.Checked)
-                    {
-                        pa_outboxcode.SelectAll();
-                        pa_outboxcode.Focus();
-                    }
-                    else
-                    {
-                        sn_code.Focus();
-                    }
-                }
-                else OperateResult.AppendText(">>请先采集箱内数据\n", Color.Red);
+                    else OperateResult.AppendText(">>请先采集箱内数据\n", Color.Red);
+                }else OperateResult.AppendText(">>备注信息不可为空\n", Color.Red);
             }
         }