yanweiyuan3
2023-10-10 d901b1ab0ee0b690f5ac211b9cdb1db3a58bca86
_Main/UI/MacroPlannerWebApp/Component_DialogCreateEditScenario/Method_OnOk.def
@@ -17,6 +17,28 @@
    newscenario := null( Scenario );
    strategy := null( Strategy );
    
    // New version
    globalotdtable := GlobalOTDTable;
    testbusinesstype := "集团";
    if( data.IsCreateNewVersion() ){
      VersionControl::CreateNewSceneVersion( globalotdtable, testbusinesstype );
      }else{
        VersionControl::CopyVersion( globalotdtable, testbusinesstype );
        }
    versionname := VersionControl::GetVersionInfo( globalotdtable, testbusinesstype ).Element( 3 );
    // Get Version Name
    if( data.Name() = "" ){
      data.Name( versionname );
      }
    // Get Business Type from Scenario Name
    businesstype := select( globalotdtable,
                            BusinessType,
                            b,
                            b.ScenarioName()=data.ScenarioName() ).BusinessTypeName();
    data.BusinessType( businesstype );
    // Copy scenario
    if( isnull( data.WrappedInstance() ) )
    {
@@ -93,8 +115,11 @@
    // sync data
    if( data.EnableSync() ) {
        MacroPlan::DoSync( macroPlanNew, 
                           data.BusinessType(), data.IsKeyProduct(), data.CreatePurchaseSupplyMaterial() );
                           data.BusinessType(), data.IsKeyProduct(), data.CreatePurchaseSupplyMaterial() ,GlobalOTDTable);
    }
    macroPlanNew.BusinessType( businesstype );
    macroPlanNew.IsKeyProduct( data.IsKeyProduct() );
    macroPlanNew.CreatePurchaseSupplyMaterial( data.CreatePurchaseSupplyMaterial() );
    
    this.Close();
  *]