diff --git a/ButcherFactory.Form/CarcassSaleOut_/CarcassSaleOutForm.cs b/ButcherFactory.Form/CarcassSaleOut_/CarcassSaleOutForm.cs index 64a4822..a96ee70 100644 --- a/ButcherFactory.Form/CarcassSaleOut_/CarcassSaleOutForm.cs +++ b/ButcherFactory.Form/CarcassSaleOut_/CarcassSaleOutForm.cs @@ -20,8 +20,9 @@ namespace ButcherFactory.CarcassSaleOut_ { #region IWithRoleForm public List RoleName - { - get { return new List { (short)设备类别.白条发货 }; } + { + // get { return new List { (short)设备类别.白条发货 }; } + get { return new List { 150 }; } } public Form Generate() diff --git a/ButcherFactory.Form/SegmentProductionAuto_/ViewTaskForm.Designer.cs b/ButcherFactory.Form/SegmentProductionAuto_/ViewTaskForm.Designer.cs index eac34c5..34cdeda 100644 --- a/ButcherFactory.Form/SegmentProductionAuto_/ViewTaskForm.Designer.cs +++ b/ButcherFactory.Form/SegmentProductionAuto_/ViewTaskForm.Designer.cs @@ -56,11 +56,10 @@ this.closeBtn.ClickColor = System.Drawing.Color.YellowGreen; this.closeBtn.Font = new System.Drawing.Font("宋体", 15F); this.closeBtn.ForeColor = System.Drawing.Color.White; - this.closeBtn.Location = new System.Drawing.Point(1560, 14); - this.closeBtn.Margin = new System.Windows.Forms.Padding(6, 6, 6, 6); + this.closeBtn.Location = new System.Drawing.Point(803, 7); this.closeBtn.Name = "closeBtn"; this.closeBtn.PlaySound = false; - this.closeBtn.Size = new System.Drawing.Size(180, 90); + this.closeBtn.Size = new System.Drawing.Size(90, 45); this.closeBtn.SoundType = WinFormControl.SoundType.Click; this.closeBtn.TabIndex = 13; this.closeBtn.Text = "关闭"; @@ -95,8 +94,7 @@ this.I_OrderWeight, this.I_FinishWeight, this.I_LastWeight}); - this.taskGrid.Location = new System.Drawing.Point(24, 116); - this.taskGrid.Margin = new System.Windows.Forms.Padding(6, 6, 6, 6); + this.taskGrid.Location = new System.Drawing.Point(12, 58); this.taskGrid.MultiSelect = false; this.taskGrid.Name = "taskGrid"; this.taskGrid.ReadOnly = true; @@ -106,7 +104,7 @@ this.taskGrid.RowsDefaultCellStyle = dataGridViewCellStyle9; this.taskGrid.RowTemplate.Height = 23; this.taskGrid.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; - this.taskGrid.Size = new System.Drawing.Size(1716, 1078); + this.taskGrid.Size = new System.Drawing.Size(881, 533); this.taskGrid.TabIndex = 12; // // I_Goods_Name @@ -174,12 +172,11 @@ // // ViewTaskForm // - this.AutoScaleDimensions = new System.Drawing.SizeF(12F, 24F); + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(1764, 1208); + this.ClientSize = new System.Drawing.Size(905, 603); this.Controls.Add(this.closeBtn); this.Controls.Add(this.taskGrid); - this.Margin = new System.Windows.Forms.Padding(6, 6, 6, 6); this.Name = "ViewTaskForm"; this.Text = "任务完工情况"; ((System.ComponentModel.ISupportInitialize)(this.taskGrid)).EndInit(); diff --git a/ButcherFactory.Form/SegmentProductionAuto_/ViewTaskForm.cs b/ButcherFactory.Form/SegmentProductionAuto_/ViewTaskForm.cs index 582588d..f5ee2ae 100644 --- a/ButcherFactory.Form/SegmentProductionAuto_/ViewTaskForm.cs +++ b/ButcherFactory.Form/SegmentProductionAuto_/ViewTaskForm.cs @@ -23,14 +23,56 @@ namespace ButcherFactory.SegmentProductionAuto_ InitializeComponent(); mDate = date; mBatchId = batchId; - mGoods = goods; - } - + mGoods = goods; + + taskGrid.RowPrePaint += uDataGridView1_RowPrePaint; + taskGrid.CellPainting += uDataGridView1_CellPainting; + } + + private void uDataGridView1_RowPrePaint(object sender, DataGridViewRowPrePaintEventArgs e) + { + if (e.RowIndex == taskGrid.Rows.Count - 1) + { + var row = taskGrid.Rows[e.RowIndex]; + row.DefaultCellStyle.SelectionForeColor = Color.Black; + row.DefaultCellStyle.BackColor = Color.Khaki; + row.DefaultCellStyle.SelectionBackColor = Color.Khaki; + } + } + + private void uDataGridView1_CellPainting(object sender, DataGridViewCellPaintingEventArgs e) + { + var last = taskGrid.Rows.Count - 1; + if (e.RowIndex == last) + { + //if (e.ColumnIndex == 2) + //{ + // e.PaintBackground(e.ClipBounds, false); + // e.Handled = true; + //} + // else + if (e.ColumnIndex == 0) + { + using (Brush foreColor = new SolidBrush(e.CellStyle.ForeColor)) + { + e.PaintBackground(e.ClipBounds, false); + StringFormat drawFormat = new StringFormat(); + drawFormat.LineAlignment = StringAlignment.Center; + drawFormat.Alignment = System.Drawing.StringAlignment.Center; + + e.Graphics.DrawString("合计", e.CellStyle.Font, foreColor, e.CellBounds, drawFormat); + e.Handled = true; + } + } + } + } + protected override void OnLoad(EventArgs e) { base.OnLoad(e); - list = new BindingList(SegmentProductionBL.GetProductTaskFull(mDate, mBatchId, mGoods)); + list = new BindingList(SegmentProductionBL.GetProductTaskFull(mDate, mBatchId, mGoods)); + list.Add(new ProductTaskFull { OrderNumber = list.Sum(x => x.OrderNumber ?? 0), FinishNumber = list.Sum(x => x.FinishNumber ), OrderWeight = list.Sum(x => x.OrderWeight ?? 0), FinishWeight = list.Sum(x => x.FinishWeight) }); taskGrid.DataSource = list; taskGrid.Refresh(); }