Ver código fonte

调整字体

章政 7 anos atrás
pai
commit
9c53f95f52

+ 1 - 1
UAS-出货标签管理(泽天)/CustomControl/DataGridViewWithSerialNum.cs

@@ -15,7 +15,7 @@ namespace UAS_LabelMachine.CustomControl
 
         protected override void OnRowPostPaint(DataGridViewRowPostPaintEventArgs e)
         {
-            e.Graphics.DrawString((e.RowIndex + 1).ToString(), e.InheritedRowStyle.Font, solidBrush, e.RowBounds.Location.X + 15, e.RowBounds.Location.Y + 5);
+            e.Graphics.DrawString((e.RowIndex + 1).ToString(), e.InheritedRowStyle.Font, solidBrush, e.RowBounds.Location.X + 5, e.RowBounds.Location.Y);
             base.OnRowPostPaint(e);
         }
 

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

@@ -29,6 +29,7 @@
         private void InitializeComponent()
         {
             this.components = new System.ComponentModel.Container();
+            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
             System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(UAS_出货标签打印));
             this.pi_inoutno_label = new System.Windows.Forms.Label();
             this.label24 = new System.Windows.Forms.Label();
@@ -738,6 +739,14 @@
             this.pr_spec1,
             this.pd_brand,
             this.pjd_zxbzs_user});
+            dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
+            dataGridViewCellStyle1.BackColor = System.Drawing.SystemColors.Window;
+            dataGridViewCellStyle1.Font = new System.Drawing.Font("微软雅黑", 12.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            dataGridViewCellStyle1.ForeColor = System.Drawing.SystemColors.ControlText;
+            dataGridViewCellStyle1.SelectionBackColor = System.Drawing.SystemColors.ControlDark;
+            dataGridViewCellStyle1.SelectionForeColor = System.Drawing.SystemColors.ControlText;
+            dataGridViewCellStyle1.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
+            this.GridPrcode.DefaultCellStyle = dataGridViewCellStyle1;
             this.GridPrcode.GridColor = System.Drawing.SystemColors.Control;
             this.GridPrcode.Location = new System.Drawing.Point(0, 222);
             this.GridPrcode.MultiSelect = false;
@@ -783,6 +792,7 @@
             this.pd_whcode.DataPropertyName = "pd_whcode";
             this.pd_whcode.HeaderText = "仓别";
             this.pd_whcode.Name = "pd_whcode";
+            this.pd_whcode.Visible = false;
             // 
             // CollectedNum
             // 
@@ -859,7 +869,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(61, 120);
+            this.label18.Location = new System.Drawing.Point(60, 119);
             this.label18.Name = "label18";
             this.label18.Size = new System.Drawing.Size(13, 17);
             this.label18.TabIndex = 90;
@@ -893,7 +903,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(60, 57);
+            this.label16.Location = new System.Drawing.Point(59, 56);
             this.label16.Name = "label16";
             this.label16.Size = new System.Drawing.Size(13, 17);
             this.label16.TabIndex = 87;
@@ -927,7 +937,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(3, 94);
+            this.label12.Location = new System.Drawing.Point(2, 93);
             this.label12.Name = "label12";
             this.label12.Size = new System.Drawing.Size(56, 17);
             this.label12.TabIndex = 77;
@@ -937,7 +947,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(3, 32);
+            this.label7.Location = new System.Drawing.Point(2, 31);
             this.label7.Name = "label7";
             this.label7.Size = new System.Drawing.Size(56, 17);
             this.label7.TabIndex = 76;
@@ -1207,7 +1217,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(85, 178);
+            this.SingleLabelPrint.Location = new System.Drawing.Point(56, 177);
             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);
@@ -1222,7 +1232,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(10, 97);
+            this.SingleLabelAutoPrint.Location = new System.Drawing.Point(9, 96);
             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);
@@ -1280,7 +1290,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(6, 118);
+            this.label2.Location = new System.Drawing.Point(5, 117);
             this.label2.Name = "label2";
             this.label2.Size = new System.Drawing.Size(32, 17);
             this.label2.TabIndex = 92;
@@ -1303,7 +1313,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(6, 151);
+            this.label5.Location = new System.Drawing.Point(5, 150);
             this.label5.Name = "label5";
             this.label5.Size = new System.Drawing.Size(32, 17);
             this.label5.TabIndex = 50;
