fy36
2025-05-14 a37aca60ff9914b0abb710f04118b22420f4f398
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
--[[
    编码: WMS-33-15
    名称: 指定出库-新增窗口-选容器前
    作者:HAN  
    日期:2025-1-29
 
    级别:固定 (说明本段代码在项目中不太会变化)
    
    函数: BeforeSelectCNTR
 
    功能:
        弹出货品查询面板
 
    更改记录:
 
--]]
 
json  = require ("json")
mobox = require ("OILua_JavelinExt")
m3 = require("oi_base_mobox")
 
function BeforeSelectCNTR ( strLuaDEID )
    local nRet, strRetInfo
 
    nRet, strRetInfo = mobox.getCurEditDataObjAttr( strLuaDEID, "S_WH_CODE", "S_AREA_CODE" ) 
    if ( nRet ~= 0 )  then lua.Error( strLuaDEID, debug.getinfo(1), "获取当前编辑属性失败! "..strRetInfo ) end 
    local obj_attrs = json.decode( strRetInfo ) 
    local wh_code = lua.Get_StrAttrValue( obj_attrs[1].value )
    if  ( wh_code == '') then
        mobox.setInfo( strLuaDEID, "请先选择一个仓库" ) 
        return
    end
 
    local area_code = lua.Get_StrAttrValue( obj_attrs[2].value )
    if  ( area_code == '') then
        mobox.setInfo( strLuaDEID, "请先选择一个库区" ) 
        return
    end
 
    local strCondition = "S_CODE IN ( select S_CNTR_CODE from TN_Loc_Container with (NOLOCK) where S_LOC_CODE in "..
    "(select S_CODE from TN_Location with (NOLOCK) where S_AREA_CODE = '"..area_code.."'))"
    local action = {
        {
            action_type = "open_data_query_dlg",
            value = {
                multi_choice = false,
                cls_name = "Container",
                grid_style = "选择面板用",
                condition = strCondition,
                order = "S_CODE"
            }
        }
    }
    nRet, strRetInfo = mobox.setAction( strLuaDEID, lua.table2str(action) )
    if (nRet ~= 0) then lua.Error( strLuaDEID, debug.getinfo(1), strRetInfo ) end    
end