<%@ page contentType="text/html;charset=UTF-8" %>

<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="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" >
                                <input placeholder="输入资产编号" type="text" name="zc_id" class="input-text" />
                            </td>
                            <td class="search-label" >
                                品牌：
                            </td>
                            <td class="search-input" >
                                <input placeholder="输入品牌" type="text" name="pinpai" class="input-text" />
                            </td>
                        </tr>
                        <tr>
                            <td class="search-label" >
                                原使用人：
                            </td>
                            <td class="search-input" >
                                <input placeholder="输入原使用人" type="text" name="old_ly_user" class="input-text" />
                            </td>
                            <td class="search-label" >
                                新使用人：
                            </td>
                            <td class="search-input" >
                                <input placeholder="输入新使用人" type="text" name="new_ly_user" class="input-text" />
                            </td>
                            <td class="search-label" style="width: 120px;">
                                变更时间：
                            </td>
                            <td class="search-input" style="width: 270px;">
                                <input type="text"  class="input-text Wdate"  autocomplete="off" onclick="WdatePicker({dateFmt:'yyyy-MM-dd'})"
                                       name="b_time" style="width:120px;">
                                &nbsp;至&nbsp;
                                <input type="text"  class="input-text Wdate"  autocomplete="off"  onclick="WdatePicker({dateFmt:'yyyy-MM-dd'})"
                                       name="e_time" style="width:120px;">
                            </td>
                            <td colspan="3">
                                <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_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 updateById(id){
        var abc = layer.open({
            title:"详情",
            type: 2,
            content: "./list_add-t.jsp?update_id="+id,
            maxmin: true
        });
        layer.full(abc);
    }
    function setRules(id){
        var abc = layer.open({
            title:"添加元素",
            type: 2,
            content: "./zd_col_list_ajax-t.jsp?zd_id="+id,
            maxmin: true
        });
        layer.full(abc);
    }
    function deleteById(id) {
        layer.confirm('确认要删除吗？', function (index) {
            $.ajax({
                type: "POST",
                url: "./action.jsp",
                data: {"action":"delete","delete_id":id},
                success: function (msg) {
                    if (msg.indexOf("success") >= 0) {
                        layer.msg('操作成功!', {icon: 1, time: 1000},
                            function () {
                                searchModel();
                            });
                    } else {
                        layer.msg('操作失败'+msg, {
                            icon: 5,
                            time: 2000 //2秒关闭（如果不配置，默认是3秒）
                        }, function () {
                        });
                    }
                }
            });
        })
    }
</script>