Browse Source

打印BUG调整

章政 6 years ago
parent
commit
0591db6f75

+ 22 - 0
UAS-出货标签管理(吉利通)/UAS_出货标签管理.Designer.cs

@@ -89,6 +89,8 @@
             this.FirstPage = new System.Windows.Forms.LinkLabel();
             this.LastPage = new System.Windows.Forms.LinkLabel();
             this.PageNum = new System.Windows.Forms.Label();
+            this.LogMenu = new System.Windows.Forms.ContextMenuStrip(this.components);
+            this.toolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
             this.front_sg_separator = new UAS_LabelMachine.CustomControl.EnterTextBox();
             this.FrontCollect = new UAS_LabelMachine.CustomControl.EnterTextBox();
             this.CollectionProcess = new UAS_LabelMachine.CustomControl.GroupBoxWithBorder.GroupBoxWithBorder();
@@ -226,6 +228,7 @@
             this.BackendCheck = new UAS_LabelMachine.CustomControl.SerialPortWithTag();
             this.FrontendCheck = new UAS_LabelMachine.CustomControl.SerialPortWithTag();
             this.PLC1 = new UAS_LabelMachine.CustomControl.SerialPortWithTag();
+            this.LogMenu.SuspendLayout();
             this.CollectionProcess.SuspendLayout();
             this.groupBox2.SuspendLayout();
             this.groupBox1.SuspendLayout();
@@ -790,6 +793,20 @@
             this.PageNum.Size = new System.Drawing.Size(0, 20);
             this.PageNum.TabIndex = 102;
             // 
+            // LogMenu
+            // 
+            this.LogMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
+            this.toolStripMenuItem1});
+            this.LogMenu.Name = "contextMenuStrip1";
+            this.LogMenu.RenderMode = System.Windows.Forms.ToolStripRenderMode.System;
+            this.LogMenu.Size = new System.Drawing.Size(125, 26);
+            // 
+            // toolStripMenuItem1
+            // 
+            this.toolStripMenuItem1.Name = "toolStripMenuItem1";
+            this.toolStripMenuItem1.Size = new System.Drawing.Size(124, 22);
+            this.toolStripMenuItem1.Text = "导出日志";
+            // 
             // front_sg_separator
             // 
             this.front_sg_separator.Enabled = false;
@@ -1302,6 +1319,7 @@
             this.MessageLog.Size = new System.Drawing.Size(1383, 97);
             this.MessageLog.TabIndex = 28;
             this.MessageLog.Text = "";
+            this.MessageLog.MouseUp += new System.Windows.Forms.MouseEventHandler(this.MessageLog_MouseUp);
             // 
             // LabelInf
             // 
@@ -2315,6 +2333,7 @@
             this.OutBoxLabelAutoPrint.TabIndex = 79;
             this.OutBoxLabelAutoPrint.Text = "自动打印";
             this.OutBoxLabelAutoPrint.UseVisualStyleBackColor = true;
+            this.OutBoxLabelAutoPrint.Visible = false;
             // 
             // OutBoxCombox
             // 
@@ -2389,6 +2408,7 @@
             this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.贴标机条码打印_FormClosing);
             this.Load += new System.EventHandler(this.贴标机条码打印_Load);
             this.SizeChanged += new System.EventHandler(this.贴标机条码打印_SizeChanged);
+            this.LogMenu.ResumeLayout(false);
             this.CollectionProcess.ResumeLayout(false);
             this.CollectionProcess.PerformLayout();
             this.groupBox2.ResumeLayout(false);
@@ -2619,5 +2639,7 @@
         private System.Windows.Forms.DataGridViewTextBoxColumn pr_spec;
         private System.Windows.Forms.DataGridViewTextBoxColumn pib_outboxcode1;
         private System.Windows.Forms.DataGridViewTextBoxColumn pib_outboxcode2;
+        private System.Windows.Forms.ContextMenuStrip LogMenu;
+        private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem1;
     }
 }

+ 152 - 133
UAS-出货标签管理(吉利通)/UAS_出货标签管理.cs

@@ -244,7 +244,7 @@ namespace UAS_LabelMachine
                     case "FrontendCheck":
                         //比对当前箱数量和容量
                         FrontCollect.Text = msg;
