Pārlūkot izejas kodu

添加外箱打印分割标签

章政 5 gadi atpakaļ
vecāks
revīzija
248022860a

+ 8 - 2
UAS-出货标签管理(贸易版)/PublicMethod/Print.cs

@@ -328,6 +328,12 @@ namespace UAS_LabelMachine.PublicMethod
 
             public static void OutPrint(LabelFormatDocument OutFormat, DataTable OutLabelParam, string pi_inoutno, string pib_id, string pib_outboxcode2, bool iCustProdCode, bool iCustPo, bool iDC, bool iLotNo, bool iOrderCode)
             {
+                if (pib_outboxcode2 == "-1")
+                {
+                    OutFormat.PrintSetup.IdenticalCopiesOfLabel = 1;
+                    OutFormat.Print();
+                    return;
+                }
                 StringBuilder sql = new StringBuilder();
                 sql.Clear();
                 for (int j = 0; j < OutFormat.SubStrings.Count; j++)
@@ -364,7 +370,7 @@ namespace UAS_LabelMachine.PublicMethod
                 {
                     GroupByCondition = " group by " + (GroupByCondition.Substring(0, GroupByCondition.Length - 1));
                 }
-                sql.Append("1,");
+                sql.Append("max(pib_id),");
                 DataTable dt = (DataTable)SystemInf.sdh.ExecuteSql("select " + sql.ToString().Substring(0, sql.Length - 1) + " from prodiobarcode where pib_inoutno='" + pi_inoutno + "' and pib_outboxcode2=" + (pib_outboxcode2 == "" ? "0" : pib_outboxcode2) + GroupByCondition, "select");
                 for (int m = 0; m < dt.Rows.Count; m++)
                 {
@@ -419,12 +425,12 @@ namespace UAS_LabelMachine.PublicMethod
                     try
                     {
                         OutFormat.PrintSetup.IdenticalCopiesOfLabel = 1;
+                        OutFormat.Print();
                     }
                     catch (Exception)
                     {
 
                     }
-                    OutFormat.Print();
                 }
             }
         }

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

@@ -163,6 +163,7 @@
             this.pib_outboxcode2 = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.pi_inoutno = new UAS_LabelMachine.CustomControl.BlurSearch();
             this.SingleLabel = new UAS_LabelMachine.CustomControl.GroupBoxWithBorder.GroupBoxWithBorder();
+            this.LabelSpace = new System.Windows.Forms.CheckBox();
             this.label8 = new System.Windows.Forms.Label();
             this.SingleDocRefresh = new System.Windows.Forms.LinkLabel();
             this.SingleLabelPrinter = new UAS_LabelMachine.CustomControl.PrinterCombox();
@@ -201,7 +202,6 @@
             this.OutBoxLabelPrint = new System.Windows.Forms.Button();
             this.OutBoxLabelAutoPrint = new System.Windows.Forms.CheckBox();
             this.OutBoxCombox = new System.Windows.Forms.ComboBox();
-            this.LabelSpace = new System.Windows.Forms.CheckBox();
             ((System.ComponentModel.ISupportInitialize)(this.Si_ItemDGV)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.MidSource)).BeginInit();
             this.Menu.SuspendLayout();
@@ -909,7 +909,7 @@
             // 
             this.label18.AutoSize = true;
             this.label18.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label18.Location = new System.Drawing.Point(65, 125);
+            this.label18.Location = new System.Drawing.Point(64, 124);
             this.label18.Name = "label18";
             this.label18.Size = new System.Drawing.Size(13, 17);
             this.label18.TabIndex = 90;
@@ -943,7 +943,7 @@
             // 
             this.label16.AutoSize = true;
             this.label16.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label16.Location = new System.Drawing.Point(65, 51);
+            this.label16.Location = new System.Drawing.Point(64, 50);
             this.label16.Name = "label16";
             this.label16.Size = new System.Drawing.Size(13, 17);
             this.label16.TabIndex = 87;
@@ -977,7 +977,7 @@
             // 
             this.label12.AutoSize = true;
             this.label12.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label12.Location = new System.Drawing.Point(9, 91);
