Browse Source

添加中盒批量打印

章政 8 years ago
parent
commit
5a7fea5d8c

+ 0 - 1
UAS-出货标签管理/PublicMethod/DataHelper.cs

@@ -771,7 +771,6 @@ namespace UAS_LabelMachine
         /// <returns></returns>
         public object ExecuteSql(string SQL, string Type, params object[] names)
         {
-            Console.WriteLine(SQL);
             object result = null;
             command = new OracleCommand(SQL, connection);
             //用来拼接参数的

+ 23 - 2
UAS-出货标签管理/UAS_出货标签管理.cs

@@ -1477,9 +1477,30 @@ namespace UAS_LabelMachine
 
         private void MidBoxLabelPrint()
         {
+            //未输入内容打印全部中盒
             if (MidLabelNum.Text == "")
             {
-                MessageBox.Show("手动打印必须填写盒号");
+                MidBoxArgument.Clear();
+                MidBoxCacheData.Clear();
+                BaseUtil.CleanDataTable(MidBoxCacheData);
+                List<int> MidOutBoxCode = new List<int>();
+                string la_id = MidLabelCombox.SelectedValue.ToString().Split('#')[0];
+                for (int i = 0; i < LabelInf.Rows.Count; i++)
+                {
+                    if (!MidIDAndOutboxcode.ContainsValue(LabelInf.Rows[i].Cells["pib_outboxcode1"].Value.ToString()))
+                        MidIDAndOutboxcode.Add(LabelInf.Rows[i].Cells["pib_id1"].Value.ToString(), LabelInf.Rows[i].Cells["pib_outboxcode1"].Value.ToString());
+                    if (!MidOutBoxCode.Contains(int.Parse(LabelInf.Rows[i].Cells["pib_outboxcode1"].Value.ToString()))) {
+                        MidOutBoxCode.Add(int.Parse(LabelInf.Rows[i].Cells["pib_outboxcode1"].Value.ToString()));
+                    }
+                }
+                GetMidBoxData();
+                for (int i = 0; i < MidOutBoxCode.Count; i++)
+                {
+                    MidBoxCodePrint(la_id, MidOutBoxCode[i],"HanlePrint");
+                }
+                MidBoxArgument.Clear();
+                MidBoxCacheData.Clear();
+                BaseUtil.CleanDataTable(MidBoxCacheData);
                 return;
             }
             bool FindMidLabel = false;
@@ -2361,7 +2382,7 @@ namespace UAS_LabelMachine
 
         private void LabelInf_CellEndEdit(object sender, DataGridViewCellEventArgs e)
         {
-            if (LabelInf.Columns[e.ColumnIndex].Name == "pib_madein")
+            if (LabelInf.Columns[e.ColumnIndex].Name == "pib_madein" && CollectionUnit.Text == "盒")
             {
                 string madein = LabelInf.Rows[e.RowIndex].Cells["pib_madein"].Value.ToString();
                 string midbox = LabelInf.Rows[e.RowIndex].Cells["pib_outboxcode1"].Value.ToString();