--[[
|
编码: WMS-33-10
|
名称: 指定出库-新增窗口-初始化
|
作者:HAN
|
日期:2025-1-29
|
|
级别:固定 (说明本段代码在项目中不太会变化)
|
|
函数: InitialNewAddDlg
|
|
功能:
|
根据登录人员获取仓库下拉列表
|
|
更改记录:
|
|
--]]
|
|
wms_base = require ("wms_base")
|
|
function InitialNewAddDlg ( strLuaDEID )
|
local nRet, strRetInfo, factory, data_objs, n
|
|
nRet, factory = m3.GetMyFactory( strLuaDEID )
|
if ( factory == '' ) then
|
nRet, factory = wms_base.Get_sConst2( strLuaDEID, "默认工厂标识", 1 )
|
if ( nRet ~= 0 ) then
|
lua.Stop( strLuaDEID, "系统无法获取常量'默认工厂标识'")
|
return
|
end
|
end
|
|
local choice_list = {}
|
if ( factory ~= '' ) then
|
local strCondition
|
local strOrder = 'S_CODE'
|
strCondition = "S_FACTORY = '"..factory.."'"
|
|
nRet, data_objs = m3.QueryDataObject( strLuaDEID, "Warehouse", strCondition, strOrder )
|
if (nRet ~= 0) then lua.Error( strLuaDEID, debug.getinfo(1), "获取【Warehouse】信息失败! " .. data_objs) end
|
local obj_attrs
|
|
for n = 1, #data_objs do
|
obj_attrs = m3.KeyValueAttrsToObjAttr(data_objs[n].attrs)
|
table.insert( choice_list, obj_attrs.S_CODE )
|
end
|
|
end
|
|
local action = {
|
{
|
action_type = "set_dlg_attr",
|
value = {
|
{ attr = "S_WH_CODE", value = "81" },--, choice_list = choice_list
|
{ attr = "S_AREA_CODE", value = "ZG2" },
|
{ attr = "N_TYPE", value = "1"}
|
}
|
},
|
{
|
action_type = "set_dlg_attr_show",
|
value = {
|
{ attr = "S_ITEM_CODE", show = false },
|
{ attr = "S_ITEM_NAME", show = false }
|
}
|
}
|
}
|
nRet, strRetInfo = mobox.setAction( strLuaDEID, lua.table2str(action) )
|
if ( nRet ~= 0 ) then lua.Error( strLuaDEID, debug.getinfo(1), "setAction失败! "..strRetInfo..' action = '..strAction ) end
|
end
|