--[[
|
编码: WMS-17-02
|
名称: 计划盘点容器-删除后
|
作者:HAN
|
日期:2025-1-29
|
|
级别:固定 (说明本段代码在项目中不太会变化)
|
|
函数: AfterDataObjDelete
|
|
功能:
|
-- 删除 【计划盘点容器明细】
|
|
更改记录:
|
|
--]]
|
|
json = require ("json")
|
mobox = require ("OILua_JavelinExt")
|
m3 = require("oi_base_mobox")
|
|
function AfterDataObjDelete ( strLuaDEID )
|
local nRet, strRetInfo, plan_count_no
|
|
-- 获取 盘点计划编号
|
nRet, strRetInfo = mobox.getCurEditDataObjAttr( strLuaDEID, "S_COUNT_NO", "S_CNTR_CODE","S_CP_NO" )
|
if ( nRet ~= 0 ) then lua.Error( strLuaDEID, debug.getinfo(1), "获取当前编辑属性失败! "..strRetInfo ) end
|
local obj_attrs = json.decode( strRetInfo )
|
local count_no = lua.Get_StrAttrValue( obj_attrs[1].value ) -- 盘点单号
|
local cntr_code = lua.Get_StrAttrValue( obj_attrs[2].value ) -- 盘点容器
|
local cp_no = lua.Get_StrAttrValue( obj_attrs[3].value ) -- 盘点容器
|
|
lua.Debug( strLuaDEID, debug.getinfo(1), "计划盘点容器删除后", strRetInfo )
|
|
if ( cntr_code ~= "") then
|
local strCondition = ''
|
if ( count_no ~= '' ) then
|
strCondition = "S_COUNT_NO = '"..count_no.."' AND S_CNTR_CODE = '"..cntr_code.."'"
|
elseif ( cp_no ~= "" ) then
|
strCondition = "S_CNTR_CODE = '"..cntr_code.."' AND S_COUNT_NO IN ( Select S_COUNT_NO From TN_Count_Order with(NOLOCK) Where S_CP_NO = '"..cp_no.."')"
|
end
|
if ( strCondition ~= '') then
|
nRet, strRetInfo = mobox.deleteDataObject( strLuaDEID, "Count_CG_Detail", strCondition )
|
if ( nRet ~= 0) then lua.Error( strLuaDEID, debug.getinfo(1), "删除盘点计划相关的【盘点容器货品明细】失败! "..strRetInfo ) end
|
end
|
end
|
end
|