费用报销单支持不同用户按部门过滤列表的python实现

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

费用报销单支持不同用户按部门过滤列表的python实现

费用报销单支持不同用户按部门过滤列表的python实现 import clr clr.AddReference('Kingdee.K3.FIN.ER.ServiceHelper') clr.AddReference('Kingdee.BOS') clr.AddReference('Kingdee.BOS.Core') clr.AddReference('Kingdee.BOS.App') from Kingdee.K3.FIN.ER.ServiceHelper import * from Kingdee.BOS import * from Kingdee.BOS.Core import * from Kingdee.BOS.Core.Bill import * from Kingdee.BOS.Core.DynamicForm.PlugIn import * from Kingdee.BOS.Core.DynamicForm.PlugIn.ControlModel import * from System import * from Kingdee.BOS.App.Data import * def PrepareFilterParameter(e): if this.View.OpenParameter == None: return billTypeId = this.View.OpenParameter.GetCustomParameter("BillTypeID") if billTypeId == None or billTypeId == "": return #if str(billTypeId)=='64c0bdab395324' or str(billTypeId)=='000ffecf2c6f97f311e32b0998d51004': #根据登录用户获取部门 gatherInfoList = CommonServiceHelper.GetUserLinkDept(this.Context, this.Context.UserId, True);#true表示只取部门,False表示取所有任职部门 if (gatherInfoList == None or len(gatherInfoList) <= 0): e.FilterString = e.FilterString + " AND 1=0 " return deptId = str(gatherInfoList[0]['FDEPTID']) if len(deptId)>0: #这段是为了根据不同部门,设置不同范围,例如:财务部可以看所有部门,其他只能看自己部门 #sql = 'select fnumber from t_bd_department where fdeptid='+deptId #deptnumber = DBUtils.ExecuteScalar(this.Context,sql,None) #if(deptnumber== None): #e.FilterString = e.FilterString + " AND 1=0 " #return #if(str(deptnumber) !='03' and str(deptnumber)!='01'): e.FilterString = e.FilterString + 'AND (FRequestDeptID in ('+deptId+') OR FExpenseDeptID in ('+deptId+'))' #以下代码主要用于获取单据类型的内码,以及验证部门是否成功取到 #def AfterBindData(e): #billTypeId = this.View.OpenParameter.GetCustomParameter("BillTypeID") #gatherInfoList = CommonServiceHelper.GetUserLinkDept(this.Context, this.Context.UserId, True); #this.View.ShowMessage(str(billTypeId))

费用报销单支持不同用户按部门过滤列表的python实现

费用报销单支持不同用户按部门过滤列表的python实现import clrclr.AddReference('Kingdee.K3.FIN.ER.ServiceHelper')clr.AddReference('Ki...
点击下载文档
确认删除?
回到顶部
客服QQ
  • 客服QQ点击这里给我发消息