<%@ page contentType="text/html;charset=UTF-8" %>
<%
    String ly_id=request.getParameter("ly_id");
%>
<link rel="stylesheet" href="<%=request.getContextPath()%>/js/zTree/v3/css/zTreeStyle/zTreeStyle.css" type="text/css">
<link rel="stylesheet" href="<%=request.getContextPath()%>/css/pagination.css">
<div class="page-container">

    <div class="content" >
        <div class="search-form">
            <form  method="post" id="data_form_search" name="data_form_search">
                <input type="hidden" name="ly_id"  value="<%=ly_id%>"/>
                <input type="hidden" name="page_number" id="page_number" value="1"/>
                <input type="hidden" name="dept_id" id="dept_id" value=""/>
                <input type="hidden" name="page_size" id="page_size" value="10"/>
                <div class="text-l">
                    <table class="search-table ">
                        <tr class="">
                            <td class="search-label" >
                                资产名称：
                            </td>
                            <td class="search-input" >
                                <input placeholder="输入资产名称" type="text" name="zc_name" class="input-text" />
                            </td>
                            <td class="search-label">
                                国标大类则：
                            </td>
                            <td class="search-input" id="zc_gj_type">
                                <script>
                                    $.post("../zd/zd_view_list.jsp?name_id=zc_gj_type&zd_e_name=gjdl&math="+Math.random(),function(data){
                                            document.getElementById("zc_gj_type").innerHTML=data;
                                        }
                                    );
                                </script>
                            </td>
                            <td class="search-label">
                                资产分类：
                            </td>
                            <td class="search-input" id="zc_fl">
                                <script>
                                    $.post("../zd/zd_view_list.jsp?name_id=zc_fl&zd_e_name=zc_fl&math="+Math.random(),function(data){
                                            document.getElementById("zc_fl").innerHTML=data;
                                        }
                                    );
                                </script>
                            </td>
                        </tr>
                        <tr>
                            <td class="search-label">
                                价值类型：
                            </td>
                            <td class="search-input" id="jz_type">
                                <script>
                                    $.post("../zd/zd_view_list.jsp?name_id=jz_type&zd_e_name=jz_type&math="+Math.random(),function(data){
                                            document.getElementById("jz_type").innerHTML=data;
                                        }
                                    );
                                </script>
                            </td>
                            <td class="search-label">
                                设备类型：
                            </td>
                            <td class="search-input" id="sb_type">
                                <script>
                                    $.post("../zd/zd_view_list.jsp?name_id=sb_type&zd_e_name=sb_type&math="+Math.random(),function(data){
                                            document.getElementById("sb_type").innerHTML=data;
                                        }
                                    );
                                </script>
                            </td>
                            <td colspan="2">
                                <a class="btn btn-primary radius" id="searchA" onclick="searchUserModel();" style="margin-left:19%;">
                                    查询
                                </a>
                                <a class="btn btn-info radius" onclick="chongzhi();" style="margin-left:5px;">
                                    重置
                                </a>
                            </td>
                        </tr>
                    </table>
                </div>
            </form>
        </div>
        <div style="height:10px;background-color: #d9e4f6">

        </div>
        <div class="datalist " id="datalist">

        </div>
    </div>
</div>
<script type="text/javascript" src="<%=request.getContextPath()%>/js/jquery.pagination.js"></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/js/zTree/v3/js/jquery.ztree.all-3.5.min.js"></script>
<script type="text/javascript">
    function searchModel() {
        $.ajax({
            type: "post",
            url: "list_zc_ajax.jsp",
            data: $('#data_form_search').serialize(),
            success: function (msg) {
                //data_form_search.reset();
                $("#datalist").html(msg);
            }
        });
    }


    function searchUserModel() {
        $("#page_number").val("1");
        searchModel();
    }
    $(function(){
        searchModel();
    });
    function chongzhi(){
        $("#page_size").val("10");
        data_form_search.reset();
        searchUserModel();
    }
    /*用户-编辑*/
    function addRules(title, url) {
        var abc = layer.open({
            title:title,
            type: 2,
            content: url,
            maxmin: true
        });
        layer.full(abc);
    }
    function saveForm(){
        var ly_id=$("#ly_id").val()
        $.ajax({
            type: "POST",
            url: "./action.jsp",
            data: $('#form1').serialize(),
            success: function (msg) {
                if (msg.indexOf("success") >= 0) {
                    layer.msg('操作成功!', {icon: 1, time: 1000},
                        function () {
                            parent.parent.addRules("./list_ly-t.jsp?ly_id="+ly_id+"&action=update","");
                            parent.closeIframe();
                            var index = parent.layer.getFrameIndex(window.name);
                            parent.layer.close(index);
                            //parent.location.href="./list_ly-t.jsp?ly_id="+ly_id;
                        });
                } else {
                    layer.msg('操作失败'+msg, {
                        icon: 5,
                        time: 2000 //2秒关闭（如果不配置，默认是3秒）
                    }, function () {
                    });
                }
            }
        });
    }
</script>