1
Jianw
10 天以前 88e26a2a960dbbc148332772448b79b9877102d8
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
60
61
62
63
64
65
66
67
68
69
70
71
72
--[[
   编码: AMS-106-11
   名称: 
   作者:
   日期:2025-05-23
 
   函数: BeforeSelectItem
   功能:
 
   更改记录:
 
--]]
 
json  = require ("json")
mobox = require ("OILua_JavelinExt")
m3 = require("oi_base_mobox")
 
function BeforeSelectItem ( strLuaDEID )
    local nRet, strRetInfo
    local runtime_parameter
    nRet, runtime_parameter = m3.GetRuntimeParam(strLuaDEID)
 
    if ( nRet ~= 0 ) then lua.Error( strLuaDEID, debug.getinfo(1), "GetRuntimeParam失败! "..runtime_parameter ) end
    
    if(runtime_parameter.master == "") then
        lua.Stop(strLuaDEID , "无法获取对应的表头参数!!")
        return
    end
    if(runtime_parameter.master.objAttr == "") then
        lua.Stop(strLuaDEID , "无法获取对应的数据!!")
        return
    end
    local wh_code = runtime_parameter.master.objAttr.S_WH_CODE
    local area_code = runtime_parameter.master.objAttr.S_AREA_CODE
    local op_type = runtime_parameter.master.objAttr.S_OP_TYPE
    local bs_no = runtime_parameter.master.objAttr.S_BS_NO
    
    if(wh_code == nil or wh_code == "") then
        lua.Stop(strLuaDEID , "仓库无值!!")
        return
    end
    if(area_code == nil or area_code == "") then
        lua.Stop(strLuaDEID , "库区无值!!")
        return
    end
    if(op_type == nil or op_type == "") then
        lua.Stop(strLuaDEID , "来源类型无值!!")
        return
    end
    if(bs_no == nil or bs_no == "") then
        lua.Stop(strLuaDEID , "来源单号无值!!")
        return
    end
    
    local strCondition = "S_UDF01 = '" ..area_code.. "' "
    
 
    local action = {
        {
            action_type = "open_data_query_dlg",
            value = {
                multi_choice = true,
                cls_name = "SKU",
                grid_style = "basis-选择面板用",
                condition = strCondition,
                order = "S_ITEM_CODE"
            }
        }
    }
    nRet, strRetInfo = mobox.setAction( strLuaDEID, lua.table2str(action) )
    if (nRet ~= 0) then lua.Error( strLuaDEID, debug.getinfo(1), strRetInfo ) end    
end