--[[
|
编码: WMS-22-21
|
名称: 发货单-按钮-报表
|
作者:HAN
|
日期:2025-1-29
|
|
级别:固定 (说明本段代码在项目中不太会变化)
|
|
函数: Report
|
功能:
|
-- 检查一下库存是否可以进行分拣
|
-- 如果缺件显示缺件信息
|
-- 如果可以进行分拣要锁定当前发货单的出库量,仓库加 分配量
|
|
更改记录:
|
|
--]]
|
|
wms_base = require ("wms_base")
|
|
function Report( strLuaDEID )
|
local nRet, strRetInfo
|
local shipping_order = {} -- 发货单
|
|
-- step1 获取当前点中的数据对象
|
nRet, objs = m3.GetSysDataJson( strLuaDEID )
|
if ( nRet ~=0 ) then lua.Error( strLuaDEID, debug.getinfo(1), objs ) end
|
-- [{"id":"","attrs":[{"attr":"","value":""},..]},..]
|
local nCount = #objs
|
if (nCount == 0) then return end
|
|
nRet, shipping_order = m3.ObjAttrStrToLuaObj( "Shipping_Order", lua.table2str(objs[1].attrs) )
|
local strUserLogin, strUserName
|
nRet, strUserLogin, strUserName = mobox.getCurUserInfo( strLuaDEID )
|
if ( nRet ~= 0 ) then strUserName = "??" end
|
|
local action = {}
|
action[1] = {
|
action_type = "open_report_dlg",
|
value = {
|
report_def_name = "大元发货单",
|
page_row = 20,
|
parameter = {
|
operator = strUserName,
|
operation_time = os.date("%Y-%m-%d %H:%M")
|
},
|
data = {
|
master_data = {
|
cls = "Shipping_Order",
|
attr_values = { S_NO = shipping_order.no }
|
},
|
sub_data = {
|
table_name = "发货单明细",
|
condition = "S_SHIPPING_NO = '"..shipping_order.no.."'" ,
|
order = "N_ROW_NO"
|
}
|
}
|
}
|
}
|
|
lua.Debug( strLuaDEID, debug.getinfo(1), "report", action)
|
|
-- 告诉前端弹出一个报表界面
|
--local strAction = '[{"action_type":"open_report_dlg","value":'..lua.table2str(action)..'}]'
|
nRet, strRetInfo = mobox.setAction( strLuaDEID, lua.table2str(action) )
|
if ( nRet ~= 0 ) then lua.Error( strLuaDEID, debug.getinfo(1), "setAction失败! "..strRetInfo..' action = '..strAction ) end
|
end
|