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-38-04
     Tðy: ûN¡R-Lˆ    c®”-͑n
    \O€ÿHAN  
    åegÿ2023-02-25
 
    §~+RÿúVš[ (ô‹f,gµkãNx(Wy˜îv-N N*YOØSS)
    
    ýQpeÿ RestTaskState
 
    ŸRý€:
        ¾‹nûN¡R¶r` ÿŠb•ï‹¶r`¾‹n:N I{…_
    ôf9e°‹U_:
 
--]]
wms_task = require( "wms_task" )
 
function RestTaskState ( strLuaDEID ) 
    local   nRet, strRetInfo
 
    -- step1  ·ƒÖSS_MR¹p-N„vûN¡R
    nRet, objs = m3.GetSysDataJson( strLuaDEID )
    if ( nRet ~=0 ) then lua.Error( strLuaDEID, debug.getinfo(1), objs ) end  
    -- [{"id":"","attrs":[{"attr":"","value":""},..]},..]
    local nCount = #objs
    if (nCount == 0) then  return end
    if ( nCount > 1 ) then
        mobox.setInfo( strLuaDEID, "͑nûN¡R¶r`êSý€    N*NûN¡R!")
        return 
    end
 
    local obj_attrs = {}
 
    obj_attrs = m3.KeyValueAttrsToObjAttr( objs[1].attrs )
    if (obj_attrs.S_B_STATE == "•ï‹" ) then
        nRet, strRetInfo = wms_task.SetStateByCode( strLuaDEID, obj_attrs.S_CODE, "ûN¡R¶r`-I{…_")
        if ( nRet ~= 0 ) then lua.Error( strLuaDEID, debug.getinfo(1), strRetInfo ) end
        local strAction = '[{"action_type":"refresh_cur_row","value":""}]'
        nRet, strRetInfo = mobox.setAction(strLuaDEID, strAction)
        if ( nRet ~= 0 ) then lua.Error( strLuaDEID, debug.getinfo(1), "setAction•ï‹: "..strRetInfo) end    
    end
 
end