Browse Source

处理中盒封盒号和尾盒打印

章政 7 years ago
parent
commit
8db1b91ff2
1 changed files with 17 additions and 14 deletions
  1. 17 14
      UAS-出货标签管理(泽天)/UAS_出货标签管理.cs

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

@@ -767,14 +767,6 @@ namespace UAS_LabelMachine
                 {
                     try
                     {
-                        if (!MidLabelAutoPrint.Checked)
-                        {
-                            DataTable dt = (DataTable)dh.ExecuteSql("select pib_id from prodiobarcode where pib_inoutno='" + pi_inoutno.Text + "' and pib_outboxcode1='" + MidOutBoxCodeIndex[i] + "'", "select");
-                            if (dt.Rows.Count < 10)
-                            {
-                                continue;
-                            }
-                        }
                         MidBoxCodePrint(la_id, MidOutBoxCodeIndex[i]);
                     }
                     catch (Exception e)
@@ -909,12 +901,23 @@ namespace UAS_LabelMachine
                 //名称相等的时候,取SQL进行值的查询
                 string pib_id = LabelInf.Rows[rowindex].Cells["pib_id1"].Value.ToString();
                 string pib_outboxcode1 = LabelInf.Rows[rowindex].Cells["pib_outboxcode1"].Value.ToString();
-                DataTable dt = (DataTable)dh.ExecuteSql("select * from prodiomidinfo_view where 出货单号='" + pi_inoutno.Text + "' and 中盒号='" + pib_outboxcode1 + "'", "select");
-                MidReport.RegisterData(dt, "prodiomidinfo_view");
-                MidReport.GetDataSource("prodiomidinfo_view").Enabled = true;
-                MidReport.PrintSettings.ShowDialog = false;
-                MidReport.PrintSettings.Printer = MidLabelPrinter.Text;
-                MidReport.Print();
+                DataTable dt;
+                if (MidLabelAutoPrint.Checked)
+                {
+                    dt = (DataTable)dh.ExecuteSql("select * from prodiomidinfo_view where 出货单号='" + pi_inoutno.Text + "' and 中盒号='" + pib_outboxcode1 + "'", "select");
+                }
+                else
+                {
+                    dt = (DataTable)dh.ExecuteSql("select * from prodiomidinfo_view where 出货单号='" + pi_inoutno.Text + "' and 中盒号='" + pib_outboxcode1 + "' and 中盒数量=10", "select");
+                }
+                if (dt.Rows.Count > 0)
+                {
+                    MidReport.RegisterData(dt, "prodiomidinfo_view");
+                    MidReport.GetDataSource("prodiomidinfo_view").Enabled = true;
+                    MidReport.PrintSettings.ShowDialog = false;
+                    MidReport.PrintSettings.Printer = MidLabelPrinter.Text;
+                    MidReport.Print();
+                }
                 Properties.Settings.Default.MPrinter = MidLabelPrinter.Text;
                 Properties.Settings.Default.Save();
             }