Pārlūkot izejas kodu

调整打印BUG

章政 6 gadi atpakaļ
vecāks
revīzija
4b01f2afbc

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

@@ -1024,6 +1024,7 @@
             this.LabelInf.TabIndex = 27;
             this.LabelInf.CellClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.LabelInf_CellClick);
             this.LabelInf.DataError += new System.Windows.Forms.DataGridViewDataErrorEventHandler(this.LabelInf_DataError);
+            this.LabelInf.SelectionChanged += new System.EventHandler(this.LabelInf_SelectionChanged);
             // 
             // Choose
             // 
@@ -1552,18 +1553,18 @@
             ((System.ComponentModel.ISupportInitialize)(this.MidSource)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.GridPrcode)).EndInit();
-            this.groupBoxWithBorder1.ResumeLayout(false);
+            this.groupBoxWithBorder1.ResumeLayout(true);
             this.groupBoxWithBorder1.PerformLayout();
             ((System.ComponentModel.ISupportInitialize)(this.LabelInf)).EndInit();
-            this.SingleLabel.ResumeLayout(false);
+            this.SingleLabel.ResumeLayout(true);
             this.SingleLabel.PerformLayout();
-            this.MidLabel.ResumeLayout(false);
+            this.MidLabel.ResumeLayout(true);
             this.MidLabel.PerformLayout();
             ((System.ComponentModel.ISupportInitialize)(this.MidboxCapacity)).EndInit();
-            this.OutBoxLabel.ResumeLayout(false);
+            this.OutBoxLabel.ResumeLayout(true);
             this.OutBoxLabel.PerformLayout();
             ((System.ComponentModel.ISupportInitialize)(this.OutboxCapacity)).EndInit();
-            this.ResumeLayout(false);
+            this.ResumeLayout(true);
             this.PerformLayout();
 
         }

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

@@ -799,7 +799,7 @@ namespace UAS_LabelMachine
                     SelectMidBoxCode = LabelInf.Rows[SelectRowIndex].Cells["pib_outboxcode1"].Value.ToString();
                     for (int i = SelectRowIndex; i >= 0; i--)
                     {
-                        if (LabelInf.Rows[i].Cells["pib_prodcode"].Value.ToString() == SelectProdcode)
+                        if (LabelInf.Rows[i].Cells["pib_prodcode"].Value.ToString() == SelectProdcode && SelectMidBoxCode == LabelInf.Rows[i].Cells["pib_outboxcode1"].Value.ToString())
                         {
                             if (!MidOutBoxCode.Contains(int.Parse(LabelInf.Rows[i].Cells["pib_outboxcode1"].Value.ToString())))
                             {
@@ -814,7 +814,7 @@ namespace UAS_LabelMachine
                     }
                     for (int i = SelectRowIndex; i < LabelInf.Rows.Count - 1; i++)
                     {
-                        if (LabelInf.Rows[i].Cells["pib_prodcode"].Value.ToString() == SelectProdcode)
+                        if (LabelInf.Rows[i].Cells["pib_prodcode"].Value.ToString() == SelectProdcode && SelectMidBoxCode == LabelInf.Rows[i].Cells["pib_outboxcode1"].Value.ToString())
                         {
                             if (!MidOutBoxCode.Contains(int.Parse(LabelInf.Rows[i].Cells["pib_outboxcode1"].Value.ToString())))
                             {
@@ -1087,7 +1087,8 @@ namespace UAS_LabelMachine
             sql.Append("pr_zxbzs,pr_unit,pib_barcode,pib_outboxcode1,pib_outboxcode2,nvl(pib_ifprint,0)pib_ifprint from prodiobarcode left join ");
             sql.Append("prodiodetail on pib_piid=pd_piid and pd_pdno=pib_pdno and pd_prodcode=pib_prodcode left join product on pr_code=pib_prodcode  ");
             sql.Append("left join sale on sa_code=pib_ordercode left join PRODJOINVENDDETAIL on pjd_brand =pd_brand and pjd_prodcode=pd_prodcode where pib_piid='" + PI_ID + "' ");
-            if (OutBoxNum.Text != "全部") {
+            if (OutBoxNum.Text != "全部")
+            {
                 sql.Append(" and pib_outboxcode2='" + OutBoxNum.Text + "' ");
             }
             sql.Append(" order by to_number(pib_outboxcode2),pib_id,pd_prodcode");
@@ -1096,6 +1097,7 @@ namespace UAS_LabelMachine
             if (LabelInf.Rows.Count > 0)
             {
                 LabelInf.FirstDisplayedScrollingRowIndex = LabelInf.Rows.Count - 1;
+                LabelInf.Rows[LabelInf.Rows.Count - 1].Selected = true;
             }
             double CollectNum = 0;
             double OutNum = 0;
@@ -1766,5 +1768,14 @@ namespace UAS_LabelMachine
         {
             LoadGridData(sender, e);
         }
+
+        private void LabelInf_SelectionChanged(object sender, EventArgs e)
+        {
+            DataGridViewSelectedRowCollection dsc = LabelInf.SelectedRows;
+            if (dsc.Count > 0)
+            {
+                SelectRowIndex = dsc[0].Index;
+            }
+        }
     }
 }