+            this.label12.Location = new System.Drawing.Point(8, 90);
             this.label12.Name = "label12";
             this.label12.Size = new System.Drawing.Size(56, 17);
             this.label12.TabIndex = 77;
@@ -987,7 +987,7 @@
             // 
             this.label7.AutoSize = true;
             this.label7.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label7.Location = new System.Drawing.Point(9, 17);
+            this.label7.Location = new System.Drawing.Point(8, 16);
             this.label7.Name = "label7";
             this.label7.Size = new System.Drawing.Size(56, 17);
             this.label7.TabIndex = 76;
@@ -1040,7 +1040,7 @@
             // 
             this.Capacity.AutoSize = true;
             this.Capacity.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.Capacity.Location = new System.Drawing.Point(57, 61);
+            this.Capacity.Location = new System.Drawing.Point(56, 60);
             this.Capacity.Name = "Capacity";
             this.Capacity.Size = new System.Drawing.Size(0, 17);
             this.Capacity.TabIndex = 75;
@@ -1049,7 +1049,7 @@
             // 
             this.Process_midboxcode.AutoSize = true;
             this.Process_midboxcode.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.Process_midboxcode.Location = new System.Drawing.Point(57, 105);
+            this.Process_midboxcode.Location = new System.Drawing.Point(56, 104);
             this.Process_midboxcode.Name = "Process_midboxcode";
             this.Process_midboxcode.Size = new System.Drawing.Size(15, 17);
             this.Process_midboxcode.TabIndex = 74;
@@ -1059,7 +1059,7 @@
             // 
             this.Process_outboxcode.AutoSize = true;
             this.Process_outboxcode.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.Process_outboxcode.Location = new System.Drawing.Point(57, 81);
+            this.Process_outboxcode.Location = new System.Drawing.Point(56, 80);
             this.Process_outboxcode.Name = "Process_outboxcode";
             this.Process_outboxcode.Size = new System.Drawing.Size(15, 17);
             this.Process_outboxcode.TabIndex = 73;
@@ -1070,7 +1070,7 @@
             this.TotalCount.AutoSize = true;
             this.TotalCount.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.TotalCount.ForeColor = System.Drawing.Color.Blue;
-            this.TotalCount.Location = new System.Drawing.Point(91, 13);
+            this.TotalCount.Location = new System.Drawing.Point(90, 12);
             this.TotalCount.Name = "TotalCount";
             this.TotalCount.Size = new System.Drawing.Size(15, 17);
             this.TotalCount.TabIndex = 72;
@@ -1080,7 +1080,7 @@
             // 
             this.label17.AutoSize = true;
             this.label17.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label17.Location = new System.Drawing.Point(77, 13);
+            this.label17.Location = new System.Drawing.Point(76, 12);
             this.label17.Name = "label17";
             this.label17.Size = new System.Drawing.Size(13, 17);
             this.label17.TabIndex = 71;
@@ -1091,7 +1091,7 @@
             this.CollectedCount.AutoSize = true;
             this.CollectedCount.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.CollectedCount.ForeColor = System.Drawing.Color.Red;
-            this.CollectedCount.Location = new System.Drawing.Point(59, 13);
+            this.CollectedCount.Location = new System.Drawing.Point(58, 12);
             this.CollectedCount.Name = "CollectedCount";
             this.CollectedCount.Size = new System.Drawing.Size(15, 17);
             this.CollectedCount.TabIndex = 70;
@@ -1101,7 +1101,7 @@
             // 
             this.label14.AutoSize = true;
             this.label14.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label14.Location = new System.Drawing.Point(7, 83);
+            this.label14.Location = new System.Drawing.Point(6, 82);
             this.label14.Name = "label14";
             this.label14.Size = new System.Drawing.Size(32, 17);
             this.label14.TabIndex = 69;
@@ -1111,7 +1111,7 @@
             // 
             this.label11.AutoSize = true;
             this.label11.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label11.Location = new System.Drawing.Point(7, 105);
+            this.label11.Location = new System.Drawing.Point(6, 104);
             this.label11.Name = "label11";
             this.label11.Size = new System.Drawing.Size(32, 17);
             this.label11.TabIndex = 68;
@@ -1121,7 +1121,7 @@
             // 
             this.label13.AutoSize = true;
             this.label13.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label13.Location = new System.Drawing.Point(7, 41);
