feat: restore VBA source code modules
All checks were successful
NTFY Notification / notify (push) Successful in 4s

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
Misaka_Company
2026-02-04 11:07:36 +08:00
parent 25f6ae29ac
commit 58e84ddd25
7 changed files with 899 additions and 0 deletions

View File

@@ -0,0 +1,37 @@
' ==============================================================================
' 模块: M04_Config
' 职责: 系统配置、常量定义
' ==============================================================================
Option Explicit
' 源数据列号定义 (根据你的描述)
Public Const COL_IDX_CODE As Long = 3 ' 代号 (C列)
Public Const COL_IDX_NAME As Long = 4 ' 名称 (D列)
Public Const COL_IDX_QTY As Long = 5 ' 数量 (E列)
Public Const COL_IDX_COND As Long = 6 ' 选择条件 (F列)
Public Const COL_IDX_CAT As Long = 8 ' 类别 (H列)
Public Const SRC_START_ROW As Long = 4 ' 数据起始行
' 获取表头排序索引 (越小越靠前)
Public Function GetHeaderPriority(key As String) As Long
Dim vList As Variant
Dim i As Long
' 定义标准排序顺序
vList = Array("azxs", "bkxs", "gclj", "jycz", "lcdw", "lcfw", _
"fjgn", "btcy", "bp", "dskd", "nqlc", "bptx", _
"jddj", "cpdm", "tsjz", "tsyq", "bpts", "kdxh")
Dim sKey As String
sKey = LCase(Trim(key))
For i = LBound(vList) To UBound(vList)
If sKey = LCase(vList(i)) Then
GetHeaderPriority = i
Exit Function
End If
Next i
' 未知变量排在最后
GetHeaderPriority = 999
End Function