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-03-01
     Tðy: “^:S-Rú^MR
    \O€ÿHAN  
    åegÿ2022-12-23
 
    §~+RÿúVš[ (ô‹f,gµkãNx(Wy˜îv-N N*YOØSS)
    
    ýQpeÿ BeforeDataObjCreate
 
    ŸRý€:
        1    ÿN_LOC_TYPE 9hncW[xQ·ƒÖSُ›N<P„vô‹f
    V3.0 HAN 2023-6-16
    V3.1 HAN 2023-7-2
         getDictItemIInfo 9eb wms_GetDictTypeName
    V4.0 HAN 2023-7-26
         N_TYPE 9hncW[xQ·ƒÖSُ›N<P„vô‹f
    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
--]]
 
wms_base = require( "wms_base" )
function BeforeDataObjCreate ( strLuaDEID ) 
    local   nRet, strRetInfo
    -- step1  ·ƒÖSS_MR'MOÑ~š[hˆ„váOo` ÿ·ƒÖS 'MO÷S ÿ¹[hV÷S
    nRet, strRetInfo = mobox.getCurEditDataObjAttr( strLuaDEID, "N_LOC_TYPE", "N_TYPE" ) 
    if ( nRet ~= 0 )  then lua.Error( strLuaDEID, debug.getinfo(1), "·ƒÖSS_MR‘^\'`1Y%! "..strRetInfo ) end 
    local obj_attrs = json.decode( strRetInfo ) 
    local loc_type = lua.StrToNumber( obj_attrs[1].value )           -- 'MO{|‹W
    local area_type = lua.StrToNumber( obj_attrs[2].value )    -- “^:S{|‹W
    if ( loc_type == "" ) then loc_type = 1 end
 
    -- ÖS'MO{|‹WáOo`
    local str_loc_type = wms_base.GetDictItemName( strLuaDEID, "WMS_LocationType", loc_type ) 
    -- ÖS“^:S{|‹WáOo`
    local str_type = wms_base.GetDictItemName( strLuaDEID, "WMS_AreaType", area_type ) 
 
    -- ¾‹n'MO{|‹WáOo`
    local   attr_value = {}
    attr_value[1] = lua.KeyValueObj( "S_LOC_TYPE", str_loc_type )
    attr_value[2] = lua.KeyValueObj( "S_TYPE", str_type )
    nRet, strRetInfo = mobox.setCurEditDataObjAttr( strLuaDEID, lua.table2str(attr_value) ) 
    if ( nRet ~= 0 ) then lua.Error( strLuaDEID, debug.getinfo(1), strLuaDEID, "¾‹n“^:SáOo`1Y%!  "..strRetInfo ) end   
end