+            this.label13.Location = new System.Drawing.Point(6, 40);
             this.label13.Name = "label13";
             this.label13.Size = new System.Drawing.Size(44, 17);
             this.label13.TabIndex = 67;
@@ -1131,7 +1131,7 @@
             // 
             this.Installed.AutoSize = true;
             this.Installed.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.Installed.Location = new System.Drawing.Point(57, 41);
+            this.Installed.Location = new System.Drawing.Point(56, 40);
             this.Installed.Name = "Installed";
             this.Installed.Size = new System.Drawing.Size(0, 17);
             this.Installed.TabIndex = 66;
@@ -1140,7 +1140,7 @@
             // 
             this.Process.AutoSize = true;
             this.Process.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.Process.Location = new System.Drawing.Point(7, 13);
+            this.Process.Location = new System.Drawing.Point(6, 12);
             this.Process.Name = "Process";
             this.Process.Size = new System.Drawing.Size(44, 17);
             this.Process.TabIndex = 65;
@@ -1518,11 +1518,24 @@
             this.SingleLabel.TabStop = false;
             this.SingleLabel.Text = "单盘标签";
             // 
+            // LabelSpace
+            // 
+            this.LabelSpace.AutoSize = true;
+            this.LabelSpace.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.LabelSpace.Location = new System.Drawing.Point(5, 134);
+            this.LabelSpace.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
+            this.LabelSpace.Name = "LabelSpace";
+            this.LabelSpace.Size = new System.Drawing.Size(75, 21);
+            this.LabelSpace.TabIndex = 117;
+            this.LabelSpace.Text = "标签间隔";
+            this.LabelSpace.UseVisualStyleBackColor = true;
+            this.LabelSpace.Visible = false;
+            // 
             // label8
             // 
             this.label8.AutoSize = true;
             this.label8.Font = new System.Drawing.Font("微软雅黑", 10F);
-            this.label8.Location = new System.Drawing.Point(3, 21);
+            this.label8.Location = new System.Drawing.Point(2, 20);
             this.label8.Name = "label8";
             this.label8.Size = new System.Drawing.Size(55, 20);
             this.label8.TabIndex = 116;
@@ -1531,7 +1544,7 @@
             // SingleDocRefresh
             // 
             this.SingleDocRefresh.AutoSize = true;
-            this.SingleDocRefresh.Location = new System.Drawing.Point(55, 21);
+            this.SingleDocRefresh.Location = new System.Drawing.Point(54, 20);
             this.SingleDocRefresh.Name = "SingleDocRefresh";
             this.SingleDocRefresh.Size = new System.Drawing.Size(42, 21);
             this.SingleDocRefresh.TabIndex = 89;
@@ -1553,7 +1566,7 @@
             // 
             this.SingleLabelPrint.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
             this.SingleLabelPrint.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.SingleLabelPrint.Location = new System.Drawing.Point(80, 202);
+            this.SingleLabelPrint.Location = new System.Drawing.Point(70, 202);
             this.SingleLabelPrint.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.SingleLabelPrint.Name = "SingleLabelPrint";
             this.SingleLabelPrint.Size = new System.Drawing.Size(68, 26);
@@ -1566,7 +1579,7 @@
             // 
             this.SingleLabelAutoPrint.AutoSize = true;
             this.SingleLabelAutoPrint.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.SingleLabelAutoPrint.Location = new System.Drawing.Point(7, 107);
+            this.SingleLabelAutoPrint.Location = new System.Drawing.Point(6, 106);
             this.SingleLabelAutoPrint.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.SingleLabelAutoPrint.Name = "SingleLabelAutoPrint";
             this.SingleLabelAutoPrint.Size = new System.Drawing.Size(75, 21);
@@ -1626,7 +1639,7 @@
             // 
             this.label9.AutoSize = true;
             this.label9.Font = new System.Drawing.Font("微软雅黑", 10F);
-            this.label9.Location = new System.Drawing.Point(3, 21);
+            this.label9.Location = new System.Drawing.Point(2, 20);
             this.label9.Name = "label9";
             this.label9.Size = new System.Drawing.Size(55, 20);
             this.label9.TabIndex = 117;
