--[[
|
编码: WMS-16-08
|
名称: 盘点单-查询面板-库区选择变化
|
作者:HAN
|
日期:2025-1-29
|
|
级别:固定 (说明本段代码在项目中不太会变化)
|
|
函数: AreaCodeChange
|
|
功能:
|
-- 如果选择了库区,需要从 库区量表 进行查询
|
|
更改记录:
|
V2.0 HAN 20250213
|
-- 增加容器盘点类型
|
|
--]]
|
|
wms_base = require( "wms_base" )
|
|
function AreaCodeChange ( strLuaDEID )
|
local nRet, strRetInfo
|
local area_code
|
|
-- 获取 库区编码,盘点类型
|
nRet, strRetInfo = mobox.getCurEditDataObjAttr( strLuaDEID, "S_AREA_CODE", "N_TYPE" )
|
if ( nRet ~= 0 ) then lua.Error( strLuaDEID, debug.getinfo(1), "获取当前编辑属性失败! "..strRetInfo ) end
|
local obj_attrs = json.decode( strRetInfo )
|
local area_code = lua.Get_StrAttrValue( obj_attrs[1].value )
|
local count_type = lua.Get_NumAttrValue( obj_attrs[2].value )
|
|
local action = {}
|
local value = {}
|
|
action.action_type = "set_query_panel"
|
if ( count_type == wms_base.Get_nConst(strLuaDEID,"盘点类型-货品盘点")) then
|
if ( area_code ~= '') then
|
value.cls_id = "AZ_Inventory"
|
else
|
value.cls_id = "WH_Inventory"
|
end
|
elseif ( count_type == wms_base.Get_nConst(strLuaDEID,"盘点类型-货位盘点")) then
|
value.cls_id = "Location"
|
-- V2.0
|
else
|
value.cls_id = "Container"
|
end
|
action.value = value
|
-- 设置窗口中的 库区 列表
|
|
nRet, strRetInfo = mobox.setAction( strLuaDEID, "["..lua.table2str(action).."]" )
|
if ( nRet ~= 0 ) then lua.Error( strLuaDEID, debug.getinfo(1), "setAction失败! "..strRetInfo..' action = '..strAction ) end
|
end
|