<!DOCTYPE html>
<!--[if IE 8]>
<html lang="en" class="ie8 no-js"> <![endif]-->
<!--[if IE 9]>
<html lang="en" class="ie9 no-js"> <![endif]-->
<!--[if !IE]><!-->
<html>
<!--<![endif]-->
<!-- BEGIN HEAD -->
<head>
    <base href="#springUrl('/assets/adminlte/')"/>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>工作台</title>
    <!-- Tell the browser to be responsive to screen width -->
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
    <!-- Bootstrap 3.3.5 -->
    <link rel="stylesheet" href="bootstrap/css/bootstrap.min.css">
    <!-- Font Awesome -->
    <link rel="stylesheet" href="plugins/font-awesome/css/font-awesome.min.css">
    <!-- Ionicons -->
    <link rel="stylesheet" href="plugins/ionicons/css/ionicons.min.css">

    <!-- DataTables -->
    <link rel="stylesheet" href="plugins/datatables/dataTables.bootstrap.css">

    <!-- Theme style -->
    <link rel="stylesheet" href="dist/css/AdminLTE.min.css">
    <!-- AdminLTE Skins. Choose a skin from the css/skins
         folder instead of downloading all of them to reduce the load. -->
    <link rel="stylesheet" href="dist/css/skins/_all-skins.min.css">
    <!-- iCheck -->
    <link rel="stylesheet" href="plugins/iCheck/flat/blue.css">
    <!-- Morris chart -->
    <link rel="stylesheet" href="plugins/morris/morris.css">
    <!-- jvectormap -->
    <link rel="stylesheet" href="plugins/jvectormap/jquery-jvectormap-1.2.2.css">
    <!-- Date Picker -->
    <link rel="stylesheet" href="plugins/datepicker/datepicker3.css">
    <!-- Daterange picker -->
    <link rel="stylesheet" href="plugins/daterangepicker/daterangepicker-bs3.css">
    <link rel="stylesheet"
          href="plugins\bootstrap-fileinput\fileinput.min.css">
    <!-- bootstrap wysihtml5 - text editor -->
    <link rel="stylesheet" href="plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.min.css">

    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
    <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->
    <style>
        .f1{text-align: center ;vertical-align: middle }
    </style>
</head>
<body class="hold-transition skin-blue sidebar-mini">


<div class="wrapper">
    <div class="content-wrapper" style="margin-left:0;">
        <div id="importExcelDiv"></div>

        <section class="content-header">
            <h1>
                需求变更日志管理
                <small>需求变更日志管理</small>
            </h1>
            <ol class="breadcrumb">
                <li><a><i class="fa fa-dashboard"></i>首页</a></li>
                <li><a class="active">管理列表</a></li>
            </ol>
        </section>


        <!-- Main content -->
        <section class="content">

            <div class="row">
                <div class="col-xs-12">
                    <div class="box">


                    </div><!-- /.box -->
                    <ul class="list-group">

                    </ul>
                </div><!-- /.col -->
            </div><!-- /.row -->
        </section><!-- /.content -->
    </div><!-- /.content-wrapper -->


    <!-- Add the sidebar's background. This div must be placed
         immediately after the control sidebar -->
    <div class="control-sidebar-bg"></div>
</div><!-- ./wrapper -->
<!-- jQuery 2.1.4 -->
<script src="plugins/jQuery/jQuery-2.1.4.min.js"></script>
<!-- Bootstrap 3.3.5 -->
<script src="bootstrap/js/bootstrap.min.js"></script>
<!-- DataTables -->
<script src="plugins/datatables/jquery.dataTables.min.js"></script>
<script src="plugins/datatables/extensions/i18n/lanauage_ch.js"></script>
<script src="plugins/datatables/dataTables.bootstrap.min.js"></script>
<!-- SlimScroll -->
<script src="plugins/slimScroll/jquery.slimscroll.min.js"></script>
<script src="plugins/datepicker/bootstrap-datepicker.js"></script>
<script src="plugins/datepicker/locales/bootstrap-datepicker.zh-CN.js"></script>
<!-- FastClick -->
<script src="plugins/fastclick/fastclick.min.js"></script>
<!--fileinput js-->
<script src="plugins\bootstrap-fileinput\fileinput.js"></script>
<script src="plugins/bootstrap-fileinput/zh.js"></script>
<script src="plugins/bootstrap-fileinput/zh2.js"></script>
<!-- AdminLTE App -->
<script src="dist/js/app.min.js"></script>
<script type="text/javascript"
        src="plugins/jquery-validation/js/jquery.validate.min.js"></script>
<!-- AdminLTE for demo purposes -->
<script src="common/js/cfapp.js"></script>

