--[[
|
编码: WMS-56-10
|
名称: 组盘明细-3055顶部窗口初始化
|
作者:HAN
|
日期:2025-1-29
|
|
级别:固定 (说明本段代码在项目中不太会变化)
|
|
函数: InitialTopViewDlg
|
|
功能:
|
-- 获取当前登录人的账号和姓名
|
-- 获取本机登录的 MAC 地址,这个在网页版是实现不了的,需要在MBC运行
|
|
|
更改记录:
|
|
--]]
|
|
wms_base = require( "wms_base" )
|
|
function InitialTopViewDlg ( strLuaDEID )
|
local nRet, strRetInfo
|
|
-- 获取当前登录人员账号名称及PC绑定的站台
|
local login_info
|
nRet, login_info = wms_base.Get_CurLoginUserInfo( strLuaDEID )
|
if ( nRet ~= 0 ) then lua.Error( strLuaDEID, debug.getinfo(1), login_info ) end
|
|
local strCondition = ""
|
local nCount = 0 -- 未执行任务数量
|
|
if ( login_info.station ~= '') then
|
-- 获取未执行任务
|
-- N_B_STATE = 0 未执行任务
|
strCondition = "S_STATION_NO = '"..login_info.station.."' AND N_B_STATE = 0"
|
nRet, strRetInfo = mobox.getDataObjCount( strLuaDEID, "Pre_Alloc_CNTR_Detail", strCondition )
|
if ( nRet ~= 0 ) then lua.Error( strLuaDEID, debug.getinfo(1), strRetInfo ) end
|
nCount = lua.StrToNumber( strRetInfo )
|
end
|
local station_enable = true
|
if ( login_info.station ~= '' ) then station_enable = false end
|
|
local action = {
|
{
|
action_type = "set_dlg_attr",
|
value = {
|
{ attr = "Operator", value = login_info.user_name, enable = false },
|
{ attr = "S_STATION_NO", value = login_info.station, enable = station_enable },
|
{ attr = "TaskCount", value = nCount, enable = false },
|
}
|
}
|
}
|
|
if ( login_info.station ~= '') then
|
|
action[2] = {
|
action_type = "set_query_condition",
|
value = {
|
condition = strCondition,
|
order = "S_SET_CODE",
|
page_name = "未执行任务"
|
}
|
}
|
end
|
|
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 ) end
|
|
end
|