SVN-Revision: r924
This commit is contained in:
cyf
2025-08-07 09:29:22 +00:00
parent f7a53010be
commit e6ec3e4886
27 changed files with 4288 additions and 277 deletions
+9 -1
View File
@@ -321,4 +321,12 @@ namespace Lskj.Control.Model
/// </summary>
public bool ScanAfterEmpty { get; set; }
/// <summary>
///是否为 导入返
///是否为 导入返回值控件(每次导入前刷新默认值并带入)
/// </summary>
public bool ImportReturnValue { get; set; }
/// <summary>
///是否为 导入控件(每次导入前把当前控件值带入)
/// </summary>
public bool ImportCurrentValue { get; set; }
/// <summary>
///是否为
@@ -108,6 +108,11 @@ namespace Lskj.Control.Model
/// <value><c>true</c> if this instance is web view; otherwise, <c>false</c>.</value>
public bool IsDetailView { get { return this._detailType == 4; } }
/// <summary>
/// 明细页签(带虚拟日期)
/// </summary>
/// <value><c>true</c> if this instance is web view; otherwise, <c>false</c>.</value>
public bool IsSched { get { return this._detailType == 7; } }
/// <summary>
/// sql配置明细是否可以保存
/// </summary>
public bool DetailIsSave;
@@ -273,7 +278,10 @@ namespace Lskj.Control.Model
///mrp条件页签(根据页签选中行去设置别的页签中对应的条件)
/// </summary>
public bool MrpConditionTab;
/// <summary>
/// 刷新明细的序号(排产模块)
/// </summary>
public string PlanLetfControl;
/// <summary>
/// 主模块编号
@@ -332,4 +340,5 @@ namespace Lskj.Control.Model
this.Enablecond = item.Table.Columns.Contains("Enablecond") ? (item["Enablecond"] + "") : string.Empty;
this.DBClickEvent = item.Table.Columns.Contains("DBClickEvent") ? "1".Equals(item["DBClickEvent"] + "") : false;
this.ProhibitRefresh = item.Table.Columns.Contains("ProhibitRefresh") ? "1".Equals(item["ProhibitRefresh"] + "") : false;
this.DragExecuteSql = item.Ta
this.DragExecuteSql = item.Table.Columns.Contains("DragExecuteSql") ? item["DragExecuteSql"] + "" : "";
this.QueryAgain = item.Table.Col
+76 -16
View File
@@ -19,6 +19,10 @@ using DevExpress.Utils;
using System.Data;
using DevExpress.XtraGrid;
using Lskj.Util;
using DevExpress.XtraTreeList.Nodes;
using DevExpress.XtraTreeList;
using DevExpress.XtraTreeList.Columns;
using DevExpress.Data;
namespace Lskj.Control.Model
{
@@ -450,27 +454,83 @@ namespace Lskj.Control.Model
}
#endregion
/// <summary>
/// 拖拽时判断条件
/// </summary>
/// <returns></returns>
protected bool JudgingConditions()
#region
public static void TreeListAddCheckBox(TreeList treeList)
{
if (!string.IsNullOrWhiteSpace(DragConditions))
treeList.OptionsView.ShowCheckBoxes = true;
treeList.OptionsSelection.MultiSelect = true;
treeList.OptionsSelection.MultiSelectMode = TreeListMultiSelectMode.RowSelect;
treeList.OptionsSelection.InvertSelection = true;
treeList.OptionsSelection.UseIndicatorForSelection = true;
treeList.OptionsSelection.EnableAppearanceFocusedCell = false;
// 绑定节点勾选状态变更事件
treeList.AfterCheckNode += OnTreeListAfterCheckNode;
// 遍历所有列,设置需要自定义汇总的列
foreach (TreeListColumn column in treeList.Columns)
{
string DragCond = ReplaceHelper.ReplaceRowParam(this._targetGridView.GetDataRow(this._targetGridView.FocusedRowHandle), DragConditions);
DataRow[] rows = GetGridSelectRows(DragHander.Count > 1 && this._sourceGridView.GetSelectedRows().Length == DragHander.Count ? DragHander.ToArray() : this._sourceGridView.GetSelectedRows());
foreach (DataRow row in rows)
GridColumnModel columnModel = (GridColumnModel)column.Tag;
if (treeList.Columns.IndexOf(column) > 0 && columnModel != null && columnModel.CanSum)
{
if (!ReplaceHelper.ReplaceRowParamCond(row, DragCond))
{
return false;
}
column.SummaryFooter = DevExpress.XtraTreeList.SummaryItemType.Custom;
column.RowFooterSummary = DevExpress.XtraTreeList.SummaryItemType.Custom;
//SummaryItem groupSummaryItem = treeList.GroupSummary.FirstOrDefault(n => n.FieldName == column.FieldName);
//if (groupSummaryItem != null)
//{
// groupSummaryItem.SummaryType = DevExpress.Data.SummaryItemType.Custom;
//}
}
}
return true;
}
// 节点勾选状态变更事件处理方法
private static void OnTreeListAfterCheckNode(object sender, NodeEventArgs e)
{
TreeList treeList = sender as TreeList;
if (treeList == null) return;
}
}
// 更新子节点状态
UpdateChildNodes(e.Node, e.Node.Checked);
// 更新父节点状态
UpdateParentNode(e.Node);
}
// 递归更新子节点的选中状态
private static void UpdateChildNodes(TreeListNode node, bool check)
{
foreach (TreeListNode childNode in node.Nodes)
{
childNode.Checked = check;
UpdateChildNodes(childNode, check);
}
}
// 更新父节点的选中状态
private static void UpdateParentNode(TreeListNode node)
{
TreeListNode parentNode = node.ParentNode;
if (parentNode == null) return;
bool allChecked = true;
bool allUnchecked = true;
// 检查所有兄弟节点的状态
foreach (TreeListNode siblingNode in parentNode.Nodes)
{
if (siblingNode.Checked)
allUnchecked = false;
else
allChecked = false;
if (!allChecked && !allUnchecked)
break;
}
// 根据兄弟节点状态设置父节点状态
parentNode.Checked = allChecked;
parentNode.CheckState = allChecked ? CheckState.Checked :
(allUnchecked ? CheckState.Unchecked : CheckState.Indeterminate);
// 递
+4 -4
View File
@@ -1282,8 +1282,8 @@ namespace Lskj.Control.Model
{
try
{
string sqlstr = "select fieldName,userName from {0} where {1}='{2}' and isExport='1' and OperatorName='{3}'";
sqlstr = string.Format(sqlstr, ResourceKeys.SettingExportTableName, "formkey", CustomColumKey, ERPInfo.Instance.UserName);
string sqlstr = "select fieldName,userName from {0} where {1}='{2}' and isExport='1' and OperatorId='{3}'";
sqlstr = string.Format(sqlstr, ResourceKeys.SettingExportTableName, "formkey", CustomColumKey, ERPInfo.Instance.UserId);
isExportTab = SqlHelper.ExecuteDataTable(sqlstr);
}
catch (Exception)
@@ -1508,8 +1508,8 @@ namespace Lskj.Control.Model
{
try
{
string sqlstr = "select fieldName,userName from {0} where {1}='{2}' and isExport='1' and OperatorName='{3}'";
sqlstr = string.Format(sqlstr, ResourceKeys.SettingExportTableName, "formkey", CustomColumKey, ERPInfo.Instance.UserName);
string sqlstr = "select fieldName,userName from {0} where {1}='{2}' and isExport='1' and OperatorId='{3}'";
sqlstr = string.Format(sqlstr, ResourceKeys.SettingExportTableName, "formkey", CustomColumKey, ERPInfo.Instance.UserId);
isExportTab = SqlHelper.ExecuteDataTable(sqlstr);
}
catch (Exception)
@@ -513,8 +513,24 @@ namespace Lskj.Control.Model
// 特殊处理程序
else if (dllName.Contains(".exe") && !model.WipeExes.Contains(dllName.ToString()) && (dllName.ToLower() != "lstest.exe"))
{
//删除选中行的json信息
if(!string.IsNullOrWhiteSpace(maintabFocusedRowJson))paramList.Remove(maintabFocusedRowJson);
// 创建进程启动信息对象
ProcessStartInfo startInfo = new ProcessStartInfo();
startInfo.FileName = File.Exists(dllName) ? dllName : PubUtil.AbsolutelyLibPath + dllName; // 指定要启动的 EXE 路径
// 将参数数组拼接为命令行字符串(注意空格处理)
// 若参数包含空格,需要用双引号包裹,避免被解析为多个参数
startInfo.Arguments = string.Join(" ", paramList.Select(arg =>
arg.Contains(" ") ? $"\"{arg}\"" : arg
));
// 可选:设置进程启动选项
startInfo.UseShellExecute = false; // 不使用系统外壳程序(建议为 false,便于重定向输入输出)
startInfo.CreateNoWindow = false; // 是否在新窗口中启动(false 为显示窗口)
// 启动进程
Process process = Process.Start(startInfo);
// 执行exe程序
WinHelper.WinExec(File.Exists(dllName) ? dllName : PubUtil.AbsolutelyLibPath + dllName, 1);
//WinHelper.WinExec(File.Exists(dllName) ? dllName : PubUtil.AbsolutelyLibPath + dllName, 1);
}
else if (dllName.StartsWith("www.") ||
+52 -3
View File
@@ -148,7 +148,10 @@ namespace Lskj.Control.Model
/// 如果主表刷新后还要选中之前的明细,就要存主表主键值(目前没用传进来)
/// </summary>
public Dictionary<string, Dictionary<DataRow, string>> DetailSelection = new Dictionary<string, Dictionary<DataRow, string>>();
/// <summary>
/// 是否为审核界面主表
/// </summary>
public bool isAuditMain = false;
/// <summary>
@@ -496,6 +499,10 @@ namespace Lskj.Control.Model
{
baseControl.ModifyDefaultColors(ColorTranslator.FromHtml(model.ControlTitleColor));
}
if (this.isAuditMain && !string.IsNullOrWhiteSpace(model.AuditControlTitleColor))
{
baseControl.ModifyAuditDefaultColors(ColorTranslator.FromHtml(model.AuditControlTitleColor));
}
baseControl.Required = model.IsEmpty;
baseControl.ReadOnly = model.ReadOnly;
@@ -1443,7 +1450,8 @@ namespace Lskj.Control.Model
model.SourceSql += "and 1<>1";
}
DataTable table = new DataTable();
if (!ControlType.IsNotLoadData(model.FieldType) && model.FieldType != ControlType.LabTreeType)
if ((!ControlType.IsNotLoadData(model.FieldType)|| model.ModuleFrameDisplayText && (model.FieldType == 160|| model.FieldType == 161)) && model.FieldType != ControlType.LabTreeType)
{
if (mControlSourceDic.ContainsKey(model))
{
@@ -1554,6 +1562,11 @@ namespace Lskj.Control.Model
LabelMultiAutoTextEdit2 moduleReturnsId = ctr as LabelMultiAutoTextEdit2;
moduleReturnsId.SetDataSource(table);
break;
case ControlType.LabSelectReturnIdNew:
case ControlType.LabSelectReturnTextNew:
LabelMultiAutoTextEdit4 moduleReturnsIdnew = ctr as LabelMultiAutoTextEdit4;
moduleReturnsIdnew.DataSource=table;
break;
case ControlType.DynamicallyGeneratedSql:
LabelMultiAutoTextEdit3 moduleSqlGenerated = ctr as LabelMultiAutoTextEdit3;
//moduleSqlGenerated.SetDataSource(table);
@@ -4008,6 +4021,8 @@ namespace Lskj.Control.Model
model.PrivilegeView = item.Table.Columns.Contains("PrivilegeView") ? item["PrivilegeView"] + "" : "";
model.PrivilegeOper = item.Table.Columns.Contains("PrivilegeOper") ? item["PrivilegeOper"] + "" : "";
model.AdditionalAssociations = item.Table.Columns.Contains("AdditionalAssociations") && !string.IsNullOrWhiteSpace(item["AdditionalAssociations"] + "") ? "1".Equals(item["AdditionalAssociations"] + "") : false;
model.AuditControlTitleColor = item.Table.Columns.Contains("AuditControlTitleColor") ? item["AuditControlTitleColor"] + "" : "";
model.ModuleFrameDisplayText = item.Table.Columns.Contains("ModuleFrameDisplayText") ? "1".Equals(item["ModuleFrameDisplayText"] + "") : false;
//为了和工具里和bs里统一
if (model.FieldType == 42)
{
@@ -4539,6 +4554,14 @@ namespace Lskj.Control.Model
moduleReturnsIdNew.ConfigureColumnMode = model.ConfigureColumnMode;
moduleReturnsIdNew.InitialFrame();
model.SourceSql = "";
//设置了ModuleFrameDisplayText(显示text值),就把配置的模块sql传给model.SourceSql
if (model.ModuleFrameDisplayText)
{
moduleReturnsIdNew.ModuleFrameDisplayText = true;
model.SourceSql = moduleReturnsIdNew._lookUpForm.SysModel.MenuSql;
}
// DataTable dataSource = new DataTable();
//moduleReturnsIdNew.SetDataSource(dataSource);
moduleReturnsIdNew.TextEdit.KeyDown += new KeyEventHandler(OnTextEditKeyDown);
@@ -6036,4 +6059,30 @@ namespace Lskj.Control.Model
LabelDateEdit dateEdit = controlObj as LabelDateEdit;
value = dateEdit.TextEdit.EditValue == null ? dateEdit.EditText : dateEdit.TextEdit.DateTime.ToString("yyyy-MM-dd");
}
else if
else if (controlObj is LabelCheckEdit)
{
LabelCheckEdit checkEdit = controlObj as LabelCheckEdit;
value = checkEdit.EditText;
}
else if (controlObj is LabelComboxEdit)
{
LabelComboxEdit autoEdit = controlObj as LabelComboxEdit;
value = autoEdit.EditValue;
}
else if (controlObj is LabelTextEdit)
{
LabelTextEdit textIntEdit = controlObj as LabelTextEdit;
if (textIntEdit != null) value = string.IsNullOrEmpty(textIntEdit.EditText) ? "0" : textIntEdit.EditText;
}
defaultValue = defaultValue.Replace(item, value);
}
}
}
return defaultValue;
}
}
}