SVN-Revision: r263
This commit is contained in:
cyf
2025-02-12 06:26:04 +00:00
parent 8fac982e19
commit 40b107eb82
6 changed files with 101 additions and 66 deletions
+5 -45
View File
@@ -1645,17 +1645,6 @@ namespace Lskj.Control
foreach (DataRow item in rowItems) foreach (DataRow item in rowItems)
{ {
WaitForm.ShowForm("正在审核[" + item[this.BaseAccraditModelObj.TmpParmaryField] + "]单据!"); WaitForm.ShowForm("正在审核[" + item[this.BaseAccraditModelObj.TmpParmaryField] + "]单据!");
//string result = BaseAuditImpl.Audit(out nextSelectStepCode, out nextSelectStepOper, this.SysModel, item[this.BaseAccraditModelObj.TmpStepField] + "", item[this.BaseAccraditModelObj.TmpParmaryField] + "", "", this.AuditComModelObj.ProcedureName, "F", "", "批量审批同意");
//if ("1".Equals(result))
//{
// success++;
//}
//else
//{
// fault++;
// tipMsg = result + "\r\n";
//}
bool isComplete = true;//判断必填项 bool isComplete = true;//判断必填项
string BillDocumentId = item[this.BaseAccraditModelObj.TmpParmaryField] + "";//单据号 string BillDocumentId = item[this.BaseAccraditModelObj.TmpParmaryField] + "";//单据号
//主表必填 //主表必填
@@ -1754,6 +1743,7 @@ namespace Lskj.Control
if (SelectGridControlEx != null && oldRowHandle > 0) if (SelectGridControlEx != null && oldRowHandle > 0)
{ {
SelectGridControlEx.GridView.SelectRowHandler(oldRowHandle); SelectGridControlEx.GridView.SelectRowHandler(oldRowHandle);
OnPcgridRowCellClick(SelectGridControlEx.GridView, null);
} }
} }
@@ -2673,6 +2663,9 @@ namespace Lskj.Control
/// <param name="code"></param> /// <param name="code"></param>
public void RefreshTabPage() public void RefreshTabPage()
{ {
DataTable detailTable = gcDetail.GridControl.DataSourceTable();
detailTable.Clear();
this.ControlObj.ResetControlValue();
foreach (TabPageObj tab in this._tabPageObjs) foreach (TabPageObj tab in this._tabPageObjs)
{ {
int cnt = 0; int cnt = 0;
@@ -2749,37 +2742,4 @@ namespace Lskj.Control
} }
catch (Exception ex) catch (Exception ex)
{ {
string Message = ErrorMessage.PromptErrorMessage(ex); string M
MessageUtil.Show(Message, ex.Message);
}
}
#endregion
/// <summary>
/// 优化加载速度
/// </summary>
protected override CreateParams CreateParams
{
get
{
CreateParams cp = base.CreateParams;
cp.ExStyle |= 0x02000000;
return cp;
}
}
public EventHandler GridView_DoubleClick { get; set; }
/// <summary>
/// 导出明细
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void simpleButton2_Click(object sender, EventArgs e)
{
LogUtil.WriteDebug(this.SysModel.ModuleCode, "导出数据", this.SysModel.FormText, "单据明细导出", this.SysModel.ModuleId + "");
this.gcDetail.GridControl.ToExcel(this.SysModel.FormText);
}
}
}
+4 -2
View File
@@ -669,7 +669,7 @@ namespace Lskj.Control
return; return;
} }
if (!string.IsNullOrEmpty(model.SqlSource)) if (!string.IsNullOrEmpty(model.SqlSource) && !(model.FieldType == ControlType.LabSelectReturnIdNew || model.FieldType == ControlType.LabSelectReturnTextNew))
{ {
Task<DataTable> sourceTask = new Task<DataTable>(() => Task<DataTable> sourceTask = new Task<DataTable>(() =>
{ {
@@ -1047,6 +1047,7 @@ namespace Lskj.Control
mLoading = true; mLoading = true;
try try
{ {
if (this.OnDataSourceBindCallBack != null) this.OnDataSourceBindCallBack(null, null);
SetColumnsSource(); SetColumnsSource();
} }
catch (Exception ex) catch (Exception ex)
@@ -1056,7 +1057,7 @@ namespace Lskj.Control
finally finally
{ {
mControlSourceDic.Clear(); mControlSourceDic.Clear();
if (this.OnDataSourceBindCallBack != null) this.OnDataSourceBindCallBack(null, null);
} }
} }
else else
@@ -1070,6 +1071,7 @@ namespace Lskj.Control
foreach (GridColumnModel item in mControlList) foreach (GridColumnModel item in mControlList)
{ {
if (this.DisableFieldSources && item.isVislble) continue; if (this.DisableFieldSources && item.isVislble) continue;
if(item.FieldType == ControlType.LabSelectReturnIdNew || item.FieldType == ControlType.LabSelectReturnTextNew) continue;
if (!string.IsNullOrWhiteSpace(item.SqlSource)) if (!string.IsNullOrWhiteSpace(item.SqlSource))
{ {
DataTable dataTable = new DataTable(); DataTable dataTable = new DataTable();
@@ -346,4 +346,9 @@ namespace Lskj.Control
_lookUpForm.NewSourceSQL = sqlValue; _lookUpForm.NewSourceSQL = sqlValue;
_lookUpForm.AddModuleResult = Model.AddModuleResult; _lookUpForm.AddModuleResult = Model.AddModuleResult;
_lookUpForm.InitControls(UnionModuleCodel); _lookUpForm.InitControls(UnionModuleCodel);
Di DialogResult result = _lookUpForm.ShowDialog();
if (result == DialogResult.OK)
{
string value = Model.FieldType == ControlType.LabSelectReturnIdNew ? _lookUpForm.EditValue : _lookUpForm.EditText;
this.EditValue = value;
@@ -361,6 +361,17 @@ namespace Lskj.Control.Model
this._bandTitle = item.Table.Columns.Contains("bandTitle") ? item["bandTitle"] + "" : string.Empty; this._bandTitle = item.Table.Columns.Contains("bandTitle") ? item["bandTitle"] + "" : string.Empty;
this._bandFields = item.Table.Columns.Contains("bandFields") ? item["bandFields"] + "" : string.Empty; this._bandFields = item.Table.Columns.Contains("bandFields") ? item["bandFields"] + "" : string.Empty;
this._fieldtype = item.Table.Columns.Contains("fieldsqltag") && !string.IsNullOrWhiteSpace(item["fieldsqltag"] + "") ? Convert.ToInt32(item["fieldsqltag"] + "") : 0; this._fieldtype = item.Table.Columns.Contains("fieldsqltag") && !string.IsNullOrWhiteSpace(item["fieldsqltag"] + "") ? Convert.ToInt32(item["fieldsqltag"] + "") : 0;
//if (this._fieldtype==116)
//{
// this._fieldtype = 160;
//}
//if (this._fieldtype == 117)
//{
// this._fieldtype = 161;
//}
this._sqlSource = item.Table.Columns.Contains("fieldsql") && !string.IsNullOrWhiteSpace(item["fieldsql"] + "") ? item["fieldsql"] + "" : string.Empty; this._sqlSource = item.Table.Columns.Contains("fieldsql") && !string.IsNullOrWhiteSpace(item["fieldsql"] + "") ? item["fieldsql"] + "" : string.Empty;
this._valueMember = item.Table.Columns.Contains("fieldsqlid") && !string.IsNullOrWhiteSpace(item["fieldsqlid"] + "") ? item["fieldsqlid"] + "" : "dm"; this._valueMember = item.Table.Columns.Contains("fieldsqlid") && !string.IsNullOrWhiteSpace(item["fieldsqlid"] + "") ? item["fieldsqlid"] + "" : "dm";
this._textMember = item.Table.Columns.Contains("fieldsqlname") && !string.IsNullOrWhiteSpace(item["fieldsqlname"] + "") ? item["fieldsqlname"] + "" : "mc"; this._textMember = item.Table.Columns.Contains("fieldsqlname") && !string.IsNullOrWhiteSpace(item["fieldsqlname"] + "") ? item["fieldsqlname"] + "" : "mc";
+28 -4
View File
@@ -211,6 +211,12 @@ namespace Lskj.Control.Model
/// 弹出框右键 /// 弹出框右键
/// </summary> /// </summary>
public BarItemLinkCollection rightItemLinks; public BarItemLinkCollection rightItemLinks;
/// <summary>
/// 模块选择框 选中后返回关联的字典
/// </summary>
public Dictionary<string, string> ModuleResultDic = new Dictionary<string, string>();
/// <summary> /// <summary>
/// 控件Panel对象 /// 控件Panel对象
/// </summary> /// </summary>
@@ -1399,7 +1405,9 @@ namespace Lskj.Control.Model
{ {
model.SourceSql += "and 1<>1"; model.SourceSql += "and 1<>1";
} }
DataTable table = (model.FieldType == ControlType.LabSelectReturnIdNew || model.FieldType == ControlType.LabSelectReturnTextNew) ? new DataTable() : BaseImpl.GetDataTableResult(model.SourceSql); DataTable table = new DataTable();
if (model.FieldType != ControlType.LabSelectReturnIdNew && model.FieldType != ControlType.LabSelectReturnTextNew)
{
if (mControlSourceDic.ContainsKey(model)) if (mControlSourceDic.ContainsKey(model))
{ {
table = mControlSourceDic[model].Result; table = mControlSourceDic[model].Result;
@@ -1408,6 +1416,7 @@ namespace Lskj.Control.Model
{ {
table = BaseImpl.GetDataTableResult(model.SourceSql); table = BaseImpl.GetDataTableResult(model.SourceSql);
} }
}
//if (model.FieldType != ControlType.LabAutoCompleteValueParam && model.FieldType != ControlType.LabAutoCompleteTextParam && model.FieldType != ControlType.LabAutoCompleteValue && model.FieldType != ControlType.LabAutoCompleteText) //if (model.FieldType != ControlType.LabAutoCompleteValueParam && model.FieldType != ControlType.LabAutoCompleteTextParam && model.FieldType != ControlType.LabAutoCompleteValue && model.FieldType != ControlType.LabAutoCompleteText)
// table = MainImpl.GetDataTableResult(model.SourceSql); // table = MainImpl.GetDataTableResult(model.SourceSql);
//else //else
@@ -2497,7 +2506,7 @@ namespace Lskj.Control.Model
foreach (ControlModel model in this.ControlModels) foreach (ControlModel model in this.ControlModels)
{ {
BaseUserControl control = FindControl(model); BaseUserControl control = FindControl(model);
if (!model.IsFixedValue) continue;//清空时该控件是否忽略 if (model.IsFixedValue) continue;//清空时该控件是否忽略
// 树结构节点不清空数据 // 树结构节点不清空数据
if (control != null && model.FieldType != ControlType.LabTreeType) if (control != null && model.FieldType != ControlType.LabTreeType)
{ {
@@ -2795,7 +2804,14 @@ namespace Lskj.Control.Model
valueBuilder.AppendFormat("N'{0}',", ParentKey); valueBuilder.AppendFormat("N'{0}',", ParentKey);
} }
if (ModuleResultDic!=null&& ModuleResultDic.Count>0)
{
foreach (string resultKey in ModuleResultDic.Keys)
{
fieldBuilder.Append(resultKey + ",");
valueBuilder.AppendFormat("N'{0}',", ModuleResultDic[resultKey].Replace("'", "''"));
}
}
execSql = string.Format("insert into {0}({1}) values ({2})", tableName, fieldBuilder.ToString().TrimEnd(','), valueBuilder.ToString().TrimEnd(',')); execSql = string.Format("insert into {0}({1}) values ({2})", tableName, fieldBuilder.ToString().TrimEnd(','), valueBuilder.ToString().TrimEnd(','));
} }
else else
@@ -2826,6 +2842,13 @@ namespace Lskj.Control.Model
updateBuilder.Append(string.IsNullOrEmpty(fieldValue) ? string.Format("{0}={1}", model.FieldName, GetNullValue(model)) : string.Format("{0}=N'{1}',", model.FieldName, fieldValue.Replace("'", "''"))); updateBuilder.Append(string.IsNullOrEmpty(fieldValue) ? string.Format("{0}={1}", model.FieldName, GetNullValue(model)) : string.Format("{0}=N'{1}',", model.FieldName, fieldValue.Replace("'", "''")));
} }
} }
if (ModuleResultDic != null && ModuleResultDic.Count > 0)
{
foreach (string resultKey in ModuleResultDic.Keys)
{
updateBuilder.Append(string.Format("{0}=N'{1}',", resultKey, ModuleResultDic[resultKey].Replace("'", "''")));
}
}
if (!string.IsNullOrWhiteSpace(updateBuilder.ToString())) if (!string.IsNullOrWhiteSpace(updateBuilder.ToString()))
{ {
execSql = string.Format("update {0} set {1} where {2}='{3}'", tableName, updateBuilder.ToString().TrimEnd(','), primaryKey, primaryValue); execSql = string.Format("update {0} set {1} where {2}='{3}'", tableName, updateBuilder.ToString().TrimEnd(','), primaryKey, primaryValue);
@@ -3736,7 +3759,8 @@ namespace Lskj.Control.Model
/// <returns>System.Windows.Forms.Control.</returns> /// <returns>System.Windows.Forms.Control.</returns>
private System.Windows.Forms.Control InitControl(ControlModel model, bool isLoadBorder = true) private System.Windows.Forms.Control InitControl(ControlModel model, bool isLoadBorder = true)
{ {
if (!string.IsNullOrEmpty(model.SourceSql) && model.Visible)
if (!string.IsNullOrEmpty(model.SourceSql)&& !(model.FieldType == ControlType.LabSelectReturnIdNew || model.FieldType == ControlType.LabSelectReturnTextNew))
{ {
Task<DataTable> sourceTask = null; Task<DataTable> sourceTask = null;
if (StaticControl.AddParentGrid.Key != null && Model != null && StaticControl.AddParentGrid.Key.Equals(Model.ModuleCode)) if (StaticControl.AddParentGrid.Key != null && Model != null && StaticControl.AddParentGrid.Key.Equals(Model.ModuleCode))
@@ -555,7 +555,7 @@ namespace Lskj.Control.MultiModelLookUp
ReplaceHelper.ReplaceWhereCond(this.NewSourceSQL) + where; ReplaceHelper.ReplaceWhereCond(this.NewSourceSQL) + where;
this.DataSource = MainImpl.GetDataTableResult(sqlValue); this.DataSource = MainImpl.GetDataTableResult(sqlValue);
this.SetSelectionBox(); this.SetSelectionBox();
this.SetDefaultValue(); //this.SetDefaultValue();
} }
/// <summary> /// <summary>
@@ -636,7 +636,7 @@ namespace Lskj.Control.MultiModelLookUp
this.SearchObj.ParentUnionField = this.ParentUnionField; this.SearchObj.ParentUnionField = this.ParentUnionField;
this.pl_top.Height = 0; this.pl_top.Height = 0;
this.pl_top.Height = this.SearchObj.InitSearchControl(queryTable, this.pl_top); this.pl_top.Height = this.SearchObj.InitSearchControl(queryTable, this.pl_top);
this.SearchObj.OnSearchAfterCallBack += SearchObj_OnSearchAfterCallBack; //this.SearchObj.OnSearchAfterCallBack += SearchObj_OnSearchAfterCallBack;
if (LeftTreeViewEx != null && LeftTreeViewEx.TreeView.Nodes.Count > 0) if (LeftTreeViewEx != null && LeftTreeViewEx.TreeView.Nodes.Count > 0)
{ {
@@ -671,12 +671,9 @@ namespace Lskj.Control.MultiModelLookUp
{ {
if (isFirstSearch) if (isFirstSearch)
{ {
//this.SetSelectionBox();
this.SetDefaultValue(); this.SetDefaultValue();
} }
isFirstSearch = false; isFirstSearch = false;
//this.SetSelectionBox();
//this.SetReadOnlyColumns();
} }
#endregion #endregion
@@ -833,13 +830,49 @@ namespace Lskj.Control.MultiModelLookUp
/// <param name="e">The <see cref="DevExpress.XtraGrid.Views.Grid.RowCellClickEventArgs"/> instance containing the event data.</param> /// <param name="e">The <see cref="DevExpress.XtraGrid.Views.Grid.RowCellClickEventArgs"/> instance containing the event data.</param>
private void OnRowCellClickRadio(object sender, EventArgs e) private void OnRowCellClickRadio(object sender, EventArgs e)
{ {
EditValue = string.Empty;
EditText = string.Empty;
ModuleResultDic.Clear();
DataRow dr = this.gcMain.GridView.GetFocusedDataRow(); DataRow dr = this.gcMain.GridView.GetFocusedDataRow();
if (dr != null) if (dr != null)
{ {
this.EditValue = dr[ValueMember] + ""; this.EditValue = dr[ValueMember] + "";
this.EditText = dr[TextField] + ""; this.EditText = dr[TextField] + "";
if (!string.IsNullOrEmpty(AddModuleResult))
{
string[] resultFields = AddModuleResult.Split(',');
foreach (string resultField in resultFields)
{
Match match = Regex.Match(resultField, @"^\s*([^\s]+)\s+AS\s+([^\s]+)\s*$", RegexOptions.IgnoreCase);
if (match.Success)
{
string beforeAs = match.Groups[1].Value.Trim();
string afterAs = match.Groups[2].Value.Trim();
string value = "";
if (dr.Table.Columns.Contains(beforeAs))
{
value += dr[beforeAs] + "";
}
ModuleResultDic.Add(afterAs, value);
}
else
{
string value = "";
if (dr.Table.Columns.Contains(resultField))
{
value += dr[resultField] + "";
}
ModuleResultDic.Add(resultField, value);
}
}
}
this.DialogResult = DialogResult.OK; this.DialogResult = DialogResult.OK;
this.Close(); this.Close();
} }