--[[
|
编码: AMS-52-21
|
名称:
|
作者:
|
日期:2025-05-28
|
|
函数: ClickItem
|
功能:
|
|
更改记录:
|
|
--]]
|
|
json = require ("json")
|
mobox = require ("OILua_JavelinExt")
|
m3 = require ("oi_base_mobox")
|
|
function ClickItem( strLuaDEID )
|
|
-- 获取输入参数
|
nRet, attrs = m3.GetSysInputParameter(strLuaDEID)
|
if (nRet ~= 0) then
|
mobox.setInfo(strLuaDEID, "获取当前输入面板里的属性失败! " .. attrs)
|
return
|
end
|
lua.Debug(strLuaDEID, debug.getinfo(1), "attrs", attrs)
|
|
local input_attr = m3.KeyValueAttrsToObjAttr(attrs)
|
local wave_no = input_attr.S_WAVE_NO --波次号
|
|
-- 正在码盘和已码盘页面
|
local nRet, obj = m3.GetSysDataJson(strLuaDEID)
|
if (nRet ~= 0) then
|
mobox.setInfo(strLuaDEID, "无法获取数据包! " .. obj)
|
return
|
end
|
|
local input_objs = m3.KeyValueAttrsToObjAttr(obj)
|
local item_code = input_objs.S_ITEM_CODE
|
local item_name = input_objs.S_ITEM_NAME
|
local loc = input_objs.S_LOC_CODE
|
|
local strCondition = "S_LOC_CODE = '" .. loc .. "' AND S_ITEM_CODE = '" .. item_code .. "' AND S_WAVE_NO = '" .. wave_no .. "' "
|
local data_objs
|
nRet, data_objs = m3.QueryDataObject(strLuaDEID, "Distribution_CNTR_Detail", strCondition)
|
|
if (nRet ~= 0) then
|
mobox.setInfo(strLuaDEID, "查询Distribution_CNTR_Detail失败!" .. data_objs)
|
return
|
end
|
lua.Debug(strLuaDEID, debug.getinfo(1), "data_objs", data_objs)
|
|
local list_data = {}
|
if data_objs and #data_objs > 0 then
|
for i, obj in ipairs(data_objs) do
|
-- 从attrs数组中提取S_BS_NO和F_QTY
|
local s_bs_no, f_qty
|
for _, attr in ipairs(obj.attrs) do
|
if attr.attr == "S_BS_NO" then
|
s_bs_no = attr.value
|
elseif attr.attr == "F_QTY" then
|
f_qty = attr.value
|
end
|
end
|
|
-- 构建list项
|
table.insert(list_data, {
|
S_BS_NO = s_bs_no or "",
|
F_QTY = f_qty or 0
|
})
|
end
|
end
|
|
local action_array = {}
|
action_array[1] = {
|
action_type = "jump_pda_page",
|
value = {
|
page = {
|
page_name = "波次详细界面",
|
list = list_data -- 使用处理后的数据
|
},
|
master_view = {
|
S_WAVE_NO = wave_no,
|
S_ITEM_CODE = item_code,
|
S_ITEM_NAME = item_name
|
}
|
}
|
}
|
|
-- 提交前端操作
|
lua.Debug(strLuaDEID, debug.getinfo(1), "action_array", action_array)
|
nRet, strRetInfo = mobox.setAction(strLuaDEID, lua.table2str(action_array))
|
if (nRet ~= 0) then
|
lua.Error(strLuaDEID, debug.getinfo(1), "setAction失败! " .. strRetInfo)
|
end
|
|
|
end
|