--[[
|
编码: JX-51-10
|
名称:
|
作者:
|
日期:2025-1-29
|
|
函数: OpenHTMLViewDlg
|
功能:
|
显示配盘结果
|
|
更改记录:
|
|
--]]
|
|
jx_base= require( "jx_base" )
|
|
-- 生成一个容器料格货品显示样式
|
local function generate_distribution_html_item( strLuaDEID, cntr_code, cell_no, item_code, item_name, qty, bs_no )
|
local nRet, img_url
|
nRet, img_url = wms_base.Get_sConst2( strLuaDEID, "网站URL" )
|
if ( nRet ~= 0 ) then return 1, "系统无法获取常量'网站URL'" end
|
|
local img = img_url..cell_no..".png"
|
|
local content =
|
'<div style="width:560px;height:150px;border:1px solid #ddd;border-radius:6px;padding-left:9px;">'..
|
'<div>'..
|
'<span style="color:black;">料箱号:</span>'..
|
'<span style="color:blue;">'..cntr_code..'</span>'..
|
'</div>'..
|
'<div style="display:flex;flex-direction:row;">'..
|
'<div style="width: 200px;">'..
|
'<img src="'..img..'" '..
|
'style="width: 200px;height: 110px;border: 1px solid #ddd;">'..
|
'</div>'..
|
'<div style="width: 320px;padding-left:6px;">'..
|
'<div>'..
|
'<span style="color:black;padding-left: 26px;">料格:</span>'..
|
'<span style="color:blue;">'..cell_no..'</span>'..
|
'</div>'..
|
'<div>'..
|
'<span style="color:black;">货品编码:</span>'..
|
'<span style="color:blue;">'..item_code..'</span>'..
|
'</div>'..
|
'<div style="display:flex;">'..
|
'<span style="color:black;">货品名称:</span>'..
|
'<span style="color:blue;width:calc(100% - 70px);">'..item_name..'</span>'..
|
'</div>'..
|
'<div>'..
|
'<span style="color:black;padding-left: 26px;">数量:</span>'..
|
'<span style="color:blue;font-size:20px;vertical-align:middle;font-weight:bold;">'..qty..'</span>'..
|
'</div>'..
|
'<div style="display:flex;">'..
|
'<span style="color:black;">出库单:</span>'..
|
'<span style="color:blue;width:calc(100% - 70px);">'..bs_no..'</span>'..
|
'</div>'..
|
'</div>'..
|
'</div>'..
|
'</div>'
|
|
return 0, content
|
end
|
|
function OpenHTMLViewDlg( strLuaDEID )
|
local nRet, strRetInfo, data_json
|
local img_url
|
nRet, img_url = wms_base.Get_sConst2( strLuaDEID, "网站URL" )
|
if ( nRet ~= 0 ) then
|
lua.Stop( strLuaDEID, "系统无法获取常量'网站URL'")
|
return
|
end
|
|
nRet, data_json = m3.GetSysDataJson( strLuaDEID )
|
if ( nRet ~=0 ) then lua.Error( strLuaDEID, debug.getinfo(1), data_json ) end
|
|
local str_html
|
if ( data_json.d_cntr_detail_list == nil or #data_json.d_cntr_detail_list == 0 ) then
|
str_html= '<img src="'..img_url..'noanything.7364c627.png" style="width: 200px;height: 110px;border: 1px solid #ddd;">'
|
else
|
str_html = '<div style="display:flex;flex-direction:row;flex-wrap:wrap;gap:20px;">'
|
local str_item
|
|
for n = 1, #data_json.d_cntr_detail_list do
|
nRet, str_item = generate_distribution_html_item( strLuaDEID,
|
data_json.d_cntr_detail_list[n].cntr_code,
|
data_json.d_cntr_detail_list[n].cell_no,
|
data_json.d_cntr_detail_list[n].item_code,
|
data_json.d_cntr_detail_list[n].item_name,
|
data_json.d_cntr_detail_list[n].qty,
|
data_json.d_cntr_detail_list[n].bs_no )
|
if ( nRet ~= 0 ) then
|
lua.Stop( strLuaDEID, str_item )
|
return
|
end
|
str_html = str_html..str_item
|
end
|
|
str_html = str_html..'</div>'
|
end
|
|
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
|