--定义树形控件
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();--展开所有节点
Copyright © TouchNet 2015 all right reserved,powered by Gitbook最后修订时间: 2022-06-21 09:21:04

results matching ""

    No results matching ""