SVN r390
SVN-Revision: r390
This commit is contained in:
+12
-12
@@ -33,8 +33,8 @@ namespace Lskj.ProductiSched
|
||||
this.splitMainControl = new DevExpress.XtraEditors.SplitContainerControl();
|
||||
this.splitLeftControl = new DevExpress.XtraEditors.SplitContainerControl();
|
||||
this.pltopmain = new DevExpress.XtraEditors.PanelControl();
|
||||
this.treebandGcTop = new Lskj.Control.TreeBandedGridControlEx();
|
||||
this.bandGcTop = new Lskj.Control.BandedGridControlEx();
|
||||
this.treebandGcTop = new Lskj.Control.TreeBandedGridControlEx();
|
||||
this.pl_mainSearch = new DevExpress.XtraEditors.PanelControl();
|
||||
this.pl_search = new DevExpress.XtraEditors.PanelControl();
|
||||
this.flowLayoutPanel = new System.Windows.Forms.FlowLayoutPanel();
|
||||
@@ -111,17 +111,6 @@ namespace Lskj.ProductiSched
|
||||
this.pltopmain.Size = new System.Drawing.Size(997, 320);
|
||||
this.pltopmain.TabIndex = 22;
|
||||
//
|
||||
// treebandGcTop
|
||||
//
|
||||
this.treebandGcTop.AdapterObj = null;
|
||||
this.treebandGcTop.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.treebandGcTop.Location = new System.Drawing.Point(0, 0);
|
||||
this.treebandGcTop.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.treebandGcTop.Name = "treebandGcTop";
|
||||
this.treebandGcTop.SiftEnumObj = Lskj.Control.GridControlEx.HeaderSiftEnum.Sum;
|
||||
this.treebandGcTop.Size = new System.Drawing.Size(997, 320);
|
||||
this.treebandGcTop.TabIndex = 19;
|
||||
//
|
||||
// bandGcTop
|
||||
//
|
||||
this.bandGcTop.AdapterObj = null;
|
||||
@@ -133,6 +122,17 @@ namespace Lskj.ProductiSched
|
||||
this.bandGcTop.Size = new System.Drawing.Size(997, 320);
|
||||
this.bandGcTop.TabIndex = 17;
|
||||
//
|
||||
// treebandGcTop
|
||||
//
|
||||
this.treebandGcTop.AdapterObj = null;
|
||||
this.treebandGcTop.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.treebandGcTop.Location = new System.Drawing.Point(0, 0);
|
||||
this.treebandGcTop.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.treebandGcTop.Name = "treebandGcTop";
|
||||
this.treebandGcTop.SiftEnumObj = Lskj.Control.GridControlEx.HeaderSiftEnum.Sum;
|
||||
this.treebandGcTop.Size = new System.Drawing.Size(997, 320);
|
||||
this.treebandGcTop.TabIndex = 19;
|
||||
//
|
||||
// pl_mainSearch
|
||||
//
|
||||
this.pl_mainSearch.Appearance.BackColor = System.Drawing.Color.Transparent;
|
||||
|
||||
@@ -140,6 +140,7 @@ namespace Lskj.ProductiSched
|
||||
//构建树表格
|
||||
if (TreeMultiHeader)//若为多表头树表格模式
|
||||
{
|
||||
treebandGcTop.Expansion = "3";
|
||||
treebandGcTop.Model = DataModel.TopSysModel;
|
||||
treebandGcTop.moduleModel = DataModel.TopModuleModel;
|
||||
treebandGcTop.SetEditColumns(DataModel.TopGridColumns, GridCustomColumnStruct.BaseMainGridView + DataModel.TopModuleModel.FormKey);
|
||||
@@ -282,8 +283,14 @@ namespace Lskj.ProductiSched
|
||||
private void OnTreeListShowingEditor(object sender, CancelEventArgs e)
|
||||
{
|
||||
TreeList treeList = sender as TreeList;
|
||||
string bj_tig = treeList.FocusedNode.GetValue("bj_tig")?.ToString() ?? "";
|
||||
if (treeList == null || treeList.FocusedNode == null) return;
|
||||
|
||||
if (bj_tig == "0")
|
||||
{
|
||||
e.Cancel = true; // 取消编辑,单元格变灰
|
||||
}
|
||||
else
|
||||
{
|
||||
string billDocumentId = treeList.FocusedNode.GetValue(DataModel.TopModuleModel.ParmaryKey)?.ToString() ?? "";
|
||||
DateTime date;
|
||||
if (DataModel.columnDateMapping.TryGetValue(treeList.FocusedColumn, out date))
|
||||
@@ -303,6 +310,8 @@ namespace Lskj.ProductiSched
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 保存按钮点击时
|
||||
/// </summary>
|
||||
@@ -310,14 +319,15 @@ namespace Lskj.ProductiSched
|
||||
/// <param name="e"></param>
|
||||
private void OnBtnSaveClick(object sender, EventArgs e)
|
||||
{
|
||||
if (SaveGridRecord())
|
||||
if (!string.IsNullOrEmpty(DataModel.TopModuleModel.MenuTable))
|
||||
{
|
||||
SaveGridRecord();
|
||||
}
|
||||
if (SaveDatePlanRecord())
|
||||
{
|
||||
DataModel.TopSearchObj.ButtonObj.PerformClick();
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 保存主表数据
|
||||
/// </summary>
|
||||
@@ -642,7 +652,7 @@ namespace Lskj.ProductiSched
|
||||
DateTime dateTime = labelDateEdit.TextEdit.DateTime;
|
||||
DataRow focusedRow = bandGcTop.BandedView.GetFocusedDataRow();
|
||||
DataTable dataDayPlan = gcRight.GridControl.DataSourceTable().Copy();
|
||||
UpdateRowWithDayPlan(focusedRow, dataDayPlan, dateTime);
|
||||
if (DataModel.TopModuleModel.HasReport)UpdateRowWithDayPlan(focusedRow, dataDayPlan, dateTime);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -694,7 +704,7 @@ namespace Lskj.ProductiSched
|
||||
// 更新行数据逻辑
|
||||
DateTime dateTime = labelDateEdit.TextEdit.DateTime;
|
||||
DataTable dataDayPlan = gcRight.GridControl.DataSourceTable().Copy();
|
||||
UpdateRowWithDayPlan(rowItem, dataDayPlan, dateTime);
|
||||
if (DataModel.TopModuleModel.HasReport) UpdateRowWithDayPlan(rowItem, dataDayPlan, dateTime);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -773,7 +783,7 @@ namespace Lskj.ProductiSched
|
||||
{
|
||||
foreach (TreeListColumn treeListColumn in band.Columns)
|
||||
{
|
||||
allWidth += treeListColumn.Width;
|
||||
if(treeListColumn.Visible) allWidth += treeListColumn.Width;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -842,7 +852,30 @@ namespace Lskj.ProductiSched
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 记录展开的节点
|
||||
/// </summary>
|
||||
public void GetTreeExpanded()
|
||||
{
|
||||
DataModel.treeListNodes.Clear();
|
||||
foreach (TreeListNode n in this.treebandGcTop.TreeListObj.Nodes)
|
||||
{
|
||||
setRecursive(n);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 递归进行遍历节点
|
||||
/// </summary>
|
||||
/// <param name="treeNode"></param>
|
||||
public void setRecursive(TreeListNode treeNode)
|
||||
{
|
||||
if (treeNode.Expanded) DataModel.treeListNodes.Add(treeNode);
|
||||
// Visit each node recursively.
|
||||
foreach (TreeListNode tn in treeNode.Nodes)
|
||||
{
|
||||
setRecursive(tn);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 搜索条件绑定完成后
|
||||
/// </summary>
|
||||
@@ -915,7 +948,7 @@ namespace Lskj.ProductiSched
|
||||
{
|
||||
dataMain = treebandGcTop.GetGridViewDataSource().Copy();
|
||||
dataDetail = treebandGcTop.GetGridViewDataSource().Copy();
|
||||
treebandGcTop.TreeListObj.DataSource = null;
|
||||
//treebandGcTop.TreeListObj.DataSource = null;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -933,15 +966,15 @@ namespace Lskj.ProductiSched
|
||||
DataTable bottomTab = BuildCTable(dataDetail, dataDayPlan, dateTime, 93);
|
||||
bandGcBottom.BandedView.GridControl.DataSource = bottomTab;
|
||||
}
|
||||
MergeMainDataWithDayPlan(dataMain, dataDayPlan, dateTime, typeDate);
|
||||
if (!TreeMultiHeader)
|
||||
{
|
||||
MergeMainDataWithDayPlan(dataMain, dataDayPlan, dateTime, typeDate);
|
||||
bandGcTop.SetGridViewDataSource(dataMain);
|
||||
OnBandedViewRowCellClick(bandGcTop.BandedView, null);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
treebandGcTop.SetGridViewDataSource(dataMain);
|
||||
//treebandGcTop.TreeListObj.DataSource = dataMain;
|
||||
}
|
||||
}
|
||||
string query = @"
|
||||
@@ -2031,24 +2064,30 @@ namespace Lskj.ProductiSched
|
||||
|
||||
if (e.KeyCode == Keys.F7)
|
||||
{
|
||||
TreeListColumn column = treeList.FocusedColumn;
|
||||
if (column != null && column.OptionsColumn.AllowEdit && treeList.AllNodesCount > 0)
|
||||
{
|
||||
// 获取当前聚焦单元格的值
|
||||
object focusedValue = treeList.FocusedNode?.GetValue(column);
|
||||
// 使用你框架中定义的精准方法来获取选中的单元格集合
|
||||
List<TreeListCell> selectedCells = treeList.GetSelectedCells();
|
||||
|
||||
if (focusedValue != null && MessageUtil.Show("是否替换所选单元格值?", MessageBoxButtons.YesNo) == DialogResult.Yes)
|
||||
if (selectedCells != null && selectedCells.Count > 0)
|
||||
{
|
||||
// 以第一个选中单元格作为赋值基准值
|
||||
TreeListCell firstCell = selectedCells[0];
|
||||
object valueToSet = firstCell.Node.GetValue(firstCell.Column);
|
||||
|
||||
if (valueToSet != null && MessageUtil.Show("是否替换所选单元格值?", MessageBoxButtons.YesNo) == DialogResult.Yes)
|
||||
{
|
||||
WaitForm.ShowForm("数据填充中");
|
||||
|
||||
foreach (TreeListNode node in treeList.Selection)
|
||||
foreach (TreeListCell cell in selectedCells)
|
||||
{
|
||||
DateTime dateTime;
|
||||
if (DataModel.columnDateMapping.TryGetValue(column, out dateTime))
|
||||
if (cell.Column.OptionsColumn.AllowEdit)
|
||||
{
|
||||
if (DataModel.columnDateMapping.TryGetValue(cell.Column, out DateTime dateTime))
|
||||
{
|
||||
// 日期必须大于等于今天才允许赋值
|
||||
if (dateTime.Date >= DateTime.Now.Date)
|
||||
{
|
||||
node.SetValue(column, focusedValue);
|
||||
cell.Node.SetValue(cell.Column, valueToSet);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2060,7 +2099,6 @@ namespace Lskj.ProductiSched
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 构建下方数据
|
||||
/// </summary>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using DevExpress.XtraTreeList.Columns;
|
||||
using DevExpress.XtraTreeList.Nodes;
|
||||
using Lskj.Control.Model;
|
||||
using Lskj.Model;
|
||||
using System;
|
||||
@@ -11,5 +12,7 @@ namespace Lskj.ProductiSched
|
||||
{
|
||||
public class ProductDataModel
|
||||
{
|
||||
//treeList树展开的节点块
|
||||
public List<TreeListNode> treeListNodes = new List<TreeListNode>();
|
||||
// 在你的类内部定义此字典(一次定义,长期复用)
|
||||
public Dictionary<object, DateTime> columnDateMapping = new Dictionar
|
||||
Reference in New Issue
Block a user