取消采购员与采购组的联动
升级到8.2的版本, 采购组有值的情况下, 修改采购员会联动修改采购组改为采购员对应采购组的第一条(写死在PurchaseOrderEdit中了), 只能用变通的办法处理, 修改采购员前取出采购组,修改后再把采购组赋值回去,可以用全局
变量充当临时变量, 这里我加了一个字段来处理(F_UAGW_PurGroup)
本脚本就是取消这个联动
#引入clr运行库
import clr
#添加对cloud插件开发的常用组件的引用
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')
#导入cloud基础库中的常用实体对象(分命名空间导入,不会递归导入)
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 System.Data import *
from Kingdee.BOS.App.Data import *
from System.Collections.Generic import List
from Kingdee.BOS.ServiceHelper import *
from Kingdee.BOS.Core.Metadata.EntityElement import *
def BeforeUpdateValue(e):
if e.Field.Key == "FPurchaserId":
purGroup = this.Model.GetValue("FPurchaserGroupId",0)
purGroupId = ""
if purGroup != None:
purGroupId = purGroup["Id"]
this.Model.SetValue("F_UAGW_PurGroup",purGroupId ,0)
#this.View.ShowMessage(str(purGroupName))
def DataChanged(e):
if e.Field.Key == "FPurchaserId":
if len(str(this.Model.GetValue("F_UAGW_PurGroup",0))) > 0:
this.Model.SetItemValueByID("FPurchaserGroupId",this.Model.GetValue("F_UAGW_PurGroup", 0),0)
this.Model.SetValue("F_UAGW_PurGroup","",0)
取消采购员与采购组的联动
本文2024-09-16 18:14:10发表“云星空知识”栏目。
本文链接:https://wenku.my7c.com/article/kingdee-k3cloud-20828.html