--[[
|
编码: WMS-19-12
|
名称:
|
作者:
|
日期:2025-05-23
|
|
函数: QueryInputChange
|
功能:
|
|
更改记录:
|
|
--]]
|
|
json = require ("json")
|
mobox = require ("OILua_JavelinExt")
|
m3 = require ("oi_base_mobox")
|
|
function QueryInputChange( 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 wh_code = lua.Get_StrAttrValue( parameter.S_WH_CODE )
|
local area_code = lua.Get_StrAttrValue( parameter.S_AREA_CODE )
|
local cntr_code = lua.Get_StrAttrValue( parameter.S_CNTR_CODE )
|
local item_code = lua.Get_StrAttrValue( parameter.S_ITEM_CODE )
|
local batch_no = lua.Get_StrAttrValue( parameter.S_BATCH_NO )
|
local strSQL = ''
|
|
if ( wh_code ~= '' ) then
|
strSQL = "S_WH_CODE like '%"..wh_code.."%'"
|
end
|
if ( area_code ~= '' ) then
|
if ( strSQL ~= '' ) then
|
strSQL = strSQL.." AND "
|
end
|
strSQL = strSQL.."S_AREA_CODE like '%"..area_code.."%'"
|
end
|
if ( cntr_code ~= '' ) then
|
if ( strSQL ~= '' ) then
|
strSQL = strSQL.." AND "
|
end
|
strSQL = 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
|
if ( batch_no ~= '' ) then
|
if ( strSQL ~= '' ) then
|
strSQL = strSQL.." AND "
|
end
|
strSQL = strSQL.."S_BATCH_NO like '%"..batch_no.."%'"
|
end
|
|
-- 设置查询条件
|
local action =
|
{
|
{
|
action_type = "set_query_condition",
|
value = {
|
condition = strSQL,
|
order = "S_ITEM_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
|