<script>
    function formatDates(now) {
        var now = new Date(now);
        var year = now.getFullYear();
        var month = now.getMonth() + 1;
        var date = now.getDate();
        var hour = now.getHours();
        var minute = now.getMinutes();
        var second = now.getSeconds();
        return year + "-" + month + "-" + date + "   " + hour + ":"
                + minute + ":" + second;
    }
    $().ready(function(){
        var detaillog = ${list};
          var  html ="<table class='table table-bordered table-striped dataTable no-footer'>";
            html+="<tr><th width='33%'>变更时间</th><th width='33%'>行程信息</th><th width='33%'>是否管理员修改</th></tr>";
            for(var i =0 ; i<detaillog.length;i++){
                var obj = detaillog[i];
                if(obj!=null&&obj!="") {
                    var admin = null;
                    if(obj.isadmin==1){
                        admin = "是";
                    }else{
                        admin = "否";
                    }
                    var log = "";
                    var detaillist = obj.detaillog;
                    var str = JSON.parse(detaillist);
                    if(str.isHotel == 1){ //酒店服务
                        log = '酒店服务：无'+'<br/>';
                    }else if(str.isHotel == 0 ||str.isHotel=="0"){
                        log += '酒店服务：'+'<br/>';
                        var hotel = JSON.parse(str.hotel);
                        log += '酒店地址：'+hotel.title+'<br>';
                        log += '入店时间：'+formatDates(hotel.startDate)+'<br>';
                        log += '离店时间：'+formatDates(hotel.endDate)+'<br>';
                    }else if(str.isHotel == null ||str.isHotel=="" ){
                        log =log;
                    }
                    if(str.isEat == 1){  //酒店服务
                        log += '餐饮服务：无'+'<br/>';
                    }else if(str.isEat ==0){
                        log += '餐饮服务：'+'<br/>';
                        var eat = JSON.parse(str.eat)
                        for(var j =0;j<eat.length;j++){
                            log += eat[j].eatname + '<br>';
                        }
                    }else if(str.isEat == null || str.isEat == ""){
                        log = log;
                    }
                    if(str.isRelay == 1){  //接送服务
                        log += '接送服务：无'+'<br/>';
                    }else if(str.isRelay == 0 ){

                        var relay = JSON.parse(str.relay);
                        log += '接站服务：'+'<br>';
                        if(relay.isOnedrive==0){
                            log += '自驾'+'<br>';
                        }else if(relay.isPlane==0){
                            var plan = relay.plane;
                            log += '交通工具：飞机'+'<br>';
                            log += '接站站点：'+plan.planesattion+'<br>';
                            log += '到站时间：'+formatDates(relay.arrivetime)+'<br>';
                            log += '班次：'+relay.shift+'<br>';
                        }else if(relay.isHigh==0){
                            var high = relay.high
                            log += '交通工具：高铁'+'<br>';
                            log += '接站站点：'+high.highsattion+'<br>';
                            log += '到站时间：'+formatDates(relay.arrivetime)+'<br>';
                            log += '班次：'+relay.shift+'<br>';
                        }else if(relay.isOther==0){
                            log += '其他'+'<br>';
                        }
                        var send = JSON.parse(str.send);
                        log += '送站服务：'+'<br>';
                        if(send.isOnedrive==0){
                            log += '自驾'+'<br>';
                        }else if(send.isPlane==0){
                            var plan = send.plane;
                            log += '交通工具：飞机'+'<br>';
                            log += '送站站点：'+plan.planesattion+'<br>';
                            log += '到站时间：'+formatDates(send.arrivetime1)+'<br>';
                            log += '班次：'+send.shift1+'<br>';
                        }else if(send.isHigh==0){
                            var high = send.high;
                            log += '交通工具：高铁'+'<br>';
                            log += '送站站点：'+high.highsattion+'<br>';
                            log += '到站时间：'+formatDates(send.arrivetime1)+'<br>';
                            log += '班次：'+send.shift1+'<br>';
                        }else if(send.isOther==0){
                            log += '其他'+'<br>';
                        }
                    }else if(str.isRelay == null ||str.isRelay==""){
                        log = log;
                    }
                    if(str.isTake == 1){ //试乘试驾
                        log += '试驾信息：无'+'<br/>';
                    }else if(str.isTake ==0){

                        log += '试驾信息：'+'<br/>';
                        var takes = JSON.parse(str.take);
                        for(var k=0;k<takes.length;k++){
                            log += formatDates(takes[k].taketime)+'<br>';
                        }
                    }else if(str.isTake == null||str.isTake==""){
                        log =log;

                    }
                    if(str.isfactory ==1){  //工厂参观
                        log += '参观时间：无'+'<br>';
                    }else if(str.isfactory ==0){
                        var factory = JSON.parse(str.factory);
                        log += '参观时间：'+'<br>';
                        for(var z=0;z<factory.length;z++){
                            log += formatDates(factory[z].visittime)+" "+factory[z].visitdesc+'<br>';
                        }
                    }else if(str.isfactory == null ||str.isfactory==""){
                        log = log;
                    }
                    if(str.desc==null||str.desc==""){
                        log += '备注：无'+'<br>';
                    }else{
                        log += '备注：'+'<br>';
                        log += str.desc;
                    }
                    html+="<tr><td class='f1'>"+formatDates(obj.createTime)+"</td><td>"+log+"</td><td class='f1'>"+admin+"</td></tr>";
                    //console.log(html)
                }

            }
        html+="</table>";
        $(".list-group").append(html);

    })

</script>

</body>
</html>
