--[[
|
编码: AMS-21-25
|
名称:
|
作者:
|
日期:2025-04-27
|
|
函数: ItemCodeChange
|
功能:
|
|
更改记录:
|
|
--]]
|
|
json = require ("json")
|
mobox = require ("OILua_JavelinExt")
|
m3 = require ("oi_base_mobox")
|
|
function ItemCodeChange( strLuaDEID )
|
local nRet, strRetInfo
|
local cntr_detail_array
|
|
local nRet,whcode
|
nRet,whcode = wms_base.Get_sConst2("人工库存储区" )
|
if ( nRet ~= 0 ) then
|
lua.Error(strLuaDEID, debug.getinfo(1), "获取系统常量:人工库存储区失败!" )
|
end
|
|
-- 获取当前编辑的容器编码
|
nRet, strRetInfo = mobox.getCurEditDataObjAttr(strLuaDEID, "S_IO_NO")
|
if (nRet ~= 0) then
|
lua.Error(strLuaDEID, debug.getinfo(1), "获取当前编辑属性失败! "..strRetInfo)
|
end
|
|
local obj_attrs = json.decode(strRetInfo)
|
local io_no = lua.Get_StrAttrValue(obj_attrs[1].value)
|
|
local strCondition = "S_NO = '" .. io_no .. "'"
|
nRet, strRetInfo = m3.GetDataObjByCondition(strLuaDEID, "Inbound_Order", strCondition)
|
if (nRet ~= 0) then
|
mobox.setInfo(strLuaDEID, "查询 Inbound_Order 表失败: " .. strRetInfo)
|
return
|
end
|
lua.Debug(strLuaDEID, debug.getinfo(1), "入库单信息-->", strRetInfo)
|
|
local area_code = strRetInfo.area_code --校验库区值
|
if(area_code ~= whcode)then
|
mobox.setInfo(strLuaDEID, "编码 = '" .. io_no .. "'的入库单的库区值不符合人工库!!!")
|
return
|
end
|
|
local bs_state = strRetInfo.b_state -- 校验状态值
|
if(bs_state == 3) then
|
mobox.setInfo(strLuaDEID, "编码 = '" .. io_no .. "'的入库单已经完成!!!")
|
return
|
end
|
|
end
|