@@ -1635,7 +1648,7 @@
             // MidDocRefresh
             // 
             this.MidDocRefresh.AutoSize = true;
-            this.MidDocRefresh.Location = new System.Drawing.Point(57, 21);
+            this.MidDocRefresh.Location = new System.Drawing.Point(56, 20);
             this.MidDocRefresh.Name = "MidDocRefresh";
             this.MidDocRefresh.Size = new System.Drawing.Size(42, 21);
             this.MidDocRefresh.TabIndex = 90;
@@ -1660,7 +1673,7 @@
             // 
             this.label5.AutoSize = true;
             this.label5.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label5.Location = new System.Drawing.Point(3, 167);
+            this.label5.Location = new System.Drawing.Point(2, 166);
             this.label5.Name = "label5";
             this.label5.Size = new System.Drawing.Size(32, 17);
             this.label5.TabIndex = 50;
@@ -1670,7 +1683,7 @@
             // 
             this.label4.AutoSize = true;
             this.label4.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label4.Location = new System.Drawing.Point(3, 135);
+            this.label4.Location = new System.Drawing.Point(2, 134);
             this.label4.Name = "label4";
             this.label4.Size = new System.Drawing.Size(32, 17);
             this.label4.TabIndex = 49;
@@ -1690,7 +1703,7 @@
             // 
             this.label15.AutoSize = true;
             this.label15.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label15.Location = new System.Drawing.Point(99, 135);
+            this.label15.Location = new System.Drawing.Point(98, 134);
             this.label15.Name = "label15";
             this.label15.Size = new System.Drawing.Size(20, 17);
             this.label15.TabIndex = 40;
@@ -1722,7 +1735,7 @@
             // 
             this.MidLabelAutoPrint.AutoSize = true;
             this.MidLabelAutoPrint.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.MidLabelAutoPrint.Location = new System.Drawing.Point(7, 107);
+            this.MidLabelAutoPrint.Location = new System.Drawing.Point(6, 106);
             this.MidLabelAutoPrint.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.MidLabelAutoPrint.Name = "MidLabelAutoPrint";
             this.MidLabelAutoPrint.Size = new System.Drawing.Size(75, 21);
@@ -1788,7 +1801,7 @@
             // 
             this.cu_print_ordercode.AutoSize = true;
             this.cu_print_ordercode.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.cu_print_ordercode.Location = new System.Drawing.Point(4, 63);
+            this.cu_print_ordercode.Location = new System.Drawing.Point(3, 62);
             this.cu_print_ordercode.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.cu_print_ordercode.Name = "cu_print_ordercode";
             this.cu_print_ordercode.Size = new System.Drawing.Size(75, 21);
@@ -1800,7 +1813,7 @@
             // 
             this.cu_print_outpo.AutoSize = true;
             this.cu_print_outpo.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.cu_print_outpo.Location = new System.Drawing.Point(4, 40);
+            this.cu_print_outpo.Location = new System.Drawing.Point(3, 39);
             this.cu_print_outpo.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.cu_print_outpo.Name = "cu_print_outpo";
             this.cu_print_outpo.Size = new System.Drawing.Size(75, 21);
@@ -1812,7 +1825,7 @@
             // 
             this.cu_print_outdc.AutoSize = true;
             this.cu_print_outdc.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.cu_print_outdc.Location = new System.Drawing.Point(4, 111);
+            this.cu_print_outdc.Location = new System.Drawing.Point(3, 110);
             this.cu_print_outdc.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.cu_print_outdc.Name = "cu_print_outdc";
             this.cu_print_outdc.Size = new System.Drawing.Size(44, 21);
@@ -1824,7 +1837,7 @@
             // 
             this.cu_print_outlotno.AutoSize = true;
             this.cu_print_outlotno.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.cu_print_outlotno.Location = new System.Drawing.Point(4, 86);
+            this.cu_print_outlotno.Location = new System.Drawing.Point(3, 85);
             this.cu_print_outlotno.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.cu_print_outlotno.Name = "cu_print_outlotno";
             this.cu_print_outlotno.Size = new System.Drawing.Size(63, 21);
