2024-03-04 16:50:20 +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 System import *
|
|
|
|
|
from Kingdee.BOS.App.Data import*
|
|
|
|
|
from Kingdee.BOS.Core.DynamicForm import*
|
|
|
|
|
from Kingdee.BOS.Core.DynamicForm.PlugIn.Args import*
|
|
|
|
|
from Kingdee.BOS.Core.List.PlugIn import*
|
|
|
|
|
from Kingdee.BOS.Orm.DataEntity import*
|
|
|
|
|
from Kingdee.BOS.Util import*
|
|
|
|
|
from Kingdee.BOS import*
|
|
|
|
|
|
|
|
|
|
def AfterCreateNewData(e):
|
2024-03-11 09:04:46 +08:00
|
|
|
details = this.View.BusinessInfo.GetEntity("FTreeEntity")
|
|
|
|
|
if details != None:
|
|
|
|
|
entrys = this.View.Model.GetEntityDataObject(details)
|
|
|
|
|
if entrys != None and entrys.Count > 0:
|
|
|
|
|
rowIndex = 0
|
|
|
|
|
count = entrys.Count
|
|
|
|
|
while count > rowIndex:
|
|
|
|
|
this.View.InvokeFieldUpdateService("FBomId",rowIndex)
|
|
|
|
|
rowIndex += 1
|
|
|
|
|
# for entry in entrys:
|
|
|
|
|
# rowIndex = this.View.Model.GetRowIndex(details, entry)
|
|
|
|
|
# this.View.InvokeFieldUpdateService("FBomId",rowIndex)
|
|
|
|
|
# bomObj = entry["BomId"]
|
|
|
|
|
# mjdzdzId = bomObj["FMJDZDZID"]
|
|
|
|
|
# this.View.Model.SetValue("FMJDZDZID",mjdzdzId)
|
2024-03-04 16:50:20 +08:00
|
|
|
|
|
|
|
|
def BarItemClick(e):
|
|
|
|
|
if e.BarItemKey == "tbUpdMJCPDZDZID":
|
|
|
|
|
MJIDObj = this.View.Model.GetValue("F_PAEZ_BASE")
|
|
|
|
|
MATERIALID = this.View.Model.GetValue("FMATERIALID")
|
|
|
|
|
mjId = MJIDObj["id"]
|
|
|
|
|
cpId = MATERIALID["id"]
|
|
|
|
|
sql ="""/*dialect*/
|
|
|
|
|
select
|
|
|
|
|
cast(b.FBZCL as real) as FBZCL
|
|
|
|
|
,a.F_PAEZ_TEXT
|
|
|
|
|
,a.F_PAEZ_TEXT1
|
|
|
|
|
,b.Fjtbz
|
|
|
|
|
,b.Fmjsmzq
|
|
|
|
|
,b.Fmjqs
|
|
|
|
|
,a.FMJID
|
|
|
|
|
,b.FCPID
|
|
|
|
|
,b.FEntryId
|
|
|
|
|
from hw_mjcpdzb a
|
|
|
|
|
inner join hw_mjcpdzbs b on a.FID = b.FID
|
|
|
|
|
where a.FMJID = {0} and b.FCPID={1}
|
|
|
|
|
""".format(mjId,cpId)
|
|
|
|
|
# raise Exception(sql)
|
|
|
|
|
dbList = DBUtils.ExecuteDynamicObject(this.Context,sql);
|
|
|
|
|
if dbList.Count > 0:
|
|
|
|
|
data = dbList[0]
|
|
|
|
|
this.View.Model.SetValue("FMJDZDZID",data["FEntryId"])
|