1
Jianw
2025-07-09 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
61
--[[
    编码: WMS-56-34
    名称: 预分配容器明细-按计划数量完成装箱
    作者:HAN  
    日期:2025-1-29
 
    级别:项目
    
    函数: PrompDlgOk
 
    功能:
        -- 装箱数量输入大于计划装箱数量时,系统弹出一个消息确认框,点确定后调用该脚本
 
    更改记录:
 
--]]
 
prj_base = require( "prj_base" )
 
function PrompDlgOk ( strLuaDEID ) 
    local nRet, strRetInfo
 
    -- 获取触发脚本带人的 data
    local parameter
    nRet, parameter = m3.GetSysDataJson( strLuaDEID )
    if ( nRet ~=0 ) then 
        lua.Stop( strLuaDEID, parameter )
        return 
    end  
 
    local id = parameter.id                 -- 当前点中的入库任务标识
    local pac_no = parameter.pac_no       -- 当前点中的入库任务所属组盘号
    if ( pac_no == nil or pac_no == "") then
        mobox.setInfo( strLuaDEID, "'组盘输入'面板必须有orgc_no参数!")
        return         
    end
 
    local qty = lua.Get_NumAttrValue( parameter.qty )  
 
    if ( qty <= 0 ) then return end
    -- 设置【预分配容器明细】状态 = 2/PalletizingOK(组盘完成)
    local strCondition = "S_ID = '"..id.."'"
    local strUpdateSql = "N_B_STATE = "..PAC_DETAIL_STATE.PalletizingOK..", F_ACT_QTY = "..qty
    nRet, strRetInfo = mobox.updateDataAttrByCondition( strLuaDEID, "Pre_Alloc_CNTR_Detail", strCondition, strUpdateSql )
    if ( nRet ~= 0 ) then  
        lua.Stop( strLuaDEID, "更新【预分配容器明细】信息失败!"..strRetInfo )
        return
    end  
 
    local action
    nRet, action = prj_base.Pre_Alloc_CNTR_PostProcess( strLuaDEID, pac_no, parameter.station, parameter.cntr_code )
    if ( nRet ~= 0 ) then 
        lua.Stop( strLuaDEID,  "Pre_Alloc_CNTR_PostProcess 失败!"..action )
        return
    end        
    nRet, strRetInfo = mobox.setAction( strLuaDEID, lua.table2str(action) )
    if ( nRet ~= 0 ) then 
        lua.Stop( strLuaDEID, "setAction失败! "..strRetInfo..' action = '..strAction ) 
        return
    end 
end