--[[
|
编码: WMS-38-25
|
名称: 任务-PDA-任务显列表HTML页面
|
作者:HAN
|
日期:2025-1-29
|
|
级别:项目
|
|
函数: GenerateItemListHTML
|
|
功能:
|
生产一个任务对象属性显示页面的HTML
|
<div class="dv_panel_content">
|
<div class="dv_panel_attr">
|
<label>No:</label>
|
<span>TA240129-00001</span>
|
</div>
|
<div class="dv_panel_attr">
|
<div class="dv_box_node">
|
<p>毛料线边</p>
|
<label>L002-1</label>
|
</div>
|
<i class="mobox-normal-right"></i>
|
<div class="dv_box_node">
|
<p>毛料线边</p>
|
<label>L003-3</label>
|
</div>
|
</div>
|
</div>
|
|
|
更改记录:
|
|
--]]
|
wms_wh = require( "wms_wh" )
|
|
local function gen_item_html( attrs )
|
local item = m3.KeyValueAttrsToObjAttr(attrs)
|
|
local str_html = '<div class="dv_panel_content"><div class="dv_panel_attr"><label>No:</label>'
|
str_html = str_html.."<span>"..item.S_CODE..'</span> <div class="dv_panel_attr">'
|
|
-- 获取起点库区名称
|
local area
|
nRet, area = wms_wh.GetAreaInfo( item.S_START_AREA )
|
if (nRet ~= 0) then
|
lua.Error( strLuaDEID, debug.getinfo(1), "从内存获取编码'"..item.S_START_AREA.."'的库区信息失败!" )
|
end
|
str_html = str_html..'<div class="dv_box_node"><p>'..area.name.."</p>"
|
str_html = str_html..'<label>'..item.S_START_LOC..'</label></div><i class="mobox-normal-right"></i>'
|
|
-- 获取终点库区名称
|
nRet, area = wms_wh.GetAreaInfo( item.S_END_AREA )
|
if (nRet ~= 0) then
|
lua.Error( strLuaDEID, debug.getinfo(1), "从内存获取编码'"..item.S_END_AREA.."'的库区信息失败!" )
|
end
|
str_html = str_html..'<div class="dv_box_node"><p>'..area.name.."</p>"
|
str_html = str_html..'<label>'..item.S_END_LOC..'</label></div></div></div>'
|
|
return str_html
|
end
|
|
function GenerateItemListHTML ( strLuaDEID )
|
local nRet, strRetInfo, strErr
|
local html_array = {}
|
|
local data_json
|
nRet, data_json = m3.GetSysDataJson( strLuaDEID )
|
if (nRet ~= 0) then lua.Error( strLuaDEID, debug.getinfo(1), data_json ) end
|
for n = 1, #data_json do
|
local str_html
|
str_html = gen_item_html( data_json[n].attrs )
|
html_array[n] = str_html
|
end
|
|
local action = {}
|
|
action.action_type = "set_panel_html"
|
action.value = html_array
|
|
lua.Debug( strLuaDEID, debug.getinfo(1), "action! ", action )
|
|
nRet, strRetInfo = mobox.setAction( strLuaDEID, '['..lua.table2str(action)..']' )
|
if ( nRet ~= 0 ) then lua.Error( strLuaDEID, debug.getinfo(1), "setAction失败! "..strRetInfo..' action = '..strAction ) end
|
|
end
|