--[[
|
编码: AMS-01-34
|
名称:
|
作者:
|
日期:2025-06-04
|
|
函数: Query
|
功能:
|
|
更改记录:
|
|
--]]
|
|
json = require ("json")
|
mobox = require ("OILua_JavelinExt")
|
m3 = require ("oi_base_mobox")
|
|
function Query( 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 )
|
lua.Debug( strLuaDEID, debug.getinfo(1), "parameter", lua.table2str(parameter) )
|
|
local cntr_code = lua.Get_StrAttrValue( parameter.S_CNTR_CODE )
|
local state = lua.Get_StrAttrValue( parameter.S_STATE )
|
local strSQL = ''
|
|
if (cntr_code ~= '') then
|
strSQL = "S_CODE = '"..cntr_code.."'"
|
end
|
if (state ~= '' ) then
|
if ( strSQL ~= '' ) then strSQL = strSQL.." AND " end
|
strSQL = strSQL.."S_UDF02 = '"..state.."'"
|
end
|
|
if (strSQL == '') then return end
|
-- 设置查询面板
|
local setAttr = '{"condition":"'..strSQL..'","order":"S_CODE"}'
|
local strAction = '[{"action_type":"set_query_condition","value":'..setAttr..'}]'
|
nRet, strRetInfo = mobox.setAction( strLuaDEID, strAction )
|
if ( nRet ~= 0 ) then lua.Error( strLuaDEID, debug.getinfo(1), "setAction失败! "..strRetInfo..' action = '..strAction ) end
|
|
end
|