Pārlūkot izejas kodu

添加是否自动新增箱号

callm 3 gadi atpakaļ
vecāks
revīzija
e0d6dc109b

+ 62 - 30
UAS-出货标签管理(泽天)/UAS_出货标签管理.Designer.cs

@@ -183,6 +183,7 @@
             this.SingleLabelAutoPrint = new System.Windows.Forms.CheckBox();
             this.SingleLabelCombox = new System.Windows.Forms.ComboBox();
             this.MidLabel = new UAS_LabelMachine.CustomControl.GroupBoxWithBorder.GroupBoxWithBorder();
+            this.AutoPrintMidBox = new System.Windows.Forms.CheckBox();
             this.CurrentRowOnly = new System.Windows.Forms.CheckBox();
             this.MidboxCapacity = new System.Windows.Forms.NumericUpDown();
             this.label2 = new System.Windows.Forms.Label();
@@ -193,6 +194,7 @@
             this.MidLabelAutoPrint = new System.Windows.Forms.CheckBox();
             this.MidLabelCombox = new System.Windows.Forms.ComboBox();
             this.OutBoxLabel = new UAS_LabelMachine.CustomControl.GroupBoxWithBorder.GroupBoxWithBorder();
+            this.AutoSetOutBox = new System.Windows.Forms.CheckBox();
             this.DiffDetno = new System.Windows.Forms.CheckBox();
             this.DiffCPN = new System.Windows.Forms.CheckBox();
             this.BoxCount = new System.Windows.Forms.Label();
@@ -991,7 +993,7 @@
             this.Weight.AutoSize = true;
             this.Weight.Font = new System.Drawing.Font("微软雅黑", 30F);
             this.Weight.ForeColor = System.Drawing.Color.Red;
-            this.Weight.Location = new System.Drawing.Point(28, 76);
+            this.Weight.Location = new System.Drawing.Point(31, 79);
             this.Weight.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.Weight.Name = "Weight";
             this.Weight.Size = new System.Drawing.Size(0, 104);
@@ -1235,7 +1237,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(128, 244);
+            this.label18.Location = new System.Drawing.Point(131, 247);
             this.label18.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.label18.Name = "label18";
             this.label18.Size = new System.Drawing.Size(24, 31);
@@ -1270,7 +1272,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(125, 117);
+            this.label16.Location = new System.Drawing.Point(128, 120);
             this.label16.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.label16.Name = "label16";
             this.label16.Size = new System.Drawing.Size(24, 31);
@@ -1305,7 +1307,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(28, 192);
+            this.label12.Location = new System.Drawing.Point(31, 195);
             this.label12.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.label12.Name = "label12";
             this.label12.Size = new System.Drawing.Size(110, 31);
@@ -1316,7 +1318,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(24, 68);
+            this.label7.Location = new System.Drawing.Point(27, 71);
             this.label7.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.label7.Name = "label7";
             this.label7.Size = new System.Drawing.Size(110, 31);
@@ -1663,7 +1665,7 @@
             // 
             this.label14.AutoSize = true;
             this.label14.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label14.Location = new System.Drawing.Point(28, 288);
+            this.label14.Location = new System.Drawing.Point(31, 291);
             this.label14.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.label14.Name = "label14";
             this.label14.Size = new System.Drawing.Size(155, 36);
@@ -1683,7 +1685,7 @@
             // 
             this.label13.AutoSize = true;
             this.label13.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label13.Location = new System.Drawing.Point(28, 232);
+            this.label13.Location = new System.Drawing.Point(31, 235);
             this.label13.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.label13.Name = "label13";
             this.label13.Size = new System.Drawing.Size(155, 36);
@@ -1713,7 +1715,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(-4, 352);
+            this.SingleLabelPrint.Location = new System.Drawing.Point(37, 358);
             this.SingleLabelPrint.Margin = new System.Windows.Forms.Padding(6, 4, 6, 4);
             this.SingleLabelPrint.Name = "SingleLabelPrint";
             this.SingleLabelPrint.Size = new System.Drawing.Size(136, 52);
@@ -1728,7 +1730,7 @@
             this.SingleLabelAutoPrint.Checked = true;
             this.SingleLabelAutoPrint.CheckState = System.Windows.Forms.CheckState.Checked;
             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(12, 178);
