102 lines
4.0 KiB
Python
102 lines
4.0 KiB
Python
|
|
import clr
|
|||
|
|
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")
|
|||
|
|
from Kingdee.BOS import *
|
|||
|
|
from Kingdee.BOS.Core import *
|
|||
|
|
from Kingdee.BOS.Core.Bill import *
|
|||
|
|
from Kingdee.BOS.Core.List import *
|
|||
|
|
from Kingdee.BOS.Core.Report import *
|
|||
|
|
from System import *
|
|||
|
|
from System.Data import *
|
|||
|
|
from System.Net import *
|
|||
|
|
from System.Text import *
|
|||
|
|
from Kingdee.BOS.App.Data import *
|
|||
|
|
from Kingdee.BOS.Core.List.PlugIn import *
|
|||
|
|
from Kingdee.BOS.Core.List.PlugIn.Args import *
|
|||
|
|
|
|||
|
|
# def FormatCellValue(args):
|
|||
|
|
# # <20><><EFBFBD>ڸ<EFBFBD>ʽ<EFBFBD><CABD>
|
|||
|
|
# if args.Header.ColType == SqlStorageType.SqlDatetime:
|
|||
|
|
# args.FormateValue = ("{0}").format(DateTime.Parse(str(args.FormateValue)).ToString("yyyy-MM-dd"))
|
|||
|
|
|
|||
|
|
def CellDbClick(e):
|
|||
|
|
e.Cancel = True
|
|||
|
|
fldKey = e.Header.FieldName;
|
|||
|
|
# <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
if fldKey == "MONO":
|
|||
|
|
reportModel = this.Model
|
|||
|
|
tab = reportModel.DataSource
|
|||
|
|
row = e.CellRowIndex - 1
|
|||
|
|
data = tab.Rows[row]
|
|||
|
|
moIds = "0";
|
|||
|
|
if data["MOIDS"] !=None and data["MOIDS"] != "":
|
|||
|
|
moIds = data["MOIDS"];
|
|||
|
|
filterStr = "FID IN ({0}) AND FMATERIALID = {1} ".format(moIds,data["ProMaterialId"])
|
|||
|
|
ShowListForm("PRD_MO", filterStr)
|
|||
|
|
|
|||
|
|
# <20><><EFBFBD><EFBFBD>.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
if fldKey == "FBASENEEDQTY":
|
|||
|
|
reportModel = this.Model
|
|||
|
|
tab = reportModel.DataSource
|
|||
|
|
row = e.CellRowIndex - 1
|
|||
|
|
data = tab.Rows[row]
|
|||
|
|
moIds = "0";
|
|||
|
|
if data["MOIDS"] !=None and data["MOIDS"] != "":
|
|||
|
|
moIds = data["MOIDS"];
|
|||
|
|
filterStr = "t1.FMOID IN ({0}) AND t1.FMATERIALID = {1} ".format(moIds,data["<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"])
|
|||
|
|
ShowListForm("PRD_PPBOM", filterStr)
|
|||
|
|
# <20><><EFBFBD><EFBFBD>.δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
if fldKey == "FBASENOPICKEDQTY":
|
|||
|
|
reportModel = this.Model
|
|||
|
|
tab = reportModel.DataSource
|
|||
|
|
row = e.CellRowIndex - 1
|
|||
|
|
data = tab.Rows[row]
|
|||
|
|
moIds = "0";
|
|||
|
|
if data["MOIDS"] !=None and data["MOIDS"] != "":
|
|||
|
|
moIds = data["MOIDS"];
|
|||
|
|
filterStr = "t1.FMOID IN ({0}) AND t1.FMATERIALID = {1} ".format(moIds,data["<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"])
|
|||
|
|
ShowListForm("PRD_PPBOM", filterStr)
|
|||
|
|
# δ<><CEB4><EFBFBD><EFBFBD>
|
|||
|
|
if fldKey == "δ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>":
|
|||
|
|
reportModel = this.Model
|
|||
|
|
tab = reportModel.DataSource
|
|||
|
|
row = e.CellRowIndex - 1
|
|||
|
|
data = tab.Rows[row]
|
|||
|
|
filterStr = "EXISTS (SELECT 1 FROM T_PRD_MOENTRY_A tt WHERE tt.FID = t1.FMOID AND tt.FSTATUS = 4 ) AND t1.FMATERIALID = {0} ".format(data["<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"])
|
|||
|
|
ShowListForm("PRD_PPBOM", filterStr)
|
|||
|
|
# <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
if fldKey == "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>":
|
|||
|
|
reportModel = this.Model
|
|||
|
|
tab = reportModel.DataSource
|
|||
|
|
row = e.CellRowIndex - 1
|
|||
|
|
data = tab.Rows[row]
|
|||
|
|
filterStr = "EXISTS (SELECT 1 FROM T_PRD_MOENTRY_A tt WHERE tt.FENTRYID = t1.FENTRYID AND tt.FSTATUS = 4 ) AND t1.FMATERIALID = {0} ".format(data["<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"])
|
|||
|
|
ShowListForm("PRD_PPBOM", filterStr)
|
|||
|
|
# <20><>;<EFBFBD><CDBE>
|
|||
|
|
if fldKey == "<EFBFBD><EFBFBD>;<EFBFBD><EFBFBD>":
|
|||
|
|
reportModel = this.Model
|
|||
|
|
tab = reportModel.DataSource
|
|||
|
|
row = e.CellRowIndex - 1
|
|||
|
|
data = tab.Rows[row]
|
|||
|
|
filterStr = "FMRPCLOSESTATUS = 'A' AND FCloseStatus = 'A' AND FMATERIALID = {0} AND FBASEUNITQTY >= FBASESTOCKINQTY".format(data["<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"])
|
|||
|
|
# ShowListForm("PUR_PurchaseOrder", filterStr)
|
|||
|
|
showParam = ListShowParameter();
|
|||
|
|
showParam.FormId = "PUR_PurchaseOrder";
|
|||
|
|
showParam.ParentPageId = this.View.PageId;
|
|||
|
|
showParam.OpenStyle.ShowType = ShowType.Floating;
|
|||
|
|
showParam.ListFilterParameter.Filter = filterStr
|
|||
|
|
showParam.IsShowQuickFilter = True;
|
|||
|
|
this.View.ShowForm(showParam)
|
|||
|
|
|
|||
|
|
def ShowListForm(_fromId, _filter, _operationStatus = OperationStatus.VIEW ,_openStyleShowType = ShowType.Floating):
|
|||
|
|
showParam = ListShowParameter();
|
|||
|
|
showParam.FormId = _fromId;
|
|||
|
|
showParam.ParentPageId = this.View.PageId;
|
|||
|
|
showParam.OpenStyle.ShowType = _openStyleShowType;
|
|||
|
|
showParam.ListFilterParameter.Filter = _filter
|
|||
|
|
showParam.IsShowQuickFilter = True;
|
|||
|
|
this.View.ShowForm(showParam)
|