--[[
|
编码: AMS-20-32
|
名称:
|
作者:
|
日期:2025-05-08
|
|
函数: AfterSubmit
|
功能:
|
|
更改记录:
|
|
--]]
|
|
json = require ("json")
|
mobox = require ("OILua_JavelinExt")
|
m3 = require ("oi_base_mobox")
|
|
function AfterSubmit( strLuaDEID )
|
|
local nRet, strRetInfo
|
local data_json, obj_attrs
|
nRet, data_json = m3.GetSysDataJson( strLuaDEID )
|
if ( nRet ~=0 ) then
|
lua.Error( strLuaDEID, debug.getinfo(1), data_json )
|
end
|
|
local nCount = #data_json
|
if ( nCount == 0 ) then
|
return
|
end
|
lua.Debug(strLuaDEID, debug.getinfo(1), "data_json", data_json)
|
local obj_attrs
|
local state
|
local err = {}
|
local strCondition, strSetAttr
|
for n = 1, #data_json do
|
obj_attrs = m3.KeyValueAttrsToObjAttr( data_json[n].attrs )
|
state = obj_attrs.S_STATE
|
if ( state == '编辑' ) then
|
strCondition = "S_NO = '"..obj_attrs.S_NO.."'"
|
strSetAttr = "S_STATE = '审核'"
|
nRet, strRetInfo = mobox.updateDataAttrByCondition( strLuaDEID, "Inbound_Order", strCondition, strSetAttr )
|
if ( nRet ~= 0 ) then
|
lua.Error( strLuaDEID, debug.getinfo(1), "更新数据失败: "..strRetInfo)
|
end
|
else
|
table.insert( err, obj_attrs.S_NO )
|
end
|
|
end
|
|
if ( #err > 0 ) then
|
local err_msg = "单据状态不为编辑,不能审核!" .. table.concat( err, "," )
|
mobox.setInfo( strLuaDEID, err_msg )
|
end
|
|
|
local action = {
|
{
|
action_type = "refresh",
|
value = ""
|
}
|
}
|
nRet, strRetInfo = mobox.setAction(strLuaDEID, lua.table2str( action ))
|
if ( nRet ~= 0 ) then lua.Error( strLuaDEID, debug.getinfo(1), "setAction错误: "..strRetInfo) end
|
|
end
|