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
ÿþ--[[
    x: WMS-03-13
     Tðy: RËYS
    \O€ÿLZH
    åegÿ2024-7-15
 
    §~+RÿúVš[ (ô‹f,gµkãNx(Wy˜îv-N N*YOØSS)
 
    ýQpeÿ Initail
 
    ŸRý€:
        ¾‹nå]‚S NÉbFhRËYS
    ôf9e°‹U_:
 
--]]
json  = require("json")
mobox = require("OILua_JavelinExt")
m3 = require( "oi_base_mobox" )
function Initail(strLuaDEID)
    local setAttr
    local strCondition = "1 = 1"
    local nRet, strRetInfo = mobox.queryDataObjAttr(strLuaDEID, "Factory", strCondition, "", "S_CODE")
    if (nRet ~= 0) then error( "·ƒÖS0å]‚S0áOo`1Y%! " .. strRetInfo) end
 
     if (strRetInfo == '') then
        setAttr = '[{"attr":"","value":"106"}]'
    else
        local attr = json.decode( strRetInfo )
        local count = #attr
        local choice_list = '['
        
        for i = 1,count do
            choice_list = choice_list..attr[i].attrs[1].value..","
        end
        choice_list = choice_list:sub(1, #choice_list-1)
        choice_list = choice_list..']'
        lua.Debug( strLuaDEID, debug.getinfo(1), 'choice_list', choice_list )
        setAttr = '[{"attr":"S_FACTORY","value":"106","choice_list":'..choice_list..'}]'
     end
 
    local strAction = '[{"action_type":"set_dlg_attr","value":'..setAttr..'}]'
    nRet, strRetInfo = mobox.setAction( strLuaDEID, strAction  )
    if ( nRet ~= 0 ) then lua.Error( strLuaDEID, debug.getinfo(1), "setAction1Y%! "..strRetInfo..' action = '..strAction ) end 
end