SVN-Revision: r726
This commit is contained in:
cyf
2025-06-13 07:24:25 +00:00
parent da8e218ceb
commit f05d0b4c96
@@ -157,6 +157,10 @@ namespace Lskj.PubAccraditation
/// 是否执行了加载储存过程
/// </summary>
public bool ProcessExists = false;
// <summary>
/// 模块对应的权限表信息
/// </summary>
public DataTable AuthorityTable;
#endregion
/// <summary>
@@ -1031,12 +1035,14 @@ namespace Lskj.PubAccraditation
// }
//}
this.AuthorityTable = PowerImpl.GetModuleAuthorityEnable(this.SysModel.ModuleCode);
if (this.AuditModelObj.DetailModifyFields != "-1")
{
this.gridBillInfo.SetReadOnlyAllColumn();
}
//设置必填和修改字段
this.gridBillInfo.SetFieldStatus(this.AuditModelObj.DetailModifyFields, this.AuditModelObj.RequiredDetailFields);
this.gridBillInfo.SetFieldStatus(this.AuditModelObj.DetailModifyFields, this.AuditModelObj.RequiredDetailFields, this.AuthorityTable);
@@ -1067,8 +1073,8 @@ namespace Lskj.PubAccraditation
{
this.SetTempleteSelectedValue(this.ControlObj.GetControlValue("brpId"));
}
this._dtSourceData = BillImpl.GetDataTableResult(ReplaceHelper.ReplaceParamToValue(this.BillModelObj.DetailSql, this.SysModel.BillDocumentId));
//this._dtSourceData = BillImpl.GetDataTableResult(ReplaceHelper.ReplaceParamToValue(this.BillModelObj.DetailSql, this.SysModel.BillDocumentId));
this._dtSourceData = BillImpl.GetDataTableResult(ReplaceHelper.ReplaceRowParam(_drBillInfoMsg, this.BillModelObj.DetailSql));
if (this.BillModelObj.DetailTreeTable)
@@ -1469,7 +1475,8 @@ namespace Lskj.PubAccraditation
this.ControlObj.SetAllControlValue(this._drBillInfoMsg);
// 刷新明细表
this._dtSourceData = BillImpl.GetDataTableResult(ReplaceHelper.ReplaceParamToValue(this.BillModelObj.DetailSql, this.SysModel.BillDocumentId));
//this._dtSourceData = BillImpl.GetDataTableResult(ReplaceHelper.ReplaceParamToValue(this.BillModelObj.DetailSql, this.SysModel.BillDocumentId));
this._dtSourceData = BillImpl.GetDataTableResult(ReplaceHelper.ReplaceRowParam(_drBillInfoMsg, this.BillModelObj.DetailSql));
this._dtSourceData.OrderBy(this.BillModelObj.DetailOrderField);
if (this.BillModelObj.DetailTreeTable)
{
@@ -1503,8 +1510,13 @@ namespace Lskj.PubAccraditation
{
GridDetailModel model = this.tab_basicInfo.GetFocusTabPageGridDetailModel();
DataRow dataRow = this.BillModelObj.DetailTreeTable ? (this.gridBillInfo as TreeGridControlEx).GetViewFocusedDataRow() : this.gridBillInfo.GridView.GetFocusedDataRow();
string sqlValue = ReplaceHelper.ReplaceRowParam(dataRow, model.DetailSql);
//string sqlValue = ReplaceHelper.ReplaceRowParam(dataRow, model.DetailSql);
//this.tab_basicInfo.SetGridDataSource(MainImpl.GetDataTableResult(sqlValue));
bool isDetailAttach = (model.IsReadOnly || model.IsChart);
string sqlValue = isDetailAttach ? ReplaceHelper.ReplaceRowParam(dataRow, model.DetailSql) : GetSearchSql(model);
sqlValue = ReplaceHelper.ReplaceRowParam(dataRow, sqlValue);
//this.tab_basicInfo.SetGridDataSource(tabPage, MainImpl.GetDataTableResult(sqlValue));
this.tab_basicInfo.SetGridDataSource(MainImpl.GetDataTableResult(sqlValue));
}
catch (Exception ex)
@@ -1699,11 +1711,38 @@ namespace Lskj.PubAccraditation
//改变控件状态 操作字段
if (!string.IsNullOrEmpty(billFields) && billFields != "-1")
{
foreach (DataRow dr in this._dtBillInfoFiled.Rows)
foreach (string item in billFields.Split(','))
{
string fieldName = dr["fieldName"] + "";
this.ControlObj.SetReadOnlyControl(fieldName, !billFields.Split(',').Contains(fieldName), false);
BaseUserControl control = this.ControlObj.FindControl(item);
if (string.IsNullOrWhiteSpace(control.Model.PrivilegeOper))
{
//没有人员权限,转成可编辑
this.ControlObj.SetReadOnlyControl(item, false, false);
}
else
{
List<int> targetPrivTypeIds = new List<int>();
foreach (string permission in control.Model.PrivilegeOper.Split(','))
{
targetPrivTypeIds.Add(int.Parse(permission));
}
//获取权限对应的人员名称
string userString = string.Join(",", AuthorityTable.AsEnumerable()
.Where(row => targetPrivTypeIds.Contains(row.Field<int>("privTypeId")))
.Select(row => row.Field<string>("userList"))
.Where(value => value != null)
.ToList());
//有权限的字段,转成可编辑
if (userString.Split(',').Contains(ERPInfo.Instance.UserName)) this.ControlObj.SetReadOnlyControl(item, false, false);
}
}
//foreach (DataRow dr in this._dtBillInfoFiled.Rows)
//{
// string fieldName = dr["fieldName"] + "";
// this.ControlObj.SetReadOnlyControl(fieldName, !billFields.Split(',').Contains(fieldName), true);
//}
}
}
@@ -2606,7 +2645,8 @@ namespace Lskj.PubAccraditation
if (returnValue == 1)
{
MessageUtil.Show(ResourceKeys.SpliterBillSuccess);
this._dtSourceData = BillImpl.GetDataTableResult(ReplaceHelper.ReplaceParamToValue(this.BillModelObj.DetailSql, this.SysModel.BillDocumentId));
//this._dtSourceData = BillImpl.GetDataTableResult(ReplaceHelper.ReplaceParamToValue(this.BillModelObj.DetailSql, this.SysModel.BillDocumentId));
this._dtSourceData = BillImpl.GetDataTableResult(ReplaceHelper.ReplaceRowParam(_drBillInfoMsg, this.BillModelObj.DetailSql));
this._dtSourceData.OrderBy(this.BillModelObj.DetailOrderField);
this._dtSpareSourceData.Clear();
return true;
@@ -2994,6 +3034,9 @@ namespace Lskj.PubAccraditation
string Message = ErrorMessage.PromptErrorMessage(ex);
MessageUtil.Show(Message, ex.Message);
}
if (this.BillModelObj.SaveSuccessfullyRefresh && !save) return save;//保存成功才刷新
// 刷新主表
this._drBillInfoMsg = BaseAuditImpl.GetCurrentFlowRowData(this.BillModelObj.MasterTable, this.BillModelObj.PrimaryKey, this.SysModel.BillDocumentId);
this.ControlObj.CanExecControl = false;
@@ -3001,7 +3044,8 @@ namespace Lskj.PubAccraditation
this.ControlObj.CanExecControl = true;
// 刷新明细表
this._dtSourceData = BillImpl.GetDataTableResult(ReplaceHelper.ReplaceParamToValue(this.BillModelObj.DetailSql, this.SysModel.BillDocumentId));
//this._dtSourceData = BillImpl.GetDataTableResult(ReplaceHelper.ReplaceParamToValue(this.BillModelObj.DetailSql, this.SysModel.BillDocumentId));
this._dtSourceData = BillImpl.GetDataTableResult(ReplaceHelper.ReplaceRowParam(_drBillInfoMsg, this.BillModelObj.DetailSql));
this._dtSourceData.OrderBy(this.BillModelObj.DetailOrderField);
if (this.BillModelObj.DetailTreeTable)
@@ -3249,7 +3293,8 @@ namespace Lskj.PubAccraditation
this.ControlObj.SetAllControlValue(this._drBillInfoMsg);
// 刷新明细表
this._dtSourceData = BillImpl.GetDataTableResult(ReplaceHelper.ReplaceParamToValue(this.BillModelObj.DetailSql, this.SysModel.BillDocumentId));
//this._dtSourceData = BillImpl.GetDataTableResult(ReplaceHelper.ReplaceParamToValue(this.BillModelObj.DetailSql, this.SysModel.BillDocumentId));
this._dtSourceData = BillImpl.GetDataTableResult(ReplaceHelper.ReplaceRowParam(_drBillInfoMsg, this.BillModelObj.DetailSql));
this._dtSourceData.OrderBy(this.BillModelObj.DetailOrderField);
if (this.BillModelObj.DetailTreeTable)
{