--[[
|
编码: WMS-01-09
|
名称: 容器-解绑
|
作者:HAN
|
日期:2025-1-29
|
|
级别:固定 (说明本段代码在项目中不太会变化)
|
|
函数: Unbinding
|
|
用在: 容器对象3000系列页面中,点中容器进行解绑
|
用于实施辅助,在实施阶段用该功能构建数据用
|
功能:
|
容器货位进行解绑,释放库存,库存量会减少
|
|
更改记录:
|
|
--]]
|
|
wms_cntr = require( "wms_container" )
|
|
function Unbinding ( strLuaDEID )
|
local nRet, strRetInfo
|
local cntr_code, data_json
|
|
nRet, data_json = m3.GetSysDataJson( strLuaDEID )
|
if ( nRet ~=0 ) then
|
lua.Stop( strLuaDEID, data_json )
|
return
|
end
|
local nCount = #data_json
|
if ( nCount == 0 ) then return end
|
local cntr
|
|
nRet, cntr = m3.ObjAttrStrToLuaObj( "Container", data_json[1].attrs )
|
if ( nRet ~= 0 ) then
|
lua.Stop( strLuaDEID, cntr )
|
return
|
end
|
local cntr_code = cntr.code or ''
|
if ( cntr_code ~= '' ) then
|
local action_src = ''
|
local login_info
|
nRet, login_info = wms_base.Get_CurLoginUserInfo( strLuaDEID )
|
if ( nRet == 0 ) then
|
action_src = "'"..login_info.user_name.."'手动解绑容器和货位之间关系"
|
end
|
|
nRet, strRetInfo = wms_cntr.Unbinding( strLuaDEID, cntr_code, action_src )
|
if ( nRet ~= 0 ) then
|
lua.Stop( strLuaDEID, "解绑容器'"..cntr.code.."'失败!"..strRetInfo )
|
return
|
end
|
|
local action = {
|
{
|
action_type = "refresh_cur_row",
|
value = ""
|
}
|
}
|
nRet, strRetInfo = mobox.setAction(strLuaDEID, lua.table2str(action))
|
if ( nRet ~= 0 ) then
|
lua.Stop( strLuaDEID, "setAction错误: "..strRetInfo)
|
return
|
end
|
end
|
|
end
|