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-38-02
     Tðy: ,dЏcäN-îO9eMR
    \O€ÿHAN  
    åegÿ2023-10-11
 
    §~+RÿúVš[ (ô‹f,gµkãNx(Wy˜îv-N N*YOØSS)
    
    ýQpeÿ BeforeDataObjModify
 
    ŸRý€:
        1    ÿù[N›Npe<P{|‹W„v^\'`ubُ›N{|‹W„v㉐g^\'`
    ôf9e°‹U_:
 
    --]]
 
    require ("WMS-BASE")
 
    function BeforeDataObjModify ( strLuaDEID ) 
        local   nRet, strRetInfo
        nRet, strRetInfo = mobox.getCurEditDataObjAttr( strLuaDEID, "N_B_STATE","N_SCHEDULE_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 state = lua.StrToNumber( obj_attrs[1].value )               -- ¶r`
        local schedule = lua.StrToNumber( obj_attrs[2].value )            -- Œ¦^û|ß~{|‹W
        local task_type = lua.StrToNumber( obj_attrs[3].value )           -- ûN¡R{|‹W
    
        -- 9hncW[xQ·ƒÖS N_B_STATE „v>f:y Tðy
        local str_b_satte = wms_base.GetDictItemName( strLuaDEID, "WMS_TaskState", state ) 
    
        -- ÖSŒ¦^û|ß~{|‹WáOo`
        local str_schedule_type = wms_base.GetDictItemName( strLuaDEID, "WMS_ScheduleSystemType", schedule ) 
    
        -- ÖSûN¡R{|‹WáOo`
        local str_task_type = wms_base.GetDictItemName( strLuaDEID, "WMS_TaskType", task_type ) 
    
        -- ¾‹náOo`
        local   attr_value = {}
        attr_value[1] = lua.KeyValueObj( "S_B_STATE", str_b_satte )
        attr_value[2] = lua.KeyValueObj( "S_SCHEDULE_TYPE", str_schedule_type )
        attr_value[3] = lua.KeyValueObj( "S_TYPE", str_task_type )
        nRet, strRetInfo = mobox.setCurEditDataObjAttr( strLuaDEID, lua.table2str(attr_value) ) 
        if ( nRet ~= 0 ) then lua.Error( strLuaDEID, debug.getinfo(1), "¾‹n0ûN¡R0áOo`1Y%!  "..strRetInfo ) end   
    end