@@ -1836,7 +1849,7 @@
             // 
             this.cu_print_outprod.AutoSize = true;
             this.cu_print_outprod.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.cu_print_outprod.Location = new System.Drawing.Point(4, 15);
+            this.cu_print_outprod.Location = new System.Drawing.Point(3, 14);
             this.cu_print_outprod.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.cu_print_outprod.Name = "cu_print_outprod";
             this.cu_print_outprod.Size = new System.Drawing.Size(75, 21);
@@ -1848,7 +1861,7 @@
             // 
             this.label19.AutoSize = true;
             this.label19.Font = new System.Drawing.Font("微软雅黑", 10F);
-            this.label19.Location = new System.Drawing.Point(1, 21);
+            this.label19.Location = new System.Drawing.Point(0, 20);
             this.label19.Name = "label19";
             this.label19.Size = new System.Drawing.Size(55, 20);
             this.label19.TabIndex = 118;
@@ -1857,7 +1870,7 @@
             // OutDocRefresh
             // 
             this.OutDocRefresh.AutoSize = true;
-            this.OutDocRefresh.Location = new System.Drawing.Point(55, 21);
+            this.OutDocRefresh.Location = new System.Drawing.Point(54, 20);
             this.OutDocRefresh.Name = "OutDocRefresh";
             this.OutDocRefresh.Size = new System.Drawing.Size(42, 21);
             this.OutDocRefresh.TabIndex = 91;
@@ -1868,7 +1881,7 @@
             // LogingOut
             // 
             this.LogingOut.AutoSize = true;
-            this.LogingOut.Location = new System.Drawing.Point(109, 11);
+            this.LogingOut.Location = new System.Drawing.Point(108, 10);
             this.LogingOut.Name = "LogingOut";
             this.LogingOut.Size = new System.Drawing.Size(42, 21);
             this.LogingOut.TabIndex = 77;
@@ -1905,7 +1918,7 @@
             // 
             this.label10.AutoSize = true;
             this.label10.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label10.Location = new System.Drawing.Point(88, 136);
+            this.label10.Location = new System.Drawing.Point(87, 135);
             this.label10.Name = "label10";
             this.label10.Size = new System.Drawing.Size(32, 17);
             this.label10.TabIndex = 90;
@@ -1915,7 +1928,7 @@
             // 
             this.label6.AutoSize = true;
             this.label6.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label6.Location = new System.Drawing.Point(88, 109);
+            this.label6.Location = new System.Drawing.Point(87, 108);
             this.label6.Name = "label6";
             this.label6.Size = new System.Drawing.Size(32, 17);
             this.label6.TabIndex = 87;
@@ -1962,7 +1975,7 @@
             // 
             this.OutBoxLabelAutoPrint.AutoSize = true;
             this.OutBoxLabelAutoPrint.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.OutBoxLabelAutoPrint.Location = new System.Drawing.Point(6, 103);
+            this.OutBoxLabelAutoPrint.Location = new System.Drawing.Point(5, 102);
             this.OutBoxLabelAutoPrint.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.OutBoxLabelAutoPrint.Name = "OutBoxLabelAutoPrint";
             this.OutBoxLabelAutoPrint.Size = new System.Drawing.Size(75, 21);
@@ -1983,19 +1996,6 @@
             this.OutBoxCombox.TabIndex = 78;
             this.OutBoxCombox.SelectedIndexChanged += new System.EventHandler(this.OutBoxCombox_SelectedIndexChanged);
             // 
-            // LabelSpace
-            // 
-            this.LabelSpace.AutoSize = true;
-            this.LabelSpace.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.LabelSpace.Location = new System.Drawing.Point(6, 135);
-            this.LabelSpace.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
-            this.LabelSpace.Name = "LabelSpace";
-            this.LabelSpace.Size = new System.Drawing.Size(75, 21);
-            this.LabelSpace.TabIndex = 117;
-            this.LabelSpace.Text = "标签间隔";
-            this.LabelSpace.UseVisualStyleBackColor = true;
-            this.LabelSpace.Visible = false;
-            // 
             // UAS_出货标签打印
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
@@ -2054,23 +2054,23 @@
             this.SizeChanged += new System.EventHandler(this.贴标机条码打印_SizeChanged);
             ((System.ComponentModel.ISupportInitialize)(this.Si_ItemDGV)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.MidSource)).EndInit();
