1
Jianw
9 天以前 70f29da38121b9a467841253e3268feb5df02902
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
--[[
   编码: WMS-102-04
   名称: 
   作者:
   日期:2025-06-04
 
   函数: BeforeDataObjDelete
   功能:
 
   更改记录:
 
--]]
 
json  = require ("json")
mobox = require ("OILua_JavelinExt")
m3 = require ("oi_base_mobox")
 
function BeforeDataObjDelete( strLuaDEID )
  m3.PrintLuaDEInfo( strLuaDEID )
  local nRet,strRetInfo
  local Outbound_Request = {}
 
  --获取当前编辑的出库需求表对象
  nRet,Outbound_Request = m3.GetCurEditDataObj(strLuaDEID)
  lua.Debug(strLuaDEID, debug.getinfo(1), 'Outbound_Request', Outbound_Request)
  --如果获取失败
  if(nRet ~= 0) then
      lua.Error(strLuaDEID,debug.getinfo(1),"获取当前编辑属性失败!"..Outbound_Request)
  end
   
    if(Outbound_Request.b_state == 1) then
      lua.Stop(strLuaDEID,"已创建出库单号数据不可删除!"..Outbound_Request)
      return
    end 
--   for _,item in ipairs(Outbound_Request) do
--       --检查业务状态是否为1,为1则不可删除,为0则可删除
--       if(item.b_state == 1) then
--         lua.Stop(strLuaDEID,"已创建出库单号数据不可删除!"..item.b_state)
--         return
--       end 
--   end
 
end