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
| --[[
| 编码: WMS-07-03
| 名称: 常量-查询面板-初始化
| 作者:HAN
| 日期:2025-1-29
|
| 级别:固定 (说明本段代码在项目中不太会变化)
|
| 函数: InitialPanel
|
| 功能:
| 对常量维护功能点中的查询界面进行初始化,比如 Group 常量类型等
| 更改记录:
|
| --]]
|
| json = require ("json")
| mobox = require ("OILua_JavelinExt")
| m3 = require("oi_base_mobox")
|
| function InitialPanel ( strLuaDEID )
| local nRet, strRetInfo
| local strCondition = ''
| local strOrder = 'S_GROUP' -- 排序字段
|
| -- 获取常量有多少分组
| nRet, strRetInfo = mobox.groupDataObjAttr( strLuaDEID, "WMS_Const", strCondition, "S_GROUP", strOrder )
| if ( nRet ~= 0 ) then lua.Error( strLuaDEID, debug.getinfo(1), "无法从【常量】获取信息!"..strRetInfo ) end
|
| local groups = json.decode( strRetInfo )
| local n, nCount
| local strGroupList = ''
|
| nCount = #groups
| for n = 1, nCount do
| strGroupList = strGroupList..'"'..groups[n].value..'",'
| end
| strGroupList = lua.trim_laster_char( strGroupList )
|
| -- 设置查询面板
| local setAttr = '[{"attr":"S_GROUP","value":"","choice_list":['..strGroupList..']}]'
| local strAction = '[{"action_type":"set_dlg_attr","value":'..setAttr..'}]'
| nRet, strRetInfo = mobox.setAction( strLuaDEID, strAction )
| if ( nRet ~= 0 ) then lua.Error( strLuaDEID, debug.getinfo(1), "setAction失败! "..strRetInfo..' action = '..strAction ) end
|
| end
|
|