1
Jianw
2025-07-09 f6f5e6b632d6649386a380558d84003f3de7ec6c
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
--[[
   编码: WMS-21-30
   名称: 
   作者:
   日期:2025-05-22
 
   函数: LocChange
   功能:
 
   更改记录:
 
--]]
 
json  = require ("json")
mobox = require ("OILua_JavelinExt")
m3 = require ("oi_base_mobox")
wms_base = require( "wms_base" )
wms_cntr= require( "wms_container" )
wms_wh = require( "wms_wh" )
 
 
function LocChange( strLuaDEID )
        -- 获取表头界面中的输入条码
    nRet, attrs = m3.GetSysInputParameter(strLuaDEID)
    if (nRet ~= 0) then
        mobox.setInfo(strLuaDEID,  "获取当前输入面板里的属性失败! " .. attrs)
        return
    end
    
    local input_attr = m3.KeyValueAttrsToObjAttr(attrs)
    local io_no = input_attr.S_IO_NO                        -- 入库单号
    local item_code = input_attr.S_ITEM_CODE                -- 物料编码
    local code = input_attr.S_EXT_ATTR1                     -- 货位编码
 
    nRet, loc = wms_wh.GetLocInfo( code )
    if ( nRet ~= 0 ) then
        mobox.setInfo(strLuaDEID, "货位'"..code.."'不存在!" )
        return
    end
    if (loc.lock_state ~= 0) then
        mobox.setInfo(strLuaDEID, "货位'" ..loc.. "'有锁,不可操作!")
        return        
    end
    if (loc.area_code ~= "rg") then
        mobox.setInfo(strLuaDEID, "货位'" ..loc.. "'非人工库,不可操作!")
        return        
    end
 
end