fy36
2025-07-01 350eb5ec9163d3ea21416b1525bb80191e958071
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-33-12
    名称: 指定出库-新增窗口-选仓库后
    作者:HAN  
    日期:2025-1-29
 
    级别:固定 (说明本段代码在项目中不太会变化)
    
    函数: AfterWHChg
 
    功能:
          根据选中的仓库获取仓库库区列表
 
    更改记录:
        V1.0 KUN 2025/02/05
        巨星要求,仓库等值设为固定值,不再根据仓库获取库区
   
--]]
 
json  = require ("json")
mobox = require ("OILua_JavelinExt")
m3 = require("oi_base_mobox")
 
function AfterWHChg ( strLuaDEID ) 
    local nRet, strRetInfo
 
    nRet, strRetInfo = mobox.getCurEditDataObjAttr( strLuaDEID, "S_WH_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 )
    local choice_list = {}
 
    --[[if ( wh_code ~= '' ) then
        local strCondition
        local strOrder = 'S_CODE'
        strCondition = "S_WH_CODE = '"..wh_code.."'"
 
        nRet, data_objs = m3.QueryDataObject( strLuaDEID, "Area", strCondition, strOrder )
        if (nRet ~= 0) then lua.Error( strLuaDEID, debug.getinfo(1), "获取【Area】信息失败! " .. data_objs) end
        local obj_attrs
 
        for n = 1, #data_objs do
            obj_attrs = m3.KeyValueAttrsToObjAttr(data_objs[n].attrs)
            table.insert( choice_list, obj_attrs.S_CODE )
        end
    end
    ]]
 
    local action = {
        {
            action_type = "set_dlg_attr",
            value = {
                { attr = "S_AREA_CODE", value = "ZG2" }
            }
        }
    }
    nRet, strRetInfo = mobox.setAction( strLuaDEID, lua.table2str(action)  )
    if ( nRet ~= 0 ) then lua.Error( strLuaDEID, debug.getinfo(1), "setAction失败! "..strRetInfo..' action = '..strAction ) end 
end