@@ -1336,7 +1346,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(9, 94);
+            this.MidLabelAutoPrint.Location = new System.Drawing.Point(8, 93);
             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);
@@ -1379,7 +1389,7 @@
             // LogingOut
             // 
             this.LogingOut.AutoSize = true;
-            this.LogingOut.Location = new System.Drawing.Point(106, 7);
+            this.LogingOut.Location = new System.Drawing.Point(105, 6);
             this.LogingOut.Name = "LogingOut";
             this.LogingOut.Size = new System.Drawing.Size(42, 21);
             this.LogingOut.TabIndex = 77;
@@ -1405,7 +1415,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(10, 144);
+            this.label10.Location = new System.Drawing.Point(9, 143);
             this.label10.Name = "label10";
             this.label10.Size = new System.Drawing.Size(32, 17);
             this.label10.TabIndex = 90;
@@ -1415,7 +1425,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(10, 110);
+            this.label6.Location = new System.Drawing.Point(9, 109);
             this.label6.Name = "label6";
             this.label6.Size = new System.Drawing.Size(32, 17);
             this.label6.TabIndex = 87;
@@ -1521,18 +1531,18 @@
             ((System.ComponentModel.ISupportInitialize)(this.MidSource)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.GridPrcode)).EndInit();
-            this.groupBoxWithBorder1.ResumeLayout(true);
+            this.groupBoxWithBorder1.ResumeLayout(false);
             this.groupBoxWithBorder1.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();
             ((System.ComponentModel.ISupportInitialize)(this.OutboxCapacity)).EndInit();
-            this.ResumeLayout(true);
+            this.ResumeLayout(false);
             this.PerformLayout();
 
         }
@@ -1634,18 +1644,6 @@
         private System.Windows.Forms.Label pi_title;
         private System.Windows.Forms.Label label9;
         private System.Windows.Forms.Label ProcessCount;
-        private System.Windows.Forms.DataGridViewTextBoxColumn pd_pdno;
-        private System.Windows.Forms.DataGridViewTextBoxColumn pjd_id;
-        private System.Windows.Forms.DataGridViewTextBoxColumn pd_custprodcode1;
-        private System.Windows.Forms.DataGridViewTextBoxColumn pd_prodcode;
-        private System.Windows.Forms.DataGridViewTextBoxColumn pd_whcode;
-        private System.Windows.Forms.DataGridViewTextBoxColumn CollectedNum;
-        private System.Windows.Forms.DataGridViewTextBoxColumn UnCollectedNum;
-        private System.Windows.Forms.DataGridViewTextBoxColumn pd_outqty;
-        private System.Windows.Forms.DataGridViewTextBoxColumn pr_unit;
-        private System.Windows.Forms.DataGridViewTextBoxColumn pr_spec1;
-        private System.Windows.Forms.DataGridViewTextBoxColumn pd_brand;
-        private System.Windows.Forms.DataGridViewTextBoxColumn pjd_zxbzs_user;
         private System.Windows.Forms.DataGridViewCheckBoxColumn Choose;
         private System.Windows.Forms.DataGridViewCheckBoxColumn pib_ifprint;
         private System.Windows.Forms.DataGridViewTextBoxColumn pib_id1;
@@ -1666,5 +1664,17 @@
         private System.Windows.Forms.DataGridViewTextBoxColumn pr_spec;
         private System.Windows.Forms.DataGridViewTextBoxColumn pib_outboxcode1;
         private System.Windows.Forms.DataGridViewTextBoxColumn pib_outboxcode2;
+        private System.Windows.Forms.DataGridViewTextBoxColumn pd_pdno;
+        private System.Windows.Forms.DataGridViewTextBoxColumn pjd_id;
+        private System.Windows.Forms.DataGridViewTextBoxColumn pd_custprodcode1;
+        private System.Windows.Forms.DataGridViewTextBoxColumn pd_prodcode;
+        private System.Windows.Forms.DataGridViewTextBoxColumn pd_whcode;
+        private System.Windows.Forms.DataGridViewTextBoxColumn CollectedNum;
+        private System.Windows.Forms.DataGridViewTextBoxColumn UnCollectedNum;
+        private System.Windows.Forms.DataGridViewTextBoxColumn pd_outqty;
+        private System.Windows.Forms.DataGridViewTextBoxColumn pr_unit;
+        private System.Windows.Forms.DataGridViewTextBoxColumn pr_spec1;
+        private System.Windows.Forms.DataGridViewTextBoxColumn pd_brand;
+        private System.Windows.Forms.DataGridViewTextBoxColumn pjd_zxbzs_user;
     }
 }

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

