单据表头附件表体附件分别显示某些按钮

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

单据表头附件表体附件分别显示某些按钮

@[TOC](目录) ### 背景 单据上一般单据头会有一个附件管理按钮,表体也会有一个附件管理按钮,这两个按钮点击后弹出的窗口都是同一个业务对象。当希望表体的“附件”只允许查看,不允许新增修改删除。单据头的“附件”又不想这样限制时,可以通过如下脚本实现。以采购订单为例 ### python案例 #### 采购订单(PUR_PurchaseOrder)表单插件 ```python import clr clr.AddReference('mscorlib') from System import * def BarItemClick(e): if e.BarItemKey == "tbAccessory":#表头附件按钮标识 this.View.OpenParameter.SetCustomParameter("IsShowBarItem", "Head") def EntryBarItemClick(e): if e.BarItemKey == "tbAccessoryCount":#表体附件按钮标识 this.View.OpenParameter.SetCustomParameter("IsShowBarItem", "Entry") ``` #### 附件明细(BOS_Attachment)列表插件 ```python import clr clr.AddReference('mscorlib') from System import * def AfterBindData(e): if this.View.ParentFormView.OpenParameter.GetCustomParameter("IsShowBarItem") == "Entry": this.View.GetBarItem("", "tbNew").Visible = False this.View.GetBarItem("", "tbbtnEdit").Visible = False this.View.GetBarItem("", "tbbtnDel").Visible = False else: this.View.GetBarItem("", "tbNew").Visible = True this.View.GetBarItem("", "tbbtnEdit").Visible = True this.View.GetBarItem("", "tbbtnDel").Visible = True ``` ### 实现效果 ![02.webp](/download/010017266d549037438b9fce03f3b3da8a5c.webp) ::: hljs-center (表头附件窗口) ::: ![03.webp](/download/01001c85d029cf07424d9fa0c41d0a0ff6ba.webp) ::: hljs-center (表体附件窗口) ::: **其他更多文章入口:**[https://wenku.my7c.com/link/s/lbRPP](https://wenku.my7c.com/link/s/lbRPP)

单据表头附件表体附件分别显示某些按钮

@[TOC](目录)### 背景单据上一般单据头会有一个附件管理按钮,表体也会有一个附件管理按钮,这两个按钮点击后弹出的窗口都是同一个业务对...
点击下载文档
确认删除?
回到顶部
客服QQ
  • 客服QQ点击这里给我发消息