+            this.SingleLabelAutoPrint.Location = new System.Drawing.Point(15, 181);
             this.SingleLabelAutoPrint.Margin = new System.Windows.Forms.Padding(6, 4, 6, 4);
             this.SingleLabelAutoPrint.Name = "SingleLabelAutoPrint";
             this.SingleLabelAutoPrint.Size = new System.Drawing.Size(142, 35);
@@ -1750,6 +1752,7 @@
             // 
             // MidLabel
             // 
+            this.MidLabel.Controls.Add(this.AutoPrintMidBox);
             this.MidLabel.Controls.Add(this.CurrentRowOnly);
             this.MidLabel.Controls.Add(this.MidboxCapacity);
             this.MidLabel.Controls.Add(this.label2);
@@ -1769,13 +1772,27 @@
             this.MidLabel.TabStop = false;
             this.MidLabel.Text = "中盒标签";
             // 
+            // AutoPrintMidBox
+            // 
+            this.AutoPrintMidBox.AutoSize = true;
+            this.AutoPrintMidBox.Checked = true;
+            this.AutoPrintMidBox.CheckState = System.Windows.Forms.CheckState.Checked;
+            this.AutoPrintMidBox.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.AutoPrintMidBox.Location = new System.Drawing.Point(16, 368);
+            this.AutoPrintMidBox.Margin = new System.Windows.Forms.Padding(6, 4, 6, 4);
+            this.AutoPrintMidBox.Name = "AutoPrintMidBox";
+            this.AutoPrintMidBox.Size = new System.Drawing.Size(166, 35);
+            this.AutoPrintMidBox.TabIndex = 94;
+            this.AutoPrintMidBox.Text = "自动打中盒";
+            this.AutoPrintMidBox.UseVisualStyleBackColor = true;
+            // 
             // CurrentRowOnly
             // 
             this.CurrentRowOnly.AutoSize = true;
             this.CurrentRowOnly.Checked = true;
             this.CurrentRowOnly.CheckState = System.Windows.Forms.CheckState.Checked;
             this.CurrentRowOnly.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.CurrentRowOnly.Location = new System.Drawing.Point(166, 188);
+            this.CurrentRowOnly.Location = new System.Drawing.Point(169, 191);
             this.CurrentRowOnly.Margin = new System.Windows.Forms.Padding(6, 4, 6, 4);
             this.CurrentRowOnly.Name = "CurrentRowOnly";
             this.CurrentRowOnly.Size = new System.Drawing.Size(166, 35);
@@ -1801,7 +1818,7 @@
             // 
             this.label2.AutoSize = true;
             this.label2.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label2.Location = new System.Drawing.Point(28, 260);
+            this.label2.Location = new System.Drawing.Point(24, 247);
             this.label2.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.label2.Name = "label2";
             this.label2.Size = new System.Drawing.Size(62, 31);
@@ -1825,7 +1842,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(28, 324);
+            this.label5.Location = new System.Drawing.Point(24, 311);
             this.label5.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.label5.Name = "label5";
             this.label5.Size = new System.Drawing.Size(62, 31);
@@ -1859,7 +1876,7 @@
             this.MidLabelAutoPrint.Checked = true;
             this.MidLabelAutoPrint.CheckState = System.Windows.Forms.CheckState.Checked;
             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(12, 186);
+            this.MidLabelAutoPrint.Location = new System.Drawing.Point(15, 189);
             this.MidLabelAutoPrint.Margin = new System.Windows.Forms.Padding(6, 4, 6, 4);
             this.MidLabelAutoPrint.Name = "MidLabelAutoPrint";
             this.MidLabelAutoPrint.Size = new System.Drawing.Size(142, 35);
@@ -1881,6 +1898,7 @@
             // 
             // OutBoxLabel
             // 
+            this.OutBoxLabel.Controls.Add(this.AutoSetOutBox);
             this.OutBoxLabel.Controls.Add(this.DiffDetno);
             this.OutBoxLabel.Controls.Add(this.DiffCPN);
             this.OutBoxLabel.Controls.Add(this.BoxCount);
@@ -1907,11 +1925,23 @@
             this.OutBoxLabel.TabStop = false;
             this.OutBoxLabel.Text = "外箱标签";
             // 
