Przeglądaj źródła

添加标签间隔功能

章政 5 lat temu
rodzic
commit
acb030e052

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

@@ -201,6 +201,7 @@
             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();
@@ -908,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(66, 126);
+            this.label18.Location = new System.Drawing.Point(65, 125);
             this.label18.Name = "label18";
             this.label18.Size = new System.Drawing.Size(13, 17);
             this.label18.TabIndex = 90;
@@ -942,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(66, 52);
+            this.label16.Location = new System.Drawing.Point(65, 51);
             this.label16.Name = "label16";
             this.label16.Size = new System.Drawing.Size(13, 17);
             this.label16.TabIndex = 87;
@@ -976,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(10, 92);
+            this.label12.Location = new System.Drawing.Point(9, 91);
             this.label12.Name = "label12";
             this.label12.Size = new System.Drawing.Size(56, 17);
             this.label12.TabIndex = 77;
@@ -986,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(10, 18);
+            this.label7.Location = new System.Drawing.Point(9, 17);
             this.label7.Name = "label7";
             this.label7.Size = new System.Drawing.Size(56, 17);
             this.label7.TabIndex = 76;
@@ -1039,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(58, 62);
+            this.Capacity.Location = new System.Drawing.Point(57, 61);
             this.Capacity.Name = "Capacity";
             this.Capacity.Size = new System.Drawing.Size(0, 17);
             this.Capacity.TabIndex = 75;
@@ -1048,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(58, 106);
+            this.Process_midboxcode.Location = new System.Drawing.Point(57, 105);
             this.Process_midboxcode.Name = "Process_midboxcode";
             this.Process_midboxcode.Size = new System.Drawing.Size(15, 17);
             this.Process_midboxcode.TabIndex = 74;
@@ -1058,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(58, 82);
+            this.Process_outboxcode.Location = new System.Drawing.Point(57, 81);
             this.Process_outboxcode.Name = "Process_outboxcode";
             this.Process_outboxcode.Size = new System.Drawing.Size(15, 17);
             this.Process_outboxcode.TabIndex = 73;
@@ -1069,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(92, 14);
+            this.TotalCount.Location = new System.Drawing.Point(91, 13);
             this.TotalCount.Name = "TotalCount";
             this.TotalCount.Size = new System.Drawing.Size(15, 17);
             this.TotalCount.TabIndex = 72;
@@ -1079,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(78, 14);
+            this.label17.Location = new System.Drawing.Point(77, 13);
             this.label17.Name = "label17";
             this.label17.Size = new System.Drawing.Size(13, 17);
             this.label17.TabIndex = 71;
@@ -1090,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(60, 14);
+            this.CollectedCount.Location = new System.Drawing.Point(59, 13);
             this.CollectedCount.Name = "CollectedCount";
             this.CollectedCount.Size = new System.Drawing.Size(15, 17);
             this.CollectedCount.TabIndex = 70;
@@ -1100,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(8, 84);
+            this.label14.Location = new System.Drawing.Point(7, 83);
             this.label14.Name = "label14";
             this.label14.Size = new System.Drawing.Size(32, 17);
             this.label14.TabIndex = 69;
@@ -1110,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(8, 106);
+            this.label11.Location = new System.Drawing.Point(7, 105);
             this.label11.Name = "label11";
             this.label11.Size = new System.Drawing.Size(32, 17);
             this.label11.TabIndex = 68;
@@ -1120,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(8, 42);
+            this.label13.Location = new System.Drawing.Point(7, 41);
             this.label13.Name = "label13";
             this.label13.Size = new System.Drawing.Size(44, 17);
             this.label13.TabIndex = 67;
@@ -1130,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(58, 42);
+            this.Installed.Location = new System.Drawing.Point(57, 41);
             this.Installed.Name = "Installed";
             this.Installed.Size = new System.Drawing.Size(0, 17);
             this.Installed.TabIndex = 66;
@@ -1139,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(8, 14);
+            this.Process.Location = new System.Drawing.Point(7, 13);
             this.Process.Name = "Process";
             this.Process.Size = new System.Drawing.Size(44, 17);
             this.Process.TabIndex = 65;
@@ -1500,6 +1501,7 @@
             // 
             // SingleLabel
             // 
+            this.SingleLabel.Controls.Add(this.LabelSpace);
             this.SingleLabel.Controls.Add(this.label8);
             this.SingleLabel.Controls.Add(this.SingleDocRefresh);
             this.SingleLabel.Controls.Add(this.SingleLabelPrinter);
