1
Jianw
10 天以前 f6f5e6b632d6649386a380558d84003f3de7ec6c
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
--[[
    编码: WMS-66-21
    名称: 机台关联区-新增小窗口-选目标库区前
    作者:HAN  
    日期:2025-1-29
    
    级别:固定 (说明本段代码在项目中不太会变化)
    
    函数: BeforeSelect
 
    功能:
        弹出仓库查询面板
    更改记录:
 
--]]
 
json  = require ("json")
mobox = require ("OILua_JavelinExt")
m3 = require("oi_base_mobox")
 
function BeforeSelect( strLuaDEID )
    local nRet, strRetInfo
 
    -- 获取仓库编码
    nRet, strRetInfo = mobox.getCurEditDataObjAttr( strLuaDEID, "N_LA_TYPE" ) 
    if ( nRet ~= 0 )  then 
        lua.Stop( strLuaDEID, "获取当前编辑属性失败! "..strRetInfo ) 
        return
    end 
    local obj_attrs = json.decode( strRetInfo ) 
    local link_obj_type = lua.Get_NumAttrValue( obj_attrs[1].value )
 
    local action = {}    
    if link_obj_type == 0 then
        -- 关联的对象是库区
        action = {
            {
                action_type = "open_data_query_dlg",
                value = {
                    multi_choice = false,
                    cls_name = "Area",                        -- 选择的数据类标识
                    grid_style = "basis-选择面板用",                  -- 选择面板中 GridStyle
                    condition = "",
                    order = "S_CODE" 
                }
            }
        }
 
    elseif link_obj_type == 1 then
        return
    else
        return
    end
 
    if not lua.isTableEmpty( action ) then
        nRet, strRetInfo = mobox.setAction( strLuaDEID, lua.table2str(action) )
        if (nRet ~= 0) then lua.Error( strLuaDEID, debug.getinfo(1), strRetInfo ) end
    end
end