Jianw
2025-05-13 3b39fe3810c3ee2ec9ec97236c1769c5c85e062c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
--[[
    编码: WMS-81-12
    名称: 出入库测试-新增窗口-选目标库区回调
    作者:HAN  
    日期:2025-1-29
    级别:固定 (说明本段代码在项目中不太会变化)
    
    函数: CallBack
 
    功能:
        把选中的库区编码+名称设置到 目标库区控件
 
    更改记录:
 
--]]
 
json  = require ("json")
mobox = require ("OILua_JavelinExt")
m3 = require("oi_base_mobox")
 
function CallBack ( strLuaDEID )
    local nRet, strRetInfo
    local obj
 
    -- 获取选中的数据对象
    nRet, obj = m3.GetSysDataJson( strLuaDEID )
    if ( nRet ~=0 ) then lua.Error( strLuaDEID, debug.getinfo(1), obj ) end  
 
    local obj_attrs = m3.KeyValueAttrsToObjAttr( obj.attrs )
    local strAreaCodeName = obj_attrs.S_CODE.."#"..obj_attrs.S_NAME
 
    -- 设置窗口中的 目标库区
    local setAttr = '[{"attr":"S_TO_AREA_CODE","value":"'..strAreaCodeName..'"}]'
    local action = {}
 
    action.action_type = "set_dlg_attr"
    action.value = json.decode(setAttr)
 
    nRet, strRetInfo = mobox.setAction( strLuaDEID, '['..lua.table2str(action)..']'  )
    if ( nRet ~= 0 ) then lua.Error( strLuaDEID, debug.getinfo(1), "setAction失败! "..strRetInfo..' action = '..strAction ) end 
end