@@ -406,7 +406,7 @@ namespace UAS_LabelMachine
                     OutBoxNum.Items.Add(io);
                 }
                 if (OutBoxNum.Items.Count > 2)
-                    OutBoxNum.SelectedIndex = 0;
+                    OutBoxNum.SelectedIndex = 2;
             }
         }
 
@@ -1071,15 +1071,21 @@ 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 + "' ");
+            sql.Append(" order by to_number(pib_outboxcode2),pib_id,pd_prodcode");
+            LabelInfDataTable = (DataTable)dh.ExecuteSql(sql.ToString(), "select");
             if (OutBoxNum.Text != "全部")
             {
-                sql.Append(" and pib_outboxcode2 ='" + OutBoxNum.Text + "' ");
+                BaseUtil.FillDgvWithDataTable(LabelInf, BaseUtil.filterDataTable(LabelInfDataTable, "  pib_outboxcode2='" + OutBoxNum.Text + "'"));
+            }
+            else
+            {
+                BaseUtil.FillDgvWithDataTable(LabelInf, LabelInfDataTable);
             }
-            sql.Append(" order by to_number(pib_outboxcode2),pib_id,pd_prodcode");
-            LabelInfDataTable = (DataTable)dh.ExecuteSql(sql.ToString(), "select");
-            BaseUtil.FillDgvWithDataTable(LabelInf, LabelInfDataTable);
             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;
             for (int i = 0; i < GridPrcode.Rows.Count; i++)
@@ -1369,7 +1375,7 @@ namespace UAS_LabelMachine
             if (OutBoxNum.Text == "新增" || OutBoxNum.Text == "")
             {
                 if (dt.Rows.Count > 0)
-                    OutBoxNum.SelectedIndex = 0;
+                    OutBoxNum.SelectedIndex = 2;
                 else
                     OutBoxNum.SelectedIndex = 0;
             }
@@ -1577,23 +1583,13 @@ namespace UAS_LabelMachine
             bool mouseOver = e.CellBounds.Contains(this.PointToClient(Cursor.Position));
             if (e.ColumnIndex > 0 && e.RowIndex >= 0)
             {
-                if (GridPrcode.Columns[e.ColumnIndex].Name == "pd_outqty")
-                {
-                    SolidBrush solidBrush = new SolidBrush(Color.FromArgb(51, 153, 255));
-                    e.Graphics.FillRectangle(mouseOver ? solidBrush : Brushes.LightSeaGreen, e.CellBounds);
-                    Rectangle border = e.CellBounds;
-                    border.Width -= 1;
-                    e.Graphics.DrawRectangle(Pens.White, border);
-                    e.PaintContent(e.CellBounds);
-                    e.Handled = true;
-                }
                 if (GridPrcode.Columns[e.ColumnIndex].Name == "UnCollectedNum")
                 {
                     SolidBrush solidBrush = new SolidBrush(Color.FromArgb(51, 153, 255));
-                    if (GridPrcode.Rows[e.RowIndex].Cells["UnCollectedNum"].Value.ToString() == "0.000")
-                        e.Graphics.FillRectangle(mouseOver ? solidBrush : Brushes.LightSeaGreen, e.CellBounds);
+                    if (GridPrcode.Rows[e.RowIndex].Cells["UnCollectedNum"].Value.ToString() != "0.000")
+                        e.Graphics.FillRectangle(mouseOver ? solidBrush : Brushes.DarkOliveGreen, e.CellBounds);
                     else
-                        e.Graphics.FillRectangle(mouseOver ? solidBrush : Brushes.Red, e.CellBounds);
+                        e.Graphics.FillRectangle(mouseOver ? solidBrush : Brushes.White, e.CellBounds);
                     Rectangle border = e.CellBounds;
                     border.Width -= 1;
                     e.Graphics.DrawRectangle(Pens.White, border);