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
--[[
    编码: WMS-33-11
    名称: 指定出库-新增窗口-出库类型变化后
    作者:HAN  
    日期:2025-1-29
    级别:固定 (说明本段代码在项目中不太会变化)
    
    函数: AfterTypeChg
 
    功能:
          根据出库类型不同 设置显示不显示一些控件
 
    更改记录:
   
--]]
 
json  = require ("json")
mobox = require ("OILua_JavelinExt")
m3 = require("oi_base_mobox")
 
function AfterTypeChg ( strLuaDEID ) 
    local nRet, strRetInfo
 
    nRet, strRetInfo = mobox.getCurEditDataObjAttr( strLuaDEID, "N_TYPE" ) 
    if ( nRet ~= 0 )  then lua.Error( strLuaDEID, debug.getinfo(1), "获取当前编辑属性失败! "..strRetInfo ) end 
    local obj_attrs = json.decode( strRetInfo ) 
    local type = lua.Get_NumAttrValue( obj_attrs[1].value )
 
    local action = {}
    if ( type == 1 ) then
        -- 指定容器出库
        action = {
            {
                action_type = "set_dlg_attr_show",   
                value = {
                    { attr = "S_ITEM_CODE", show = false },
                    { attr = "S_ITEM_NAME", show = false },
                    { attr = "S_CNTR_CODE", show = true },
                }                     
            }
        }        
    else
        -- 指定货品出库
        action = {
            {
                action_type = "set_dlg_attr_show",   
                value = {
                    { attr = "S_ITEM_CODE", show = true },
                    { attr = "S_ITEM_NAME", show = true },
                    { attr = "S_CNTR_CODE", show = false },
                }                     
            }
        }         
    end
    nRet, strRetInfo = mobox.setAction( strLuaDEID, lua.table2str(action)  )
    if ( nRet ~= 0 ) then lua.Error( strLuaDEID, debug.getinfo(1), "setAction失败! "..strRetInfo..' action = '..strAction ) end 
end