Browse Source

中盒打印指定行

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

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

@@ -781,14 +781,16 @@ namespace UAS_LabelMachine
                     }
                 }
                 //如果有选中行
-                if (SelectProdcode != "")
+                if (SelectRowIndex >=0)
                 {
                     MidOutBoxCode.Clear();
                     MidOutBoxCodeIndex.Clear();
                 }
+                SelectProdcode = LabelInf.Rows[SelectRowIndex].Cells["pib_prodcode"].Value.ToString();
+                SelectMidBoxCode = LabelInf.Rows[SelectRowIndex].Cells["pib_outboxcode1"].Value.ToString();
                 for (int i = 0; i < LabelInf.Rows.Count; i++)
                 {
-                    if (LabelInf.Rows[i].Cells["pib_prodcode"].Value.ToString() == SelectProdcode)
+                    if (LabelInf.Rows[i].Cells["pib_prodcode"].Value.ToString() == SelectProdcode&& LabelInf.Rows[i].Cells["pib_outboxcode1"].Value.ToString() == SelectMidBoxCode)
                     {
                         if (!MidOutBoxCode.Contains(int.Parse(LabelInf.Rows[i].Cells["pib_outboxcode1"].Value.ToString())))
                         {
@@ -1731,10 +1733,12 @@ namespace UAS_LabelMachine
             LoadPrcodeData();
         }
         string SelectProdcode = "";
+        string SelectMidBoxCode = "";
+        int SelectRowIndex=-1;
         private void LabelInf_CellClick(object sender, DataGridViewCellEventArgs e)
         {
             LabelInf.Rows[e.RowIndex].Selected = true;
-            SelectProdcode = LabelInf.Rows[e.RowIndex].Cells["pib_prodcode"].Value.ToString();
+            SelectRowIndex = e.RowIndex;
         }
     }
 }