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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
ÿþ--[[
    x: GT-04-11
     Tðy: RËYS
    \O€ÿLZH
    åegÿ2024-5-10
 
    §~+RÿúVš[ (ô‹f,gµkãNx(Wy˜îv-N N*YOØSS)
 
    ýQpeÿ Initail
 
    ŸRý€:
        10¹pûQ    c®”·ƒÖS0RPDA/UNxv^ÞVŒ0R—zãS
        20¾‹nå]MOŒTw¹p:N NÉbFh
    ôf9e°‹U_:
 
--]]
json  = require("json")
mobox = require("OILua_JavelinExt")
m3 = require( "oi_base_mobox" )
function Initail(strLuaDEID)
    local nRet, strRetInfo
 
    local strUserLogin, strUserName
    nRet, strUserLogin, strUserName = mobox.getCurUserInfo(strLuaDEID)
    if (nRet ~= 0) then lua.Error(strLuaDEID, debug.getinfo(1), "·ƒÖSS_MRÍd\OºNXTáOo`1Y%! " .. strUserLogin) end
 
    local strUserInfo
    nRet, strUserInfo = mobox.getUserInfo(strUserLogin, 1, 1)
    if (nRet ~= 0) then lua.Error(strLuaDEID, debug.getinfo(1), "·ƒÖSS_MRÍd\OºNXTæ‹Æ~áOo`1Y%! " .. strUserLogin) end
 
    local tbl = json.decode(strUserInfo)
    local client_info = tbl.client_info
    local num = client_info.num
 
    -- local loc_list = ""
    -- -- ågâ‹'MOhˆ
    -- local strcondition = "S_WH_CODE = 'AHYLK' and S_AREA_CODE = 'SJQ'"
    -- nRet, strRetInfo = mobox.queryDataObjAttr(strLuaDEID, "Location", strcondition, "", "S_CODE")
    -- if (nRet ~= 0) then lua.Error(strLuaDEID, debug.getinfo(1), "ågâ‹'MOhˆ1Y% " .. strRetInfo) end
 
    -- if (strRetInfo ~= '') then
    --     local loc = {}
    --     local n, nCount
    --     local success
    --     success, loc = pcall(json.decode, strRetInfo)
    --     if (success == false) then lua.Error(strLuaDEID, debug.getinfo(1), "·ƒÖS0'MO0áOo`1Y%! ^—Õl„vJSON<h_!" .. loc) end
 
    --     nCount = #loc
    --     for n = 1, nCount do
    --         loc_list = loc_list .. '"' .. loc[n].attrs[1].value .. '",'
    --     end
    --     loc_list = lua.trim_laster_char(loc_list)
    -- end
 
    -- ÞVŒPDA/UNx
    -- ¾‹n—zãS-N„váOo`
    local setAttr = '[{"attr":"S_PDA_NO","value":"' .. num .. '"}]'
    -- local setAttr = setAttr .. ',{"attr":"S_START_LOC","value":"","choice_list":[' .. loc_list .. ']}]'
    local action = {}
    action.action_type = "set_dlg_attr"
    action.value = json.decode(setAttr)
    nRet, strRetInfo = mobox.setAction(strLuaDEID, '[' .. lua.table2str(action) .. ']')
    if (nRet ~= 0) then
        lua.Error(strLuaDEID, debug.getinfo(1),
            "setAction1Y%! " .. strRetInfo .. ' action = ' .. strAction)
    end
end