--[[
|
编码: WMS-71-12
|
名称: 库存量表差异-新增窗口-确定后
|
作者:HAN
|
日期:2025-1-29
|
|
级别:固定 (说明本段代码在项目中不太会变化)
|
|
函数: AfterClickOk
|
|
功能:
|
根据输入的仓库、库区编码统计这些仓库、库区的量值
|
|
更改记录:
|
|
--]]
|
|
json = require ("json")
|
mobox = require ("OILua_JavelinExt")
|
m3 = require("oi_base_mobox")
|
|
function AfterClickOk ( strLuaDEID )
|
local nRet, strRetInfo
|
|
nRet, strRetInfo = mobox.getCurEditDataObjAttr( strLuaDEID, "S_WH_CODE", "S_AREA_CODE" )
|
if ( nRet ~= 0 ) then lua.Error( strLuaDEID, debug.getinfo(1), "获取当前编辑属性失败! "..strRetInfo ) end
|
local obj_attrs = json.decode( strRetInfo )
|
local wh_code = obj_attrs[1].value
|
local area_code = obj_attrs[2].value
|
local datajson = {}
|
|
if ( wh_code == '' ) then
|
mobox.setInfo( strLuaDEID, "必须输入仓库编码!" )
|
mobox.stopProgram( strLuaDEID, strRetInfo )
|
return
|
end
|
|
datajson.wh_code = wh_code
|
datajson.area_code = area_code
|
|
local add_wfp_paramter = {}
|
add_wfp_paramter.wfp_type = 1 -- 触发数据类事件
|
add_wfp_paramter.cls = "WMS_Inventory_Diff"
|
add_wfp_paramter.trigger_event = "库存量表差异检测"
|
add_wfp_paramter.datajson = datajson
|
nRet, strRetInfo = m3.AddSysWFP( strLuaDEID, add_wfp_paramter )
|
if ( nRet ~= 0 ) then
|
lua.Error( strLuaDEID, debug.getinfo(1), strRetInfo )
|
end
|
|
if ( area_code ~= '' ) then
|
local strCondition = "S_AREA_CODE='"..area_code.."'"
|
nRet,strRetInfo = mobox.dbdeleteData( strLuaDEID, "WMS_Inventory_Diff", strCondition )
|
if ( nRet ~= 0 ) then lua.Error( strLuaDEID, debug.getinfo(1), strRetInfo ) end
|
else
|
if ( wh_code ~= '' ) then
|
local strCondition = "S_WH_CODE='"..wh_code.."'"
|
nRet,strRetInfo = mobox.dbdeleteData( strLuaDEID, "WMS_Inventory_Diff", strCondition )
|
if ( nRet ~= 0 ) then lua.Error( strLuaDEID, debug.getinfo(1), strRetInfo ) end
|
else
|
mobox.setInfo( strLuaDEID, "仓库编码必须有值" )
|
return
|
end
|
end
|
|
mobox.setInfo( strLuaDEID, "已经向服务发起货品存储量表检测申请! 请等待.." )
|
|
end
|