-            this.Menu.ResumeLayout(true);
-            this.groupBoxWithBorder1.ResumeLayout(true);
+            this.Menu.ResumeLayout(false);
+            this.groupBoxWithBorder1.ResumeLayout(false);
             this.groupBoxWithBorder1.PerformLayout();
-            this.CollectionProcess.ResumeLayout(true);
+            this.CollectionProcess.ResumeLayout(false);
             this.CollectionProcess.PerformLayout();
             ((System.ComponentModel.ISupportInitialize)(this.LabelInf)).EndInit();
-            this.SingleLabel.ResumeLayout(true);
+            this.SingleLabel.ResumeLayout(false);
             this.SingleLabel.PerformLayout();
-            this.MidLabel.ResumeLayout(true);
+            this.MidLabel.ResumeLayout(false);
             this.MidLabel.PerformLayout();
             ((System.ComponentModel.ISupportInitialize)(this.MidBoxCapacity)).EndInit();
-            this.OutBoxLabel.ResumeLayout(true);
+            this.OutBoxLabel.ResumeLayout(false);
             this.OutBoxLabel.PerformLayout();
-            this.groupBoxWithBorder2.ResumeLayout(true);
+            this.groupBoxWithBorder2.ResumeLayout(false);
             this.groupBoxWithBorder2.PerformLayout();
             ((System.ComponentModel.ISupportInitialize)(this.OutboxCapacity)).EndInit();
-            this.ResumeLayout(true);
+            this.ResumeLayout(false);
             this.PerformLayout();
 
         }

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

@@ -96,7 +96,9 @@ namespace UAS_LabelMachine
         /// BarTender引擎
         /// </summary>
         Engine engine;
-        LabelFormatDocument EmptyDoc;
+        LabelFormatDocument EmptySingleFormat;
+
+        LabelFormatDocument EmptyOutFormat;
         /// <summary>
         /// BarTender单盘
         /// </summary>
@@ -160,7 +162,7 @@ namespace UAS_LabelMachine
         /// <summary>
         /// 用于记录外箱号和当前的箱号进行比对,判断当前行和上一行是否是同一个箱号,从而判断是否要打印空白页
         /// </summary>
-        public string LastOutboxCode = "";
+        public string Last_OutboxCode = "";
 
         public UAS_出货标签打印(string Master)
         {
@@ -558,7 +560,7 @@ namespace UAS_LabelMachine
                         }
                         pibid1.Append("1");
                         sdh.ExecuteSql("update prodiobarcode set pib_ifpick=-1,pib_lotno='" + lotno + "',pib_datecode='" + datecode + "',pib_year='" + year + "',pib_month='" + month + "',pib_day='" + day + "' where pib_id in (" + pibid1 + ")", "update");
