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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
--[[
    编码: WMS-56-33
    名称: 获取入库空料箱计算结果
    作者:HAN  
    日期:2025-3-12
 
    级别:项目
    
    函数: GetEmptyBoxOutResult
 
    功能:
        -- 点击【呼出空料箱】按钮后后台进程进行呼出空料箱计算
 
    更改记录:
--]]
 
wms_base = require ("wms_base")
 
function GetEmptyBoxOutResult ( strLuaDEID ) 
    local nRet, strRetInfo, n
    local paramter
 
    nRet, paramter = m3.GetSysDataJson( strLuaDEID )
    if (nRet ~= 0) then lua.Error( strLuaDEID, debug.getinfo(1), paramter ) end
 
    nRet, strRetInfo = mobox.getBackendScriptProcResult( paramter.proc_id )
    local action = {}
    if ( nRet == 0 ) then
        -- 后台脚本还没处理完成
        action[1] = 
        {
            action_type = "wait",
            value = {
                time = 1,
                event = {
                    cls_name = "Pre_Alloc_CNTR_Detail",
                    event_name = "获取入库空料箱计算结果",
                    data_json = paramter
                }
            }
        }
    elseif ( nRet == 1 ) then
        -- 后台脚本执行成功
        local result = json.decode( strRetInfo )
 
        local input_parameter = {
            cls_id = "Inbound_Wave",
            obj_id = result.wave_obj_id,
            from = paramter.from,
            station = paramter.station,
            bs_type = paramter.bs_type,
            bs_no = paramter.bs_no          
        }        
        local data_json = {
            cntr_count = result.cntr_count,
            cntr_cell_list = result.cntr_cell_list
        }
        action = 
        {
            {
                action_type = "refresh_master_panel",
                value = {
                    sub_page = {"站台超重货品明细"}
                }
            },            
            {
                action_type = "open_html_dlg",
                value = {
                    dlg_name = "空料箱呼出确认",
                    cls_id = "Inbound_Order",
                    data_json =  data_json,
                    input_parameter = input_parameter
                }
            },
            {
                action_type = "refresh",
                value = ""
            }
        }
    else
        -- 错误
        mobox.setInfo( strLuaDEID, strRetInfo )
        return
    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