1
Jianw
9 天以前 70f29da38121b9a467841253e3268feb5df02902
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-50-03
    名称: 功能区-新增窗口-选目标编码前
    作者:HAN  
    日期:2025-1-29
 
    级别:固定 (说明本段代码在项目中不太会变化)
    
    函数: BeforeSelectTarget
 
    功能:
        根据“功能区目标对象类型”不同弹出不同的选择对话框
 
    更改记录:
 
--]]
 
json  = require ("json")
mobox = require ("OILua_JavelinExt")
m3 = require("oi_base_mobox")
 
function BeforeSelectTarget ( strLuaDEID )
    local nRet, strRetInfo
 
    -- 获取仓库编码
    nRet, strRetInfo = mobox.getCurEditDataObjAttr( strLuaDEID, "N_FA_TYPE" ) 
    if ( nRet ~= 0 )  then lua.Error( strLuaDEID, debug.getinfo(1), "获取当前编辑属性失败! "..strRetInfo ) end 
    local obj_attrs = json.decode( strRetInfo ) 
    local nFAType = lua.Get_NumAttrValue( obj_attrs[1].value )
 
 
    -- 设置 action 的参数
    local action = {}
    local value = {}
 
    action.action_type = "open_data_query_dlg"
    value.multi_choice = false                          -- 不多选    
    -- nFAType = 0 库区 1 货位 2 仓库
    if ( nFAType == 0 ) then
        value.cls_name = "Area"                         -- 选择的数据类标识
        value.grid_style = "选择面板用"                  -- 选择面板中 GridStyle
        value.order = "S_CODE" 
    elseif ( nFAType == 1 ) then
        value.cls_name = "Location"  
        value.grid_style = "选择面板用"                  -- 选择面板中 GridStyle
        value.order = "S_CODE" 
    elseif ( nFAType == 2 ) then
        value.cls_name = "Warehouse"  
        value.grid_style = "选择面板用"                  -- 选择面板中 GridStyle
        value.order = "S_CODE"         
    else
        return
    end
 
    action.value = value
 
    nRet, strRetInfo = mobox.setAction( strLuaDEID, '['..lua.table2str(action)..']' )
    if (nRet ~= 0) then lua.Error( strLuaDEID, debug.getinfo(1), strRetInfo ) end
end