@@ -1520,7 +1522,7 @@
             // 
             this.label8.AutoSize = true;
             this.label8.Font = new System.Drawing.Font("微软雅黑", 10F);
-            this.label8.Location = new System.Drawing.Point(4, 22);
+            this.label8.Location = new System.Drawing.Point(3, 21);
             this.label8.Name = "label8";
             this.label8.Size = new System.Drawing.Size(55, 20);
             this.label8.TabIndex = 116;
@@ -1529,7 +1531,7 @@
             // SingleDocRefresh
             // 
             this.SingleDocRefresh.AutoSize = true;
-            this.SingleDocRefresh.Location = new System.Drawing.Point(56, 22);
+            this.SingleDocRefresh.Location = new System.Drawing.Point(55, 21);
             this.SingleDocRefresh.Name = "SingleDocRefresh";
             this.SingleDocRefresh.Size = new System.Drawing.Size(42, 21);
             this.SingleDocRefresh.TabIndex = 89;
@@ -1551,7 +1553,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(37, 201);
+            this.SingleLabelPrint.Location = new System.Drawing.Point(80, 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);
@@ -1564,7 +1566,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(8, 108);
+            this.SingleLabelAutoPrint.Location = new System.Drawing.Point(7, 107);
             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);
@@ -1624,7 +1626,7 @@
             // 
             this.label9.AutoSize = true;
             this.label9.Font = new System.Drawing.Font("微软雅黑", 10F);
-            this.label9.Location = new System.Drawing.Point(4, 22);
+            this.label9.Location = new System.Drawing.Point(3, 21);
             this.label9.Name = "label9";
             this.label9.Size = new System.Drawing.Size(55, 20);
             this.label9.TabIndex = 117;
@@ -1633,7 +1635,7 @@
             // MidDocRefresh
             // 
             this.MidDocRefresh.AutoSize = true;
-            this.MidDocRefresh.Location = new System.Drawing.Point(58, 22);
+            this.MidDocRefresh.Location = new System.Drawing.Point(57, 21);
             this.MidDocRefresh.Name = "MidDocRefresh";
             this.MidDocRefresh.Size = new System.Drawing.Size(42, 21);
             this.MidDocRefresh.TabIndex = 90;
@@ -1658,7 +1660,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(4, 168);
+            this.label5.Location = new System.Drawing.Point(3, 167);
             this.label5.Name = "label5";
             this.label5.Size = new System.Drawing.Size(32, 17);
             this.label5.TabIndex = 50;
@@ -1668,7 +1670,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(4, 136);
+            this.label4.Location = new System.Drawing.Point(3, 135);
             this.label4.Name = "label4";
             this.label4.Size = new System.Drawing.Size(32, 17);
             this.label4.TabIndex = 49;
@@ -1688,7 +1690,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(100, 136);
+            this.label15.Location = new System.Drawing.Point(99, 135);
             this.label15.Name = "label15";
             this.label15.Size = new System.Drawing.Size(20, 17);
             this.label15.TabIndex = 40;
@@ -1720,7 +1722,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(8, 108);
+            this.MidLabelAutoPrint.Location = new System.Drawing.Point(7, 107);
             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);
@@ -1786,7 +1788,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(5, 64);
+            this.cu_print_ordercode.Location = new System.Drawing.Point(4, 63);
             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);
@@ -1798,7 +1800,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(5, 41);
+            this.cu_print_outpo.Location = new System.Drawing.Point(4, 40);
             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);
@@ -1810,7 +1812,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(5, 112);
+            this.cu_print_outdc.Location = new System.Drawing.Point(4, 111);
             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);
@@ -1822,7 +1824,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(5, 87);
+            this.cu_print_outlotno.Location = new System.Drawing.Point(4, 86);
             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);
@@ -1834,7 +1836,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(5, 16);
+            this.cu_print_outprod.Location = new System.Drawing.Point(4, 15);
             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);
@@ -1846,7 +1848,7 @@
             // 
             this.label19.AutoSize = true;
             this.label19.Font = new System.Drawing.Font("微软雅黑", 10F);
-            this.label19.Location = new System.Drawing.Point(2, 22);
+            this.label19.Location = new System.Drawing.Point(1, 21);
             this.label19.Name = "label19";
             this.label19.Size = new System.Drawing.Size(55, 20);
             this.label19.TabIndex = 118;
@@ -1855,7 +1857,7 @@
             // OutDocRefresh
             // 
             this.OutDocRefresh.AutoSize = true;
