<%@ page import="com.alibaba.fastjson.JSON" %>
<%@page language="java" contentType="text/html; charset=utf-8"
        pageEncoding="utf-8" %>
<%@ include file="header.jsp" %>
<script type="text/javascript" src="<%=webpath%>/js/business/recharge_query.js"></script>
<script type="text/javascript" src="<%=webpath%>/js/DatePicker/WdatePicker.js"></script>
<style>

    table.searchTable td:nth-last-child(1) {
        width: auto;
    }

    table.searchTable td {
        width: auto;
    }
</style>
<%
    LoginUserVo vo = (LoginUserVo) request.getSession().getAttribute("logininfo");
%>
<script type="text/javascript">
    var uri = "/coupon/recharges_query.do";
    function query() {
        var queryParams = {};
        queryParams['vininput'] = $("#vininput").val();
        queryParams['electronicAccounts'] = $("#electronicAccounts").val();
        queryParams['license'] = $("#license").val();
        queryParams['phone'] = $("#phone").val();
        queryParams['orderCode'] = $("#orderCode").val();
        queryParams['queryDate1'] = $("#queryDate1").val();
        queryParams['queryDate2'] = $("#queryDate2").val();
        queryCouponList(uri, queryParams);
    }
    //导出数据
    function expordata() {
        var queryParams = {};
        queryParams['vininput'] = $("#vininput").val();
        queryParams['electronicAccounts'] = $("#electronicAccounts").val();
        queryParams['license'] = $("#license").val();
        queryParams['phone'] = $("#phone").val();
        queryParams['orderCode'] = $("#orderCode").val();
        queryParams['queryDate1'] = $("#queryDate1").val();
        queryParams['queryDate2'] = $("#queryDate2").val();

        var checkurl = $("#paths").val() + "/coupon/rechangeExportData.do";

        //刷新列表
        var data = ajaxgetresultpost(checkurl, queryParams);
        // alert(data.webUrl);
        if (data.result == 1) {
            $.messager.alert("提示", "导出数据失败");
        } else {
            //$("#dataexport_div").hide();
            window.open(data.webUrl);
        }

    }

    function clearVal() {
        $("#vininput").val("");
        $("#electronicAccounts").val("");
        $("#license").val("");
        $("#phone").val("");
        $("#orderCode").val("");
        $("#queryDate1").val("");
        $("#queryDate2").val("");
    }

    $(document).ready(function () {
        queryCouponList(uri, {});
    })
</script>
<input type="hidden" id="paths" value="<%=path%>"/>
<div id="main">
    <div class="search">
        <table class="searchTable">
            <tbody>
            <tr>
                <td>
                    <span class="inputTitle">VIN码:</span>
                    <input id="vininput" name="vininput" type="text" value=""
                           class="mc-ipt-text hasDatepicker" style=""/>
                </td>

                <td>
                    <span class="inputTitle">电子账户:</span>
                    <input id="electronicAccounts" name="electronicAccounts" type="text" value=""
                           class="mc-ipt-text hasDatepicker" style=""/>
                </td>

                <%--<td>--%>
                <%--<span class="inputTitle">车牌号:</span>--%>
                <%--<input id="license" name="license" type="text" value=""--%>
                <%--class="mc-ipt-text hasDatepicker" style=""/>--%>
                <%--</td>--%>

                <td>
                    <span class="inputTitle">电话号码:</span>
                    <input id="phone" name="phone" type="text" value=""
                           class="mc-ipt-text hasDatepicker" style=""/>
                </td>


                <td>
                    <button class="t-button searchBtn" style="margin-left:10px;"
                            type="button" onclick="expordata();">
                        导出报表
                    </button>
                    <button class="t-button searchBtn" id="CaseInfoList2btnCtClear"
                            type="button" onclick="clearVal();">
                        <img class="searchIcon" src="../images/clear.png">清空
                    </button>
                    <button class="t-button searchBtn" style="margin-right:10px;"
                            id="CaseInfoList2btnCtSearch" type="button" onclick="query();">
                        <img class="searchIcon" src="../images/search.png">搜索
                    </button>

                </td>
            </tr>
            <tr>
                <td style="position:relative;">
                    <span class="inputTitle">案件编号:</span>
                    <input id="orderCode" name="orderCode" type="text" value=""
                           class="mc-ipt-text hasDatepicker" style=""/>
                </td>
                <td>
                    <span class="inputTitle"> 充值日期: </span>
                    <input type="text" id="queryDate1" class="Wdate" readonly="readonly"
                           onfocus="WdatePicker({errDealMode:2,readOnly:true,startDate:'%y-%M-%d %H:%m:%s',dateFmt:'yyyy-MM-dd',maxDate:'#F{$dp.$D(\'queryDate2\')||\'%y-%M-%d\'}'})"
                           style="cursor:pointer;"/>
                </td>

                <td>
                    <span class="inputTitle"> 充值日期: </span>
                    <input type="text" id="queryDate2" class="Wdate" readonly="readonly"
                           onfocus="WdatePicker({errDealMode:2,readOnly:true,startDate:'%y-%M-%d %H:%m:%s',dateFmt:'yyyy-MM-dd',maxDate:'%y-%M-%d',minDate:'#F{$dp.$D(\'queryDate1\')}'})"
                           style="cursor:pointer;"/>
                </td>
            </tr>
            </tbody>
        </table>
    </div>
    <table id="datatable"></table>
</div>

<%@ include file="footer.jsp" %>