-                        if (!FrontCheckFunction(msg, out ErrorMsg))
+                        if (!FrontCheckFunction(pib_id, msg, out ErrorMsg))
                         {
                             LogicHandler.SendDataToPLC(PLC1, PLCInstruct.FrontDataDelete);
                             MessageLog.AppendText(">>" + ErrorMsg + "\n", Color.Red);
@@ -264,12 +264,10 @@ namespace UAS_LabelMachine
                                     return;
                                 }
                             }
+                            LabelInf.Rows[CurrentRowIndex].Cells["pib_ifpick"].Value = true;
                             //勾选了中盒自动打印
                             if (MidLabelAutoPrint.Checked)
                                 AutoPrintMidLabel();
-                            LabelInf.Rows[CurrentRowIndex].Cells["pib_ifpick"].Value = true;
-                            //设置变量为已勾选
-                            ShowDt.Select("pib_id=" + pib_id)[0]["pib_ifpick"] = -1;
                             LogicHandler.SendDataToPLC(PLC1, PLCInstruct.FrontDataPass);
                             LabelInf.Refresh();
                         }
@@ -278,6 +276,8 @@ namespace UAS_LabelMachine
                         BackCheck.Text = msg;
                         if (BackendCheckFunction(msg, pib_id, out ErrorMsg))
                         {
+                            //设置变量为已勾选
+                            ShowDt.Select("pib_id=" + pib_id)[0]["pib_ifpick"] = -1;
                             LogicHandler.SendDataToPLC(PLC1, PLCInstruct.BackDataPass);
                         }
                         else
@@ -297,7 +297,7 @@ namespace UAS_LabelMachine
             }
         }
 
