Kevin Kok Khah Whey
2023-09-25 34d29be6a3eb0c025da50b77f2107c4ad259c6c0
_Main/UI/MacroPlannerWebApp/Component_FrmMaterial/Response_List832_OnDoubleClick.def
@@ -13,19 +13,31 @@
    [*
      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
@@ -35,7 +47,27 @@
        }
        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");
        }
      }
    *]