--[[
|
编码: JX-35-13
|
名称: HTML界面-料箱显示
|
作者:
|
日期:2025-1-29
|
|
函数: main
|
功能:
|
生成一个料箱格显示HTML
|
|
更改记录:
|
|
--]]
|
|
wms_base = require ("wms_base")
|
|
function main( strLuaDEID )
|
local nRet, strRetInfo, data_json
|
|
local runtime_parameter
|
nRet, runtime_parameter = m3.GetRuntimeParam(strLuaDEID)
|
if ( nRet ~= 0 ) then lua.Error( strLuaDEID, debug.getinfo(1), "GetRuntimeParam失败! "..runtime_parameter ) end
|
|
-- 获取【料格显示】面板的参数
|
local parameter
|
nRet, parameter = m3.GetRuntimePanel_InputParamter( strLuaDEID, runtime_parameter.panel, "料格显示" )
|
if ( nRet == 1 ) then return end
|
if ( nRet ~= 0 ) then lua.Error( strLuaDEID, debug.getinfo(1), parameter ) end
|
if ( parameter == nil ) then return end
|
|
local cell_no = parameter.cell_no
|
if ( cell_no == nil or cell_no == '' ) then
|
mobox.setInfo( strLuaDEID, "面板'料格显示'中的参数没有cell_no!")
|
return
|
end
|
|
local img_url
|
nRet, img_url = wms_base.Get_ImgUrl( )
|
if ( nRet ~= 0 ) then
|
lua.Stop( strLuaDEID, img_url )
|
return
|
end
|
|
local img = img_url..cell_no..".png"
|
local str_html = '<img src="'..img..'" '..'style="width: 400px;height: 220px;border: 1px solid #ddd;">'
|
|
local action = {
|
{
|
action_type = "set_panel_html",
|
value = str_html
|
}
|
}
|
nRet, strRetInfo = mobox.setAction( strLuaDEID, lua.table2str(action) )
|
if ( nRet ~= 0 ) then lua.Error( strLuaDEID, debug.getinfo(1), "setAction失败! "..strRetInfo..' action = '..strAction ) end
|
end
|