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
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
89
90
91
92
93
94
95
96
97
98
99
100
101
--[[
    编码: 
    名称: 
    作者: HUI
    创建时间: 2025/6/5 14:27
    入口函数: 
    功能说明: 
    变更历史: 
--]]
 
m3 = require("oi_base_mobox")
wms = require("OILua_WMS")
lua = require("oi_base_func")
json = require("json")
mobox = require("OILua_JavelinExt")
wms_wh = require("wms_wh")
wms_out = require("wms_outbound")
wms_base = require("wms_base")
wms_cntr = require("wms_container")
 
function BandingSortBox (strLuaDEID)
 
    local nRet, strRetInfo
    local wave_detail_array
    local wave_detail_list = {}
 
    -- 获取要启动的出库波次
    nRet, strRetInfo = m3.GetSysDataJson(strLuaDEID)
    if (nRet ~= 0) then
        lua.Error(strLuaDEID, debug.getinfo(1), strRetInfo)
    end
    if (#strRetInfo == 0) then
        mobox.setInfo(strLuaDEID, "请先勾选一条数据!")
        return
    end
 
    -- 获取出库波次
    local id = strRetInfo[1].id
    local out_wave = m3.KeyValueAttrsToObjAttr(strRetInfo[1].attrs)
    local wave_no = out_wave.S_WAVE_NO
 
    -- 获取波次明细
    nRet, wave_detail_array = m3.QueryDataObject(strLuaDEID, "OW_Detail", "S_WAVE_NO = '" .. wave_no .. "'", "")
    if (nRet ~= 0) then
        lua.Error(strLuaDEID, debug.getinfo(1), "获取信息失败!" .. wave_detail_array)
    end
    if (#wave_detail_array == 0) then
        mobox.setInfo(strLuaDEID, "波次:" .. wave_no .. "下未查询到明细数据!")
        return
    end
 
    -- 将波次明细添加到波次列表
    for m = 1, #wave_detail_array do
        local wave_detail = m3.KeyValueAttrsToObjAttr(wave_detail_array[m].attrs)
        table.insert(wave_detail_list, wave_detail)
    end
 
    -- 弹出 一个HTML界面显示 拣料箱的数量
    local action = {
        {
            action_type = "refresh",
            value = ""
        },
        {
            action_type = "open_form_dlg",
            value = {
                dlg_name = "绑定拣料箱",
                cls_id = "Outbound_Wave",
                input_parameter = {
                    id = id, -- 数据对象id
                    wave_no = wave_no, -- 波次号
                    operator = out_wave.S_OPERATOR, -- 操作人
                    operator_name = out_wave.S_OPERATOR_NAME, -- 操作人姓名
                    good_type_num = out_wave.N_GOOD_TYPE_NUM, -- 物料种类
                    total_qty = out_wave.N_TOTAL_QTY, -- 物料总数
                    picking_box_num = out_wave.N_PICKING_BOX_NUM, -- 拣料箱数量
                    wh_code = out_wave.S_WH_CODE, -- 仓库编码
                    area_code = out_wave.S_AREA_CODE, -- 库区编码
                    station = out_wave.S_STATION_NO, -- 出库站台
                    o_detail_list = wave_detail_list   -- 分拣明细列表
                },
                data_object = {
                    id = "",
                    attrs = {
                        Station = out_wave.S_STATION_NO,
                        PickingBoxNum = out_wave.N_PICKING_BOX_NUM,
                        GoodTypeNum = out_wave.N_GOOD_TYPE_NUM,
                        Qty = out_wave.N_TOTAL_QTY
                    }
                }
            }
        }
    }
 
    -- 设置页面数据
    nRet, strRetInfo = mobox.setAction(strLuaDEID, lua.table2str(action))
    if (nRet ~= 0) then
        lua.Error(strLuaDEID, debug.getinfo(1), "setAction失败! " .. strRetInfo)
    end
 
end