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
--[[
   编码: AMS-60-20
   名称: 
   作者:
   日期:2025-07-07
 
   函数: ClickOkButton
   功能:
 
   更改记录:
 
--]]
 
json  = require ("json")
mobox = require ("OILua_JavelinExt")
m3 = require ("oi_base_mobox")
 
function ClickOkButton( strLuaDEID )
    
    local nRet, strRetInfo
    local parameter
    local out_order_array
 
    -- 获取自定义表单附加参数
    nRet, parameter = m3.GetSysInputParameter(strLuaDEID)
    if (nRet ~= 0) then
        lua.Error(strLuaDEID, debug.getinfo(1), parameter)
    end
    
    -- step1  获取当前点中的任务
    nRet, objs = m3.GetSysDataJson( strLuaDEID )
    if ( nRet ~=0 ) then lua.Error( strLuaDEID, debug.getinfo(1), objs ) end  
    -- [{"id":"","attrs":[{"attr":"","value":""},..]},..]
    local nCount = #objs
    if (nCount == 0) then  return end
 
    local parameter = m3.KeyValueAttrsToObjAttr(objs[1].attrs)
    lua.Debug(strLuaDEID, debug.getinfo(1), "parameter", parameter)
    local id = parameter.S_ID
    local wave_no = parameter.S_WAVE_NO
 
    -- -- 开始配盘
    nRet, strRetInfo = mobox.triggerClsEvent(strLuaDEID, "Outbound_Wave", id, "自动配盘")
    if (nRet ~= 0) then
        lua.Error(strLuaDEID, debug.getinfo(1), "执行【盘点计划启动】脚本失败!" .. strRetInfo)
    end
 
    -- 刷新界面
    local action = {
        {
            action_type = "close_dlg",
            value = ""
        },
        {
            action_type = "refresh",
            value = ""
        }
    }
 
    nRet, strRetInfo = mobox.setAction(strLuaDEID, lua.table2str(action))
    if (nRet ~= 0) then
        lua.Error(strLuaDEID, debug.getinfo(1), "setAction失败! " .. strRetInfo)
    end
 
    mobox.setInfo(strLuaDEID, "配盘成功!")
end