根据采购员获取绑定的用户

栏目:云星空知识作者:金蝶来源:金蝶云社区发布:2024-09-16浏览:1

根据采购员获取绑定的用户

采购订单上根据采购员获取其对应的用户 1、新增用户字段 2、注册python表单插件,复制下面的脚本,修改`F_ABC_UserId`为自己新增的用户标识 ```python import clr clr.AddReference('mscorlib') clr.AddReference('Kingdee.BOS.App') from System import * from Kingdee.BOS.App.Data import * def DataChanged(e): #采购员值更新 if e.Field.Key == "FPurchaserId": pur = this.View.Model.GetValue("FPurchaserId",0) purId = 0#采购员内码 if pur != None: purId = pur["Id"] userId = GetUserIdByCGY(purId) this.View.Model.SetValue("F_ABC_UserId",userId,0)#设置用户字段,二开修改F_ABC_UserId标识即可 #根据采购员获取绑定的用户 def GetUserIdByCGY(cgyId): org= this.View.Model.GetValue("FPurchaseOrgId",0) orgId = 0#采购组织内码 if org != None: orgId = org["Id"] sql = """select t1.FUSERID from T_SEC_USER t1 inner join T_BD_STAFF t2 on t2.FPERSONID = t1.FLINKOBJECT inner join T_BD_OPERATORENTRY t3 on t3.FSTAFFID=t2.FSTAFFID where t3.FENTRYID = {0} and t3.FOPERATORTYPE = 'CGY' and t3.FBIZORGID = {1} and t3.FISUSE='1'""".format(cgyId,orgId) ds = DBUtils.ExecuteDataSet(this.Context,sql) tab = ds.Tables[0] userId = tab.Rows[0]["FUSERID"] if tab.Rows.Count>0 else 0#获取用户内码 return userId ``` **其他更多文章入口:**[https://wenku.my7c.com/link/s/lbRPP](https://wenku.my7c.com/link/s/lbRPP)

根据采购员获取绑定的用户

采购订单上根据采购员获取其对应的用户1、新增用户字段2、注册python表单插件,复制下面的脚本,修改`F_ABC_UserId`为自己新增的用户标识``...
点击下载文档
确认删除?
回到顶部
客服QQ
  • 客服QQ点击这里给我发消息