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
--[[
    编码: WMS-01-13#1
    名称: 拣料箱批量新增-确定后
    作者:HAN  
    日期:2025-01-29
 
    级别:固定 (说明本段代码在项目中不太会变化)
    
    函数: ClickOK
 
    功能:
         -- 根据输入数量创建 n个拣料箱
 
    更改记录:
 
--]]
 
wms_base = require( "wms_base" )
 
function ClickOK ( strLuaDEID ) 
    local nRet, strRetInfo
 
    -- 获取输入界面中的属性
    nRet, strRetInfo = mobox.getCurEditDataObjAttr( strLuaDEID, "Number" )  
    if ( nRet ~= 0 )  then lua.Error( strLuaDEID, debug.getinfo(1), "获取当前编辑属性失败! "..strRetInfo ) end 
 
    local obj_attrs = json.decode( strRetInfo ) 
    local num = lua.StrToNumber( obj_attrs[1].value )
    local n
    local container
 
    for n = 1, num do
        container = m3.AllocObject( strLuaDEID, "Container" )
        container.type = "Picking_Box"
        nRet, container = m3.CreateDataObj(strLuaDEID, container)
        if (nRet ~= 0 ) then lua.Error( strLuaDEID, debug.getinfo(1),"创建【容器】失败!"..container ) end           
    end
end