-        private bool FrontCheckFunction(string msg, out string ErrorMsg)
+        private bool FrontCheckFunction(string pib_id, string msg, out string ErrorMsg)
         {
             int GroupCount = 0;
             ErrorMsg = "";
@@ -435,8 +435,143 @@ namespace UAS_LabelMachine
             }
             else
             {
+                //获取当前最大的箱号
                 LabelInf.Rows[CurrentRowIndex].Cells["pib_datecode"].Value = DateCode;
                 LabelInf.Rows[CurrentRowIndex].Cells["pib_lotno"].Value = LotNo;
+                string boxcode = adh.getFieldDataByCondition("prodiobarcode", "max(pib_outboxcode1)", "pib_inoutno='" + pi_inoutno.Text + "'").ToString();
+                int outboxcode1 = int.Parse(boxcode == "" ? "1" : boxcode);
+                boxcode = adh.getFieldDataByCondition("prodiobarcode", "max(pib_outboxcode2)", "pib_inoutno='" + pi_inoutno.Text + "'").ToString();
+                int outboxcode2 = int.Parse(boxcode == "" ? "1" : boxcode);
+                string pd_id = LabelInf.Rows[CurrentRowIndex].Cells["pd_id"].Value.ToString();
+                //超过中盒容量中盒号+1
+                if (adh.getRowCount("prodiobarcode", "pib_inoutno='" + pi_inoutno.Text + "' and pib_outboxcode1=" + outboxcode1) >= MidBoxCapacity.Value)
+                {
+                    outboxcode1 = outboxcode1 + 1;
+                    LogicHandler.GetBarCode(PI_ID, pd_id, 1, out MidBoxBarCode);
+                }
+                if (CurrentRowIndex - 1 >= 0)
+                {
+                    //或者不符合合并条件中盒号+1
+                    if (cu_print_midlotno.Checked)
+                    {
+                        if (LabelInf.Rows[CurrentRowIndex - 1].Cells["pib_lotno"].Value.ToString() != LabelInf.Rows[CurrentRowIndex].Cells["pib_lotno"].Value.ToString())
+                        {
+                            LogicHandler.GetBarCode(PI_ID, pd_id, 1, out MidBoxBarCode);
+                            LabelInf.Rows[CurrentRowIndex].Cells["pib_custmidboxcode"].Value = MidBoxBarCode;
+                            outboxcode1 = outboxcode1 + 1;
+                        }
+                    }
+                    else if (cu_print_midpo.Checked)
+                    {
+                        if (LabelInf.Rows[CurrentRowIndex - 1].Cells["pd_pocode"].Value.ToString() != LabelInf.Rows[CurrentRowIndex].Cells["pd_pocode"].Value.ToString())
+                        {
+                            LogicHandler.GetBarCode(PI_ID, pd_id, 1, out MidBoxBarCode);
+                            LabelInf.Rows[CurrentRowIndex].Cells["pib_custmidboxcode"].Value = MidBoxBarCode;
+                            outboxcode1 = outboxcode1 + 1;
+                        }
+                    }
+                    else if (cu_print_midprod.Checked)
+                    {
+                        if (LabelInf.Rows[CurrentRowIndex - 1].Cells["pr_orispeccode"].Value.ToString() != LabelInf.Rows[CurrentRowIndex].Cells["pd_custprodcode"].Value.ToString())
+                        {
+                            LogicHandler.GetBarCode(PI_ID, pd_id, 1, out MidBoxBarCode);
+                            LabelInf.Rows[CurrentRowIndex].Cells["pib_custmidboxcode"].Value = MidBoxBarCode;
+                            outboxcode1 = outboxcode1 + 1;
+                        }
+                    }
+                    else if (cu_print_midspec.Checked)
+                    {
+                        if (LabelInf.Rows[CurrentRowIndex - 1].Cells["pd_custprodspec"].Value.ToString() != LabelInf.Rows[CurrentRowIndex].Cells["pd_custprodspec"].Value.ToString())
+                        {
+                            LogicHandler.GetBarCode(PI_ID, pd_id, 1, out MidBoxBarCode);
+                            LabelInf.Rows[CurrentRowIndex].Cells["pib_custmidboxcode"].Value = MidBoxBarCode;
+                            outboxcode1 = outboxcode1 + 1;
+                        }
+                    }
+                    else if (cu_print_middc.Checked)
+                    {
+                        if (LabelInf.Rows[CurrentRowIndex - 1].Cells["pib_datecode"].Value.ToString() != LabelInf.Rows[CurrentRowIndex].Cells["pib_datecode"].Value.ToString())
+                        {
+                            LogicHandler.GetBarCode(PI_ID, pd_id, 1, out MidBoxBarCode);
+                            LabelInf.Rows[CurrentRowIndex].Cells["pib_custmidboxcode"].Value = MidBoxBarCode;
+                            outboxcode1 = outboxcode1 + 1;
+                        }
+                    }
+                    if (MidBoxBarCode == "")
+                    {
+                        LogicHandler.GetBarCode(PI_ID, pd_id, 1, out MidBoxBarCode);
+                    }
+                    LabelInf.Rows[CurrentRowIndex].Cells["pib_custmidboxcode"].Value = MidBoxBarCode;
+                }
+                else
+                {
+                    LogicHandler.GetBarCode(PI_ID, pd_id, 1, out MidBoxBarCode);
+                    LabelInf.Rows[CurrentRowIndex].Cells["pib_custmidboxcode"].Value = MidBoxBarCode;
+                }
+                if (adh.getRowCount("prodiobarcode", "pib_inoutno='" + pi_inoutno.Text + "' and pib_outboxcode2=" + outboxcode2) >= OutBoxCapacity.Value)
+                {
+                    outboxcode2 = outboxcode2 + 1;
+                    LogicHandler.GetBarCode(PI_ID, pd_id, 1, out OutBoxBarCode);
+                    LabelInf.Rows[CurrentRowIndex].Cells["pib_custoutboxcode"].Value = OutBoxBarCode;
+                }
+                else if (CurrentRowIndex - 1 >= 0)
+                {
+                    //或者不符合合并条件中盒号+1
+                    if (cu_print_outlotno.Checked)
+                    {
+                        if (LabelInf.Rows[CurrentRowIndex - 1].Cells["pib_lotno"].Value.ToString() != LabelInf.Rows[CurrentRowIndex].Cells["pib_lotno"].Value.ToString())
+                        {
+                            LogicHandler.GetBarCode(PI_ID, pd_id, 1, out OutBoxBarCode);
+                            LabelInf.Rows[CurrentRowIndex].Cells["pib_custoutboxcode"].Value = OutBoxBarCode;
+                        }
+                    }
+                    else if (cu_print_outpo.Checked)
+                    {
+                        if (LabelInf.Rows[CurrentRowIndex - 1].Cells["pd_pocode"].Value.ToString() != LabelInf.Rows[CurrentRowIndex].Cells["pd_pocode"].Value.ToString())
+                        {
+                            LogicHandler.GetBarCode(PI_ID, pd_id, 1, out OutBoxBarCode);
+                            LabelInf.Rows[CurrentRowIndex].Cells["pib_custoutboxcode"].Value = OutBoxBarCode;
+                        }
+                    }
+                    else if (cu_print_outprod.Checked)
+                    {
+                        if (LabelInf.Rows[CurrentRowIndex - 1].Cells["pr_orispeccode"].Value.ToString() != LabelInf.Rows[CurrentRowIndex].Cells["pd_custprodcode"].Value.ToString())
+                        {
+                            LogicHandler.GetBarCode(PI_ID, pd_id, 1, out OutBoxBarCode);
+                            LabelInf.Rows[CurrentRowIndex].Cells["pib_custoutboxcode"].Value = OutBoxBarCode;
+                        }
+                    }
+                    else if (cu_print_outspec.Checked)
+                    {
+                        if (LabelInf.Rows[CurrentRowIndex - 1].Cells["pd_custprodspec"].Value.ToString() != LabelInf.Rows[CurrentRowIndex].Cells["pd_custprodspec"].Value.ToString())
+                        {
+                            LogicHandler.GetBarCode(PI_ID, pd_id, 1, out OutBoxBarCode);
+                            LabelInf.Rows[CurrentRowIndex].Cells["pib_custoutboxcode"].Value = OutBoxBarCode;
+                        }
+                    }
+                    else if (cu_print_outdc.Checked)
+                    {
+                        if (LabelInf.Rows[CurrentRowIndex - 1].Cells["pib_datecode"].Value.ToString() != LabelInf.Rows[CurrentRowIndex].Cells["pib_datecode"].Value.ToString())
+                        {
+                            LogicHandler.GetBarCode(PI_ID, pd_id, 1, out MidBoxBarCode);
+                            LabelInf.Rows[CurrentRowIndex].Cells["pib_custoutboxcode"].Value = OutBoxBarCode;
+                        }
+                    }
+                    if (OutBoxBarCode == "")
+                    {
+                        LogicHandler.GetBarCode(PI_ID, pd_id, 1, out OutBoxBarCode);
+                    }
+                    LabelInf.Rows[CurrentRowIndex].Cells["pib_custoutboxcode"].Value = OutBoxBarCode;
+                }
+                else
+                {
+                    LogicHandler.GetBarCode(PI_ID, pd_id, 1, out OutBoxBarCode);
+                    LabelInf.Rows[CurrentRowIndex].Cells["pib_custoutboxcode"].Value = OutBoxBarCode;
+                }
+                LabelInf.Rows[CurrentRowIndex].Cells["pib_outboxcode1"].Value = outboxcode1;
+                LabelInf.Rows[CurrentRowIndex].Cells["pib_outboxcode2"].Value = outboxcode2;
+                adh.ExecuteSql("update prodiobarcode set pib_outboxcode2=" + outboxcode2 + ",pib_outboxcode1=" + outboxcode1 + ",pib_custoutboxcode='" + OutBoxBarCode + "',pib_custmidboxcode='" + MidBoxBarCode + "',pib_lotno='" + LotNo + "',pib_datecode='" + DateCode + "',pib_ifpick=-1 where pib_id=" + pib_id, "update");
+                LabelInf.Refresh();
                 return true;
             }
         }
