1
Jianw
10 天以前 88e26a2a960dbbc148332772448b79b9877102d8
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
--[[
    编码: GK-56-14#2
    来源: WMS-56-14
    名称: 预分配容器明细-3055-顶部窗口容器变化后
    作者:HAN  
    日期:2025-1-29
 
    级别:固定 (说明本段代码在项目中不太会变化)
    
    函数: AfterCNTRChange
 
    功能:
        -- 根据输入的容器号,判断在当前工作台是否有该容器号的 预分配容器明细 ,有显示在 当前任务 页签
        -- 如果当前到站台的入库任务中的容器号和扫码输入的容器号不相等报错
 
 
    更改记录:
 
--]]
wms_base = require("wms_base")
 
function AfterCNTRChange ( strLuaDEID ) 
    local nRet, strRetInfo
 
    -- 获取站台编码
    nRet, strRetInfo = mobox.getCurEditDataObjAttr( strLuaDEID, "S_STATION_NO","S_CNTR_CODE" ) 
    if ( nRet ~= 0 )  then 
        lua.Stop( strLuaDEID, "获取当前编辑属性失败! "..strRetInfo ) 
        return
    end 
    local obj_attrs = json.decode( strRetInfo ) 
    local station = lua.Get_StrAttrValue( obj_attrs[1].value )  
    if ( station == '' ) then return end
    local cntr_code = lua.Get_StrAttrValue( obj_attrs[2].value )  
    local strCondition
 
    strCondition = "S_STATION_NO = '"..station.."' AND N_B_STATE = "..PAC_DETAIL_STATE.Palletizing
    if cntr_code ~= '' then
        strCondition = strCondition.." AND S_CNTR_CODE = '"..cntr_code.."'"
    end
 
    local action =  {
        {
            action_type = "set_query_condition",
            value = {
                condition = strCondition,
                order = "S_SET_CODE",
                page_name = "当前任务"
            }            
        }
    }
 
 
    nRet, strRetInfo = mobox.setAction( strLuaDEID, lua.table2str(action)  )
    if ( nRet ~= 0 ) then 
        lua.Stop( strLuaDEID, "setAction失败! "..strRetInfo ) 
        return
    end 
 
end