Files
GateDge2023_ljy/02.珠海市供水有限公司/ZHSW.Python/STK_MisDelivery/BillEventPlugInEx.py

44 lines
1.7 KiB
Python
Raw Normal View History

2024-04-10 10:39:04 +08:00
import clr
clr.AddReference("System")
clr.AddReference("Kingdee.BOS")
clr.AddReference("Kingdee.BOS.Core")
clr.AddReference("Kingdee.BOS.DataEntity")
clr.AddReference("Kingdee.BOS.App")
clr.AddReference("Kingdee.BOS.Contracts")
clr.AddReference("Kingdee.BOS.ServiceHelper")
from Kingdee.BOS import*
from Kingdee.BOS.Core import *
from Kingdee.BOS.Core.Metadata.EntityElement import *
from Kingdee.BOS.Orm.DataEntity import*
from Kingdee.BOS.Orm.Metadata.DataEntity import*
from Kingdee.BOS.Core.DynamicForm.PlugIn import *
from Kingdee.BOS.Core.DynamicForm.PlugIn.Args import *
from Kingdee.BOS.Util import *
from System import *
from System.ComponentModel import*
from System.Collections.Generic import*
from System.Text import*
from Kingdee.BOS.ServiceHelper import *
def DataChanged(e):
if e.Field.Key == "FDATE":
if DoCheckConditions():
if e.NewValue.ToString().Equals(e.OldValue.ToString()) == False:
details = this.View.BusinessInfo.GetEntity("FEntity")
if details != null:
entrys = this.View.Model.GetEntityDataObject(details)
if entrys != null and entrys.Count > 0:
rowIndex = this.View.Model.GetRowIndex(details, entry)
materialObjValue = entry["MaterialId_Id"];
materialValue = 0 if materialObjValue.IsNullOrEmptyOrWhiteSpace() else materialObjValue.Long2Int()
stockObjValue = entry["StockId_Id"];
stockValue = 0 if stockObjValue.IsNullOrEmptyOrWhiteSpace() else stockObjValue.Long2Int();
def DoCheckConditions():
orgObj = this.View.Model.GetValue("FStockOrgId")
if orgObj["Id"] == 101542:
return True
# return False
return True