@@ -514,137 +649,12 @@ namespace UAS_LabelMachine
                 {
                     Item += CheckItem[i].ToString() + " ";
                 }
-                ErrorMsg = ">>" + Item + "复核不通过";
+                ErrorMsg = Item + "复核不通过";
                 return false;
             }
             LabelInf.Rows[CurrentRowIndex].Cells["pib_ifrecheck"].Value = true;
             adh.ExecuteSql("update prodiobarcode set pib_ifrecheck=-1 where pib_id=" + pib_id, "update");
             LabelInf.Refresh();
-            //获取当前最大的箱号
-            string boxcode = adh.getFieldDataByCondition("prodiobarcode", "max(pib_outboxcode1)", "pib_inoutno='" + pi_inoutno.Text + "'").ToString();
-            int outboxcode1 = int.Parse(boxcode == "" ? "1" : boxcode);
-            boxcode = adh.getFieldDataByCondition("prodiobarcode", "max(pib_outboxcode2)", "pib_inoutno='" + pi_inoutno.Text + "'").ToString();
-            int outboxcode2 = int.Parse(boxcode == "" ? "1" : boxcode);
-            string pd_id = LabelInf.Rows[CurrentRowIndex].Cells["pd_id"].Value.ToString();
-            //超过中盒容量中盒号+1
-            if (adh.getRowCount("prodiobarcode", "pib_inoutno='" + pi_inoutno.Text + "' and pib_outboxcode1=" + outboxcode1) > MidBoxCapacity.Value)
-            {
-                outboxcode1 = outboxcode1 + 1;
-                LogicHandler.GetBarCode(PI_ID, pd_id, 1, out MidBoxBarCode);
-            }
-            if (CurrentRowIndex - 1 >= 0)
-            {
-                //或者不符合合并条件中盒号+1
-                if (cu_print_midlotno.Checked)
-                {
-                    if (LabelInf.Rows[CurrentRowIndex - 1].Cells["pib_lotno"].Value.ToString() != LabelInf.Rows[CurrentRowIndex].Cells["pib_lotno"].Value.ToString())
-                    {
-                        LogicHandler.GetBarCode(PI_ID, pd_id, 1, out MidBoxBarCode);
-                        LabelInf.Rows[CurrentRowIndex].Cells["pib_custmidboxcode"].Value = MidBoxBarCode;
-                        outboxcode1 = outboxcode1 + 1;
-                    }
-                }
-                else if (cu_print_midpo.Checked)
-                {
-                    if (LabelInf.Rows[CurrentRowIndex - 1].Cells["pd_pocode"].Value.ToString() != LabelInf.Rows[CurrentRowIndex].Cells["pd_pocode"].Value.ToString())
-                    {
-                        LogicHandler.GetBarCode(PI_ID, pd_id, 1, out MidBoxBarCode);
-                        LabelInf.Rows[CurrentRowIndex].Cells["pib_custmidboxcode"].Value = MidBoxBarCode;
-                        outboxcode1 = outboxcode1 + 1;
-                    }
-                }
-                else if (cu_print_midprod.Checked)
-                {
-                    if (LabelInf.Rows[CurrentRowIndex - 1].Cells["pr_orispeccode"].Value.ToString() != LabelInf.Rows[CurrentRowIndex].Cells["pd_custprodcode"].Value.ToString())
-                    {
-                        LogicHandler.GetBarCode(PI_ID, pd_id, 1, out MidBoxBarCode);
-                        LabelInf.Rows[CurrentRowIndex].Cells["pib_custmidboxcode"].Value = MidBoxBarCode;
-                        outboxcode1 = outboxcode1 + 1;
-                    }
-                }
-                else if (cu_print_midspec.Checked)
-                {
-                    if (LabelInf.Rows[CurrentRowIndex - 1].Cells["pd_custprodspec"].Value.ToString() != LabelInf.Rows[CurrentRowIndex].Cells["pd_custprodspec"].Value.ToString())
-                    {
-                        LogicHandler.GetBarCode(PI_ID, pd_id, 1, out MidBoxBarCode);
-                        LabelInf.Rows[CurrentRowIndex].Cells["pib_custmidboxcode"].Value = MidBoxBarCode;
-                        outboxcode1 = outboxcode1 + 1;
-                    }
-                }
-                else if (cu_print_middc.Checked)
-                {
-                    if (LabelInf.Rows[CurrentRowIndex - 1].Cells["pib_datecode"].Value.ToString() != LabelInf.Rows[CurrentRowIndex].Cells["pib_datecode"].Value.ToString())
-                    {
-                        LogicHandler.GetBarCode(PI_ID, pd_id, 1, out MidBoxBarCode);
-                        LabelInf.Rows[CurrentRowIndex].Cells["pib_custmidboxcode"].Value = MidBoxBarCode;
-                        outboxcode1 = outboxcode1 + 1;
-                    }
-                }
-                if (MidBoxBarCode == "")
-                {
-                    LogicHandler.GetBarCode(PI_ID, pd_id, 1, out MidBoxBarCode);
-                }
-                LabelInf.Rows[CurrentRowIndex].Cells["pib_custmidboxcode"].Value = MidBoxBarCode;
-            }
-            if (adh.getRowCount("prodiobarcode", "pib_inoutno='" + pi_inoutno.Text + "' and pib_outboxcode2=" + outboxcode2) >= OutBoxCapacity.Value)
-            {
-                outboxcode2 = outboxcode2 + 1;
-                LogicHandler.GetBarCode(PI_ID, pd_id, 1, out OutBoxBarCode);
-                LabelInf.Rows[CurrentRowIndex].Cells["pib_custoutboxcode"].Value = OutBoxBarCode;
-            }
-            else if (CurrentRowIndex - 1 >= 0)
-            {
-                //或者不符合合并条件中盒号+1
-                if (cu_print_outlotno.Checked)
-                {
-                    if (LabelInf.Rows[CurrentRowIndex - 1].Cells["pib_lotno"].Value.ToString() != LabelInf.Rows[CurrentRowIndex].Cells["pib_lotno"].Value.ToString())
-                    {
-                        LogicHandler.GetBarCode(PI_ID, pd_id, 1, out OutBoxBarCode);
-                        LabelInf.Rows[CurrentRowIndex].Cells["pib_custoutboxcode"].Value = OutBoxBarCode;
-                    }
-                }
-                else if (cu_print_outpo.Checked)
-                {
-                    if (LabelInf.Rows[CurrentRowIndex - 1].Cells["pd_pocode"].Value.ToString() != LabelInf.Rows[CurrentRowIndex].Cells["pd_pocode"].Value.ToString())
-                    {
-                        LogicHandler.GetBarCode(PI_ID, pd_id, 1, out OutBoxBarCode);
-                        LabelInf.Rows[CurrentRowIndex].Cells["pib_custoutboxcode"].Value = OutBoxBarCode;
-                    }
-                }
-                else if (cu_print_outprod.Checked)
-                {
-                    if (LabelInf.Rows[CurrentRowIndex - 1].Cells["pr_orispeccode"].Value.ToString() != LabelInf.Rows[CurrentRowIndex].Cells["pd_custprodcode"].Value.ToString())
-                    {
-                        LogicHandler.GetBarCode(PI_ID, pd_id, 1, out OutBoxBarCode);
-                        LabelInf.Rows[CurrentRowIndex].Cells["pib_custoutboxcode"].Value = OutBoxBarCode;
-                    }
-                }
-                else if (cu_print_outspec.Checked)
-                {
-                    if (LabelInf.Rows[CurrentRowIndex - 1].Cells["pd_custprodspec"].Value.ToString() != LabelInf.Rows[CurrentRowIndex].Cells["pd_custprodspec"].Value.ToString())
-                    {
-                        LogicHandler.GetBarCode(PI_ID, pd_id, 1, out OutBoxBarCode);
-                        LabelInf.Rows[CurrentRowIndex].Cells["pib_custoutboxcode"].Value = OutBoxBarCode;
-                    }
-                }
-                else if (cu_print_outdc.Checked)
-                {
-                    if (LabelInf.Rows[CurrentRowIndex - 1].Cells["pib_datecode"].Value.ToString() != LabelInf.Rows[CurrentRowIndex].Cells["pib_datecode"].Value.ToString())
-                    {
-                        LogicHandler.GetBarCode(PI_ID, pd_id, 1, out MidBoxBarCode);
-                        LabelInf.Rows[CurrentRowIndex].Cells["pib_custoutboxcode"].Value = OutBoxBarCode;
-                    }
-                }
-                if (OutBoxBarCode == "")
-                {
-                    LogicHandler.GetBarCode(PI_ID, pd_id, 1, out OutBoxBarCode);
-                }
-                LabelInf.Rows[CurrentRowIndex].Cells["pib_custoutboxcode"].Value = OutBoxBarCode;
-            }
-            LabelInf.Rows[CurrentRowIndex].Cells["pib_outboxcode1"].Value = outboxcode1;
-            LabelInf.Rows[CurrentRowIndex].Cells["pib_outboxcode2"].Value = outboxcode2;
-            adh.ExecuteSql("update prodiobarcode set pib_outboxcode2=" + outboxcode2 + ",pib_outboxcode1=" + outboxcode1 + ",pib_custoutboxcode='" + OutBoxBarCode + "',pib_custmidboxcode='" + MidBoxBarCode + "',pib_lotno='" + LotNo + "',pib_datecode='" + DateCode + "',pib_ifpick=-1 where pib_id=" + pib_id, "update");
-            LabelInf.Refresh();
             if (CurrentRowIndex + 1 < LabelInf.Rows.Count)
                 CurrentRowIndex = CurrentRowIndex + 1;
             RefreshProcessData();
