lzh
2025-06-24 13c4a636539584ab977fddacfae884b3ec250aee
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
ÿþ--[[
    x: WMS-05-03
     Tðy: ;‘“^:S-îO9eMR
    \O€ÿHAN  
    åegÿ2023-06-11
 
    §~+RÿúVš[ (ô‹f,gµkãNx(Wy˜îv-N N*YOØSS)
    
    ýQpeÿ BeforeDataObjModify
 
    ŸRý€:
        ¾‹n S_LOCK_STATE S_ZONE_TYPE 
    ôf9e°‹U_:
        V3.1 HAN 2023-7-2
            getDictItemIInfo 9eb wms_GetDictTypeName 
        V4.1 HAN 2023-8-9  wmsøvsQ¥cãSŒte    
        V4.2 wms_GetDictTypeName -> wms_base.GetDictItemName   
        V6.0 HAN 2023/9/6  -- lua.Error/lua.Debug ýQpeØSS
        V6.1 HAN 2023/9/20 -- N_ZONE_TYPE 9eb N_TYPE                
--]]
 
require ("WMS-BASE")
 
function BeforeDataObjModify ( strLuaDEID ) 
    local   nRet, strRetInfo
    
    nRet, strRetInfo = mobox.getCurEditDataObjAttr( strLuaDEID, "N_LOCK_STATE", "N_TYPE" ) 
    if ( nRet ~= 0 )  then lua.Error( strLuaDEID, debug.getinfo(1), "[1] ·ƒÖSS_MR‘^\'`1Y%! "..strRetInfo ) end 
    local obj_attrs = json.decode( strRetInfo ) 
    local nLockState = lua.StrToNumber(obj_attrs[1].value)           -- •¶r`
    local nZoneType = lua.StrToNumber(obj_attrs[2].value)            -- ;‘“^:S{|‹W
 
    -- 9hncW[xQ·ƒÖS N_LOCK_STATE „v>f:y Tðy
    local str_lock_state = wms_base.GetDictItemName( strLuaDEID, "WMS_LocationLockState", nLockState ) 
 
    -- 9hncW[xQ·ƒÖS N_ZONE_TYPE „v>f:y Tðy
    local str_zone_type = wms_base.GetDictItemName( strLuaDEID, "WMS_AreaType", nZoneType ) 
 
    -- ¾‹náOo`
    local   attr_value = {}
    attr_value[1] = lua.KeyValueObj( "S_LOCK_STATE", str_lock_state )
    attr_value[2] = lua.KeyValueObj( "S_TYPE", str_zone_type )
    nRet, strRetInfo = mobox.setCurEditDataObjAttr( strLuaDEID, lua.table2str(attr_value) ) 
    if ( nRet ~= 0 ) then lua.Error( strLuaDEID, debug.getinfo(1), "[2] ¾‹n0;‘“^:S0áOo`1Y%!  "..strRetInfo ) end   
end