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
ÿþ--[[
    x: WMS-19-02
     Tðy: ¹[hV'ÁTfÆ~-xØv-¹[hVx“eQT
    \O€ÿHAN  
    åegÿ2023-8-15
 
    §~+RÿúVš[ (ô‹f,gµkãNx(Wy˜îv-N N*YOØSS)
    
    ýQpeÿ AfterCNTRNumChange
 
    ŸRý€:
        -- (WxØvLub— ÿ“eQ¹[hV÷ST ÿû|ß~·ƒÖS勹[hVò]Ï~Ñ~š[„v'ÁTnUS ÿv^NԏÞVÙ~MRïzLub—ۏLˆ>f:y
    ôf9e°‹U_ÿ
        V6.0 HAN 2023/9/6  -- lua.Error/lua.Debug ýQpeØSS  
--]]
 
wms_cntr = require( "wms_container" )
 
function AfterCNTRNumChange ( strLuaDEID ) 
    local nRet, strRetInfo
    local attrs
 
    -- step1  ·ƒÖS5600xØvLub—-Nhˆ4YLub—„v“eQÂSpeÿ¹[hV÷S/XbØv÷S    ÿ
    nRet, attrs = m3.GetSysInputParameter( strLuaDEID ) 
    if ( nRet ~= 0 )  then lua.Error( strLuaDEID, debug.getinfo(1), "·ƒÖSS_MR“eQb—g̑„v^\'`1Y%! "..attrs ) end 
 
    local input_attr = m3.KeyValueAttrsToObjAttr(attrs)
    local cntr_code = input_attr.S_CNTR_CODE
    if (cntr_code == nil or cntr_code == '') then return end
 
    -- step2 $R­e“¹[hV/f&TX[(WTÕl
    local container
    nRet, container = wms_cntr.GetInfo( strLuaDEID, cntr_code )
    if (nRet ~= 0) then lua.Error( strLuaDEID, debug.getinfo(1), "·ƒÖS0¹[hV0áOo`1Y%! " .. container) end
    if ( container == '') then lua.Error( strLuaDEID, debug.getinfo(1), "0¹[hV0" .. cntr_code.." NX[(W!") end
    if ( container.virtual == 'Y' ) then lua.Error( strLuaDEID, debug.getinfo(1), "¹[hV'" .. cntr_code.."'/fN*NZ†ßb¹[hV!") end
 
    -- step3 ågâ‹å‹¹[hV÷S̑/f&T    gÑ~š[†N'ÁT
    -- ågâ‹0¹[hV'ÁTfÆ~0
    local strCondition = "S_CNTR_CODE = '"..cntr_code.."'"
    local strOrder = "T_CREATE"         -- 9hncRú^öeô•ۏLˆ’c^
    nRet, cg_detail = m3.QueryDataObject( strLuaDEID, "CG_Detail", strCondition, strOrder )
    if (nRet ~= 0) then lua.Error( strLuaDEID, debug.getinfo(1), "·ƒÖS0¹[hV'ÁTfÆ~0áOo`1Y%! " .. cg_detail) end
 
    -- ¾‹n
0ò]xØv 0u˜b—áOo`
    local strDataJson, strAction
    if ( #cg_detail == 0 ) then
        strDataJson = '{"page_name":"ò]xØv","clear":true,"content":[]}'
    else
        strDataJson = '{"page_name":"ò]xØv","clear":true,"content":'..lua.table2str(cg_detail)..'}'
    end
    strAction = '[{"action_type":"set_subtable_page_content","value":'..strDataJson..'}]'
    lua.Debug(strLuaDEID, debug.getinfo(1), "strAction:", strAction)
    nRet, strRetInfo = mobox.setAction( strLuaDEID, strAction  )
    if ( nRet ~= 0 ) then lua.Error( strLuaDEID, debug.getinfo(1), "setAction1Y%! "..strRetInfo..' action = '..strAction ) end 
end