-                        LastOutboxCode = "";
+                        Last_OutboxCode = "";
                     }
                     else if (CollectionUnit.Text == "全部")
                     {
@@ -596,7 +598,7 @@ namespace UAS_LabelMachine
                             if (SingleLabelCombox.SelectedValue != null)
                             {
                                 AutoPrintSingleLabel(LabelInf.Rows[CurrentRowIndex].Cells["pib_id1"].Value.ToString(), LabelInf.Rows[CurrentRowIndex].Cells["pib_outboxcode2"].Value.ToString());
-                                LastOutboxCode = "";
+                                Last_OutboxCode = "";
                             }
                             else
                             {
@@ -677,20 +679,20 @@ namespace UAS_LabelMachine
             else
             {
                 //第一箱不打印空标签
-                if (outboxcode != "" && LastOutboxCode == "")
+                if (outboxcode != "" && Last_OutboxCode == "")
                 {
                     PrintBlankLabel = false;
                 }
                 //如果外箱不相等
-                else if (outboxcode != "" && LastOutboxCode != "" && outboxcode != LastOutboxCode)
+                else if (outboxcode != "" && Last_OutboxCode != "" && outboxcode != Last_OutboxCode)
                 {
                     PrintBlankLabel = true;
                 }
-                LastOutboxCode = outboxcode;
+                Last_OutboxCode = outboxcode;
                 //打印一张空白标签
                 if (LabelSpace.Checked && PrintBlankLabel)
                 {
-                    Print.BarTender.SinglePrint(EmptyDoc, SingleLabelParam, pib_id);
+                    Print.BarTender.SinglePrint(EmptySingleFormat, SingleLabelParam, pib_id);
                 }
                 Print.BarTender.SinglePrint(SingleFormat, SingleLabelParam, pib_id);
             }
@@ -1134,10 +1136,15 @@ namespace UAS_LabelMachine
             try
             {
                 //打开空标签文件
-                if (EmptyDoc == null)
+                if (EmptySingleFormat == null)
+                {
+                    EmptySingleFormat = engine.Documents.Open("Empty.btw");
+                    EmptySingleFormat.PrintSetup.PrinterName = SingleLabelPrinter.Text;
+                }
+                if (EmptyOutFormat == null)
                 {
-                    EmptyDoc = engine.Documents.Open("Empty.btw");
-                    EmptyDoc.PrintSetup.PrinterName = SingleLabelPrinter.Text;
+                    EmptyOutFormat = engine.Documents.Open("Empty.btw");
+                    EmptyOutFormat.PrintSetup.PrinterName = OutBoxPrinter.Text;
                 }
             }
             catch (Exception)
@@ -1291,7 +1298,7 @@ namespace UAS_LabelMachine
                         catch (Exception ex) { LogManager.DoLog(ex.Message); }
                     }
                 }
-                LastOutboxCode = "";
+                Last_OutboxCode = "";
                 dh.BatchInsert("update prodiobarcode set pib_printdate=sysdate where pib_id=:pib_id", new string[] { "pib_id" }, SingleID.ToArray());
                 if (CheckedRowCount == 0)
                     MessageBox.Show("未勾选打印明细!");
@@ -1550,7 +1557,13 @@ namespace UAS_LabelMachine
             if (PrintMethod == "CodeSoft")
                 Print.CodeSoft.OutPrint(OutBoxDoc, OutLabelParam, pi_inoutno.Text, pib_id, pib_outboxcode2, cu_print_outprod.Checked, cu_print_outpo.Checked, cu_print_outdc.Checked, cu_print_outlotno.Checked, cu_print_ordercode.Checked);
             else
+            {
                 Print.BarTender.OutPrint(OutFormat, OutLabelParam, pi_inoutno.Text, pib_id, pib_outboxcode2, cu_print_outprod.Checked, cu_print_outpo.Checked, cu_print_outdc.Checked, cu_print_outlotno.Checked, cu_print_ordercode.Checked);
+                if (LabelSpace.Checked)
+                {
+                    Print.BarTender.OutPrint(EmptyOutFormat, OutLabelParam, pi_inoutno.Text, pib_id, "-1", cu_print_outprod.Checked, cu_print_outpo.Checked, cu_print_outdc.Checked, cu_print_outlotno.Checked, cu_print_ordercode.Checked);
+                }
+            }
         }
 
         private void CleanDetail_Click(object sender, EventArgs e)
@@ -2013,7 +2026,7 @@ namespace UAS_LabelMachine
                         {
                             SingleFormat = engine.Documents.Open(BaseUtil.GetLabelUrl(SingleLabelCombox.SelectedValue.ToString().Split('#')[1], SingleLabelCombox.Text, time));
                             SingleFormat.PrintSetup.PrinterName = SingleLabelPrinter.Text;
-                            EmptyDoc.PrintSetup.PrinterName= SingleLabelPrinter.Text;
+                            EmptySingleFormat.PrintSetup.PrinterName = SingleLabelPrinter.Text;
                         }
                     }
                 }
@@ -2082,6 +2095,7 @@ namespace UAS_LabelMachine
                         {
                             OutFormat = engine.Documents.Open(BaseUtil.GetLabelUrl(OutBoxCombox.SelectedValue.ToString().Split('#')[1], OutBoxCombox.Text, time));
                             OutFormat.PrintSetup.PrinterName = OutBoxPrinter.Text;
+                            EmptyOutFormat.PrintSetup.PrinterName = OutBoxPrinter.Text;
                         }
                     }
                 }