diff --git a/插件库/Lskj.PubBill/BillModule.cs b/插件库/Lskj.PubBill/BillModule.cs index 00cf6ea..99d1338 100644 --- a/插件库/Lskj.PubBill/BillModule.cs +++ b/插件库/Lskj.PubBill/BillModule.cs @@ -216,6 +216,7 @@ namespace Lskj.PubBill /// public bool MultiLineSummary; + public BillModule() { InitializeComponent(); @@ -1330,7 +1331,6 @@ namespace Lskj.PubBill gcMain.GridView.OptionsView.ShowFooter = true; DataRow[] dataRows = dataTable.Select("num='999'"); DataRow dataRow = dataRows != null && dataRows.Length > 0 ? dataRows[0] : null; - //树表格 gcMain.AddHeadquarters(dataRow); } else if (MultiLineSummary) @@ -1632,7 +1632,8 @@ namespace Lskj.PubBill { this.tb_buttom.TabControlObj.ShowTabHeader = DevExpress.Utils.DefaultBoolean.False; } - dataCaches.GetValue(gcMain, "InitSourcesTask", out bool _); + dataCaches.GetValue(this, "InitSourcesTask", out bool _); + //dataCaches.GetValue(gcMain, "InitSourcesTask", out bool _); for (int i = 0; i < masterTable.Rows.Count; i++) { @@ -3063,28 +3064,29 @@ namespace Lskj.PubBill private void RefreshSource(BillSourceUnionModel unionModel = null) { if (unionModel == null || unionModel.SearchObj == null) return; - //unionModel.SearchObj.SearchLastGrid(); - string sql = ReplaceHelper.ReplaceUserInfo(unionModel.ModelObj.SourceSql); - int Handle = 0; - if (unionModel.GridControlObj != null) Handle = unionModel.GridControlObj.GridView.FocusedRowHandle; - sql = sql.Replace("#", ""); - List paramList = ReplaceHelper.GetParamFields(sql); - if (unionModel.SearchObj != null) - { - //sql拼接来源条件和替换主表控件值 - sql = this.ControlObj.ReplaceControlValue(unionModel.SearchObj.SetSearchSqlValue(sql, true)); - } - if (unionModel.GridControlObj != null) - { - unionModel.GridControlObj.gridControl.DataSource = BaseImpl.GetDataTableResult(sql); + unionModel.SearchObj.SearchLastGrid(); - if (unionModel.GridControlObj != null) - { - unionModel.GridControlObj.GridView.SelectRowHandler(Handle); - //this.RefreshSourceDetail(tabPage.Tag as BillSourceUnionModel); - } - RefreshSourceDetail(unionModel); - } + //string sql = ReplaceHelper.ReplaceUserInfo(unionModel.ModelObj.SourceSql); + //int Handle = 0; + //if (unionModel.GridControlObj != null) Handle = unionModel.GridControlObj.GridView.FocusedRowHandle; + //sql = sql.Replace("#", ""); + //List paramList = ReplaceHelper.GetParamFields(sql); + //if (unionModel.SearchObj != null) + //{ + // //sql拼接来源条件和替换主表控件值 + // sql = this.ControlObj.ReplaceControlValue(unionModel.SearchObj.SetSearchSqlValue(sql, true)); + //} + //if (unionModel.GridControlObj != null) + //{ + // unionModel.GridControlObj.gridControl.DataSource = BaseImpl.GetDataTableResult(sql); + + // if (unionModel.GridControlObj != null) + // { + // unionModel.GridControlObj.GridView.SelectRowHandler(Handle); + // //this.RefreshSourceDetail(tabPage.Tag as BillSourceUnionModel); + // } + // RefreshSourceDetail(unionModel); + //} } /// /// 说明:右边选择下拉框刷新左边来源 @@ -3465,6 +3467,7 @@ namespace Lskj.PubBill if (rowItem != null && model != null) { List calcModels = this.gcMain.ObjmControlList.FindAll(x => !string.IsNullOrEmpty(x.CalcExpr)).OrderBy(y => y.CalcOrder).ToList(); + foreach (GridColumnModel gridModel in calcModels) { // 计算顺序小于当前控件则不计算 @@ -3870,12 +3873,16 @@ namespace Lskj.PubBill } else if (!string.IsNullOrEmpty(model.DefaultValue)) { - newRow[col.FieldName] = fieldValue; + if (string.IsNullOrEmpty(newRow[col.FieldName] + "")) + { + newRow[col.FieldName] = fieldValue; + } + if (!string.IsNullOrEmpty(model.UnionFields)) { - this.SetUnionValue(model, fieldValue + "", newRow); + this.SetUnionValue(model, newRow[col.FieldName] + "", newRow); } - SetCalcValue(model, fieldValue + "", newRow); + SetCalcValue(model, newRow[col.FieldName] + "", newRow); //this.gcMain.GridView.SetFocusedRowCellValue(col, fieldValue); }