From 40e4fffbb86f33e0c10835c21bd9cc9546ba3fc1 Mon Sep 17 00:00:00 2001
From: yanweiyuan3 <yanweiyuan3@gmail.com>
Date: 星期三, 20 九月 2023 20:21:08 +0800
Subject: [PATCH] Fix bug

---
 _Main/UI/MacroPlannerWebApp/Component_DialogCreateEditScenario/Method_OnOk.def |   24 +++++++++++++++---------
 1 files changed, 15 insertions(+), 9 deletions(-)

diff --git a/_Main/UI/MacroPlannerWebApp/Component_DialogCreateEditScenario/Method_OnOk.def b/_Main/UI/MacroPlannerWebApp/Component_DialogCreateEditScenario/Method_OnOk.def
index 1d0ed83..5d283ea 100644
--- a/_Main/UI/MacroPlannerWebApp/Component_DialogCreateEditScenario/Method_OnOk.def
+++ b/_Main/UI/MacroPlannerWebApp/Component_DialogCreateEditScenario/Method_OnOk.def
@@ -17,6 +17,21 @@
     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 );
+      }
+    
     // Copy scenario
     if( isnull( data.WrappedInstance() ) )
     {
@@ -95,15 +110,6 @@
         MacroPlan::DoSync( macroPlanNew, 
                            data.BusinessType(), data.IsKeyProduct(), data.CreatePurchaseSupplyMaterial() );
     }
-    
-    // New version
-    globalotdtable := GlobalOTDTable;
-    testbusinesstype := "闆嗗洟";
-    if( data.IsCreateNewVersion() ){
-      VersionControl::CreateNewSceneVersion( globalotdtable, testbusinesstype );
-      }else{
-        VersionControl::CreateNewVersion( globalotdtable, testbusinesstype );
-        }
     
     this.Close();
   *]

--
Gitblit v1.9.3