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
ÿþ--[[
   x: GT-122-26
    Tðy: 
   \O€ÿ
   åegÿ2025-03-26
 
    ýQpeÿ CallBack
 
    ŸRý€:
        10·ƒÖS0RPDAkbx„vAm4l÷SŒTXbØv÷S
        209hncAm4l÷Sågâ‹agîváOo` ÿ¡l    g1\¥b•
        309hncXbØv÷Sågâ‹XbØváOo` ÿ¡l    gXbØv1\9hncXbØv÷SRú^N*NXbØv
        409hncågâ‹úQeg„vagxáOo`Çaction¾‹n0Ru˜b—
    ôf9e°‹U_:
 
--]]
 
json  = require ("json")
mobox = require ("OILua_JavelinExt")
require("WMS-BASE")
m3 = require( "oi_base_mobox" )
function CallBack(strLuaDEID)
    lua.Debug( strLuaDEID, debug.getinfo(1), '¹[hVagxÑ~š[','¹[hVagxÑ~š[' )
    local nRet, strRetInfo
    -- ·ƒÖSPDAÂSpe
    nRet, strRetInfo = mobox.getCurEditDataObjAttr(strLuaDEID, "S_SERIAL_NO", "S_CNTR_CODE")
    if (nRet ~= 0) then lua.Error(strLuaDEID, debug.getinfo(1), "Œ(u¹eÕlGetSysDataJsonúQ•") end
    local obj_attrs = json.decode(strRetInfo)
 
    local serial_no = obj_attrs[1].value
    if (serial_no == nil or serial_no == '') then return end
 
    --ågâ‹agxáOo`
    local label_attrs,strCondition
    nRet, label_attrs = m3.GetDataObjectByKey(strLuaDEID, "GT_Label_Crad", "S_SERIAL_NO",serial_no)
    if (nRet ~= 0) then lua.Error(strLuaDEID, debug.getinfo(1), strRetInfo) end
    
    -- ¾‹n—zãS-N„v ir™eáOo`
    local setAttr = '[{"attr":"S_ITEM_CODE","value":"' .. label_attrs.item_code .. '"},'
    setAttr = setAttr..'{"attr":"S_ITEM_NAME","value":"'..label_attrs.item_name..'"},'
    setAttr = setAttr..'{"attr":"S_BATCH_NO","value":"'..label_attrs.batch_no..'"},'
    setAttr = setAttr..'{"attr":"F_QTY","value":"'..label_attrs.qty..'"}]'
    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