From 0128c210f81ce4810c20dd8fe2f524bde0e80fc8 Mon Sep 17 00:00:00 2001 From: Misaka_Company Date: Fri, 20 Mar 2026 13:12:00 +0800 Subject: [PATCH] Update frmAddSpec form Co-Authored-By: Claude Sonnet 4.6 --- VBA/Forms/frmAddSpec.frm | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/VBA/Forms/frmAddSpec.frm b/VBA/Forms/frmAddSpec.frm index 0a8d4c1..2b8a255 100644 --- a/VBA/Forms/frmAddSpec.frm +++ b/VBA/Forms/frmAddSpec.frm @@ -31,11 +31,19 @@ Private Sub UserForm_Initialize() Exit Sub End If - ' 初始化策略下拉框 + ' 初始化策略下拉框 (中文化显示,底层输出英文指令) With Me.cboStrategy .Clear - .AddItem "APPEND" - .AddItem "CLONE" + .ColumnCount = 2 + .ColumnWidths = "180;0" ' 第一列中文可见,第二列英文标识隐藏 + .BoundColumn = 2 ' 指定 .Value 属性读取隐藏的第二列 + + .AddItem "追加规格 (在原有条件上追加)" + .List(0, 1) = "APPEND" + + .AddItem "克隆新增 (复制母版并生成新行)" + .List(1, 1) = "CLONE" + .ListIndex = 0 ' 默认选中 APPEND End With @@ -251,10 +259,11 @@ End Sub ' ============================================================================== Private Sub btnExecute_Click() ' --- 校验输入 --- - Dim paramName As String, newValue As String, strategy As String + Dim paramName As String, newValue As String, strategy As String, strategyName As String paramName = Trim(Me.cboParamName.Text) newValue = Trim(Me.txtNewValue.Text) - strategy = Me.cboStrategy.value + strategy = Me.cboStrategy.value ' 获取隐藏的底层代码 (APPEND / CLONE) + strategyName = Me.cboStrategy.Text ' 获取界面显示的中文名称 If paramName = "" Or newValue = "" Then MsgBox "参数名称和新增规格值不能为空!", vbExclamation @@ -318,7 +327,7 @@ Private Sub btnExecute_Click() End If ' --- 调用调度中枢进行外科手术 --- - Me.btnExecute.Caption = "正在锻造..." + Me.btnExecute.Caption = "正在处理..." Me.btnExecute.Enabled = False DoEvents ' 刷新UI防止假死 @@ -326,18 +335,18 @@ Private Sub btnExecute_Click() mSpecAdditionManager.ExecutePipeline mTargetWorksheet, mGlobalBOMs, targetBOMs, paramName, newValue, strategy ' --- 完成与恢复 --- - Me.btnExecute.Caption = "锻造入库 (执行)" + Me.btnExecute.Caption = "保存入库 (执行)" Me.btnExecute.Enabled = True Me.txtNewValue.Text = "" - Me.lblLog.Caption = "成功![" & newValue & "] 规格已通过 " & strategy & " 策略注入完成。" & vbCrLf & actionLog + Me.lblLog.Caption = "成功![" & newValue & "] 规格已通过 [" & strategyName & "] 处理完成。" & vbCrLf & actionLog Me.lblLog.ForeColor = RGB(0, 128, 0) ' 绿色 ' 重新加载数据刷新UI LoadDataAndRender RefreshDetailsPanel - MsgBox "规格锻造完成!请查看表格确认结果。", vbInformation + MsgBox "规格新增完成!请查看表格确认结果。", vbInformation End Sub ' 关闭按钮