--[[
|
编码: WMS-33-12
|
名称: 指定出库-新增窗口-选仓库后
|
作者:HAN
|
日期:2025-1-29
|
|
级别:固定 (说明本段代码在项目中不太会变化)
|
|
函数: AfterWHChg
|
|
功能:
|
根据选中的仓库获取仓库库区列表
|
|
更改记录:
|
V1.0 KUN 2025/02/05
|
巨星要求,仓库等值设为固定值,不再根据仓库获取库区
|
|
--]]
|
|
json = require ("json")
|
mobox = require ("OILua_JavelinExt")
|
m3 = require("oi_base_mobox")
|
|
function AfterWHChg ( strLuaDEID )
|
local nRet, strRetInfo
|
|
nRet, strRetInfo = mobox.getCurEditDataObjAttr( strLuaDEID, "S_WH_CODE" )
|
if ( nRet ~= 0 ) then lua.Error( strLuaDEID, debug.getinfo(1), "获取当前编辑属性失败! "..strRetInfo ) end
|
local obj_attrs = json.decode( strRetInfo )
|
local wh_code = lua.Get_StrAttrValue( obj_attrs[1].value )
|
local choice_list = {}
|
|
--[[if ( wh_code ~= '' ) then
|
local strCondition
|
local strOrder = 'S_CODE'
|
strCondition = "S_WH_CODE = '"..wh_code.."'"
|
|
nRet, data_objs = m3.QueryDataObject( strLuaDEID, "Area", strCondition, strOrder )
|
if (nRet ~= 0) then lua.Error( strLuaDEID, debug.getinfo(1), "获取【Area】信息失败! " .. 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_AREA_CODE", value = "ZG2" }
|
}
|
}
|
}
|
nRet, strRetInfo = mobox.setAction( strLuaDEID, lua.table2str(action) )
|
if ( nRet ~= 0 ) then lua.Error( strLuaDEID, debug.getinfo(1), "setAction失败! "..strRetInfo..' action = '..strAction ) end
|
end
|