+            // AutoSetOutBox
+            // 
+            this.AutoSetOutBox.AutoSize = true;
+            this.AutoSetOutBox.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.AutoSetOutBox.Location = new System.Drawing.Point(19, 225);
+            this.AutoSetOutBox.Margin = new System.Windows.Forms.Padding(6, 4, 6, 4);
+            this.AutoSetOutBox.Name = "AutoSetOutBox";
+            this.AutoSetOutBox.Size = new System.Drawing.Size(142, 35);
+            this.AutoSetOutBox.TabIndex = 100;
+            this.AutoSetOutBox.Text = "自动新增";
+            this.AutoSetOutBox.UseVisualStyleBackColor = true;
+            // 
             // DiffDetno
             // 
             this.DiffDetno.AutoSize = true;
             this.DiffDetno.Font = new System.Drawing.Font("微软雅黑", 8F);
-            this.DiffDetno.Location = new System.Drawing.Point(264, 392);
+            this.DiffDetno.Location = new System.Drawing.Point(267, 378);
             this.DiffDetno.Margin = new System.Windows.Forms.Padding(6, 4, 6, 4);
             this.DiffDetno.Name = "DiffDetno";
             this.DiffDetno.Size = new System.Drawing.Size(133, 34);
@@ -1923,7 +1953,7 @@
             // 
             this.DiffCPN.AutoSize = true;
             this.DiffCPN.Font = new System.Drawing.Font("微软雅黑", 8F);
-            this.DiffCPN.Location = new System.Drawing.Point(264, 348);
+            this.DiffCPN.Location = new System.Drawing.Point(267, 334);
             this.DiffCPN.Margin = new System.Windows.Forms.Padding(6, 4, 6, 4);
             this.DiffCPN.Name = "DiffCPN";
             this.DiffCPN.Size = new System.Drawing.Size(135, 34);
@@ -1935,7 +1965,7 @@
             // 
             this.BoxCount.AutoSize = true;
             this.BoxCount.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.BoxCount.Location = new System.Drawing.Point(276, 388);
+            this.BoxCount.Location = new System.Drawing.Point(279, 391);
             this.BoxCount.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.BoxCount.Name = "BoxCount";
             this.BoxCount.Size = new System.Drawing.Size(0, 31);
@@ -1945,7 +1975,7 @@
             // 
             this.DiffLotNo.AutoSize = true;
             this.DiffLotNo.Font = new System.Drawing.Font("微软雅黑", 8F);
-            this.DiffLotNo.Location = new System.Drawing.Point(264, 300);
+            this.DiffLotNo.Location = new System.Drawing.Point(267, 286);
             this.DiffLotNo.Margin = new System.Windows.Forms.Padding(6, 4, 6, 4);
             this.DiffLotNo.Name = "DiffLotNo";
             this.DiffLotNo.Size = new System.Drawing.Size(118, 34);
@@ -1957,7 +1987,7 @@
             // 
             this.DiffDC.AutoSize = true;
             this.DiffDC.Font = new System.Drawing.Font("微软雅黑", 8F);
-            this.DiffDC.Location = new System.Drawing.Point(264, 248);
+            this.DiffDC.Location = new System.Drawing.Point(267, 234);
             this.DiffDC.Margin = new System.Windows.Forms.Padding(6, 4, 6, 4);
             this.DiffDC.Name = "DiffDC";
             this.DiffDC.Size = new System.Drawing.Size(121, 34);
@@ -1969,7 +1999,7 @@
             // 
             this.OnlyOneRow.AutoSize = true;
             this.OnlyOneRow.Font = new System.Drawing.Font("微软雅黑", 8F);
-            this.OnlyOneRow.Location = new System.Drawing.Point(264, 200);
+            this.OnlyOneRow.Location = new System.Drawing.Point(267, 186);
             this.OnlyOneRow.Margin = new System.Windows.Forms.Padding(6, 4, 6, 4);
             this.OnlyOneRow.Name = "OnlyOneRow";
             this.OnlyOneRow.Size = new System.Drawing.Size(111, 34);
@@ -1981,18 +2011,18 @@
             // 
             this.AllLabel.AutoSize = true;
             this.AllLabel.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.AllLabel.Location = new System.Drawing.Point(30, 192);
+            this.AllLabel.Location = new System.Drawing.Point(19, 183);
             this.AllLabel.Margin = new System.Windows.Forms.Padding(6, 4, 6, 4);
             this.AllLabel.Name = "AllLabel";