@@ -1299,7 +1309,7 @@ namespace UAS_LabelMachine
                     sql.Append(dr1[0]["lp_sql"].ToString() + ",");
                 }
             }
-            DataTable dt = (DataTable)adh.ExecuteSql("select " + sql.ToString().Substring(0, sql.Length - 1) + " from prodiobarcode where pib_inoutno='" + pi_inoutno.Text + "' and pib_outboxcode1=" + "select " + sql.ToString().Substring(0, sql.Length - 1) + " from prodiobarcode where pib_inoutno='" + pi_inoutno.Text + "' and pib_outboxcode1=" + (pib_outboxcode1 == "" ? "0" : pib_outboxcode1), "select");
+            DataTable dt = (DataTable)adh.ExecuteSql("select " + sql.ToString().Substring(0, sql.Length - 1) + " from prodiobarcode where pib_inoutno='" + pi_inoutno.Text + "' and pib_outboxcode1=" + (pib_outboxcode1 == "" ? "0" : pib_outboxcode1), "select");
             for (int j = 0; j < MidDoc.Variables.FreeVariables.Count; j++)
             {
                 DataRow[] dr1 = MidLabelParam.Select("lp_name='" + MidDoc.Variables.FreeVariables.Item(j + 1).Name.ToLower() + "'");
@@ -1435,6 +1445,7 @@ namespace UAS_LabelMachine
                 sql.Append("pib_outboxcode2,nvl(pib_ifpick,0)pib_ifpick,nvl(pib_ifprint,0)pib_ifprint from prodiobarcode left join prodinout on pib_piid=pi_id left join prodiodetail on pib_piid=pd_piid and  ");
                 sql.Append("pd_pdno=pib_pdno and pd_prodcode=pib_prodcode left join product on pr_code=pib_prodcode left join sale on sa_code=pib_ordercode where pib_piid='" + PI_ID + "' order by to_number(pib_id))t");
                 LabelInfDataTable = (DataTable)dh.ExecuteSql(sql.ToString(), "select");
+                ShowDt = LabelInfDataTable;
                 //检验查询的字段和本地数据库字段是否匹配
                 adh.AddColumFromDataTable(LabelInfDataTable, "prodiobarcode");
                 //将数据保存在本地数据库
@@ -1870,7 +1881,7 @@ namespace UAS_LabelMachine
             string pib_id = LabelInf.Rows[CurrentRowIndex].Cells["pib_id1"].Value.ToString();
             int pib_pdno = int.Parse(LabelInf.Rows[CurrentRowIndex].Cells["pib_pdno"].Value.ToString());
             string ErrorMsg = "";
-            FrontCheckFunction("", out ErrorMsg);
+            FrontCheckFunction(pib_id, "", out ErrorMsg);
         }
 
         private void ButtonRecheckPass_Click(object sender, EventArgs e)
@@ -1970,5 +1981,13 @@ namespace UAS_LabelMachine
                 }
             }
         }
+
+        private void MessageLog_MouseUp(object sender, MouseEventArgs e)
+        {
+            if (e.Button == MouseButtons.Right)
+            {
+                LogMenu.Show(new Point(MessageLog.Location.X + 100, MessageLog.Location.Y + 20));
+            }
+        }
     }
 }

+ 6 - 3
UAS-出货标签管理(吉利通)/UAS_出货标签管理.resx

@@ -123,6 +123,9 @@
   <metadata name="RefreshDBConnect.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
     <value>17, 17</value>
   </metadata>
+  <metadata name="LogMenu.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>758, 18</value>
+  </metadata>
   <metadata name="pd_id.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>
@@ -172,13 +175,13 @@
     <value>True</value>
   </metadata>
   <metadata name="BackendCheck.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
-    <value>523, 20</value>
+    <value>644, 18</value>
   </metadata>
   <metadata name="FrontendCheck.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
-    <value>348, 19</value>
+    <value>503, 18</value>
   </metadata>
   <metadata name="PLC1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
-    <value>677, 18</value>
+    <value>781, 18</value>
   </metadata>
   <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
   <data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">