-            this.OutDocRefresh.Location = new System.Drawing.Point(56, 22);
+            this.OutDocRefresh.Location = new System.Drawing.Point(55, 21);
             this.OutDocRefresh.Name = "OutDocRefresh";
             this.OutDocRefresh.Size = new System.Drawing.Size(42, 21);
             this.OutDocRefresh.TabIndex = 91;
@@ -1866,7 +1868,7 @@
             // LogingOut
             // 
             this.LogingOut.AutoSize = true;
-            this.LogingOut.Location = new System.Drawing.Point(110, 12);
+            this.LogingOut.Location = new System.Drawing.Point(109, 11);
             this.LogingOut.Name = "LogingOut";
             this.LogingOut.Size = new System.Drawing.Size(42, 21);
             this.LogingOut.TabIndex = 77;
@@ -1903,7 +1905,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(89, 137);
+            this.label10.Location = new System.Drawing.Point(88, 136);
             this.label10.Name = "label10";
             this.label10.Size = new System.Drawing.Size(32, 17);
             this.label10.TabIndex = 90;
@@ -1913,7 +1915,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(89, 110);
+            this.label6.Location = new System.Drawing.Point(88, 109);
             this.label6.Name = "label6";
             this.label6.Size = new System.Drawing.Size(32, 17);
             this.label6.TabIndex = 87;
@@ -1960,7 +1962,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(7, 104);
+            this.OutBoxLabelAutoPrint.Location = new System.Drawing.Point(6, 103);
             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);
@@ -1981,6 +1983,19 @@
             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);
@@ -2232,5 +2247,6 @@
         private System.Windows.Forms.DataGridViewTextBoxColumn pib_outboxcode1;
         private System.Windows.Forms.DataGridViewTextBoxColumn pib_outboxcode2;
         private System.Windows.Forms.CheckBox cu_print_ordercode;
+        private System.Windows.Forms.CheckBox LabelSpace;
     }
 }

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

@@ -96,6 +96,7 @@ namespace UAS_LabelMachine
         /// BarTender引擎
         /// </summary>
         Engine engine;
+        LabelFormatDocument EmptyDoc;
         /// <summary>
         /// BarTender单盘
         /// </summary>
@@ -156,6 +157,10 @@ namespace UAS_LabelMachine
         public static DataTable Attach;
 
         public string PrintMethod = "CodeSoft";
