123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637 |
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="UTF-8">
- <title>机票预订</title>
- <meta name="description" content="后台管理系统" />
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
-
- <!-- bootstrap -->
- <link href="css/bootstrap/bootstrap.css" rel="stylesheet">
- <link href="css/bootstrap/bootstrap-overrides.css" type="text/css" rel="stylesheet">
- <!-- global styles -->
- <link rel="stylesheet" type="text/css" href="css/compiled/layout.css">
- <link rel="stylesheet" type="text/css" href="css/compiled/elements.css">
- <link rel="stylesheet" type="text/css" href="css/compiled/icons.css">
- <!-- libraries -->
- <link href="css/lib/font-awesome.css" type="text/css" rel="stylesheet" />
- <link href="css/lib/bootstrap.datepicker.css" type="text/css" rel="stylesheet">
- <!-- this page specific styles -->
- <link rel="stylesheet" href="css/compiled/flight-query-complex.css" type="text/css" media="screen" />
- <link rel="stylesheet" href="css/compiled/tables.css" type="text/css" media="screen" />
- <!--[if lt IE 9]>
- <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
- <![endif]-->
- </head>
- <body>
- <!-- navbar -->
- <header class="navbar navbar-inverse" role="banner">
- <div class="navbar-header">
- <button class="navbar-toggle" type="button" data-toggle="collapse" id="menu-toggler">
- <span class="sr-only">导航</span>
- <span class="icon-bar"></span>
- <span class="icon-bar"></span>
- <span class="icon-bar"></span>
- </button>
- <a class="navbar-brand" href="./index.html"><img src="img/logo.png"></a>
- </div>
- <ul class="nav navbar-nav pull-right hidden-xs">
- <li class="settings hidden-xs hidden-sm">
- <a href="./setting.html" role="button">
- <i class="icon-cog"></i>
- </a>
- </li>
- <li class="settings hidden-xs hidden-sm">
- <a href="./signin.html" role="button">
- 退出<i class="icon-signout" style="font-size: 12px;margin-left: 10px;"></i>
- </a>
- </li>
- </ul>
- </header>
- <!-- end navbar -->
- <!-- sidebar -->
- <div id="sidebar-nav">
- <ul id="dashboard-menu">
- <li>
- <a href="./index.html">
- <i class="icon-home"></i>
- <span>首页</span>
- </a>
- </li>
- <li>
- <a href="./flight-query.html">
- <i class="icon-plane"></i>
- <span>快捷下单</span>
- </a>
- </li>
- <li class="active">
- <div class="pointer">
- <div class="arrow"></div>
- <div class="arrow_border"></div>
- </div>
- <a href="./flight-query-complex.html">
- <i class="icon-fighter-jet"></i>
- <span>人工下单</span>
- </a>
- </li>
- <li>
- <a href="./order-list.html">
- <i class="icon-tasks"></i>
- <span>订单管理</span>
- </a>
- </li>
- <li>
- <a href="./setting.html">
- <i class="icon-cog"></i>
- <span>系统配置</span>
- </a>
- </li>
- </ul>
- </div>
- <!-- end sidebar -->
- <!-- main container -->
- <div class="content">
- <div id="pad-wrapper">
- <!-- query form -->
- <form class="query">
- <div class="alert alert-danger"><i class="icon-remove-sign"></i>请输入完整的查询信息。</div>
- <div class="row form-wrapper">
- <div class="col-md-3 col-xs-6 field-box">
- <label>航班号:</label>
- <input class="form-control" type="text" name="flightNo" required="required"/>
- </div>
- <div class="col-md-3 col-xs-6 field-box">
- <label>航空公司:</label>
- <input class="form-control" type="text" name="airlineCode" required="required" disabled="disabled"/>
- </div>
- <div class="col-md-3 col-xs-6 field-box">
- <label>舱位:</label>
- <input class="form-control" type="text" name="cabin" />
- </div>
- <div class="col-md-3 col-xs-6 field-box" class="dep_date">
- <label>出行日期:</label>
- <input class="form-control" type="text" name="depDate" required="required"/>
- <div class="pop-dialog">
- <div class="pointer">
- <div class="arrow"></div>
- <div class="arrow_border"></div>
- </div>
- <div class="body">
- <div data-date="2017-10-01" data-date-format="yyyy-mm-dd"></div>
- </div>
- </div>
- </div>
- <div class="col-md-3 col-xs-6 field-box">
- <label>起飞机场:</label>
- <input class="form-control" type="text" name="depAirport" required="required"/>
- </div>
- <div class="col-md-3 col-xs-6 field-box">
- <label>到达机场:</label>
- <input class="form-control" type="text" name="arrAirport" required="required"/>
- </div>
- <div class="col-md-3 col-xs-6 field-box">
- <button class="btn-flat success" type="button">查询</button>
- </div>
- </div>
- </form>
- <!-- end query form -->
- <!-- query-list table -->
- <div class="table-wrapper orders-table section" style="margin-bottom: 35px;">
- <table class="table">
- <thead>
- <tr class="text-center">
- <th class="col-md-2" style="width: 14%;">
- 产品类型
- </th>
- <th class="col-md-1" style="width: 15%;">
- <span class="line"></span>
- 航班信息
- </th>
- <th class="col-md-2">
- <span class="line"></span>
- 起飞时间
- </th>
- <th class="col-md-2">
- <span class="line"></span>
- 到达时间
- </th>
- <th class="col-md-2" style="width: 12%;">
- <span class="line"></span>
- 价格
- </th>
- <th class="col-md-3">
- <span class="line"></span>
- 退改签信息
- </th>
- </tr>
- </thead>
- <tbody class="query-list">
- <!-- row -->
- <tr class="first">
- <td>--</td>
- <td>--</td>
- <td>--</td>
- <td>--</td>
- <td>--</td>
- <td>--</td>
- </tr>
- </tbody>
- </table>
- </div>
- <form class="passengers-info" style="display:none;">
- <p class="bg-info">乘机人信息</p>
- <div class="cont-wrap">
- <div class="row form-wrapper psg-item">
- <div class="col-md-4 col-xs-6 field-box">
- <label>旅客姓名:</label>
- <input class="form-control" type="text" name="Pname" required="required"/>
- </div>
- <div class="col-md-4 col-xs-6 field-box">
- <label>证件类型:</label>
- <select class="form-control docType" name="docType" required="required" style="width: 73%;">
- <option value="NI">身份证</option>
- <option value="PP">护照</option>
- <option value="MI">军人证</option>
- <option value="BH">回乡证</option>
- <option value="TW">台胞证</option>
- <option value="HK">港澳通行证</option>
- <option value="PO">警官证 </option>
- <option value="SO">士兵证</option>
- <option value="TH">其他证件</option>
- </select>
- </div>
- <div class="col-md-4 col-xs-6 field-box">
- <label>证件号码:</label>
- <input class="form-control" type="text" name="docId" required="required"/>
- </div>
- <div class="col-md-4 col-xs-6 field-box">
- <label>乘客类型:</label>
- <select class="form-control" name="Ptype" required="required" style="width: 73%;">
- <option value="ADT">成人</option>
- <option value="CHD">儿童</option>
- </select>
- </div>
- <div class="col-md-4 col-xs-6 field-box">
- <label>出生日期:</label>
- <input class="form-control" type="text" name="birthDay" required="required" PLACEHOLDER="YYYY-MM-DD"/>
- <div class="pop-dialog">
- <div class="pointer">
- <div class="arrow"></div>
- <div class="arrow_border"></div>
- </div>
- <div class="body">
- <div data-date="2017-10-01" data-date-format="yyyy-mm-dd"></div>
- </div>
- </div>
- </div>
- <!-- <div class="col-md-3 col-xs-6 field-box">
- <label>票号:</label>
- <input class="form-control" type="text" name="ticketNo" required="required"/>
- </div> -->
- <div class="col-md-2 col-xs-6 field-box">
- <button class="btn-flat success addPsg" type="button" style="margin-left:18%;">
- <i class="icon-plus"></i>再添加一位乘客</button>
- </div>
- <div class="col-md-2 col-xs-6 field-box">
- <button class="btn-flat danger delPsg" type="button" style="margin-left:0;">
- <i class="icon-trash"></i>删除</button>
- </div>
- </div>
- </div>
- </form>
-
- <button class="btn btn-info quick-buy pull-right" type="button" data-toggle="modal">下单</button>
- <!-- end query-list table -->
- </div>
- <div class="modal fade" tabindex="-1" role="dialog" aria-labelledby="orderinfoS" id="orderinfoS">
- <div class="modal-dialog" role="document" style="width:32%;">
- <div class="modal-content">
- <div class="modal-header">
- <button type="button" class="close modalClose" data-dismiss="modal"><span aria-hidden="true">×</span></button>
- <h3 class="modal-title text-success" id="gridSystemModalLabel">您已下单成功!</h3>
- </div>
- <div class="modal-body">
- <ul class="list-group" style="margin-bottom: 0;">
- </ul>
- </div>
- <div class="modal-footer">
- <a type="button" class="btn btn-info details" href="javascript:;">查看订单详情</a>
- <button type="button" class="btn btn-default modalClose" data-dismiss="modal">关闭</button>
- </div>
- </div><!-- /.modal-content -->
- </div><!-- /.modal-dialog -->
- </div><!-- /.modal -->
- </div>
- <!-- end main container -->
- <!-- scripts -->
- <script src="js/jquery.min.js"></script>
- <script src="js/bootstrap.min.js"></script>
- <script src="js/theme.js"></script>
- <script src="js/bootstrap.datepicker.js"></script>
- <script>
- $(function(){
- //航司回填
- $("input[name='flightNo']").blur(function(){
- var airlineCode = $("input[name='flightNo']").val().substring(0,2);
- $("input[name='airlineCode']").val(airlineCode);
- // console.log($("input[name='airlineCode']").val());
- });
- //身份证号回填生日
- $("input[name='docId']").blur(function(){
- var that = $(this);
- var inputdocid = $(this).val().trim();
- var docselected = that.parent().prev();
- var bthdayinput = that.parent().next().next();
- var valtype = docselected.find("select[name='docType']").val();
- var valbthday = bthdayinput.find("input[name='birthDay']");
- if(inputdocid!= null && inputdocid != ""){
- if( valtype == "NI"){
- var brithday = getBirthdayFromIdCard(inputdocid);
- valbthday.val(brithday);
- // valbthday.attr("disabled","disabled");
- }else{
- valbthday.val("");
- }
- }
- });
- // 初始化出行日期日历插件
- $("form input[name='depDate']").datepicker({
- format: 'yyyy-mm-dd',
- startDate: '-3d'
- });
- function getNowFormatDate() {
- var date = new Date();
- var seperator1 = "-";
- var month = date.getMonth() + 1;
- var strDate = date.getDate();
- if (month >= 1 && month <= 9) {
- month = "0" + month;
- }
- if (strDate >= 0 && strDate <= 9) {
- strDate = "0" + strDate;
- }
- var currentdate = date.getFullYear() + seperator1 + month + seperator1 + strDate;
- $("form input[name='depDate']").val(currentdate);
- }
- getNowFormatDate();
- function getBirthdayFromIdCard(idCard) {
- var birthday = "";
- if(idCard != null && idCard != ""){
- if(idCard.length == 15){
- birthday = "19"+idCard.substr(6,6);
- }else if(idCard.length == 18){
- birthday = idCard.substr(6,8);
- }else{
- alert("请输入正确的身份证号!");
- };
- birthday = birthday.replace(/(.{4})(.{2})/,"$1-$2-");
- }
- return birthday;
- }
- //关闭弹出框
- $(".icon-remove-sign").click(function(){
- $(this).parent(".alert").hide();
- });
- // 提交查询表单
- $(".query button").click(function(){
- $(".query .alert").hide();
- var _this = $(this);
- var uname = localStorage.uname;
- var token = localStorage.tokenId;
- var cabin = $("input[name='cabin']").val();
- var airlineCode = $("input[name='airlineCode']").val();
- var flightNo = $("input[name='flightNo']").val();
- var depDate = $("input[name='depDate']").val();
- var depAirport = $("input[name='depAirport']").val();
- var arrAirport = $("input[name='arrAirport']").val();
- /* console.log(arrAirport == "");
- console.log(airlineCode == "");
- console.log(flightNo == "");
- console.log(depDate == "");
- console.log(depAirport == "");*/
- if(airlineCode == "" || flightNo == "" || depDate == "" || depAirport == "" || arrAirport == ""){
- $(".query").find(".alert").show();
- $(".icon-remove-sign").click(function(){
- $(this).parent(".alert").hide();
- });
- return false;
- };
- $.ajax({
- // url:'http://114.55.6.23/jh/ticket/get',
- url:'http://114.55.6.23/jh/ticket/get',
- data:{
- "uname":uname,
- "token":token,
- "cabin":cabin,
- "airlineCode":airlineCode,
- "flightNo":flightNo,
- "depDate":depDate,
- "depAirport":depAirport,
- "arrAirport":arrAirport
- },
- type:"POST",
- dataType:"json",
- error:function(XMLHttpRequest, textStatus, errorThrown) {
- console.log(XMLHttpRequest.responseText);
- console.log(XMLHttpRequest.readyState);
- console.log(textStatus);
- },
- success:function(data){
- if(data.status == 100){
- $(".query .alert").html('<i class="icon-remove-sign"></i>'+data.attachment).show();
- $(".icon-remove-sign").click(function(){
- $(this).parent(".alert").hide();
- });
- }else if(data.status == 200){
- console.log(data);
- $(".query-list .first").hide();
- var queryStr = "";
- for(var i = 0;i < data.attachment.length;i++){
- var str='<tr>'+
- '<td>'+
- '<p>'+'<i class="icon-ok" style="display: none"></i>'+ '<span>'+ data.attachment[i].productType +'</span>'+'</p>'+
- '<p class="hidden">infoId:'+ '<span class="infoId">'+ data.attachment[i].infoId +'</span>'+'</p>'+
- '</td>'+
- '<td>'+
- '<p>航空公司:'+ '<span>'+ data.attachment[i].airLine +'</span>'+'</p>'+
- '<p>航班号:'+ '<span>'+ data.attachment[i].flightNum +'</span>'+'</p>'+
- '<p>舱位:'+ '<span>'+ data.attachment[i].cabin +'</span>'+'</p>'+
- '<p>舱位等级:'+'<span>'+ data.attachment[i].cabinClass+'</span>'+ '</p>'+
- '</td>'+
- '<td>'+
- '<p>出发城市:'+ '<span>'+ data.attachment[i].depAirport +'</span>'+'</p>'+
- '<p>'+ '<span>'+ data.attachment[i].depTime +'</span>' +'</p>'+
- '</td>'+
- '<td>'+
- '<p>到达城市:'+ '<span>'+ data.attachment[i].arrAirport +'</span>'+'</p>'+
- '<p>'+ '<span>'+ data.attachment[i].arrTime +'</span>'+'</p>'+
- '</td>'+
- '<td>'+
- '<p>舱位价格:'+ '<span>'+ data.attachment[i].cabinPrice +'</span>' +'</p>'+
- '<p>票面价格:'+ '<span>'+data.attachment[i].ticketPrice +'</span>' +'</p>'+
- '</td>'+
- '<td>'+
- '<p>退改签说明:'+ '<span>'+ data.attachment[i].tuiGaiQian.tuigaiqianStr +'</span>' +'</p>'+
- // '<p>产品类型:'+ data.attachment[i].productType+'</p>'+
- '</td>'+
- '</tr>';
- queryStr += str;
- }
-
- $(".query-list").html(queryStr);
- };
-
- var checkedInfo = "";
- $(".query-list tr").click(function(){
- $(".query-list tr.active").removeClass("active");
- $(this).addClass("active");
- checkedInfo = $(this).find(".infoId").html();
- // alert( checkedInfo);
- });
- $(".passengers-info").show();
- $(".quick-buy").show();
- // 增加乘客信息
- $(".addPsg").click(function(){
- $(".delPsg").removeAttr("disabled");
- var psgItemClone = $(".psg-item:last").clone(true);
- psgItemClone.find("input[name='Pname']").val("");
- psgItemClone.find("input[name='Ptype']").val("ADT");
- psgItemClone.find("select[name='docType']").val("NI");
- psgItemClone.find("input[name='docId']").val("");
- $(".cont-wrap").append(psgItemClone);
- });
- // 删除乘客信息
- $(".delPsg").click(function(){
- //第一条乘客信息中删除按钮禁用
- if($(".psg-item").length == 1){
- $(this).attr("disabled",true);
- }else{
- $(this).removeAttr("disabled");
- $(this).parents(".psg-item").remove();
- }
-
- });
- // 定义下单时需要的参数
- var psgList = new Array();
- var pname;
- var ptype;
- var docType;
- var docId;
- var birthDay;
- var psgItem;
- /*var depTime = data.attachment.depTime;
- var arrAirport = data.attachment.arrAirport;
- var cabin = data.attachment.cabin;
- var cabinClass = data.attachment.cabinClass;
- var cabinPrice = data.attachment.cabinPrice;
- var leg = data.attachment.leg;
- var depDate = data.attachment.depDate;
- var airLine = data.attachment.airLine;
- var flightNum = data.attachment.flightNum;
- var depAirport = data.attachment.depAirport;
- var arrTime = data.attachment.arrTime;
- var ticketPrice = data.attachment.ticketPrice;
- var amount = data.attachment.amount;
- var fee = data.attachment.fee;
- var tax = data.attachment.tax;*/
- $(".quick-buy").click(function(data){
- checkedInfo = $(".query-list tr.active").find(".infoId").html();
- // alert(checkedInfo);
- if($(".query-list tr.active").length < 1){
- var orderStr = '<li class="list-group-item" style="border: none;font-size: 16px;">请选择航班信息!</li>';
- var modHeader = '<h3 class="modal-title text-danger" id="gridSystemModalLabel">操作失败!</h3>';
- $(".modal-header button").next("h3").remove();
- $(".modal-header button").after(modHeader);
- $(".modal-footer .details").addClass("hide");
- $(".modal-body .list-group").html(orderStr);
- $('#orderinfoS').modal();
- return false;
- };
- //从身份证号中截取生日
-
- for(var i = 0;i < $(".psg-item").length;i++){
- pname = $(".psg-item").eq(i).find("input[name='Pname']").val();
- ptype = $(".psg-item").eq(i).find("select[name='Ptype']").val();
- docType = $(".psg-item").eq(i).find("select[name='docType']").val();
- docId = $(".psg-item").eq(i).find("input[name='docId']").val();
- birthDay = $(".psg-item").eq(i).find("input[name='birthDay']").val();
- psgItem = {
- "docType": docType,
- "docId": docId,
- "birthDay": birthDay,
- "Pname": pname,
- "ptype": ptype
- };
- psgList.push(psgItem);
- }
- function GetJsonData() {
- var orderParams = {
- "uname":uname,
- "token":token,
- /*"depTime":depTime,
- "arrAirport":arrAirport,
- "cabin":cabin,
- "cabinClass":cabinClass,
- "cabinPrice":cabinPrice,
- "leg":leg,
- "depDate":depDate,
- "airLine":airLine,
- "flightNum":flightNum,
- "depAirport":depAirport,
- "arrTime":arrTime,
- "ticketPrice":ticketPrice,
- "amount":amount,
- "fee":fee,
- "tax":tax,*/
- "infoId":checkedInfo,
- "passengers":psgList
- };
- return orderParams;
- };
- if(docId == "" || ptype == "" || docType == "" || birthDay == "" || pname == ""){
- var orderStr = '<li class="list-group-item" style="border: none;font-size: 16px;">请输入完整的乘机人信息!</li>';
- var modHeader = '<h3 class="modal-title text-danger" id="gridSystemModalLabel">操作失败!</h3>';
- $(".modal-header button").next("h3").remove();
- $(".modal-header button").after(modHeader);
- $(".modal-footer .details").addClass("hide");
- $(".modal-body .list-group").html(orderStr);
- $('#orderinfoS').modal();
- return false;
- };
- // CheckAdd();
- $.ajax({
- type:"POST",
- url:"http://114.55.6.23/jh/ticket/orderAndPayByParams",
- async:false,
- contentType: "application/json; charset=utf-8",
- data: JSON.stringify(GetJsonData()),
- dataType:"json",
- success:function(data){
- console.log(data);
- if(data.status == 200){
- var useOriginalPnr = "";
- if(data.attachment.useOriginalPnr){
- useOriginalPnr = "是";
- }else{
- useOriginalPnr = "否";
- }
-
- var orderStr = '<li class="list-group-item">淘宝订单号:'+data.attachment.orderid+'</li>'+
- '<li class="list-group-item">支付宝交易流水号:'+data.attachment.alipayTradeNo+'</li>'+
- '<li class="list-group-item">订单实际支付金额:'+data.attachment.totalMoney+'</li>'+
- '<li class="list-group-item">该单是否使用了原PNR出票:'+useOriginalPnr+'</li>';
- $(".modal-body .list-group").html(orderStr);
- $(".modal-footer .details").attr("href","order-details.html?Id="+data.attachment.orderid);
- $('#orderinfoS').modal();
- }else{
- var orderStr = '<li class="list-group-item">'+data.attachment+'</li>';
- var modHeader = '<h3 class="modal-title text-danger" id="gridSystemModalLabel">操作失败!</h3>';
- $(".modal-header button").after(modHeader);
- $(".modal-body .list-group").html(orderStr);
- $(".modal-footer .details").addClass("hide");
- $('#orderinfoS').modal();
- }
-
- },
- error:function(XMLHttpRequest, textStatus, errorThrown) {
- console.log(XMLHttpRequest.responseText);
- console.log(XMLHttpRequest.readyState);
- console.log(textStatus);
- alert("系统出问题啦o(╥﹏╥)o......");
- }
- });
- });
- }
-
- });
- });
- $('.modalClose').on('click',function(){
- window.history.go(0);
- })
- });
- </script>
- </body>
- </html>
|