Lua脚本【人员选择前】
json = require (“json”)
mobox = require (“OILua_JavelinExt”)
function BeforeSelectUser ( strLuaDEID )
local action = ‘[{“action_type”:”open_select_userdlg“,”value”:{“multi_choice “:false,”style”:”user“}}]’
— user 的意思 只列出用户选择
nRet, strRetInfo = mobox.setAction( strLuaDEID, action )
if (nRet ~= 0) then error( strRetInfo ) end
end
Lua脚本【人员选择后】
json = require (“json”)mobox = require (“OILua_JavelinExt”)function AfterSelectUser ( strLuaDEID )local nRet, strUserLogin, strUserName— 获取当前选择数据nRet, strRetInfo = mobox.getInputParameter( strLuaDEID )if ( nRet ~= 0 or strRetInfo == ”) thenmobox.error( strLuaDEID, “无法获取数据!”)returnendlocal retJson = json.decode( strRetInfo )local input_parameter = retJson[“parameter”]strUserLogin = input_parameter[1].idstrUserName = input_parameter[1].name— 设置所选人员local setAttr = ‘[{“attr”:”S_MASTER”,”value”:”‘..strUserName..'”},{“attr”:”S_S_MASTER_Login”,”value”:”‘..strUserLogin..'”}]’mobox.setCurEditDataObjAttr( strLuaDEID,setAttr )end