+        /// <summary>
+        /// 用于记录外箱号和当前的箱号进行比对,判断当前行和上一行是否是同一个箱号,从而判断是否要打印空白页
+        /// </summary>
+        public string LastOutboxCode = "";
 
         public UAS_出货标签打印(string Master)
         {
@@ -246,6 +251,11 @@ namespace UAS_LabelMachine
             asc.controlAutoSize(this);
             string Code = dh.GetConfig("PrintMethod", "CodeOrBar").ToString();
             SystemInf.CheckDcAndLotNo = dh.GetConfig("PrintCheck", "CheckDcAndLotNo").ToString() == "" ? false : true;
+            if (dh.GetConfig("isSpeac", "LabelSpace").ToString() == "" ? false : true)
+            {
+                LabelSpace.Visible = true;
+                LabelSpace.Checked = true;
+            }
             if (Code == "")
             {
                 try
@@ -525,6 +535,7 @@ namespace UAS_LabelMachine
                             if (LabelInf.Rows[i].Cells["pib_outboxcode1"].Value.ToString() == LabelInf.Rows[CurrentRowIndex].Cells["pib_outboxcode1"].Value.ToString())
                             {
                                 string pibid = LabelInf.Rows[i].Cells["pib_id1"].Value.ToString();
+                                string outboxcode = LabelInf.Rows[i].Cells["pib_outboxcode2"].Value.ToString();
                                 dt.Rows[i]["pib_lotno"] = lotno;
                                 dt.Rows[i]["pib_datecode"] = datecode;
                                 dt.Rows[i]["pib_year"] = year;
@@ -538,7 +549,7 @@ namespace UAS_LabelMachine
                                 CurrentRowIndex = i;
                                 if (SingleLabelAutoPrint.Checked)
                                 {
-                                    AutoPrintSingleLabel(pibid);
+                                    AutoPrintSingleLabel(pibid, outboxcode);
                                 }
                                 if (MidLabelAutoPrint.Checked)
                                     AutoPrintMidLabel();
@@ -547,6 +558,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 = "";
                     }
                     else if (CollectionUnit.Text == "全部")
                     {
@@ -583,7 +595,8 @@ namespace UAS_LabelMachine
                         {
                             if (SingleLabelCombox.SelectedValue != null)
                             {
-                                AutoPrintSingleLabel(LabelInf.Rows[CurrentRowIndex].Cells["pib_id1"].Value.ToString());
+                                AutoPrintSingleLabel(LabelInf.Rows[CurrentRowIndex].Cells["pib_id1"].Value.ToString(), LabelInf.Rows[CurrentRowIndex].Cells["pib_outboxcode2"].Value.ToString());
+                                LastOutboxCode = "";
                             }
                             else
                             {
@@ -656,12 +669,31 @@ namespace UAS_LabelMachine
             }
         }
 
-        private void AutoPrintSingleLabel(string pib_id)
+        private void AutoPrintSingleLabel(string pib_id, string outboxcode)
         {
+            bool PrintBlankLabel = false;
             if (PrintMethod == "CodeSoft")
                 Print.CodeSoft.SinglePrint(SingleDoc, SingleLabelParam, pib_id);
             else
+            {
+                //第一箱不打印空标签
+                if (outboxcode != "" && LastOutboxCode == "")
+                {
+                    PrintBlankLabel = false;
+                }
+                //如果外箱不相等
+                else if (outboxcode != "" && LastOutboxCode != "" && outboxcode != LastOutboxCode)
+                {
+                    PrintBlankLabel = true;
+                }
+                LastOutboxCode = outboxcode;
+                //打印一张空白标签
+                if (LabelSpace.Checked && PrintBlankLabel)
+                {
+                    Print.BarTender.SinglePrint(EmptyDoc, SingleLabelParam, pib_id);
+                }
                 Print.BarTender.SinglePrint(SingleFormat, SingleLabelParam, pib_id);
+            }
             LabelInf.Rows[CurrentRowIndex].Cells["pib_ifprint"].Value = true;
             sdh.ExecuteSql("update prodiobarcode set pib_ifprint=-1 where pib_id='" + pib_id + "'", "update");
         }
@@ -1008,6 +1040,7 @@ namespace UAS_LabelMachine
                 {
                     SingleDoc = lbl.Documents.Open(ftpOperater.DownLoadTo + SingleLabelCombox.Text);
                     SingleDoc.Printer.SwitchTo(SingleLabelPrinter.Text);
+
                 }
                 else
                 {
@@ -1097,6 +1130,19 @@ namespace UAS_LabelMachine
                     OutFormat.PrintSetup.PrinterName = OutBoxPrinter.Text;
                 }
                 OutLabelParam = (DataTable)dh.ExecuteSql("select lp_name,lp_sql,lp_valuetype from label left join LABELPARAMETER on la_id= lp_laid where la_id=" + OutBoxCombox.SelectedValue.ToString().Split('#')[0], "select");
+            }
+            try
+            {
+                //打开空标签文件
+                if (EmptyDoc == null)
+                {
+                    EmptyDoc = engine.Documents.Open(ftpOperater.DownLoadTo + "empty.btw");
+                    EmptyDoc.PrintSetup.PrinterName = SingleLabelPrinter.Text;
+                }
+            }
+            catch (Exception)
+            {
+
             }
             //缓存外箱参数
             ComBoxClickChangeLabelDoc = true;
@@ -1222,7 +1268,8 @@ namespace UAS_LabelMachine
                         try
                         {
                             string pib_id = LabelInf.Rows[i].Cells["pib_id1"].Value.ToString();
-                            AutoPrintSingleLabel(pib_id);
+                            string outboxcode = LabelInf.Rows[i].Cells["pib_outboxcode2"].Value.ToString();
+                            AutoPrintSingleLabel(pib_id, outboxcode);
                             if (MidLabelAutoPrint.Checked)
                             {
                                 //判断当前行的盒号和下一行不相等或者已经是最后一行了
@@ -1244,6 +1291,7 @@ namespace UAS_LabelMachine
                         catch (Exception ex) { LogManager.DoLog(ex.Message); }
                     }
                 }
+                LastOutboxCode = "";
                 dh.BatchInsert("update prodiobarcode set pib_printdate=sysdate where pib_id=:pib_id", new string[] { "pib_id" }, SingleID.ToArray());
                 if (CheckedRowCount == 0)
                     MessageBox.Show("未勾选打印明细!");
@@ -1965,6 +2013,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;
                         }
                     }
                 }