a
This commit is contained in:
86
14.宝锐/GZ.LJY000.Biori/PLN_FORECAST/BillEventPlugInEx.py
Normal file
86
14.宝锐/GZ.LJY000.Biori/PLN_FORECAST/BillEventPlugInEx.py
Normal file
@@ -0,0 +1,86 @@
|
||||
import clr
|
||||
clr.AddReference("System")
|
||||
clr.AddReference("System.Xml")
|
||||
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.Contracts import *
|
||||
from Kingdee.BOS.Core import *
|
||||
from Kingdee.BOS.Core.List import *
|
||||
from Kingdee.BOS.Core.DynamicForm.PlugIn import *
|
||||
from Kingdee.BOS.Core.DynamicForm.PlugIn.Args import *
|
||||
from Kingdee.BOS.Core.Metadata.EntityElement import *
|
||||
from Kingdee.BOS.Core.Bill import *
|
||||
from Kingdee.BOS.Core.Metadata import *
|
||||
from Kingdee.BOS.Orm.DataEntity import *
|
||||
from Kingdee.BOS.Util import *
|
||||
from Kingdee.BOS.Core.Util import *
|
||||
from System import *
|
||||
from System.Xml import *
|
||||
from System.ComponentModel import *
|
||||
from System.Collections.Generic import *
|
||||
from System.Text import*
|
||||
from Kingdee.BOS.ServiceHelper import *
|
||||
|
||||
def BarItemClick(e):
|
||||
#如果是变动插入则改变状态
|
||||
if e.BarItemKey.Equals("tbBarCodePrintEx"):
|
||||
# dynamicFormShowParameter = DynamicFormShowParameter();
|
||||
# dynamicFormShowParameter.FormId = "sfsf_SCJHZQLKUAIZHANTIE";#动态表单标识
|
||||
# this.View.ShowForm(dynamicFormShowParameter,lambda x: SetModel(x));
|
||||
|
||||
billObj = this.View.Model.DataObject;
|
||||
billId = billObj["Id"]
|
||||
FFormId = billObj["FFormId"]
|
||||
allRowCollection = ListSelectedRowCollection()
|
||||
|
||||
entity = billObj["PLN_FORECASTENTRY"]
|
||||
if entity == None or entity.Count == 0:
|
||||
return;
|
||||
# raise Exception(JsonUtil.Serialize(entity))
|
||||
for eItem in entity:
|
||||
# raise Exception(JsonUtil.Serialize(eItem))
|
||||
if eItem["ProductType"] == "1":
|
||||
row = ListSelectedRow("",str(eItem["Id"]) ,0 ,FFormId)
|
||||
row.EntryEntityKey = "FEntity";
|
||||
allRowCollection.Add(row)
|
||||
|
||||
# raise Exception(JsonUtil.Serialize(allRowCollection))
|
||||
sqlL = """/*dialect*/
|
||||
SELECT t0.FID,t0_l.FNAME,t0b.FBILLID
|
||||
FROM T_BD_BARCODERULE t0
|
||||
INNER JOIN T_BD_BARCODERULE_L t0_l on t0_l.FID = t0.FID AND t0_l.FLOCALEID = 2052
|
||||
INNER JOIN T_BD_BARCODERULETOBILL t0b on t0b.FID = t0.FID
|
||||
WHERE 1=1
|
||||
AND t0.FDOCUMENTSTATUS = 'C'
|
||||
AND t0b.FBILLID = '{0}'
|
||||
AND FISCHECK = '1'
|
||||
""".format(FFormId);
|
||||
ruleId = 0
|
||||
resData = DBServiceHelper.ExecuteDynamicObject(this.Context, sqlL)
|
||||
if resData != None and resData.Count > 0:
|
||||
ruleId = resData[0]["FID"]
|
||||
|
||||
# raise Exception(JsonUtil.Serialize(allRowCollection))
|
||||
billShowParameter = BillShowParameter();
|
||||
billShowParameter.FormId = "UHIK_BAR_BarCodePrint";
|
||||
billShowParameter.ParentPageId =this.View.PageId;
|
||||
# billShowParameter.OpenStyle.ShowType = ShowType.Modal;
|
||||
billShowParameter.CustomParams.Add("isFromBill", "1");
|
||||
billShowParameter.CustomParams.Add("SourceFormId", FFormId);
|
||||
billShowParameter.CustomParams.Add("EntityKey", "FEntity");
|
||||
billShowParameter.CustomParams.Add("SourceEntryId", allRowCollection[0].EntryPrimaryKeyValue);
|
||||
billShowParameter.CustomParams.Add("SourceId", str(billId));
|
||||
billShowParameter.CustomParams.Add("RuleId", str(ruleId));
|
||||
# billShowParameter.CustomParams.Add("SelectedRows", JsonUtil.Serialize(allRowCollection))
|
||||
#单据内码
|
||||
# billShowParameter.PKey = str(this.View.Model.DataObject["Id"])
|
||||
billShowParameter.Status = OperationStatus.ADDNEW
|
||||
# billShowParameter.Status = OperationStatus.VIEW;
|
||||
this.View.ShowForm(billShowParameter);
|
||||
return;
|
||||
Reference in New Issue
Block a user