当前位置:首页 > Python教程 > python技巧

python实现不同条件下单据体的颜色不一样,比如直接成本分析表中关闭的细目显示为黄色

#引入clr运行库
import clr
#添加对cloud插件开发的常用组件的引用
clr.AddReference(‘Kingdee.BOS‘)
clr.AddReference(‘Kingdee.BOS.Core‘)
from Kingdee.BOS.Core.DynamicForm.PlugIn.ControlModel import *

def  OnLoad(e):
     grid = this.View.GetControl[EntryGrid]("FEntity")#需要设置的单据体标识Key(获取到对应的控件)   
     rows = this.View.Model.GetEntryRowCount("FEntity")  #获取到单据体总行数
     fh=‘‘
     for row in range(0,rows):
         fxh=this.View.Model.GetValue("FBILLSTATUS", row)   #获取单据状态的值
         if  fxh==‘2‘:  #已关闭
            grid.SetRowBackcolor("#FFFF00", row)
            grid.Enabled = False
         

原文:https://www.cnblogs.com/woshinige/p/11510874.html


【说明】本文章由站长整理发布,文章内容不代表本站观点,如文中有侵权行为,请与本站客服联系(QQ:254677821)!

相关教程推荐

其他课程推荐