1
Jianw
9 天以前 70f29da38121b9a467841253e3268feb5df02902
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
--[[
   编码: WMS-20-22#2
   名称: 预分配料箱取消2#
   作者:
   日期:2025-1-29
 
   函数: ClickCancel
 
   功能:
        -- 适合入库单预分配料箱
        
        -- 在呼出空料箱后操作者可以点取消,这个时候会删除新创建的入库波次
        -- 并且取消呼出容器的预分配数量,及料格的状态
 
   更改记录:
        V2.0 HAN 20250317 增加对超重呼出料箱功能点的处理,取消后要把【站台货品明细】的N_B_STATE状态设置为 0
--]]
 
json  = require ("json")
mobox = require ("OILua_JavelinExt")
m3 = require("oi_base_mobox")
 
function ClickCancel( strLuaDEID )
    local nRet, strRetInfo, parameter
    
    -- 这里的 paramter 是在点击领用按钮后,传入的 入库波次对象,如果取消就是删除波次对象
    nRet, parameter = m3.GetSysInputParameter( strLuaDEID ) 
    if ( nRet ~= 0 )  then lua.Error( strLuaDEID, debug.getinfo(1), "获取input parameter 失败! "..parameter ) end 
 
    local from = parameter.from
    -- 是否来源超重检查不通过后再吃呼出空料箱
    if ( from == "Overweight_call" ) then
        -- 呼出空料箱来自 站台的超重货品入库呼出,需要把【站台货品明细】中相关的记录更新状态
        local station = lua.Get_StrAttrValue( parameter.station )
        local bs_type = lua.Get_StrAttrValue( parameter.bs_type )
        local bs_no = lua.Get_StrAttrValue( parameter.bs_no )
        if ( station == '' or bs_type == '' or bs_no == '' ) then 
            lua.Stop( strLuaDEID, "paramter 参数中 属性 station, bs_type, bs_no 不能为空!")
            return
        end
        strCondition = "S_STATION_NO = '"..station.."' AND S_BS_TYPE = '"..bs_type.."' AND S_BS_NO = '"..bs_no.."'"
        strSetAttr = "N_B_STATE = 0"        -- 0 待处理
        nRet, strRetInfo = mobox.updateDataAttrByCondition( strLuaDEID, "Station_Goods_Detail", strCondition, strSetAttr )
        if ( nRet ~= 0 ) then  
            lua.Stop( strLuaDEID, "更新【站台货品明细】信息失败!"..strRetInfo ) 
            return
        end 
    end
 
    local action = {
        {
            action_type = "close_dlg",
            value = ""
        }
    }
    nRet, strRetInfo = mobox.setAction( strLuaDEID, lua.table2str(action) )
    if ( nRet ~= 0 ) then 
        lua.Stop( strLuaDEID, "setAction失败! "..strRetInfo..' action = '..strAction ) 
        return
    end        
 
end