Jianw
2025-05-13 3b39fe3810c3ee2ec9ec97236c1769c5c85e062c
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
--[[
   编码: WMS-09-12
   名称: 
   作者:
   日期:2025-03-06
 
   函数: ClickOK
 
   场景:  在实施过程中进行会出现有些货位被某个作业锁了,但是这些作业可能已经被删除或完成,取消,这个时候就需要把这些货位释放
   功能:  
         点击确定后获取仓库、库区编码,调用 进行释放被无效作业锁定的货位
 
   更改记录:
 
--]]
wms_wh = require ("wms_wh")
 
function ClickOK( strLuaDEID )
    local nRet, strRetInfo
    local _obj = {}
    nRet, io_obj = m3.GetSysCurEditDataObj( strLuaDEID, "Lock" )
    if (nRet ~= 0) then lua.Error( strLuaDEID, debug.getinfo(1), "获取【锁】对象属性失败!"..io_obj ) end
    
    nRet, strRetInfo = mobox.getCurEditDataObjAttr( strLuaDEID, "S_WH_CODE", "S_AREA_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 area_code = lua.Get_StrAttrValue( obj_attrs[2].value )
 
    if ( wh_code == '') then
        mobox.stopProgram( strLuaDEID, "仓库编码不能为空!" )
        return
    end
    if ( area_code == '') then
        mobox.stopProgram( strLuaDEID, "库区编码不能为空!" )
        return
    end    
 
    nRet, strRetInfo = wms.wms_CleanInvalidLocLock( wh_code, area_code )
    if ( nRet ~= 0 ) then lua.Error( strLuaDEID, debug.getinfo(1), "wms_CleanInvalidLocLock失败! "..strRetInfo ) end 
end