diff --git a/插件库/Lskj.PubBill/BillModule.cs b/插件库/Lskj.PubBill/BillModule.cs index 3c02d1b..eea2bb5 100644 --- a/插件库/Lskj.PubBill/BillModule.cs +++ b/插件库/Lskj.PubBill/BillModule.cs @@ -201,6 +201,10 @@ namespace Lskj.PubBill /// 主表动态生成的日期列 /// public List DateColumnList = new List(); + /// + /// 附加右键菜单 + /// + public SimpleButton itemCommon = new SimpleButton(); public BillModule() { @@ -910,13 +914,12 @@ namespace Lskj.PubBill itemCommon.ItemClick += new ItemClickEventHandler(OnCommonItemClick); if (tableCommon.Columns.Contains("menuCond")) { - itemCommon.Enabled = ReplaceHelper.EvalCond(ReplaceHelper.ReplaceUserInfo(item["menuCond"] + "")); + itemCommon.Enabled = ValidateCond(item["menuCond"] + "", null); } pMenu.AddItem(itemCommon); } else { - SimpleButton itemCommon = new SimpleButton(); //itemCommon.AutoSize = true; itemCommon.Text = item["menuname"] + ""; itemCommon.Tag = item; @@ -929,7 +932,7 @@ namespace Lskj.PubBill x += itemCommon.Width + 6; if (tableCommon.Columns.Contains("menuCond")) { - itemCommon.Enabled = ReplaceHelper.EvalCond(ReplaceHelper.ReplaceUserInfo(item["menuCond"] + "")); + itemCommon.Enabled = ValidateCond(item["menuCond"] + "", null); } j++; } @@ -2019,6 +2022,14 @@ namespace Lskj.PubBill this.dbpFP.Enabled = this.btnDelete.Enabled = this.btnBillSave.Enabled = this.btnBillApply.Enabled = !isReadOnly; this.ControlObj.CanExecControl = true; this.cb_input.Enabled = this.btn_input.Enabled = this.txt_input.Enabled = !isReadOnly; + if (this.itemCommon.Visible == true && this.itemCommon.Tag is DataRow rightRow) + { + string menuCode = rightRow["menuCond"] + ""; + if (!string.IsNullOrEmpty(menuCode)) + { + this.itemCommon.Enabled = ValidateCond(menuCode, rowItem); ; + } + } this.BillRowItem = rowItem; // 设置Brp模版 if (this.IsBrpTemplete || this.BillModel.IsBrp) @@ -2093,6 +2104,14 @@ namespace Lskj.PubBill this.BillModel.SaveState = false; this.ControlObj.SetReadOnlyAllControl(false); this.rdBlue.Enabled = this.rdRed.Enabled = true; + if (this.itemCommon.Visible == true && this.itemCommon.Tag is DataRow rightRow) + { + string menuCode = rightRow["menuCond"] + ""; + if (!string.IsNullOrEmpty(menuCode)) + { + this.itemCommon.Enabled = ValidateCond(menuCode, rowItem); ; + } + } // 通过右键菜单打开单据,假如明细有数据则在初始化时使用传入数据. if (this.BillModel.DetailTreeTable) {