金蝶云 操作插件(列表界面、维护界面)弹出提示信息
1.维护界面 弹出提示
【注意】注册操作插件
import clr
clr.AddReference("System")
clr.AddReference("System.Data")
clr.AddReference("System.XML")
clr.AddReference("System.Web.Extensions")
clr.AddReference("Kingdee.BOS")
clr.AddReference("Kingdee.BOS.Core")
clr.AddReference("Kingdee.BOS.DataEntity")
clr.AddReference("Kingdee.BOS.ServiceHelper")
clr.AddReference("Newtonsoft.Json")
clr.AddReference("Kingdee.BOS.Contracts")
clr.AddReference("Kingdee.BOS.App")
clr.AddReference("System.Windows.Forms")
clr.AddReference("System.Web")
import sys
from System import *
from System.IO import *
from System.Net import *
from System.Web import *
from System.Text import *
from System.Threading import *
from System.Globalization import *
from System.Security.Cryptography import *
from System.Web.Script.Serialization import *
from System.Collections.Generic import List as syslist
from System.Collections.Generic import Dictionary
from Newtonsoft.Json.Linq import *
from Kingdee.BOS.Contracts import *
from Kingdee.BOS.Core.List import *
from Kingdee.BOS.Core.CommonFilter import *
from Kingdee.BOS.Contracts.Report import *
from Kingdee.BOS.Core.Report import ISysReportView
from Kingdee.BOS.Core.Report import ReportTitles
from Kingdee.BOS.App import ServiceHelper as ServiceHelperAPP
from Kingdee.BOS import *
from System.Windows.Forms import *
from Kingdee.BOS.Core.List.PlugIn import *
from Kingdee.BOS.Core.Log import *
from Kingdee.BOS.Core import *
from Kingdee.BOS.Core.DynamicForm import *
from Kingdee.BOS.Orm import OperateOption
from Kingdee.BOS.Core import *
from Kingdee.BOS.Core.DynamicForm import *
from Kingdee.BOS.DataEntity import *
from Kingdee.BOS.Orm.DataEntity import *
from Kingdee.BOS.Core.Bill import *
from Kingdee.BOS.Core.Bill.PlugIn import *
from Kingdee.BOS.ServiceHelper import *
from Kingdee.BOS.Core.Interaction import KDInteractionException
from Kingdee.BOS import KDBusinessException
from Kingdee.BOS.Core.Metadata.EntityElement import *
from Kingdee.BOS.Core.Metadata import SelectorItemInfo ##字段选择实体类
from Kingdee.BOS.Core.SqlBuilder import QueryBuilderParemeter ##查询参数实体类
#修改默认编码为utf8
reload(sys)
sys.setdefaultencoding('utf-8')
def BeforeExecuteOperationTransaction(e):
oResult = this.OperationResult.OperateResult;
dp=OperateResult()
dp.Message ="哈哈哈哈哈哈哈哈哈哈"#校验信息
dp.Name = "提示"#关键字
dp.MessageType =MessageType.Normal#信息类型
#MessageType.Normal 普通
#MessageType.Warning 警告
#MessageType.FatalError 错误
dp.SuccessStatus =True#状态
oResult.Add(dp)
2.列表界面 弹出提示
【注意】操作插件的提示会继承到列表提示上,若不需要可设置(关闭原有的提示信息)
【注意】注册列表插件
import clr
clr.AddReference("System")
clr.AddReference("System.Data")
clr.AddReference("System.XML")
clr.AddReference("System.Web.Extensions")
clr.AddReference("Kingdee.BOS")
clr.AddReference("Kingdee.BOS.Core")
clr.AddReference("Kingdee.BOS.DataEntity")
clr.AddReference("Kingdee.BOS.ServiceHelper")
clr.AddReference("Newtonsoft.Json")
clr.AddReference("Kingdee.BOS.Contracts")
clr.AddReference("Kingdee.BOS.App")
clr.AddReference("System.Windows.Forms")
clr.AddReference("System.Web")
import sys
from System import *
from System.IO import *
from System.Net import *
from System.Web import *
from System.Text import *
from System.Threading import *
from System.Globalization import *
from System.Security.Cryptography import *
from System.Web.Script.Serialization import *
from System.Collections.Generic import List as syslist
from System.Collections.Generic import Dictionary
from Newtonsoft.Json.Linq import *
from Kingdee.BOS.Contracts import *
from Kingdee.BOS.Core.List import *
from Kingdee.BOS.Core.CommonFilter import *
from Kingdee.BOS.Contracts.Report import *
from Kingdee.BOS.Core.Report import ISysReportView
from Kingdee.BOS.Core.Report import ReportTitles
from Kingdee.BOS.App import ServiceHelper as ServiceHelperAPP
from Kingdee.BOS import *
from System.Windows.Forms import *
from Kingdee.BOS.Core.List.PlugIn import *
from Kingdee.BOS.Core.Log import *
from Kingdee.BOS.Core import *
from Kingdee.BOS.Core.DynamicForm import *
from Kingdee.BOS.Orm import OperateOption
from Kingdee.BOS.Core import *
from Kingdee.BOS.Core.DynamicForm import *
from Kingdee.BOS.DataEntity import *
from Kingdee.BOS.Orm.DataEntity import *
from Kingdee.BOS.Core.Bill import *
from Kingdee.BOS.Core.Bill.PlugIn import *
from Kingdee.BOS.ServiceHelper import *
from Kingdee.BOS.Core.Interaction import KDInteractionException
from Kingdee.BOS import KDBusinessException
from Kingdee.BOS.Core.Metadata.EntityElement import *
from Kingdee.BOS.Core.Metadata import SelectorItemInfo ##字段选择实体类
from Kingdee.BOS.Core.SqlBuilder import QueryBuilderParemeter ##查询参数实体类
#修改默认编码为utf8
reload(sys)
sys.setdefaultencoding('utf-8')
def AfterDoOperation(e):
if e.Operation.Operation=="DoNothing":#操作代码
#e.OperationResult.IsShowMessage =False #关闭原有的提示信息(操作插件插入的提示全部不显示)
oResult =e.OperationResult.OperateResult
f=0
for p in range(len(oResult)):
if "空操作" in oResult[p-f].Message:
oResult.RemoveAt(p-f) #删除没用的提示信息
f+=1
if len(oResult)>0:
this.View.ShowOperateResult(oResult) #打开新的提示信息