Files
GateDge2023_ljy/14.宝锐/GZ.LJY000.Biori/PUR_ReceiveBill/BillEventPlugInEx.py
PastSaid 9725ab5376 a
2024-12-05 15:39:19 +08:00

84 lines
3.7 KiB
Python

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("tbBarCodeScanEx"):
billObj = this.View.Model.DataObject;
# billId = billObj["BillNo"]
billNo = billObj["BillNo"]
FFormId = billObj["FFormId"]
# allRowCollection = ListSelectedRowCollection()
# allRowCollection.Add(ListSelectedRow(billId,None,0,FFormId))
# raise Exception(JsonUtil.Serialize(allRowCollection))
# 条码扫描
billShowParameter = BillShowParameter();
billShowParameter.FormId = "UHIK_BD_BarCodeScan";
billShowParameter.ParentPageId =this.View.PageId;
# billShowParameter.OpenStyle.ShowType = ShowType.Modal;
billShowParameter.CustomParams.Add("isFromBill", "1");
billShowParameter.CustomParams.Add("SourceFormId", FFormId);
billShowParameter.CustomParams.Add("SourceId", billNo);
# billShowParameter.CustomParams.Add("RuleId", str(1003602));
# 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;
# 条码打印
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()
allRowCollection.Add(ListSelectedRow(str(billId),None,0,FFormId))
# 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("SourceId", str(billId));
billShowParameter.CustomParams.Add("RuleId", str(1004002));
billShowParameter.CustomParams.Add("SelectedRows", JsonUtil.Serialize(allRowCollection))
#单据内码
# billShowParameter.PKey = str(this.View.Model.DataObject["Id"])
billShowParameter.Status = OperationStatus.ADDNEW
this.View.ShowForm(billShowParameter);
return;