SVN r393
SVN-Revision: r393
This commit is contained in:
+12
-14
@@ -39,8 +39,8 @@ namespace Lskj.ProductiSched
|
||||
this.pl_search = new DevExpress.XtraEditors.PanelControl();
|
||||
this.flowLayoutPanel = new System.Windows.Forms.FlowLayoutPanel();
|
||||
this.btnSave = new DevExpress.XtraEditors.SimpleButton();
|
||||
this.bandGcBottom = new Lskj.Control.BandedGridControlEx();
|
||||
this.gcRight = new Lskj.Control.GridControlEx();
|
||||
this.tabBottom = new Lskj.Control.TabControlEx();
|
||||
((System.ComponentModel.ISupportInitialize)(this.pl_main)).BeginInit();
|
||||
this.pl_main.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.splitMainControl)).BeginInit();
|
||||
@@ -93,7 +93,7 @@ namespace Lskj.ProductiSched
|
||||
this.splitLeftControl.Panel1.Controls.Add(this.pltopmain);
|
||||
this.splitLeftControl.Panel1.Controls.Add(this.pl_mainSearch);
|
||||
this.splitLeftControl.Panel1.Text = "Panel1";
|
||||
this.splitLeftControl.Panel2.Controls.Add(this.bandGcBottom);
|
||||
this.splitLeftControl.Panel2.Controls.Add(this.tabBottom);
|
||||
this.splitLeftControl.Panel2.Text = "Panel2";
|
||||
this.splitLeftControl.Size = new System.Drawing.Size(997, 679);
|
||||
this.splitLeftControl.SplitterPosition = 353;
|
||||
@@ -180,17 +180,7 @@ namespace Lskj.ProductiSched
|
||||
this.btnSave.Size = new System.Drawing.Size(72, 26);
|
||||
this.btnSave.TabIndex = 40;
|
||||
this.btnSave.Text = "保存(&S)";
|
||||
//
|
||||
// bandGcBottom
|
||||
//
|
||||
this.bandGcBottom.AdapterObj = null;
|
||||
this.bandGcBottom.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.bandGcBottom.Location = new System.Drawing.Point(0, 0);
|
||||
this.bandGcBottom.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.bandGcBottom.Name = "bandGcBottom";
|
||||
this.bandGcBottom.SiftEnumObj = Lskj.Control.GridControlEx.HeaderSiftEnum.Sum;
|
||||
this.bandGcBottom.Size = new System.Drawing.Size(997, 321);
|
||||
this.bandGcBottom.TabIndex = 12;
|
||||
|
||||
//
|
||||
// gcRight
|
||||
//
|
||||
@@ -203,6 +193,14 @@ namespace Lskj.ProductiSched
|
||||
this.gcRight.Size = new System.Drawing.Size(315, 679);
|
||||
this.gcRight.TabIndex = 11;
|
||||
//
|
||||
// tabBottom
|
||||
//
|
||||
this.tabBottom.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.tabBottom.Location = new System.Drawing.Point(0, 0);
|
||||
this.tabBottom.Name = "tabBottom";
|
||||
this.tabBottom.Size = new System.Drawing.Size(997, 321);
|
||||
this.tabBottom.TabIndex = 14;
|
||||
//
|
||||
// FrmProductSched
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
|
||||
@@ -219,4 +217,4 @@ namespace Lskj.ProductiSched
|
||||
((System.ComponentModel.ISupportInitialize)(this.pltopmain)).EndInit();
|
||||
this.pltopmain.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)(this.pl_mainSearch)).EndInit();
|
||||
this.pl_mainSearch.
|
||||
this.pl_m
|
||||
@@ -6,9 +6,11 @@ using DevExpress.XtraGrid.Columns;
|
||||
using DevExpress.XtraGrid.Views.BandedGrid;
|
||||
using DevExpress.XtraGrid.Views.Base;
|
||||
using DevExpress.XtraGrid.Views.Grid;
|
||||
using DevExpress.XtraTab;
|
||||
using DevExpress.XtraTreeList;
|
||||
using DevExpress.XtraTreeList.Columns;
|
||||
using DevExpress.XtraTreeList.Nodes;
|
||||
using Lskj.Business;
|
||||
using Lskj.Business.Impl;
|
||||
using Lskj.Control;
|
||||
using Lskj.Control.Model;
|
||||
@@ -36,6 +38,8 @@ namespace Lskj.ProductiSched
|
||||
{
|
||||
|
||||
public bool TreeMultiHeader;
|
||||
public bool isAddBottom;
|
||||
public Control.BandedGridControlEx bandGcBottom;
|
||||
public ProductDataModel DataModel;
|
||||
public FrmProductSched()
|
||||
{
|
||||
@@ -76,45 +80,70 @@ namespace Lskj.ProductiSched
|
||||
DataModel.TopSearchObj = new MyControl(DataModel.TopModuleModel.MenuSql, bandGcTop);
|
||||
}
|
||||
DataModel.TopSearchObj.Model = DataModel.TopSysModel;
|
||||
DataTable detailsTab = BaseModuleImpl.GetBaseDetailPages(DataModel.TopSysModel.ModuleCode);
|
||||
DataTable detailsTab = BaseModuleImpl.GetBaseDetailPages(DataModel.TopSysModel.ModuleCode);//明细数据
|
||||
List<GridDetailModel> detailsTablist = new List<GridDetailModel>();
|
||||
if (detailsTab != null)
|
||||
{
|
||||
if (detailsTab.Rows.Count > 1)
|
||||
foreach (DataRow item in detailsTab.Rows)
|
||||
{
|
||||
string moduleCode = detailsTab.Rows[0]["unionModule"] + "";
|
||||
DataModel.BottomDetailModel = new GridDetailModel(detailsTab.Rows[0], null, GridCustomColumnStruct.BaseDetailGridView);
|
||||
DataModel.BottomSysModel = new DynamicModel(new string[] { DataModel.TopSysModel.FormText, DataModel.TopSysModel.UserId, DataModel.TopSysModel.UserName, DataModel.TopSysModel.Privilege, moduleCode });
|
||||
DataRow sysRow = MainImpl.GetSystemdllTab(DataModel.BottomSysModel.ModuleCode);
|
||||
DataModel.BottomModuleModel = new ModuleModel(sysRow);
|
||||
DataModel.BottomModuleModel.ParmaryKey = BaseImpl.GetBasePrimaryKey(DataModel.BottomSysModel.ModuleCode);
|
||||
DataModel.BottomGridColumns = BaseModuleImpl.GetBaseGridColumns(DataModel.BottomSysModel.ModuleCode);
|
||||
DataModel.BottomRightMenus = BaseModuleImpl.GetBaseGridRightMenus(DataModel.TopModuleModel.FormKey);
|
||||
DataModel.BottomRowColors = BaseModuleImpl.GetBaseGridRowColors(DataModel.TopModuleModel.FormKey);
|
||||
}
|
||||
if (detailsTab.Rows.Count > 1)
|
||||
{
|
||||
string moduleCode = detailsTab.Rows[1]["unionModule"] + "";
|
||||
DataModel.RightDetailModel = new GridDetailModel(detailsTab.Rows[1], null, GridCustomColumnStruct.BaseDetailGridView);
|
||||
DataModel.RightSysModel = new DynamicModel(new string[] { DataModel.TopSysModel.FormText, DataModel.TopSysModel.UserId, DataModel.TopSysModel.UserName, DataModel.TopSysModel.Privilege, moduleCode });
|
||||
DataRow sysRow = MainImpl.GetSystemdllTab(DataModel.RightSysModel.ModuleCode);
|
||||
DataModel.RightModuleModel = new ModuleModel(sysRow);
|
||||
DataModel.RightModuleModel.ParmaryKey = BaseImpl.GetBasePrimaryKey(DataModel.RightSysModel.ModuleCode);
|
||||
DataModel.RightGridColumns = BaseModuleImpl.GetBaseGridColumns(DataModel.RightSysModel.ModuleCode);
|
||||
DataModel.RightRightMenus = BaseModuleImpl.GetBaseGridRightMenus(DataModel.TopModuleModel.FormKey);
|
||||
DataModel.RightRowColors = BaseModuleImpl.GetBaseGridRowColors(DataModel.TopModuleModel.FormKey);
|
||||
}
|
||||
else
|
||||
{
|
||||
string moduleCode = detailsTab.Rows[0]["unionModule"] + "";
|
||||
DataModel.RightDetailModel = new GridDetailModel(detailsTab.Rows[0], null, GridCustomColumnStruct.BaseDetailGridView);
|
||||
DataModel.RightSysModel = new DynamicModel(new string[] { DataModel.TopSysModel.FormText, DataModel.TopSysModel.UserId, DataModel.TopSysModel.UserName, DataModel.TopSysModel.Privilege, moduleCode });
|
||||
DataRow sysRow = MainImpl.GetSystemdllTab(DataModel.RightSysModel.ModuleCode);
|
||||
DataModel.RightModuleModel = new ModuleModel(sysRow);
|
||||
DataModel.RightModuleModel.ParmaryKey = BaseImpl.GetBasePrimaryKey(DataModel.RightSysModel.ModuleCode);
|
||||
DataModel.RightGridColumns = BaseModuleImpl.GetBaseGridColumns(DataModel.RightSysModel.ModuleCode);
|
||||
DataModel.RightRightMenus = BaseModuleImpl.GetBaseGridRightMenus(DataModel.TopModuleModel.FormKey);
|
||||
DataModel.RightRowColors = BaseModuleImpl.GetBaseGridRowColors(DataModel.TopModuleModel.FormKey);
|
||||
GridDetailModel detailModel = new GridDetailModel(item,null, GridCustomColumnStruct.BaseDetailGridView);
|
||||
if (detailModel.Orderid == -1)//序号为-1固定配置右键
|
||||
{
|
||||
string moduleCode = detailModel.UnionModule;
|
||||
DataModel.RightDetailModel = detailModel;
|
||||
DataModel.RightSysModel = new DynamicModel(new string[] { DataModel.TopSysModel.FormText, DataModel.TopSysModel.UserId, DataModel.TopSysModel.UserName, DataModel.TopSysModel.Privilege, moduleCode });
|
||||
DataRow sysRow = MainImpl.GetSystemdllTab(DataModel.RightSysModel.ModuleCode);
|
||||
DataModel.RightModuleModel = new ModuleModel(sysRow);
|
||||
DataModel.RightModuleModel.ParmaryKey = BaseImpl.GetBasePrimaryKey(DataModel.RightSysModel.ModuleCode);
|
||||
DataModel.RightGridColumns = BaseModuleImpl.GetBaseGridColumns(DataModel.RightSysModel.ModuleCode);
|
||||
DataModel.RightRightMenus = BaseModuleImpl.GetBaseGridRightMenus(DataModel.TopModuleModel.FormKey);
|
||||
DataModel.RightRowColors = BaseModuleImpl.GetBaseGridRowColors(DataModel.TopModuleModel.FormKey);
|
||||
}
|
||||
else
|
||||
{
|
||||
detailsTablist.Add(detailModel);
|
||||
}
|
||||
}
|
||||
tabBottom.Model = DataModel.TopSysModel;
|
||||
tabBottom.InitTabPages(detailsTablist);
|
||||
this.isAddBottom = detailsTablist.Where(o => o.displayMode != 1 && o.rightVisible != 1 && o.Orderid == -2).ToList().Count>0;
|
||||
|
||||
//if (detailsTab.Rows.Count > 1)
|
||||
//{
|
||||
// string moduleCode = detailsTab.Rows[0]["unionModule"] + "";
|
||||
// DataModel.BottomDetailModel = new GridDetailModel(detailsTab.Rows[0], null, GridCustomColumnStruct.BaseDetailGridView);
|
||||
// DataModel.BottomSysModel = new DynamicModel(new string[] { DataModel.TopSysModel.FormText, DataModel.TopSysModel.UserId, DataModel.TopSysModel.UserName, DataModel.TopSysModel.Privilege, moduleCode });
|
||||
// DataRow sysRow = MainImpl.GetSystemdllTab(DataModel.BottomSysModel.ModuleCode);
|
||||
// DataModel.BottomModuleModel = new ModuleModel(sysRow);
|
||||
// DataModel.BottomModuleModel.ParmaryKey = BaseImpl.GetBasePrimaryKey(DataModel.BottomSysModel.ModuleCode);
|
||||
// DataModel.BottomGridColumns = BaseModuleImpl.GetBaseGridColumns(DataModel.BottomSysModel.ModuleCode);
|
||||
// DataModel.BottomRightMenus = BaseModuleImpl.GetBaseGridRightMenus(DataModel.TopModuleModel.FormKey);
|
||||
// DataModel.BottomRowColors = BaseModuleImpl.GetBaseGridRowColors(DataModel.TopModuleModel.FormKey);
|
||||
//}
|
||||
//if (detailsTab.Rows.Count > 1)
|
||||
//{
|
||||
// string moduleCode = detailsTab.Rows[1]["unionModule"] + "";
|
||||
// DataModel.RightDetailModel = new GridDetailModel(detailsTab.Rows[1], null, GridCustomColumnStruct.BaseDetailGridView);
|
||||
// DataModel.RightSysModel = new DynamicModel(new string[] { DataModel.TopSysModel.FormText, DataModel.TopSysModel.UserId, DataModel.TopSysModel.UserName, DataModel.TopSysModel.Privilege, moduleCode });
|
||||
// DataRow sysRow = MainImpl.GetSystemdllTab(DataModel.RightSysModel.ModuleCode);
|
||||
// DataModel.RightModuleModel = new ModuleModel(sysRow);
|
||||
// DataModel.RightModuleModel.ParmaryKey = BaseImpl.GetBasePrimaryKey(DataModel.RightSysModel.ModuleCode);
|
||||
// DataModel.RightGridColumns = BaseModuleImpl.GetBaseGridColumns(DataModel.RightSysModel.ModuleCode);
|
||||
// DataModel.RightRightMenus = BaseModuleImpl.GetBaseGridRightMenus(DataModel.TopModuleModel.FormKey);
|
||||
// DataModel.RightRowColors = BaseModuleImpl.GetBaseGridRowColors(DataModel.TopModuleModel.FormKey);
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// string moduleCode = detailsTab.Rows[0]["unionModule"] + "";
|
||||
// DataModel.RightDetailModel = new GridDetailModel(detailsTab.Rows[0], null, GridCustomColumnStruct.BaseDetailGridView);
|
||||
// DataModel.RightSysModel = new DynamicModel(new string[] { DataModel.TopSysModel.FormText, DataModel.TopSysModel.UserId, DataModel.TopSysModel.UserName, DataModel.TopSysModel.Privilege, moduleCode });
|
||||
// DataRow sysRow = MainImpl.GetSystemdllTab(DataModel.RightSysModel.ModuleCode);
|
||||
// DataModel.RightModuleModel = new ModuleModel(sysRow);
|
||||
// DataModel.RightModuleModel.ParmaryKey = BaseImpl.GetBasePrimaryKey(DataModel.RightSysModel.ModuleCode);
|
||||
// DataModel.RightGridColumns = BaseModuleImpl.GetBaseGridColumns(DataModel.RightSysModel.ModuleCode);
|
||||
// DataModel.RightRightMenus = BaseModuleImpl.GetBaseGridRightMenus(DataModel.TopModuleModel.FormKey);
|
||||
// DataModel.RightRowColors = BaseModuleImpl.GetBaseGridRowColors(DataModel.TopModuleModel.FormKey);
|
||||
//}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
@@ -169,13 +198,11 @@ namespace Lskj.ProductiSched
|
||||
{
|
||||
flowLayoutPanel.Visible = false;
|
||||
}
|
||||
//下方表格
|
||||
if (DataModel.BottomSysModel != null && !string.IsNullOrEmpty(DataModel.BottomSysModel.ModuleCode))
|
||||
|
||||
if (isAddBottom)
|
||||
{
|
||||
bandGcBottom.Model = DataModel.BottomSysModel;
|
||||
bandGcBottom.SetEditColumns(DataModel.BottomGridColumns, GridCustomColumnStruct.BaseMainGridView + DataModel.BottomModuleModel.FormKey);
|
||||
bandGcBottom.SetGridRightMenus(BaseModuleImpl.GetBaseGridRightMenus(DataModel.BottomModuleModel.ModeCode), DataModel.BottomSysModel);
|
||||
bandGcBottom.SetGridRowColors(BaseModuleImpl.GetBaseGridRowColors(DataModel.BottomModuleModel.ModeCode));
|
||||
GridControlEx gridControl = tabBottom.TabControlObj.TabPages[0].Tag as GridControlEx;
|
||||
bandGcBottom = gridControl as BandedGridControlEx;
|
||||
AddDataColumns(bandGcBottom);
|
||||
foreach (GridBand gridBand in bandGcBottom.BandedView.Bands)
|
||||
{
|
||||
@@ -185,7 +212,6 @@ namespace Lskj.ProductiSched
|
||||
bandedGridColumn.OptionsColumn.AllowSize = false;
|
||||
}
|
||||
}
|
||||
bandGcBottom.BandedView.OptionsBehavior.Editable = false;
|
||||
if (TreeMultiHeader)
|
||||
{
|
||||
OnBandedViewColumnWidthChanged(treebandGcTop.TreeListObj, null);
|
||||
@@ -200,6 +226,34 @@ namespace Lskj.ProductiSched
|
||||
{
|
||||
splitLeftControl.PanelVisibility = DevExpress.XtraEditors.SplitPanelVisibility.Panel1;
|
||||
}
|
||||
//下方表格
|
||||
//if (DataModel.BottomSysModel != null && !string.IsNullOrEmpty(DataModel.BottomSysModel.ModuleCode))
|
||||
//{
|
||||
// bandGcBottom.Model = DataModel.BottomSysModel;
|
||||
// bandGcBottom.SetEditColumns(DataModel.BottomGridColumns, GridCustomColumnStruct.BaseMainGridView + DataModel.BottomModuleModel.FormKey);
|
||||
// bandGcBottom.SetGridRightMenus(BaseModuleImpl.GetBaseGridRightMenus(DataModel.BottomModuleModel.ModeCode), DataModel.BottomSysModel);
|
||||
// bandGcBottom.SetGridRowColors(BaseModuleImpl.GetBaseGridRowColors(DataModel.BottomModuleModel.ModeCode));
|
||||
// AddDataColumns(bandGcBottom);
|
||||
// foreach (GridBand gridBand in bandGcBottom.BandedView.Bands)
|
||||
// {
|
||||
// gridBand.OptionsBand.AllowSize = false;
|
||||
// foreach (BandedGridColumn bandedGridColumn in gridBand.Columns)
|
||||
// {
|
||||
// bandedGridColumn.OptionsColumn.AllowSize = false;
|
||||
// }
|
||||
// }
|
||||
// bandGcBottom.BandedView.OptionsBehavior.Editable = false;
|
||||
// if (TreeMultiHeader)
|
||||
// {
|
||||
// OnBandedViewColumnWidthChanged(treebandGcTop.TreeListObj, null);
|
||||
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// OnBandedViewColumnWidthChanged(bandGcTop.BandedView, null);
|
||||
// }
|
||||
//}
|
||||
|
||||
//右侧表格
|
||||
if (!string.IsNullOrEmpty(DataModel.RightSysModel.ModuleCode))
|
||||
{
|
||||
@@ -218,9 +272,11 @@ namespace Lskj.ProductiSched
|
||||
splitMainControl.SplitterPositionChanged += OnSplitContainerPositionChanged;
|
||||
DataModel.TopSearchObj.OnDataSourceBindCallBack += OnDataSourceBindCallBack;
|
||||
DataModel.TopSearchObj.OnSearchAfterCallBack += OnSearchAfterCallBack;
|
||||
bandGcBottom.BandedView.LeftCoordChanged += OnBandedViewLeftCoordChanged;
|
||||
bandGcBottom.BandedView.CustomDrawColumnHeader += OnCustomDrawColumnHeader;
|
||||
|
||||
if (bandGcBottom != null)
|
||||
{
|
||||
bandGcBottom.BandedView.LeftCoordChanged += OnBandedViewLeftCoordChanged;
|
||||
bandGcBottom.BandedView.CustomDrawColumnHeader += OnCustomDrawColumnHeader;
|
||||
}
|
||||
if (TreeMultiHeader)
|
||||
{
|
||||
// 改为TreeList的事件绑定
|
||||
@@ -282,6 +338,10 @@ namespace Lskj.ProductiSched
|
||||
/// </summary>
|
||||
private void OnTreeListShowingEditor(object sender, CancelEventArgs e)
|
||||
{
|
||||
if (DataModel.TopModuleModel.HasReport)//报表所有的都不能编辑
|
||||
{
|
||||
e.Cancel = true; // 取消编辑,单元格变灰
|
||||
}
|
||||
TreeList treeList = sender as TreeList;
|
||||
string bj_tig = treeList.FocusedNode.GetValue("bj_tig")?.ToString() ?? "";
|
||||
if (treeList == null || treeList.FocusedNode == null) return;
|
||||
@@ -655,6 +715,7 @@ namespace Lskj.ProductiSched
|
||||
if (DataModel.TopModuleModel.HasReport) UpdateRowWithDayPlan(focusedRow, dataDayPlan, dateTime);
|
||||
}
|
||||
}
|
||||
this.SetDetailGridDataSource(rowItem);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
@@ -704,6 +765,7 @@ namespace Lskj.ProductiSched
|
||||
DateTime dateTime = labelDateEdit.TextEdit.DateTime;
|
||||
DataTable dataDayPlan = gcRight.GridControl.DataSourceTable().Copy();
|
||||
if (DataModel.TopModuleModel.HasReport) UpdateRowWithDayPlan(rowItem, dataDayPlan, dateTime);
|
||||
this.SetDetailGridDataSource(rowItem);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -712,7 +774,145 @@ namespace Lskj.ProductiSched
|
||||
Console.WriteLine(ex.Message);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:下面多数据源刷新</para>
|
||||
/// <para>创建人:王一帆</para>
|
||||
/// <para>创建日期:2017-12-19 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
public void SetDetailGridDataSource(DataRow rowItem,XtraTabPage tabPage = null)
|
||||
{
|
||||
if (tabPage != null)
|
||||
{
|
||||
this.SetTabPageDataSource(tabPage, rowItem);
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach (XtraTabPage page in this.tabBottom.TabControlObj.TabPages)
|
||||
{
|
||||
if (rowItem != null && page != null)
|
||||
{
|
||||
this.SetTabPageDataSource(page, rowItem);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected void SetTabPageDataSource(XtraTabPage tabPage,DataRow rowItem)
|
||||
{
|
||||
GridDetailModel model = this.tabBottom.GetGridDetailModel(tabPage);
|
||||
if (model.Orderid == -2) return;
|
||||
Object moduleObject = tabPage.Controls.Cast<Object>().FirstOrDefault();
|
||||
ModuleGridEx moduleGridEx = null;
|
||||
if (moduleObject is ModuleGridEx)
|
||||
{
|
||||
moduleGridEx = moduleObject as ModuleGridEx;
|
||||
}
|
||||
if (rowItem != null && model != null)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(model.UnionModule) && (string.IsNullOrEmpty(model.UnionValue) && string.IsNullOrEmpty(model.UnionCond))) return;
|
||||
if (tabPage.Tag is FrmWebBrowser)
|
||||
{
|
||||
// 加载网页
|
||||
FrmWebBrowser webView = tabPage.Tag as FrmWebBrowser;
|
||||
string url = ReplaceHelper.ReplaceRowParam(rowItem, ReplaceHelper.ReplaceUserInfo(model.DetailSql));
|
||||
url = url.StartsWith("http") ? url : SystemInfo.Instance.OAUrl + url;
|
||||
//webView.FrmLoad(url);
|
||||
webView.LoadUrl(url);
|
||||
webView.Dock = DockStyle.Fill;
|
||||
webView.Tag = model;
|
||||
}
|
||||
else if (tabPage.Tag is FrmWebBrowser2)
|
||||
{
|
||||
// 加载网页
|
||||
FrmWebBrowser2 webView = tabPage.Tag as FrmWebBrowser2;
|
||||
string url = ReplaceHelper.ReplaceRowParam(rowItem, ReplaceHelper.ReplaceUserInfo(model.DetailSql));
|
||||
url = url.StartsWith("http") ? url : SystemInfo.Instance.OAUrl + url;
|
||||
webView.LoadUrl(url);
|
||||
webView.Dock = DockStyle.Fill;
|
||||
webView.Tag = model;
|
||||
}
|
||||
else if (tabPage.Tag is FrmMiniBlink)
|
||||
{
|
||||
// 加载网页
|
||||
FrmMiniBlink webView = tabPage.Tag as FrmMiniBlink;
|
||||
string url = ReplaceHelper.ReplaceRowParam(rowItem, ReplaceHelper.ReplaceUserInfo(model.DetailSql));
|
||||
url = url.StartsWith("http") ? url : SystemInfo.Instance.OAUrl + url;
|
||||
webView.LoadUrl(url);
|
||||
webView.Dock = DockStyle.Fill;
|
||||
webView.Tag = model;
|
||||
}
|
||||
else if (tabPage.Tag is TabMultipledetails)
|
||||
{
|
||||
TabMultipledetails tabMultipledetails = tabPage.Tag as TabMultipledetails;
|
||||
tabMultipledetails.SetConditionValues(rowItem);
|
||||
GridControlEx grdExMain = (tabMultipledetails.SplitMain.Panel1.Tag as GridControlEx);
|
||||
GridDetailModel MainModel = grdExMain.Tag as GridDetailModel;
|
||||
string searchMainSql = this.GetSearchSql(MainModel, rowItem);
|
||||
DataTable firstTable = MainImpl.GetDataTableResult(searchMainSql);
|
||||
grdExMain.LastSearchSql = searchMainSql;
|
||||
grdExMain.SetGridViewDataSource(firstTable);
|
||||
if (tabMultipledetails.SplitMain.Panel2.Tag is GridControlEx)
|
||||
{
|
||||
GridControlEx grdExAdditional = (tabMultipledetails.SplitMain.Panel2.Tag as GridControlEx);
|
||||
GridDetailModel AdditionalModel = grdExAdditional.Tag as GridDetailModel;
|
||||
string searchAddSql = this.GetSearchSql(AdditionalModel, rowItem);
|
||||
if (!MainModel.IsUnioDetail)
|
||||
{
|
||||
grdExAdditional.LastSearchSql = searchAddSql;
|
||||
grdExAdditional.SetGridViewDataSource(MainImpl.GetDataTableResult(searchAddSql));
|
||||
}
|
||||
//右侧是左侧的明细,左侧没有数据时。右侧赋空值(因为无法触发左侧行改变事件)
|
||||
if (MainModel.IsUnioDetail && firstTable.Rows.Count == 0)
|
||||
{
|
||||
grdExAdditional.LastSearchSql = "";
|
||||
grdExAdditional.SetGridViewDataSource(new DataTable());
|
||||
}
|
||||
}
|
||||
else if (tabMultipledetails.SplitMain.Panel2.Tag is ChartControlEx)
|
||||
{
|
||||
ChartControlEx grdExAdditional = (tabMultipledetails.SplitMain.Panel2.Tag as ChartControlEx);
|
||||
GridDetailModel AdditionalModel = grdExAdditional.Tag as GridDetailModel;
|
||||
string searchAddSql = this.GetSearchSql(AdditionalModel, rowItem);
|
||||
DataTable table = MainImpl.GetDataTableResult(searchAddSql);
|
||||
grdExAdditional.CreateChart(table);
|
||||
}
|
||||
|
||||
tabPage.Text = MainModel.DetailName + "(" + firstTable.Rows.Count + "条)";
|
||||
tabPage.Appearance.Header.ForeColor = firstTable.Rows.Count > 0 ? Color.Red : Color.FromArgb(0, 0, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (model.IsDrag)
|
||||
{
|
||||
return;
|
||||
}
|
||||
string searchSql = this.GetSearchSql(model, rowItem);
|
||||
if (tabPage.Tag is GridControlEx)
|
||||
{
|
||||
(tabPage.Tag as GridControlEx).LastSearchSql = searchSql;
|
||||
}
|
||||
//DataTable dataTable = MainImpl.GetDataTableResult(searchSql);//明细数据源
|
||||
if (model.DynamicDetails && rowItem.Table.Columns.Contains("DisplayColumns")) //
|
||||
{
|
||||
this.tabBottom.SetGridDisplayColumns(tabPage, rowItem["DisplayColumns"] + "");
|
||||
}
|
||||
this.tabBottom.SetGridDataSource(tabPage, MainImpl.GetDataTableResult(searchSql));
|
||||
if (tabPage.Tag is GridControlEx && (tabPage.Tag as GridControlEx).ParentControl != null)
|
||||
(tabPage.Tag as GridControlEx).ParentControl.SetAllControlValue(rowItem);
|
||||
//配置明细直接根据条件加载
|
||||
if (model.SystemModel != null && 1 == model.SystemModel.isFirstLoad)
|
||||
{
|
||||
(tabPage.Tag as GridControlEx).ParentControl.SearchGrid();
|
||||
tabPage.Text = model.DetailName + "(" + (tabPage.Tag as GridControlEx).ParentControl.GridRowCount + "条)";
|
||||
}
|
||||
}
|
||||
if (moduleGridEx != null) moduleGridEx.ParentButtonState(rowItem);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取查询sql
|
||||
/// </summary>
|
||||
@@ -828,7 +1028,7 @@ namespace Lskj.ProductiSched
|
||||
/// <param name="e"></param>
|
||||
private void OnBandedViewLeftCoordChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (!bandGcBottom.Visible) return;
|
||||
if (!isAddBottom) return;
|
||||
if (sender == bandGcTop.BandedView)
|
||||
{
|
||||
bandGcBottom.BandedView.LeftCoord = bandGcTop.BandedView.LeftCoord;
|
||||
@@ -895,7 +1095,7 @@ namespace Lskj.ProductiSched
|
||||
{
|
||||
LabelDateEdit labelDateEdit = baseUserControl as LabelDateEdit;
|
||||
DateTime dateTime = labelDateEdit.TextEdit.DateTime;
|
||||
UpdateDynamicColumns(bandGcBottom, dateTime, typeDate);
|
||||
if(isAddBottom)UpdateDynamicColumns(bandGcBottom, dateTime, typeDate);
|
||||
if (TreeMultiHeader)
|
||||
{
|
||||
UpdateDynamicColumns(treebandGcTop, dateTime, typeDate);
|
||||
@@ -940,7 +1140,7 @@ namespace Lskj.ProductiSched
|
||||
{
|
||||
UpdateDynamicColumns(bandGcTop, dateTime, typeDate);
|
||||
}
|
||||
UpdateDynamicColumns(bandGcBottom, dateTime, typeDate);
|
||||
if (isAddBottom) UpdateDynamicColumns(bandGcBottom, dateTime, typeDate);
|
||||
DataTable dataMain = null;
|
||||
DataTable dataDetail = null;
|
||||
if (TreeMultiHeader)
|
||||
@@ -960,7 +1160,7 @@ namespace Lskj.ProductiSched
|
||||
string isweekcond = DataModel.TopModuleModel.HasReport ? "" : $"and isWeek='{typeDate}'";
|
||||
sqlValue = $"{ReplaceHelper.ReplaceWhereCond(sqlValue)} and day >= '{dateTime.ToString("yyyy-MM-dd")}' {isweekcond}";
|
||||
DataTable dataDayPlan = BaseImpl.GetDataTableResult(sqlValue);
|
||||
if (bandGcBottom.Visible)
|
||||
if (isAddBottom)
|
||||
{
|
||||
DataTable bottomTab = BuildCTable(dataDetail, dataDayPlan, dateTime, 93);
|
||||
bandGcBottom.BandedView.GridControl.DataSource = bottomTab;
|
||||
@@ -1608,7 +1808,7 @@ namespace Lskj.ProductiSched
|
||||
{
|
||||
treeListColumn.OptionsColumn.AllowEdit = dateForColumn.Date >= DateTime.Now.Date;
|
||||
}
|
||||
|
||||
|
||||
treeListColumn.Visible = true;
|
||||
}
|
||||
else
|
||||
@@ -2163,4 +2363,34 @@ namespace Lskj.ProductiSched
|
||||
|
||||
// 对每个动态日期列,从 dtPlan 中查找 billdocument_id 在 keyValues 内,
|
||||
// 且 ShowDay 等于当前列名的记录,将 amount 累加后再乘以系数
|
||||
foreach (stri
|
||||
foreach (string dateCol in dateColumns)
|
||||
{
|
||||
decimal sumAmount = planRows
|
||||
.Where(pr => keyValues.Contains(pr.BillId) && pr.ShowDay == dateCol)
|
||||
.Sum(pr => pr.Amount);
|
||||
// 乘以系数得到实际值
|
||||
newRow[dateCol] = sumAmount * coefficient;
|
||||
}
|
||||
dtC.Rows.Add(newRow);
|
||||
}
|
||||
return dtC;
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
return default;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 纠正输入异常
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void OnInvalidValueException(object sender, InvalidValueExceptionEventArgs e)
|
||||
{
|
||||
if (e.Value.Equals(""))
|
||||
{
|
||||
e.ExceptionMode = ExceptionMode.Ignore;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user