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
ÿþ--[[
    x: WMS-12-01
     Tðy: ûN¡R¨R\O-Rú^MR
    \O€ÿHAN  
    åegÿ2023-6-20
 
    §~+RÿúVš[ (ô‹f,gµkãNx(Wy˜îv-N N*YOØSS)
    
    ýQpeÿ BeforeDataObjCreate
 
    ŸRý€:
        1    ÿ·ƒÖS N_ACTION_CODE 9hncW[xQ·ƒÖSُ›N¨R\Ox„vô‹f
    ôf9e°‹U_:
        V3.0 HAN 2023-6-16
        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    
--]]
require ("WMS-BASE")
 
function BeforeDataObjCreate ( strLuaDEID ) 
    local   nRet, strRetInfo
 
    -- step1  ·ƒÖSS_MRûN¡R¨R\O„v¨R\OxŒT¨R\O Tðy
    nRet, strRetInfo = mobox.getCurEditDataObjAttr( strLuaDEID, "N_ACTION_CODE", "S_ACTION" ) 
    if ( nRet ~= 0 )  then lua.Error( strLuaDEID, debug.getinfo(1), "·ƒÖSS_MR‘^\'`1Y%! "..strRetInfo ) end 
    local obj_attrs = json.decode( strRetInfo ) 
    local action_code = lua.StrToNumber( obj_attrs[1].value )            -- ¨R\Ox
    local action = obj_attrs[2].value
 
    -- ‚Yœg¨R\Ox:Nzz
    if ( action == '') then
        -- 9hncW[xQ·ƒÖS S_ACTION 
        action = wms_base.GetDictItemName( strLuaDEID, "WMS_EquipmentAction", action_code ) 
    end
 
    local attr_value = {}
    attr_value[1] = lua.KeyValueObj( "S_ACTION", action )
    nRet, strRetInfo = mobox.setCurEditDataObjAttr( strLuaDEID, lua.table2str(attr_value) ) 
    if ( nRet ~= 0 ) then lua.Error( strLuaDEID, debug.getinfo(1), "¾‹n0ûN¡R¨R\O0áOo`1Y%!  "..strRetInfo ) end   
end