--[[
|
编码: 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
|