--[[
|
编码: WMS-40-30
|
名称: 绑定上架-界面初始化
|
作者:HAN
|
日期:2025-7-4
|
|
级别:标准
|
|
函数:InitialDlg
|
|
功能:
|
-- 站台做绑定上架操作,获取当前登录电脑绑定的站台号
|
-- 设置登录人员姓名
|
|
更改记录:
|
|
--]]
|
|
wms_base = require( "wms_base" )
|
|
function InitialDlg ( 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 station_enable = true
|
if ( login_info.station ~= '' ) then station_enable = false end
|
|
local station_list = {}
|
local cur_station = ''
|
if ( login_info.station ~= '') then
|
-- 获取当前站台的作业类型
|
table.insert( station_list, login_info.station )
|
cur_station = login_info.station
|
station_enable = false -- 不能选站台
|
else
|
-- 获取所有可用的站台,类型是 WS(TP/SW)类型
|
local station_objs, obj_attrs
|
|
strCondition = "C_ENABLE = 'Y' AND S_TYPE = 'WS(TP/SW)'"
|
nRet, station_objs = m3.QueryDataObject( strLuaDEID, "Machine_Station", strCondition, "S_CODE" )
|
if nRet ~= 0 then
|
lua.Stop( strLuaDEID, "获取【Machine_Station】信息失败! " .. station_objs )
|
return
|
end
|
|
for _, obj in ipairs( station_objs ) do
|
obj_attrs = m3.KeyValueAttrsToObjAttr(obj.attrs)
|
table.insert( station_list, obj_attrs.S_CODE )
|
end
|
station_enable = true
|
end
|
|
local strSQL = "S_STATION_NO = '"..cur_station.."'"
|
local action = {
|
{
|
action_type = "set_dlg_attr",
|
value = {
|
{ attr = "Operator", value = login_info.user_name, enable = false },
|
{ attr = "S_STATION_NO", value = cur_station, choice_list = station_list, enable = station_enable }
|
}
|
},
|
{
|
action_type = "set_query_condition",
|
value = {
|
condition = strSQL,
|
order = "S_CODE Desc"
|
}
|
}
|
}
|
|
nRet, strRetInfo = mobox.setAction( strLuaDEID, lua.table2str(action) )
|
if ( nRet ~= 0 ) then
|
lua.Stop( strLuaDEID, "setAction失败! "..strRetInfo..' action = '..strAction )
|
return
|
end
|
end
|