--[[
|
编码: GK-56-24
|
名称: 预分配容器明细-入库任务界面-任务取消
|
作者:HAN
|
日期:2025-6-26
|
|
级别:固定 (说明本段代码在项目中不太会变化)
|
|
函数: TaskCancel
|
|
功能:
|
-- 清除站台中的缓存,这些是入库任务留下的后台缓存
|
-- 灭灯
|
-- 清除入库界面
|
|
更改记录:
|
|
|
--]]
|
wms_base = require( "wms_base" )
|
wms_ptl = require( "wms_ptl" )
|
|
function TaskCancel ( strLuaDEID )
|
local nRet, strRetInfo
|
local parameter
|
nRet, parameter = m3.Get_3053_PanelParameter( strLuaDEID, "组盘输入" )
|
if nRet ~= 0 then
|
wms_base.Notice_Audio( strLuaDEID, parameter, "error.mp3" )
|
return
|
end
|
station = parameter.station
|
|
if station == '' then return end
|
local groupID = "Station:"..station
|
|
nRet, strRetInfo = mobox.getCacheValue( "CurInboundTask", groupID )
|
local cur_in_task = {}
|
if ( nRet == 0 ) then
|
local success
|
success, cur_in_task = pcall( json.decode, strRetInfo )
|
if ( success == false ) then
|
wms_base.Notice_Audio( strLuaDEID, "获取当前入库任务缓存信息失败!", "error.mp3" )
|
return
|
end
|
end
|
|
-- 清除站台的入库任务操作缓存
|
mobox.removeCacheGroup( groupID )
|
|
if not lua.isTableEmpty( cur_in_task ) then
|
-- 灭灯
|
nRet, strRetInfo = wms_ptl.TurnOff( cur_in_task.loc_code )
|
if nRet ~= 0 then
|
wms_base.Notice_Audio( strLuaDEID, "灭灯失败!", "error.mp3" )
|
end
|
end
|
|
local action = {
|
{
|
action_type = "refresh_related_panel",
|
value = {
|
{
|
panel_name = "料格显示",
|
input_parameter = {
|
cell_no =""
|
}
|
}
|
}
|
},
|
{
|
action_type = "set_panel_dlg_attr",
|
value = {
|
panel_name = "组盘输入",
|
attrs = {
|
{ attr = "BarCode", prompt = "请扫周转箱号" },
|
{ attr = "Prompt", value = "请扫周转箱号" },
|
{ attr = "S_ITEM_CODE", value = "" },
|
{ attr = "S_ITEM_NAME", value = "" },
|
{ attr = "S_BATCH_NO", value = "" },
|
{ attr = "F_QTY", value = "" },
|
{ attr = "ExpDate", value = "" },
|
{ attr = "TrayCode", value = "" },
|
{ attr = "F_ACT_QTY", value = "", enable = false }
|
}
|
}
|
|
},
|
}
|
|
nRet, strRetInfo = mobox.setAction( strLuaDEID, lua.table2str(action) )
|
if ( nRet ~= 0 ) then
|
lua.Stop( strLuaDEID, "setAction失败! "..strRetInfo )
|
return
|
end
|
|
end
|