Browse Source

标签打印BUG修改

callm 4 years ago
parent
commit
c0a3e6200e

+ 1 - 0
UAS-出货标签管理(泽天)/UAS_出货标签管理.Designer.cs

@@ -1213,6 +1213,7 @@
             this.Weight.Name = "Weight";
             this.Weight.Size = new System.Drawing.Size(0, 104);
             this.Weight.TabIndex = 113;
+          
             // 
             // DCCheck
             // 

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

@@ -323,19 +323,33 @@ namespace UAS_LabelMachine
             //校验DateCode是否过期
             if (!CheckDateCode(Data["DATECODE"]))
             {
-                richTextAutoBottom1.AppendText("物料" + Data["PRCODE"] + "【DateCode】超出校验日期\n");
-                //Input.SelectAll();
                 if (ConnectToMachine)
+                {
+                    richTextAutoBottom1.AppendText("物料" + Data["PRCODE"] + "【DateCode】超出校验日期\n");
                     receiveClient.Client.Send(Encoding.ASCII.GetBytes(GetSendCode("ReadId1|,|NG|,|Y")));
-                return;
+                    return;
+                }
+                else
+                {
+                    string close = MessageBox.Show(this.ParentForm, "物料" + Data["PRCODE"] + "【DateCode】超出校验日期\n", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question).ToString();
+                    if (close.ToString() != "Yes")
+                        return;
+                }
             }
             if (Data["BRAND"] != CurrentBrand)
             {
-                richTextAutoBottom1.AppendText("当前采集【品牌" + Data["BRAND"] + "】不对应\n");
-                //Input.SelectAll();
                 if (ConnectToMachine)
+                {
+                    richTextAutoBottom1.AppendText("当前采集【品牌" + Data["BRAND"] + "】不对应\n");
                     receiveClient.Client.Send(Encoding.ASCII.GetBytes(GetSendCode("ReadId1|,|NG|,|Y")));
-                return;
+                    return;
+                }
+                else
+                {
+                    string close = MessageBox.Show(this.ParentForm, "当前采集【品牌" + Data["BRAND"] + "】不对应", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question).ToString();
+                    if (close.ToString() != "Yes")
+                        return;
+                }
             }
             int CodeCount = 0;
             //如果单位是KPCS则需要除1000
@@ -1206,6 +1220,10 @@ namespace UAS_LabelMachine
                 }
                 //名称相等的时候,取SQL进行值的查询
                 DataTable dt;
+                sql.Clear();
+                sql.Append("update prodiobarcode set pib_midboxweight='" + Weight.Text + "' where pib_inoutno='" + pi_inoutno.Text + "' ");
+                sql.Append("  and pib_outboxcode1 in(" + pib_outboxcode1 + ")");
+                dh.ExecuteSql(sql.ToString(), "update");
                 if (MidLabelAutoPrint.Checked)
                 {
                     if (CurrentRowOnly.Checked)
@@ -1242,6 +1260,7 @@ namespace UAS_LabelMachine
                 {
                     if (!MidLabelCombox.SelectedValue.ToString().Contains("System.Data.DataRowView"))
                         MidReport.Load(MidLabelCombox.SelectedValue.ToString());
+                 
                     for (int j = 0; j < MidReport.Parameters.Count; j++)
                     {
                         MidReport.SetParameterValue(MidReport.Parameters[j].Name, "");
@@ -1259,10 +1278,6 @@ namespace UAS_LabelMachine
                     MidReport.PrintSettings.Printer = MidLabelPrinter.Text;
                     MidReport.Print();
                     dh.UpdateByCondition("prodiobarcode", "pib_midifprint=-1", "pib_inoutno='" + pi_inoutno.Text + "' and pib_outboxcode1 in (" + pib_outboxcode1 + ")");
-                    sql.Clear();
-                    sql.Append("update prodiobarcode set pib_midboxweight='" + Weight.Text + "' where pib_inoutno='" + pi_inoutno.Text + "' ");
-                    sql.Append(" and pib_outboxcode2='" + OutBoxNum.Text + "' and pib_outboxcode1 in(" + pib_outboxcode1 + ")");
-                    dh.ExecuteSql(sql.ToString(), "update");
                     SelectRowIndex = -1;
                     LoadGridData(new object(), new EventArgs());
                     LogManager.DoCommandLog(pi_inoutno.Text, User.UserCode, "打印中盒" + pib_outboxcode1.Replace("'", ""), "打印成功");

+ 4 - 4
UAS-出货标签管理(贸易版)/UAS_出货标签管理.cs

@@ -2781,8 +2781,8 @@ namespace UAS_LabelMachine
             for (int i = 0; i < LabelInf.Rows.Count; i++)
             {
                 string midcapa = LabelInf.Rows[i].Cells["pr_midboxcapacity_user"].Value.ToString();
-                if (!(midcapa == "" || midcapa == "0"))
-                {
+                //if (!(midcapa == "" || midcapa == "0"))
+                //{
                     //如果出现值为空或者0默认界面上填写的值
                     MidBoxCapacity.Value = decimal.Parse((midcapa == "" || midcapa == "0") ? MidBoxCapacity.Value.ToString() : midcapa);
                     LabelInf.Rows[i].Cells["pib_outboxcode1"].Value = BoxCode;
@@ -2793,7 +2793,7 @@ namespace UAS_LabelMachine
                             BoxCode = BoxCode + 1;
                             innerboxcount = 1;
                         }
-                        else if (LabelInf.Rows[i].Cells["pib_prodcode"].Value.ToString() != LabelInf.Rows[i + 1].Cells["pib_prodcode"].Value.ToString())
+                        else if (LabelInf.Rows[i].Cells["pib_prodcode"].Value.ToString() != LabelInf.Rows[i + 1].Cells["pib_prodcode"].Value.ToString() || LabelInf.Rows[i].Cells["pib_outboxcode2"].Value.ToString() != LabelInf.Rows[i + 1].Cells["pib_outboxcode2"].Value.ToString())
                         {
                             BoxCode = BoxCode + 1;
                             innerboxcount = 1;
@@ -2803,7 +2803,7 @@ namespace UAS_LabelMachine
                             innerboxcount = innerboxcount + 1;
                         }
                     }
-                }
+                //}
             }
             sdh.BatchInsert("prodiobarcode", LabelInf.DataSource as DataTable);
             DataTable dt1 = (DataTable)sdh.ExecuteSql("select pib_id,pib_outboxcode1,pib_outboxcode2,pib_custmidboxcode,pib_custoutboxcode,pib_lotno,pib_datecode,pib_ifupload,pib_ifpick,pib_ifprint from prodiobarcode where pib_inoutno='" + pi_inoutno.Text + "' ", "select");