Python版上 单据体上移下移功能原创
84人赞赏了该文章
487次浏览
编辑于2024年07月12日 16:33:43
import clr clr.AddReference('System') clr.AddReference('System.Data') clr.AddReference('Kingdee.BOS') clr.AddReference('Kingdee.BOS.Core') clr.AddReference('Kingdee.BOS.App') clr.AddReference('Kingdee.BOS.ServiceHelper') clr.AddReference('Newtonsoft.Json') from Kingdee.BOS import * from Kingdee.BOS.Core import * from Kingdee.BOS.Core.Bill import * from Kingdee.BOS.Util import * from Kingdee.BOS.Core.DynamicForm.PlugIn import * from Kingdee.BOS.Core.DynamicForm.PlugIn.ControlModel import * from System import * from System.Data import * from System.Net import * from System.Text import * from System.IO import * from Kingdee.BOS.Core.Bill.PlugIn import * from Kingdee.BOS.App.Data import * from System.Collections.Generic import List from Kingdee.BOS.ServiceHelper import * def EntryBarItemClick(e): entityKey="FEntity"; if e.BarItemKey=='u_up': index = this.View.Model.GetEntryCurrentRowIndex(entityKey); if index == 0: return; currRowData = this.View.Model.GetEntityDataObject(this.View.BusinessInfo.GetEntity(entityKey), index);#当前行数据 lastRowData = this.View.Model.GetEntityDataObject(this.View.BusinessInfo.GetEntity(entityKey), index - 1);#上一行数据 #objstr=JsonUtil.Serialize(currRowData); #this.View.ShowMessage(objstr); currRowData["Seq"] = index; lastRowData["Seq"] = index + 1; this.View.UpdateView(entityKey); this.View.GetControl(entityKey).SetFocusRowIndex(index - 1); if e.BarItemKey=='u_down': index=this.View.Model.GetEntryCurrentRowIndex(entityKey); if index == this.View.Model.GetEntryRowCount(entityKey) - 1: return; currRowData = this.View.Model.GetEntityDataObject(this.View.BusinessInfo.GetEntity(entityKey), index);#当前行数据 nextRowData = this.View.Model.GetEntityDataObject(this.View.BusinessInfo.GetEntity(entityKey), index + 1);#下一行数据 currRowData["SEQ"] = index + 2; nextRowData["SEQ"] = index + 1; this.View.UpdateView(entityKey); this.View.GetControl(entityKey).SetFocusRowIndex(index + 1);
相关信息来源于此贴。
赞 84
84人点赞
还没有人点赞,快来当第一个点赞的人吧!
打赏
0人打赏
还没有人打赏,快来当第一个打赏的人吧!