1
Jianw
9 天以前 70f29da38121b9a467841253e3268feb5df02902
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
47
48
49
50
51
52
53
54
55
56
57
58
59
--[[
   编码: AMS-102-05
   名称: 
   作者:
   日期:2025-06-04
 
   函数: SelectClick
   功能:
 
   更改记录:
 
--]]
 
json  = require ("json")
mobox = require ("OILua_JavelinExt")
m3 = require ("oi_base_mobox")
 
function SelectClick( strLuaDEID )
    local nRet,strRetInfo
    local parameter = {}
    local attrs
 
    --获取查询条件
    nRet,attrs = m3.GetSysInputParameter(strLuaDEID)
 
    if(nRet ~= 0) then
        lua.Error( strLuaDEID, debug.getinfo(1), "m3.GetSysInputParameter 失败! "..attrs ) 
    end
    parameter = m3.KeyValueAttrsToObjAttr(attrs)
    local cntr_code = lua.Get_StrAttrValue(parameter.S_CNTR_CODE)
    local item_code = lua.Get_StrAttrValue(parameter.S_ITEM_CODE)
    local strSQL = ''
 
    if(cntr_code ~= '') then
        strSQL = "S_CNTR_CODE like '%"..cntr_code.."%'"
    end
    if(item_code ~= '') then
        if(strSQL ~= '') then
           strSQL = strSQL.." AND "  
        end
        strSQL = strSQL.."S_ITEM_CODE like '%"..item_code.."%'" 
    end
 
    --设置查询条件
    local action = {
        {
            action_type = "set_query_condition",
            value = {
                condition = strSQL,
                order = "S_CNTR_CODE"
            }
        }
    }
    nRet,strRetInfo = mobox.setAction(strLuaDEID,lua.table2str(action))
    if(nRet ~= 0) then
        lua.Error( strLuaDEID, debug.getinfo(1), "setAction失败! "..strRetInfo..' action = '..strAction ) 
    end
 
end