cy
2022-06-21 129904537f66509f97b285e7eb4f42b3dc349dd0
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
 
<div class="select_tree" style="padding-top:15px;">
     [#if apply_cate?? && apply_cate?size>0]
        [#list apply_cate as tree]
         <div>
             <div class="fl_title">
                <td>${tree.lv1_name}-${tree.lv2_name}-${tree.lv3_name} (数量:${tree.cate_num})</td>
                <td><a class="blue_txt lb_button" href="javascript:deleteTree('${tree.id}');"><span>删除</span></a></td>
                 <!-- <a class="fl_morebtn"></a> -->
             </div>
             <table class="display_form common_list_table leftTable" style="margin-top:0;">
                     <tr class="title">
                        <td width="5%">序号</td>
                        <td width="22%">备件分类</td>
                        <td width="15%">实物编码</td>
                        <td width="10%">备件名称</td>
                        <td width="10%">资产编码</td>
                        <td width="9%">型号</td>
                        <td width="14%">供应商</td>
                        <td width="7%">销售价</td>
                        <td width="7%">操作</td>
                    </tr>
                     [#if tree.children?? && tree.children?size>0]
                     [#list tree.children as item]
                    <tr>
                        <td>${item_index+1}</td>
                        <td>${tree.lv1_name}-${tree.lv2_name}-${tree.lv3_name}</td>
                        <td>${item.ENTITY_NO}</td>
                        <td>${item.NAME}</td>
                        <input type="hidden" name="spart_id"  value="${item.SPART_ID}" />
                        <td>${item.ASSET_NO}</td>
                        <td>${item.MODEL_NO}</td>
                        <td>${item.SUPPLIER_NAME}</td>
                        <td>${item.SALE_PRICE}</td>
                        <td class="list_btnmore_wrap">
                            <a class="blue_txt" href="javascript:deleteItem('${item.id}');"><span>删除</span></a> 
                        </td>
                    </tr>
                    [/#list]
                    [/#if]
              </table>
         </div>
        [/#list]
    [/#if]
</div>
         
         <script type="text/javascript">
             $(function() {
                 $(".tree").click(function() {
                     var checkTree = $(".tree:checked");
                     var alreadySelect = "";
                     checkTree.each(function() {
                         var slId = $(this).attr("id");
                         alreadySelect += "<a><span class='removeSelect' sl='"+slId+"'>"+$(this).attr("labelName")+"</span></a>";
                     });
                     
                     $("#treeLabel").empty().append(alreadySelect);
                 });
                 
                 $(".removeSelect").live("click",function() {
                     var slId = $(this).attr("sl");
                     niceform("#"+slId).prop("checked",false);
                     $(this).parent().remove();
                 });
                 defaultOpen();
             })
             
             //加载页面时默认打开选中项所在div
             function defaultOpen(){
                 //判断窗体加载,默认选择哪个div
                 var id = $(".removeSelect").attr("sl");
                 //让选中的默认展开
                 if(id != undefined){
                     //关闭所有
                     $('div.select_tree').each(function(i){
                        var fl = $(this).children('div.first_level'),
                            flb = fl.find('a.fl_morebtn');
                        flb.removeClass('focus');
                        fl.height('38px');
                     });
                     var fl = $("#"+id).closest("div.first_level");
                    flb = fl.find('a.fl_morebtn');
                    fl.height('auto');
                    flb.addClass('focus');
                    
                 }
             }
             
         </script>