--[[
|
编码: WMS-26-11
|
名称:
|
作者:
|
日期:2025-07-03
|
|
函数: BeforeDataObjModify
|
功能:
|
|
更改记录:
|
|
--]]
|
|
json = require ("json")
|
mobox = require ("OILua_JavelinExt")
|
m3 = require ("oi_base_mobox")
|
|
function BeforeDataObjModify( strLuaDEID )
|
local nRet, strRetInfo
|
nRet, strRetInfo = mobox.getCurEditDataObjAttr( strLuaDEID, "N_CUR_OP_TYPE","S_CODE","S_LOC_CODE" )
|
if ( nRet ~= 0 ) then lua.Error( strLuaDEID, debug.getinfo(1), "获取当前编辑属性失败! "..strRetInfo ) end
|
local obj_attrs = json.decode( strRetInfo )
|
local op_type = obj_attrs[1].value
|
local code = obj_attrs[2].value
|
local loc_code = obj_attrs[3].value
|
|
lua.Debug(strLuaDEID, debug.getinfo(1), "获取当前模式 -->", op_type)
|
lua.Debug(strLuaDEID, debug.getinfo(1), "获取当前站台号 -->", loc_code)
|
|
strCondition = "S_END_LOC = '"..loc_code.."' AND N_B_STATE IN (0,1,5,6,8)"
|
nRet, strRetInfo = mobox.getDataObjCount( strLuaDEID, "Operation", strCondition )
|
if ( nRet ~= 0 ) then lua.Error( strLuaDEID, debug.getinfo(1), "getDataObjCount失败!"..strRetInfo ) end
|
task_num = lua.StrToNumber( strRetInfo )
|
if(task_num > 0) then
|
lua.Stop(strLuaDEID, "当前站台有执行的任务不可作业!")
|
return
|
end
|
|
end
|