-            this.AllLabel.Size = new System.Drawing.Size(190, 35);
+            this.AllLabel.Size = new System.Drawing.Size(142, 35);
             this.AllLabel.TabIndex = 93;
-            this.AllLabel.Text = "打印所有标签";
+            this.AllLabel.Text = "打印全部";
             this.AllLabel.UseVisualStyleBackColor = true;
             // 
             // AddNewOutBox
             // 
             this.AddNewOutBox.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.AddNewOutBox.Location = new System.Drawing.Point(18, 354);
+            this.AddNewOutBox.Location = new System.Drawing.Point(18, 360);
             this.AddNewOutBox.Margin = new System.Windows.Forms.Padding(6, 4, 6, 4);
             this.AddNewOutBox.Name = "AddNewOutBox";
             this.AddNewOutBox.Size = new System.Drawing.Size(102, 52);
@@ -2004,7 +2034,7 @@
             // LogingOut
             // 
             this.LogingOut.AutoSize = true;
-            this.LogingOut.Location = new System.Drawing.Point(240, 28);
+            this.LogingOut.Location = new System.Drawing.Point(243, 31);
             this.LogingOut.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.LogingOut.Name = "LogingOut";
             this.LogingOut.Size = new System.Drawing.Size(82, 41);
@@ -2019,7 +2049,7 @@
             this.OutBoxNum.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.OutBoxNum.Items.AddRange(new object[] {
             "新增"});
-            this.OutBoxNum.Location = new System.Drawing.Point(122, 298);
+            this.OutBoxNum.Location = new System.Drawing.Point(122, 314);
             this.OutBoxNum.Margin = new System.Windows.Forms.Padding(6, 4, 6, 4);
             this.OutBoxNum.Name = "OutBoxNum";
             this.OutBoxNum.Size = new System.Drawing.Size(100, 39);
@@ -2032,7 +2062,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(44, 320);
+            this.label10.Location = new System.Drawing.Point(39, 321);
             this.label10.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.label10.Name = "label10";
             this.label10.Size = new System.Drawing.Size(62, 31);
@@ -2043,7 +2073,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(44, 260);
+            this.label6.Location = new System.Drawing.Point(39, 272);
             this.label6.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.label6.Name = "label6";
             this.label6.Size = new System.Drawing.Size(62, 31);
@@ -2062,7 +2092,7 @@
             // OutboxCapacity
             // 
             this.OutboxCapacity.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.OutboxCapacity.Location = new System.Drawing.Point(122, 240);
+            this.OutboxCapacity.Location = new System.Drawing.Point(122, 267);
             this.OutboxCapacity.Margin = new System.Windows.Forms.Padding(6, 4, 6, 4);
             this.OutboxCapacity.Name = "OutboxCapacity";
             this.OutboxCapacity.Size = new System.Drawing.Size(100, 39);
@@ -2077,7 +2107,7 @@
             // OutBoxLabelPrint
             // 
             this.OutBoxLabelPrint.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.OutBoxLabelPrint.Location = new System.Drawing.Point(114, 356);
+            this.OutBoxLabelPrint.Location = new System.Drawing.Point(114, 362);
             this.OutBoxLabelPrint.Margin = new System.Windows.Forms.Padding(6, 4, 6, 4);
             this.OutBoxLabelPrint.Name = "OutBoxLabelPrint";
             this.OutBoxLabelPrint.Size = new System.Drawing.Size(134, 52);
@@ -2103,7 +2133,7 @@
             this.AutoScaleDimensions = new System.Drawing.SizeF(12F, 24F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(229)))), ((int)(((byte)(233)))), ((int)(((byte)(206)))));
-            this.ClientSize = new System.Drawing.Size(1924, 1062);
+            this.ClientSize = new System.Drawing.Size(2493, 1062);
             this.Controls.Add(this.MixPrCode);
             this.Controls.Add(this.richTextAutoBottom1);
             this.Controls.Add(this.Connect);
@@ -2364,5 +2394,7 @@
         private System.Windows.Forms.CheckBox MixPrCode;
         private System.Windows.Forms.Label label14;
         private System.Windows.Forms.NumericUpDown CurrentOutBoxNum;
