
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@page language="java" contentType="text/html; charset=utf-8"
        pageEncoding="utf-8" %>
<%@ include file="header.jsp" %>


<link rel="stylesheet" type="text/css" href="<%=webpath%>/css/printOut.css"/>
<script type="text/javascript" src="<%=webpath%>/js/business/caseEnter.js"></script>
<script type="text/javascript" src="<%=webpath%>/js/DatePicker/WdatePicker.js"></script>
<script type="text/javascript" src="<%=webpath%>/js/jquery.jqprint-0.3.js"></script>
<script src="http://www.jq22.com/jquery/jquery-migrate-1.2.1.min.js"></script>
<style media="print">
    .Noprint {
        display: none;
    }

    .PageNext {
        page-break-after: always;
    }
    table.searchTable td:nth-last-child(1){
        width:40%;
    }
</style>
<script type="text/javascript">
    function query() {
        var queryParams = {};
        var frame_code = $("#frame_code").val();
        var caseCode = $("#caseCode").val();
        var createTime = $("#createTime").val();
        var finishTime = $("#finishTime").val();
        if ((frame_code == null || frame_code == '') && (caseCode == null || caseCode == '') &&
                (finishTime == null || finishTime == '') && (createTime == null || createTime == '')) {
            alert("查询条件不能为空");
            return;
        }
        queryParams['frame_code'] = frame_code;
        queryParams['caseCode'] = caseCode;
        queryParams['createTime'] = createTime;
        queryParams['finishTime'] = finishTime;
        var state = parseInt(${state});
        queryParams['state'] = state;
        queryCouponList("<%=path%>/casesInfo/caseEnterQuery.do", queryParams,
            "<%=path%>/casesInfo/caseEnterInfo.do?code=",state);
    }
    function clearVal() {
        $("#frame_code").val("");
        $("#license").val("");
        $("#caseCode").val("");
        $("#createTime").val("");
        $("#finishTime").val("");
    }

    function clearValState1() {
        $("#license").val("");
        $("#frame_code").val("");
        $("#caseCode").val("");
        $("#createTime").val("");
        $("#finishTime").val("");
        $("#companyName").val("");
        $("#rescueState").val("0");
    }

    $(window).ready(function () {
        var frame_code = $("#frame_code").val();
        var caseCode = $("#caseCode").val();
        var createTime = $("#createTime").val();
        var finishTime = $("#finishTime").val();
        var queryParams = {};
        queryParams['frame_code'] = frame_code;
        queryParams['caseCode'] = caseCode;
        queryParams['createTime'] = createTime;
        queryParams['finishTime'] = finishTime;
        var state = parseInt(${state});
        queryParams['state'] = state;
        queryCouponList("<%=path%>/casesInfo/caseEnterQuery.do", queryParams,
                "<%=path%>/casesInfo/caseEnterInfo.do?code=",state);
    })

    //导出数据
    function expordata() {
        var frame_code = $("#frame_code").val();
        var caseCode = $("#caseCode").val();
        var createTime = $("#createTime").val();
        var finishTime = $("#finishTime").val();
        var params = {};
        params["frame_code"] = frame_code;
        params["caseCode"] = caseCode;
        params["createTime"] = createTime;
        params["finishTime"] = finishTime;
        var state = parseInt(${state});
        params['state'] = state;
        var checkurl = $("#paths").val() + "/casesInfo/exportData.do";
        //刷新列表
        var data = ajaxgetresultpost(checkurl, params);
        if (data.result == 1) {
            $.messager.alert("提示", data.msg);
        } else {
            window.open(data.webUrl);
        }

    }

    //导出数据
    function expordataCSV() {
        var frame_code = $("#frame_code").val();
        var caseCode = $("#caseCode").val();
        var createTime = $("#createTime").val();
        var finishTime = $("#finishTime").val();
        var params = {};
        params["frame_code"] = frame_code;
        params["caseCode"] = caseCode;
        params["createTime"] = createTime;
        params["finishTime"] = finishTime;
        var state = parseInt(${state});
        params['state'] = state;
        var checkurl = $("#paths").val() + "/casesInfo/exportDataCSV.do";
        //刷新列表
        var data = ajaxgetresultpost(checkurl, params);
        if (data.result == 1) {
            $.messager.alert("提示", data.msg);
        } else {
            window.open(data.webUrl);
        }

    }

