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
68
69
70
71
72
73
ÿþ--[[
    x: WMS-61-40
     Tðy: :gðSsQT€:S-    ébsQT€ù[aŒxMR
    \O€ÿHANXU
    åegÿ2023-12-28
 
    §~+RÿúVš[ (ô‹f,gµkãNx(Wy˜îv-N N*YOØSS)
 
    ýQpeÿ BeforeCheckLaCode
 
    ŸRý€:
        -- 9hncsQT€ù[aŒ{|‹W<P >f:ysQT€ù[aŒx
    ôf9e°‹U_:
 
 
    GetRuntimeParamÿ
    {"function":"3036",
     "master":{
            "objAttr":{
                "state":"‘",
                "S_ID":"{83CB66CC-201B-40AD-86D4-8501840752AF}",
                "S_NOTE":"",
                "S_NAME":"ÉbN:g",
                "S_FACTORY":"9006",
                "id":"{83CB66CC-201B-40AD-86D4-8501840752AF}",
                "S_CODE":"JT001"
                },
            "objId":"{83CB66CC-201B-40AD-86D4-8501840752AF}",
            "clsId":"Machine_Station"
                },
     "button":"top",
     "cls_id":"MS_Area_Link",
     "button_name":"°ežX",
     "edit_dlg":{
            "type":"small",
            "class_id":"MS_Area_Link"
        }
    }
 
--]]
 
require("WMS-Base")
function BeforeCheckLaCode(strLuaDEID)
    local strRetInfo
    local nRet, run_paramter = GetRuntimeParam(strLuaDEID)
    if (nRet ~= 0) then Error(strLuaDEID, debug.getinfo(1), run_paramter) end
    local master = run_paramter.master
    if (master == nil) then Error(strLuaDEID, debug.getinfo(1), "û|ß~¡l    g(W¯sƒXÂSpe-Nš[INmasterù[aŒáOo`!") end
    local strFactory = master.objAttr.S_FACTORY -- å]‚Sx
 
 
    nRet, strRetInfo = mobox.getCurEditDataObjAttr(strLuaDEID, "N_LA_TYPE")
    if (nRet ~= 0) then Error(strLuaDEID, debug.getinfo(1), "·ƒÖSS_MR‘^\'`1Y%! " .. strRetInfo) end
    local obj_attrs    = json.decode(strRetInfo)
    local nLaType      = StrToNumber(obj_attrs[1].value) -- sQT€ù[aŒ{|‹W<P
    local strTable     = ''
    local strCondition = ''
    if (nLaType == WMS_nConst(strLuaDEID, "úW@x{|‹W-irt“^:S")) then -- irt“^:S
        strTable = 'Area'
        strCondition = "S_FACTORY = '" .. strFactory .. "'"
    elseif (nLaType == WMS_nConst(strLuaDEID, "úW@x{|‹W-'MO")) then -- 'MO
        strTable = 'Location'
        strCondition = "S_WH_CODE = 'AHYLK'"
    elseif (nLaType == WMS_nConst(strLuaDEID, "úW@x{|‹W-;‘“^:S")) then -- ;‘“^:S
        strTable = 'Zone'
        strCondition = "S_WH_CODE = 'AHYLK'"
    end
 
    local action = '[{"action_type":"open_data_query_dlg","value":{"mulit_select":0,"cls_name":"'..strTable..'","grid_style":"    ébb—g(u", "order":"","condition":"'.. strCondition .. '"}}]'
    mobox.writeSysLog("actionY&7b",action)
    mobox.setAction(strLuaDEID, action) 
end