| | |
| | | [* |
| | | if( not isnull( selection)) |
| | | { |
| | | // 预测订单基本信息 |
| | | CustomCode:=""; |
| | | CustomName:=""; |
| | | SValueJsonString:=""; |
| | | // 获取客户名称和客户ID |
| | | if(txtSaveForecastData_FM.Text().Length()>0) |
| | | { |
| | | jForecast := JSON::Parse( txtSaveForecastData_FM.Text()); |
| | | CustomCode := jForecast.Get( "CustomCode").GetString(); |
| | | CustomName := jForecast.Get( "CustomName").GetString(); |
| | | } |
| | | |
| | | if(selection.MaterialType()="半成品") |
| | | { |
| | | OrderCode:=""; |
| | | ForecastID:=""; |
| | | if( txtSaveForecastData_FM.Text().Length()>0) |
| | | { |
| | | JForecast := JSON::Parse( txtSaveForecastData_FM.Text()); |
| | | OrderCode := JForecast.Get( "OrderCode").GetString(); |
| | | JForecast := JSON::Parse(txtSaveForecastData_FM.Text()); |
| | | ForecastID := JForecast.Get( "ForecastID").GetString(); |
| | | } |
| | | jResult := H_FunctionClass::SM_GetMaterialData( MacroPlan,selection.SKU(),selection.NeedQty(), OrderCode,"-",selection.NeedDate()); |
| | | jResult := H_FunctionClass::SM_GetMaterialData( MacroPlan,selection.SKU(),selection.NeedQty(), ForecastID,"-",selection.NeedDate()); |
| | | if(jResult.Get( "Status").GetBoolean()) |
| | | { |
| | | de_dh_FM_ProductMP.FixedFilter( "object.ParentSKU() = " + selection.SKU().AsQUILL() |
| | | + " and object.ForecastID() = " + OrderCode.AsQUILL() |
| | | + " and object.ForecastID() = " + ForecastID.AsQUILL() |
| | | ); |
| | | } |
| | | else |
| | |
| | | } |
| | | else |
| | | { |
| | | // 弹出物料反签授权 |
| | | SelectItem := select( MacroPlan,H_MessagePassing,Obj,Obj.FKey()="FrmMaterial" and Obj.ItemKey()="ListSelect"); |
| | | if(not isnull(selection)) |
| | | { |
| | | SValueJsonString:= JSON::Object().Add( "SKU",selection.SKU()) |
| | | .Add( "MaterialName",selection.MaterialName()) |
| | | .Add( "MaterialType",selection.MaterialType()) |
| | | .Add( "OrgCode",selection.OrgCode()) |
| | | .Add( "Unit",selection.Unit()) |
| | | .Add( "CustomCode",CustomCode) |
| | | .Add( "ParentSKU",lb_SUK_FM.Text()) |
| | | .Add( "CustomName",CustomName).Build().AsString(); |
| | | } |
| | | if(isnull( SelectItem)) |
| | | { |
| | | MacroPlan.H_MessagePassing(relnew,FKey := "FrmMaterial",ItemKey := "ListSelect", ValueJsonString:=SValueJsonString); |
| | | } |
| | | else |
| | | { |
| | | SelectItem.ValueJsonString( SValueJsonString); |
| | | } |
| | | Application.OpenForm( "FrmAuthorizeAndCountersign_Material","modal"); |
| | | } |
| | | } |
| | | *] |