</script>
<input type="hidden" id="paths" value="<%=path%>"/>
<!--希望打印时不显示的内容设置class="Noprint"样式-->
<!--IE内置打印控件IEWebBrowser-->
<OBJECT id="wb" height="0" width="0" classid="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2" name="wb"></OBJECT>
<div id="main" class="Noprint">
    <div class="search">

            <table class="searchTable">
                <tbody>
                <tr>
                    <!-- <td><b><font><font>车牌号</font></font></b></td> -->
                    <td style="position:relative;">
                        <span class="inputTitle"> 案件编号： </span>
                        <span>
                    <input id="caseCode" name="endSubmitDate"
                           type="text" value=""
                           class="mc-ipt-text hasDatepicker"
                           style=""/><span class="mc-ipt"
                                           style="width:90%;">
                            <span
                                    id="input33Tip"
                                    class="mc-ipt-tip-query"
                                    style="font-size: 11px; line-height: 40px; height: 40px;"></span></span></span>
                    </td>

                    <!-- <td><b><font><font>VIN码</font></font></b></td> -->
                    <td style="position:relative;">
                        <span class="inputTitle">VIN码: </span>
                        <span>
                    <input id="frame_code" name="endSubmitDate"
                           type="text" value=""
                           class="mc-ipt-text hasDatepicker"
                           style=""/><span class="mc-ipt"
                                           style="width:90%;"><span
                                id="input33Tip" class="mc-ipt-tip-query"
                                style="font-size: 11px; line-height: 40px; height: 40px;"></span></span></span></td>

                    <td colspan="2">

                        <button class="t-button searchBtn " id="CaseInfoList2btnCtClear" style="margin-right:10px;"
                                type="button" onclick="expordataCSV()">导出CSV报表
                        </button>
                        <button class="t-button searchBtn " id="CaseInfoList2btnCtClear" style="margin-right:10px;"
                                type="button" onclick="expordata()">导出EXCEL报表
                        </button>
                        <button class="t-button searchBtn" id="CaseInfoList2btnCtClear" style="margin-right:10px;"
                                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>
                        <span class="inputTitle"> 开始日期: </span>
                        <input type="text" id="createTime" 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(\'finishTime\')||\'%y-%M-%d\'}'})"
                               style="cursor:pointer;"/>
                    </td>

                    <td>
                        <span class="inputTitle"> 结束日期: </span>
                        <input type="text" id="finishTime" 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(\'createTime\')}'})"
                               style="cursor:pointer;"/>
                    </td>
                    <td></td>
                    <td></td>
                </tr>
                </tbody>
            </table>
    </div>
    <table id="datatable"></table>
</div>
<div class="order_print" style="display: none">
    <div class="printWrap">
        <div class="printTitle Noprint">
            救援完成确认
            <a class="printBtn" onclick="printOut()">打印</a>
            <a class="printClose"><img src="<%=path%>/images/close.png" alt=""></a>
        </div>
        <div class="printCon">
            <form>
                <table class="PrintCase"></table>
                <hr/>
                <table class="saveDetail"></table>
                <table class="sign"></table>
            </form>
        </div>
    </div>
</div>
<script>
    $(".printClose").on("click", function () {
        $(".order_print").hide();
    })

    //    function  print(){
    //        $(".printCon").jqprint();
    //    }
    // 打印
    function printOut() {
        var explorer = window.navigator.userAgent;
// //firefox 浏览器
//         else if (explorer.indexOf("Firefox") >= 0) {
//             alert("Firefox浏览器");
//         }
//Chrome浏览器
        if (explorer.indexOf("Chrome") >= 0) {
            $(".printCon").jqprint();
        } else {
            $("#menucontainer").addClass("Noprint");
            $("#header").addClass("Noprint");
            wb.execwb(8, 1);
            wb.execwb(6, 1);
        }
    }
</script>
<%@ include file="footer.jsp" %>