m_pTreeLoc = CLuaTreeUtil();
m_pTreeLoc:SetTree(ui:getDialogName(), 'id_loc_tree');
local helpTreeLocation = CSelectHelp();
local sql = [[select wh_name, wh_id, ' '+location_id, 0 as isfolder,
case wh_id when 1092 then '/picture/common/tree/com_tree_folder.png'
else '/picture/common/tree/com_tree_file.png' end as pic_path
from bs_warehouse with(nolock) where is_delete is null or is_delete=0
union all
select bin_name, bin_code, wh_id, 0, '/picture/common/tree/com_tree_file.png' from bs_warehouse_bin with(nolock)
where wh_id = 1092
UNION all
select location_name, ' '+location_id, ' '+parent_location_id, 1 as isfolder, '/picture/common/tree/com_tree_folder.png'
from bs_location with(nolock) where is_delete is null or is_delete=0]];
if db:select(sql, '', helpTreeLocation) < 0 then
ui:tip(db:error());
return;
end
m_pTreeLoc:setHelp(helpTreeLocation);
m_pTreeLoc:expandAllNodes();