haorenhui
2023-10-30 6d6cc10d9e8e242661da7fd655dec155a09d676c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
Quintiq file version 2.0
#parent: Panel418/btn_Add_FM
Response OnClick (
  H_MaterialInfo selection
) id:Response_Panel418_btn_Add_FM_OnClick_975
{
  #keys: '[414724.0.145238844]'
  CanBindMultiple: false
  DefinitionID => /Panel418/Responsedef_Panel418_btn_Add_FM_OnClick
  Precondition:
  [*
    return not isnull( MacroPlan);
  *]
  QuillAction
  {
    Body:
    [*
      SelectItem :=  select( MacroPlan,H_MessagePassing,Obj,Obj.FKey()="FrmMaterial" and Obj.ItemKey()="ListSelect");
      CustomCode:="";
      CustomName:="";
      SValue:="";
      SValueJsonString:="";
      SKUName:="";
      // 获取客户名称和客户ID
      if(txtSaveForecastData_FM.Text().Length()>0)
      {
         jForecast := JSON::Parse( txtSaveForecastData_FM.Text());
         CustomCode := jForecast.Get( "CustomCode").GetString();
         CustomName := jForecast.Get( "CustomName").GetString();
         SKUName := jForecast.Get( "SKUName").GetString();
      }
      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( "ParentSKUName",SKUName)
                    .Add( "CustomName",CustomName).Build().AsString();
      }
      if( isnull( SelectItem))
      {
        MacroPlan.H_MessagePassing(relnew,FKey := "FrmMaterial",ItemKey := "ListSelect", Value:=SValue,ValueJsonString:=SValueJsonString);
      }
      else
      {
        SelectItem.Value(SValue);
        SelectItem.ValueJsonString( SValueJsonString);
      }
      Application.OpenForm( "FrmAuthorizeAndCountersign_Material","modal");
    *]
    GroupServerCalls: false
  }
}