+        private System.Windows.Forms.CheckBox AutoPrintMidBox;
+        private System.Windows.Forms.CheckBox AutoSetOutBox;
     }
 }

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

@@ -384,7 +384,7 @@ namespace UAS_LabelMachine
             string pib_outboxcode2 = "";
 
             int BoxNum = LabelInfDataTable.Select("pib_outboxcode2='" + OutBoxNum.Text + "'").Length;
-            if (BoxNum + CodeCount > OutboxCapacity.Value)
+            if (BoxNum + CodeCount > OutboxCapacity.Value && AutoSetOutBox.Checked)
             {
                 string maxoutbox = dh.getFieldDataByCondition("prodiobarcode", "max(to_number(pib_outboxcode2))", "pib_inoutno='" + pi_inoutno.Text + "'").ToString();
                 //如果没有则从开始插入
@@ -574,10 +574,17 @@ namespace UAS_LabelMachine
             {
                 dh.UpdateByCondition("prodinout", "pi_user_packingstatus='Packed'", "pi_inoutno='" + pi_inoutno.Text + "'");
             }
-
+            if (CollectQty / double.Parse(CurrentZXBZ) % double.Parse(MidboxCapacity.Value.ToString()) == 0)
+            {
+                LabelInf.Rows[LabelInf.Rows.Count - 1].Selected = true;
+                if (AutoPrintMidBox.Checked)
+                    MidLabelPrint.PerformClick();
+            }
             //采集达到了数量进行换行
             if (CollectQty == double.Parse(CurrentPrCount))
             {
+                if (AutoPrintMidBox.Checked && (CollectQty / double.Parse(CurrentZXBZ) % double.Parse(MidboxCapacity.Value.ToString()) != 0))
+                    MidLabelPrint.PerformClick();
                 //需要换行,当前最后一盒
                 DataGridViewSelectedRowCollection selectrow = GridPrcode.SelectedRows;
                 if (selectrow.Count > 0)
@@ -1944,7 +1951,7 @@ namespace UAS_LabelMachine
             if (GridPrcode.SelectedRows.Count > 0)
             {
                 DataGridViewSelectedRowCollection dsc = GridPrcode.SelectedRows;
-                //MachineCollectRowIndex = GridPrcode.SelectedRows[0].Index;
+                MachineCollectRowIndex = GridPrcode.SelectedRows[0].Index;
                 CurrentPrCode = GridPrcode.Rows[dsc[0].Index].Cells["pd_prodcode"].Value.ToString();
                 CurrentZXBZ = GridPrcode.Rows[dsc[0].Index].Cells["pjd_zxbzs_user"].Value.ToString();
                 CurrentUnit = GridPrcode.Rows[dsc[0].Index].Cells["pr_unit"].Value.ToString();
@@ -2316,6 +2323,13 @@ namespace UAS_LabelMachine
                     MessageBox.Show("外箱号" + OutBoxNum1 + "尚未打印标签");
                 }
             OutBoxNum1 = OutBoxNum.Text;
+            if (OutBoxNum1 == "新增")
+            {
+                PassSixTenCount = 1;
+                PassTenCount = 1;
+                CurrentBoxNum.Value = 0;
+                CurrentOutBoxNum.Value = 0;
+            }
         }
 
         private void Reset_Click(object sender, EventArgs e)
@@ -2704,7 +2718,8 @@ namespace UAS_LabelMachine
                             double zxbzs = double.Parse(GridPrcode.Rows[i].Cells["PJD_ZXBZS_USER"].Value.ToString());
                             string Prcode = GridPrcode.Rows[i].Cells["pd_prodcode"].Value.ToString();
                             string pdno = GridPrcode.Rows[i].Cells["pd_pdno"].Value.ToString();
-                            if ((pr_code == Prcode || pr_code == "") && checknum < outqty / zxbzs)
+                            string SelectPrCode = GridPrcode.Rows[MachineCollectRowIndex].Cells["pd_prodcode"].Value.ToString();
+                            if ((MachineCollectRowIndex == i && SelectPrCode == pr_code) || ((pr_code == Prcode || pr_code == "") && SelectPrCode != pr_code) && checknum < outqty / zxbzs)
                             {
                                 checknum = checknum + 1;
                                 GridPrcode.Rows[i].Cells["checknum"].Value = checknum;