---
|
--- Generated by EmmyLua(https://github.com/EmmyLua)
|
--- Created by HUI.
|
--- DateTime: 2024/3/7 13:53
|
---
|
|
require("WMS-BASE")
|
require("oi_basestrfunc")
|
|
function AfterInputItemName (strLuaDEID)
|
|
local attrs, nRet, strRetInfo, Material
|
|
-- 获取输入的物料名称
|
nRet, attrs = GetSysInputParameter(strLuaDEID)
|
if (nRet ~= 0) then
|
Error(strLuaDEID, debug.getinfo(1), "获取当前输入面板里的属性失败! " .. attrs)
|
end
|
|
local resData = KeyValueAttrsToObjAttr(attrs)
|
local ItemName = resData.S_ITEM_NAME
|
|
-- 查询【物料表】
|
local strCondition = "S_ITEM_NAME = '" .. ItemName .. "'"
|
local strOrder = "T_CREATE"
|
nRet, Material = QueryDataObject(strLuaDEID, "Material", strCondition, strOrder)
|
if (nRet ~= 0) then
|
Error(strLuaDEID, debug.getinfo(1), "获取【容器货品明细】信息失败! " .. Material)
|
end
|
|
Debug(strLuaDEID, debug.getinfo(1), "查询到的物料信息:", Material)
|
|
-- 设置《待入库》页面信息
|
local strDataJson, strAction
|
if (#Material == 0) then
|
strDataJson = '{"page_name":"待入库","clear":true,"content":[]}'
|
else
|
strDataJson = '{"page_name":"待入库","clear":true,"content":' .. table2str(Material) .. '}'
|
end
|
strAction = '[{"action_type":"set_subtable_page_content","value":' .. strDataJson .. '}]'
|
|
Debug(strLuaDEID, debug.getinfo(1), "strAction:", strAction)
|
|
nRet, strRetInfo = mobox.setAction(strLuaDEID, strAction)
|
if (nRet ~= 0) then
|
Error(strLuaDEID, debug.getinfo(1), "setAction失败! " .. strRetInfo .. ' action = ' .. strAction)
|
end
|
|
end
|