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: WMS-05-06
     Tðy: ;‘“^:S-RËYS\—zãS
    \O€ÿHAN  
    åegÿ2023-09-20
 
    §~+RÿúVš[ (ô‹f,gµkãNx(Wy˜îv-N N*YOØSS)
    
    ýQpeÿ InitialDlg
 
    ŸRý€:
        1    ÿ(W5505 ŸRý€¹pÿ;‘“^:Sô~¤b    ÿ-N°ežX;‘“^:S ÿ—‰ŠbS_MRÍd\O„vÓN“^ŒT“^:SáOo`&^ºN0RZone„vøvsQáOo`-N
        2    ÿ(W 5505 ¹pûQ°ežX„vöeP ÿMRïzOŠbS_MR„vÓN“^x0“^:Sx\O:NhQ@\ØSϑ  OeQ ÿ<h_‚Y Nÿ
           {"wh_code":"xxx","area_code":"xxxx"}
    ôf9e°‹U_:
--]]
wms_base = require( "wms_base" )
 
function InitialDlg ( strLuaDEID ) 
    local nRet, strRetInfo
    local global_attrs
    nRet,  global_attrs = m3.GetSysGloablAttr( strLuaDEID )
    if (nRet ~= 0) then lua.Error( strLuaDEID, debug.getinfo(1), global_attrs ) end 
 
    local wh_code = global_attrs.wh_code
    if ( wh_code == nil or wh_code == '' ) then lua.Error( strLuaDEID, debug.getinfo(1), "ÓN“^x Ný€:Nzz!" ) end 
    local area_code = global_attrs.area_code
    if ( area_code == nil or area_code == '' ) then lua.Error( strLuaDEID, debug.getinfo(1), "“^:Sx Ný€:Nzz!" ) end 
 
    -- ·ƒÖSS_MR„v;‘“^:S{|‹W
    nRet, strRetInfo = mobox.getCurEditDataObjAttr( strLuaDEID, "N_TYPE" ) 
    if ( nRet ~= 0 )  then lua.Error( strLuaDEID, debug.getinfo(1), "·ƒÖSS_MR‘^\'`1Y%! "..strRetInfo ) end 
    local obj_attrs = json.decode( strRetInfo ) 
 
 
    local   attr_value = {}
    attr_value[1] = lua.KeyValueObj( "S_WH_CODE", wh_code )
    attr_value[2] = lua.KeyValueObj( "S_AREA_CODE", area_code )
    nRet, strRetInfo = mobox.setCurEditDataObjAttr( strLuaDEID, lua.table2str(attr_value) ) 
    if ( nRet ~= 0 ) then lua.Error( strLuaDEID, debug.getinfo(1),"¾‹n0;‘“^:S0áOo`1Y%!  "..strRetInfo ) end
    
    -- ‚Yœg N/f¥csš{|‹W„v;‘“^:S ÿ N>f:y N_CONNECT_TYPE
    local nType = obj_attrs[1].value                         -- ;‘“^:S{|‹W
    if ( nType ~= wms_base.Get_nConst(strLuaDEID, ";‘“^:S{|‹W-¥csš") )  then -- ¥csš{|‹W
        local strAction = '[{"action_type":"set_dlg_attr_show","value":[{"attr":"N_CONNECT_TYPE","show":false}]}]'
        nRet, strRetInfo = mobox.setAction( strLuaDEID, strAction  )
        if ( nRet ~= 0 ) then lua.Error( strLuaDEID, debug.getinfo(1), "setAction1Y%! "..strRetInfo..' action = '..strAction ) end 
    end
 
end