实现应付单或付款申请单携带当前用户绑定的员工(类似费用申请新增时携带的申请人)
一、扩展应付单或付款申请单增加基础资料员工(申请人),付款申请单图为例:标识F_ZZA_BASE
注册Python表单插件
效果,新增单据时,会携带到当前用户为申请人
代码如下
clr.AddReference('System')
clr.AddReference('Kingdee.BOS')
clr.AddReference('mscorlib')
clr.AddReference('Kingdee.BOS.Core')
clr.AddReference('Kingdee.K3.FIN.ER.ServiceHelper')
from Kingdee.BOS.Util import *
from Kingdee.BOS.Util import ObjectUtils
from System import *
from System.Collections.Generic import *
from Kingdee.K3.FIN.ER.ServiceHelper import *
def AfterBindData(e):
baseId = this.View.Model.GetValue("F_ZZA_BASE")
statue=this.View.Model.GetValue("FDOCUMENTSTATUS")
if (baseId is None or Convert.ToInt64(baseId["id"])==0) and statue!="C":
gatherInfo = CommonServiceHelper.GetUserLinkEmp(this.Context, this.Context.UserId);
if gatherInfo is not None:
this.View.Model.SetValue("F_ZZA_BASE", gatherInfo["FEmpID"])
this.View.UpdateView("F_ZZA_BASE")
推荐阅读