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
46
47
48
49
50
51
52
ÿþ--[[
    x: WMS-08-01
     Tðy: ¾‹Y¨R\Où[aŒ-Rú^MR
    \O€ÿHAN  
    åegÿ2023-6-15
 
    §~+RÿúVš[ (ô‹f,gµkãNx(Wy˜îv-N N*YOØSS)
    
    ýQpeÿ BeforeDataObjCreate
 
    ŸRý€:
        1    ÿÇ N_EQ_TYPE „v<P9hncW[xQ·ƒÖSُ›N<P„vô‹f‡eW[K<PÙ~ S_EQ_TYPE
        2    ÿÇ N_ACTION_CODE „v<P9hncW[xQ·ƒÖSُ›N<P„vô‹f‡eW[K<PÙ~ S_ACTION
    ô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 HAN 2023-8-15
        V4.2 wms_GetDictTypeName -> wms_base.GetDictItemName
        V6.0 HAN 2023/9/6  -- lua.Error/lua.Debug ýQpeØSS 
        V6.1 HAN 2023/10/9 -- ‚Yœg¾‹Y{|‹W Tðy ÿ¨R\O Tðyò]Ï~    g<P N—‰·ƒÖS     
--]]
 
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_EQ_TYPE","N_ACTION_CODE","S_EQ_TYPE","S_ACTION" ) 
    if ( nRet ~= 0 )  then lua.Error( strLuaDEID, debug.getinfo(1), "·ƒÖSS_MR‘^\'`1Y%! "..strRetInfo ) end 
    local obj_attrs = json.decode( strRetInfo ) 
    local eq_type = lua.StrToNumber( obj_attrs[1].value )            -- ¾‹Y{|‹W
    local action_code = lua.StrToNumber( obj_attrs[2].value )        -- ¨R\Ox
    local eq_type_name = obj_attrs[3].value                      -- ¨R\Ox
    local action_name = obj_attrs[4].value                       -- ¨R\Ox
 
    -- 9hncW[xQ·ƒÖS N_EQ_TYPE „v>f:y Tðy
    if ( eq_type_name == '' ) then
        eq_type_name = wms_base.GetDictItemName( strLuaDEID, "WMS_EquipmentType", eq_type ) 
    end
    -- 9hncW[xQ·ƒÖS N_ACTION_CODE „v>f:y Tðy
    if ( action_name == '' ) then
        action_name = wms_base.GetDictItemName( strLuaDEID, "WMS_EquipmentAction", action_code ) 
    end
 
    local   attr_value = {}
    attr_value[1] = lua.KeyValueObj( "S_EQ_TYPE", eq_type_name )
    attr_value[2] = lua.KeyValueObj( "S_ACTION", action_name )
    nRet, strRetInfo = mobox.setCurEditDataObjAttr( strLuaDEID, lua.table2str(attr_value) ) 
    if ( nRet ~= 0 ) then lua.Error( strLuaDEID, debug.getinfo(1), "¾‹n0¾‹Y¨R\O–R0áOo`1Y%!  "..strRetInfo ) end   
end