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 == ”) then? ? ? ? mobox.error( strLuaDEID, “無法獲取數據!”)? ? ? ? return? ? end? ? local retJson = json.decode( strRetInfo )? ? local input_parameter = retJson[“parameter”]? ? strUserLogin = input_parameter[1].id? ? strUserName =? input_parameter[1].name? ? — 設置所選人員? ? local setAttr = ‘[{“attr”:”S_MASTER”,”value”:”‘..strUserName..'”},{“attr”:”S_S_MASTER_Login”,”value”:”‘..strUserLogin..'”}]’? ? mobox.setCurEditDataObjAttr( strLuaDEID,setAttr )end