--[[
|
编码: WMS-51-10
|
名称: 显示前
|
作者:HAN
|
日期:2025-1-29
|
|
|
入口函数:BeforeGridShow
|
|
功能说明:
|
控制行按钮显示
|
--]]
|
|
json = require ("json")
|
mobox = require ("OILua_JavelinExt")
|
m3 = require("oi_base_mobox")
|
|
function BeforeGridShow ( strLuaDEID )
|
local nRet, strRetInfo
|
local cntr_objs
|
local n, nCount
|
local bs_state_name = {"","配盘完成","出库中","出库完成","拣货完成","回库中","完成","错误"}
|
|
nRet, cntr_objs = m3.GetSysDataJson( strLuaDEID )
|
if ( nRet ~=0 ) then lua.Error( strLuaDEID, debug.getinfo(1), cntr_objs ) end
|
nCount = #cntr_objs
|
if (nCount == 0) then return end
|
|
local obj
|
local row_data_set = {}
|
local bs_state
|
|
for n = 1, nCount do
|
local row_item = {}
|
|
obj = cntr_objs[n]
|
row_item.id = obj.id
|
row_item.attrs = {}
|
row_item.row_button_hidden = "删除;出库;重置"
|
wave_no = ''
|
-- 获取 项目清单 对象属性
|
for nIndex = 1, #obj.attrs do
|
local attr_value = {}
|
|
attr_value.attr = obj.attrs[nIndex].attr
|
attr_value.value = obj.attrs[nIndex].value
|
|
if ( attr_value.attr == 'N_B_STATE' ) then
|
bs_state = lua.StrToNumber( attr_value.value )
|
attr_value.value = bs_state_name[bs_state+1]
|
if ( bs_state == 0 ) then
|
row_item.row_button_hidden = "出库;重置"
|
elseif ( bs_state == 7 ) then
|
row_item.row_button_hidden = "删除;出库"
|
elseif ( bs_state == 1) then
|
row_item.row_button_hidden = "重置"
|
end
|
elseif ( attr_value.attr == 'S_WAVE_NO' ) then
|
wave_no = attr_value.value
|
end
|
table.insert( row_item.attrs, attr_value )
|
end
|
|
table.insert( row_data_set, row_item)
|
end
|
|
local action = {}
|
action[1] = {
|
action_type = "reset_data_attr",
|
value = row_data_set
|
}
|
|
nRet, strRetInfo = mobox.setAction(strLuaDEID, lua.table2str(action))
|
if ( nRet ~= 0 ) then
|
lua.Error( strLuaDEID, debug.getinfo(1), "setAction错误: "..strRetInfo)
|
end
|
end
|