根据当前用户关联的采购员过滤价格查询结果

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

根据当前用户关联的采购员过滤价格查询结果

### 背景 采购订单明细信息菜单栏中的“价格查询”操作想设置数据隔离,只能由当前用户所绑定的采购员跟物料上的采购员匹配上才允许其查看价格。 ### 步骤分析 1、根据当前用户获取对应的采购员 2、在价格查询操作的弹出的价目表中过滤物料的采购员是否为当前用户的采购员 ### python案例 ```python import clr clr.AddReference('mscorlib') clr.AddReference('System') clr.AddReference('System.Data') clr.AddReference('Kingdee.BOS.App') clr.AddReference('Kingdee.BOS.ServiceHelper') from System import * from System.Data import * from Kingdee.BOS.App.Data import * from Kingdee.BOS.ServiceHelper import * def PrepareFilterParameter(e): isPriceListQuery = this.View.OpenParameter.GetCustomParameter("IsPriceListQuery") if isPriceListQuery != None: meta = MetaDataServiceHelper.Load(this.Context, this.View.BillBusinessInfo.GetForm().Id) field = meta.BusinessInfo.GetQueryInfo().GetSelectField("FMaterialId") tableName = field.FullFieldName.Substring(0, field.FullFieldName.IndexOf('.')) purchaserId = GetBuyerByUser() filterSqlByBuyer = "EXISTS(SELECT 1 FROM t_bd_MaterialPurchase MP WHERE MP.FMATERIALID = {0}.FMATERIALID AND FPURCHASERID = {1})".format(tableName,str(purchaserId)) e.AppendQueryFilter(filterSqlByBuyer) def GetBuyerByUser(): orgId = this.Context.CurrentOrganizationInfo.ID userId = this.Context.UserId sql = """SELECT t0.FENTRYID FROM T_BD_OPERATORENTRY t0 INNER JOIN T_BD_STAFF t1 on t0.FSTAFFID=t1.FSTAFFID INNER JOIN T_SEC_USER t3 on t1.FPERSONID = t3.FLINKOBJECT WHERE t3.FUSERID = {0} and t0.FOPERATORTYPE = 'CGY' and t0.FBIZORGID={1} and t0.FISUSE='1'""".format(str(userId),str(orgId)) purchaserId = DBUtils.ExecuteScalar(this.Context, sql, None) return purchaserId ``` **其他更多文章入口:**[https://wenku.my7c.com/link/s/lbRPP](https://wenku.my7c.com/link/s/lbRPP)

根据当前用户关联的采购员过滤价格查询结果

### 背景采购订单明细信息菜单栏中的“价格查询”操作想设置数据隔离,只能由当前用户所绑定的采购员跟物料上的采购员匹配上才允许其查看...
点击下载文档
确认删除?
回到顶部
客服QQ
  • 客服QQ点击这里给我发消息