|
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <title>2.0系统</title>
- <link rel="stylesheet" href="css/font-awesome.min.css">
- <link rel="stylesheet" href="css/bootstrap.min.css">
- <link rel="stylesheet" href="css/ace.min.css">
- <link rel="stylesheet" href="css/master.css">
- <link rel="stylesheet" type="text/css" href="./css/bootstrap-timepicker.css" />
- <link rel="stylesheet" type="text/css" href="./css/daterangepicker.css" />
- <link rel="stylesheet" type="text/css" href="./css/datepicker.css" />
- <script src="js/jquery-2.2.4.min.js"></script>
- <script type="text/javascript" src="./js/date-time/bootstrap-datepicker.min.js"></script>
- <script type="text/javascript" src="./js/date-time/bootstrap-timepicker.min.js"></script>
-
- <script src="js/jquery.cookie.js"></script>
- <!--<script src="js/xm.js"></script>-->
- <!-- <script src="js/bootstrap.min.js"></script> -->
-
-
-
- <!--<script>
- login();
- </script>-->
-
- <style type="text/css">
- body{
- font-size:12px !important;
- background-color:#fff;
- }
- .padding{
- padding-bottom:10px;
- }
- .padding1{
- width:230px !important;
- }
- .gray{
- color:gray !important;
- }
- #sample-table-1 tbody td div:last-child{
- padding-bottom:0;
- }
- td,th{
- text-align:center;
- }
-
- </style>
- </head>
- <body>
- <!--<div class="navbar navbar-default" style="margin-bottom: 0px;">
- <div class="navbar-header ">
- <a href="#" class="navbar-brand">
- <i class="icon-leaf"></i>
- CS System<sub style="font-size:12px;position: initial;"> <span id="version_txt"></span></sub>
- </a>
- </div>
- </div>
-
- <div id="show_html" style="display:none;" class="warp clearfix">
- <div class="control-bar">
-
- </div>
- <div class="control-show" style="display:none;" id="xm_show">-->
- <div style="display:none;" id="xm_show">
- <div style="width:1200px; margin:40px 0 0 40px;" id="width">
- <div style="margin-bottom:10px;font-size:14px;">车票退改</div>
-
- <div class="row" style="margin-bottom:20px;">
- <div class="col-xs-12">
- <!-- PAGE CONTENT BEGINS -->
-
- <div class="row">
- <div class="col-xs-12">
- <div class="table-responsive">
- <table id="sample-table-2" class="table table-striped table-bordered">
- <thead>
- <tr style=" background: #fff;">
- <th>线路</th>
- <th>出发地</th>
- <th>目的地</th>
- <th>出发时间</th>
- <th>车号</th>
- <th>座位</th>
- <th>人群</th>
- <th>座号</th>
- <th>打印</th>
- <th>改签</th>
- <th>退票</th>
- <th>金额</th>
- <th>选择</th>
- </tr>
- </thead>
-
- </table>
- <div style="margin:0 0 10px 10px;"><b>现有票</b></div>
- <table id="sample-table-1" class="table table-striped table-bordered">
-
-
- <tbody>
- <tr>
- <td class="padding1">SHWZ - J01(上海 - 乌镇 - 萧山)</td>
- <td>上海(黄埔集散)</td>
- <td>乌镇(西栅牌坊)</td>
- <td>
- <div class="padding">2016.05.20 07:00</div>
- <div class="padding gray">2016.05.20 07:00</div>
- <div class="padding gray">2016.05.20 07:00</div>
- </td>
- <td>
- <div class="padding">01</div>
- <div class="padding gray">01</div>
- <div class="padding gray">01</div>
- </td>
- <td>
- <div class="padding">普通</div>
- <div class="padding gray">普通</div>
- <div class="padding gray">普通</div>
- </td>
- <td>
- <div class="padding">成人</div>
- <div class="padding gray">儿童</div>
- <div class="padding gray">儿童</div>
- </td>
- <td>
- <div class="padding ">02</div>
- <div class="padding gray ">03</div>
- <div class="padding gray ">03</div>
- </td>
- <td>
- <div class="padding">否</div>
- <div class="padding gray">是</div>
- <div class="padding gray">是</div>
- </td>
- <td>
- <div class="padding" id="xxc1_meal">否</div>
- <div class="padding gray" id="xxc2_meal">是</div>
- <div class="padding gray" id="xxc2_meal">是</div>
- </td>
- <td>
- <div class="padding" id="xxc1_bounce">已退票</div>
- <div class="padding gray" id="xxc2_bounce">-</div>
- <div class="padding gray" id="xxc2_bounce">-</div>
- </td>
- <td>
- <div class="padding" style="color:#FF9900;"><span style="font-family:Arial;">¥</span>120</div>
- <div class="padding gray">¥50</div>
- <div class="padding gray">¥50</div>
- </td>
- <td>
- <div class="padding"><input id="xxc1" type="radio" name="radio_exist" pid=0 onclick="checkBoxClick(this)" /></div>
- <div class="padding"><input id="xxc2" type="radio" name="radio_exist" pid=0 onclick="checkBoxClick(this)" /></div>
- <div class="padding"><input id="xxc2" type="radio" name="radio_exist" pid=0 onclick="checkBoxClick(this)" /></div>
-
- </td>
- </tr>
- <tr>
- <td class="">SHWZ - J01(上海 - 乌镇 - 萧山)</td>
-
- <td>上海(黄埔集散)</td>
- <td>乌镇(西栅牌坊)</td>
- <td>
- <div class="padding">2016.05.20 07:00</div>
- <div class="gray">2016.05.20 07:00</div>
- </td>
- <td>
- <div class="padding">01</div>
- <div class="gray">01</div>
- </td>
- <td>
- <div class="padding">普通</div>
- <div class="gray">普通</div>
- </td>
- <td>
- <div class="padding">成人</div>
- <div class="gray">儿童</div>
- </td>
- <td>
- <div class="padding">2</div>
- <div class="gray">3</div>
- </td>
- <td>
- <div class="padding">否</div>
- <div class="gray">是</div>
- </td>
- <td>
- <div class="padding" id="xxc3_meal">是</div>
- <div class="gray" id="xxc4_meal">是</div>
- </td>
- <td>
- <div class="padding" id="xxc3_bounce">-</div>
- <div class="gray" id="xxc4_bounce">-</div>
- </td>
- <td>
- <div class="padding" style="color:#FF9900;">¥120</div>
- <div class="gray">¥50</div>
- </td>
- <td>
- <div><input id="xxc3" type="radio" name="radio_exist" pid=1 onclick="checkBoxClick(this)"/></div>
- <div><input id="xxc4" type="radio" name="radio_exist" pid=1 onclick="checkBoxClick(this)"/></div>
- </td>
- </tr>
-
-
- </tbody>
- </table>
- <div>
- <button class="btn btn-white" style="padding:2px 0;font-size:12px;margin-left:10px;float:right;width:70px;" id="bounce">退票</button>
- <button class="btn btn-white" style="padding:2px 0;font-size:12px; float:right;width:70px;" id="meal">改签</button>
- </div>
-
-
- <div style="clear:both;"></div>
- <div id="meal_tickets">
- <div style="margin:0 0 10px 10px;"><b>改签票</b></div>
- <input id="meal_tickets_order_id" type="hidden">
- <input id="meal_tickets_run_id" type="hidden">
- <table id="sample-table-3" class="table table-striped table-bordered">
-
-
- <tbody>
- <tr>
- <td>SHWZ - J01(上海 - 乌镇 - 萧山)</td>
- <td>上海(黄埔集散)</td>
- <td>乌镇(西栅牌坊)</td>
- <td>
- <div class="padding">2016.05.20 07:00</div>
-
- </td>
- <td>
- <div class="padding">01</div>
-
- </td>
- <td>
- <div class="padding">普通</div>
-
- </td>
- <td>
- <div class="padding">成人</div>
-
- </td>
- <td>
- <div class="padding">2</div>
-
- </td>
- <td>
- <div class="padding">否</div>
-
- </td>
- <td>
- <div class="padding">是</div>
-
- </td>
- <td>
- <div class="padding">-</div>
-
- </td>
- <td>
- <div class="padding" style="color:#FF9900;"><span style="font-family:Arial;">¥</span>120</div>
-
- </td>
- <td>
- <div><input id="xxca1" type="checkbox" name="radio_meal" pid=0 onclick="checkBoxClick1(this)" /></div>
- </td>
- </tr>
-
-
- </tbody>
- </table>
- <div>
- <button class="btn btn-white" style="padding:2px 0;font-size:12px;margin-left:10px;float:right;width:70px;" id="cancel_meal">取消</button>
- <button class="btn btn-white" style="padding:2px 0;font-size:12px; float:right;width:70px;" id="confirm_meal">确认改签</button>
- </div>
- </div>
- </div><!-- /.table-responsive -->
-
- </div><!-- /span -->
- </div><!-- /row -->
- <!--</div>--><!-- /.col -->
- </div><!-- /.row -->
-
-
- <div id="choice_tickets" style="bottom:0;position:absolute;left:235px;">
- <div class="widget-main" style="border:1px solid #ccc;" >
- <div style="margin-bottom:40px;height:30px;line-height:30px;">
- <div style="float:left;">出发日期:</div>
- <div class="col-sm-2" style="float:left;">
- <div class="input-group">
- <input type="text" data-date-format="dd-mm-yyyy" id="id-date-picker-1" class="form-control date-picker">
- <span class="input-group-addon">
- <i class="icon-calendar bigger-110"></i>
- </span>
- </div>
- </div>
- <div style="float:left;">
- <button class="btn btn-white" style="padding:2px 0;font-size:12px;margin:0 10px;width:70px;" id="prev_day">前一天</button>
- <button class="btn btn-white" style="padding:2px 0;font-size:12px;width:70px;" id="next_day">后一天</button>
- <button class="btn btn-white" style="padding:2px 0;font-size:12px;background-color:#ebebeb !important;margin-left:20px;width:70px;" id="search">查询</button>
- </div>
- <div class="widget-toolbar">
- <a data-action="close" onclick="choiceClose()" style="cursor: pointer;" >
- <i class="icon-remove"></i>
- </a>
- </div>
- </div>
-
-
- <div class="row" style="margin-bottom:20px;">
- <div class="col-xs-12">
- <!-- PAGE CONTENT BEGINS -->
- <div class="row">
- <div class="col-xs-12">
- <div class="table-responsive">
- <input id="xm_prod_id" type="hidden">
- <input id="xm_parent_prod_id" type="hidden">
- <input id="xm_order_id" type="hidden">
- <input id="xm_up_station_id" type="hidden">
- <input id="xm_down_station_id" type="hidden">
- <table id="sample-table-4" class="table table-striped table-bordered">
-
- <thead>
- <tr style=" background: #fff;">
-
- <th>出发地</th>
- <th>目的地</th>
- <th>线路</th>
- <th>出发日期</th>
- <th>出发站</th>
- <th>到达站</th>
- <th>座位</th>
- <th>人群</th>
- <th>价格</th>
- <th>库存</th>
- <th>操作</th>
-
- </tr>
- </thead>
-
- <tbody>
- <tr>
-
- <td>上海(黄埔集散)</td>
- <td>乌镇(西栅牌坊)</td>
- <td>SHWZ - J01(上海 - 乌镇 - 萧山)</td>
- <td>2016.05.20 07:00</td>
- <td>
- <select>
- <option value ="volvo">黄埔集散(07:30)</option>
- <option value ="volvo">黄埔集散(08:30)</option>
- <option value ="volvo">黄埔集散(09:30)</option>
- <option value ="volvo">黄埔集散(10:30)</option>
-
- </select>
- </td>
- <td>
- <select>
- <option value ="volvo">东栏牌坊(07:30)</option>
- <option value ="volvo">东栏牌坊(08:30)</option>
- <option value ="volvo">东栏牌坊(09:30)</option>
- <option value ="volvo">东栏牌坊(10:30)</option>
-
- </select>
- </td>
- <td>
- <div class="padding">普通</div>
- <!-- <div class="gray">贵宾</div> -->
- </td>
- <td>
- <div class="padding">成人</div>
- <!-- <div class="gray">成人</div> -->
- </td>
- <td>
- <div class="padding" style="color:#FF9900;"><span style="font-family:Arial;">¥</span>120</div>
- <!-- <div class="gray">¥128</div> -->
- </td>
- <td>
- <div class="padding">10</div>
- <!-- <div class="gray">2</div> -->
- </td>
- <td>
- <div class="padding"><button style="border:none;background:none;" onclick="choice_button()" id="aaa">选择</button></div>
- <!-- <div class="gray"><button style="border:none;background:none;" disabled="disabled">选择</button></div> -->
- </td>
-
- </tr>
-
- </tbody>
- </table>
- </div><!-- /.table-responsive -->
-
- </div><!-- /span -->
- </div><!-- /row -->
- </div><!-- /.col -->
- </div><!-- /.row -->
- </div>
- </div>
- </div>
-
- </div>
- </div>
- <script type="text/javascript">
- $('.date-picker').datepicker({
- autoclose:true,
- format:'yyyy-mm-dd',
- language: 'zh-CN'
- }).next().on("click", function(){$(this).prev().focus();});
- var orderid=getQueryString("order_id");
- if(orderid !=''){
- var ticket=ticketExist();
- if(ticket.code==0){
- $(function(){
- $("input:radio").attr("checked",false);
- $("input:checkbox").attr("checked",false);
- $("#bounce").attr("disabled","disabled");
- $("#meal").attr("disabled","disabled");
- $("#meal_tickets").css("display","none");
- $("#choice_tickets").css("display","none");
- //var screenWidth = $(window).width();//获取屏幕可视区域的宽度。
- var screenWidth = $("#width").width();//获取屏幕可视区域的宽度。
- //var screenWidth = '1200px';//获取屏幕可视区域的宽度。
- $("#choice_tickets").width(screenWidth);//将宽度赋值给bottomDiv使其可以贯穿整个屏幕。
- var screenHeight = $(window).height();//获取屏幕可视区域的高度。
- var divHeight = $("#choice_tickets").height() + 1;//bottomDiv的高度再加上它一像素的边框。
- $(window).scroll(function(){
- var scrollHeight = $(document).scrollTop();//获取滚动条滚动的高度。
- if(!window.XMLHttpRequest){
- $("#choice_tickets").css("top",screenHeight + scrollHeight - divHeight);
- }//判断是否为IE6,如果是,执行大括号中内容
- });
- var tab1_width = $("#sample-table-1 tr:first td").length
- for(i=0;i<tab1_width;i++)
- {
- $("#sample-table-2 tr:first th").eq(i).width($("#sample-table-1 tr:first td").eq(i).width());
- }
- });
-
- }else{
- alert("单号错误");
- $('#xm_show').html("");
- }
- }else{
- alert('请传入正确参数');
- $('#xm_show').html("");
- }
-
- $("#meal").click(function(){
- $("#sample-table-1 input[name='radio_exist']").each(function(){
- if(this.checked==true){
- meal_order_id=$(this).attr("order_id");
- meal_prod_id=$(this).attr("prod_id");
- meal_parent_prod_id=$(this).attr("parent_prod_id");
- meal_up_id=$(this).attr("up_station_id");
- meal_down_id=$(this).attr("down_station_id");
- var mydate = new Date();
-
- var month=mydate.getMonth()+1;
- var day= mydate.getDate();
- if(month<10){
- month="0"+month;
- }
- if(day<10){
- day="0"+day;
- }
- meal_date = mydate.getFullYear() + "-"+month+"-"+day;
- meal_date = '2016-08-08';
- $('#xm_prod_id').val(meal_prod_id);
- $('#xm_parent_prod_id').val(meal_parent_prod_id);
- $('#xm_order_id').val(meal_order_id);
- $('#xm_up_station_id').val(meal_up_id);
- $('#xm_down_station_id').val(meal_down_id);
-
- }
- });
- $.ajax({
- url: "./st-xm/Api/change_back.php", //请求地址
- type: "get", //请求方式
- data: { prodid: meal_prod_id,method:"meal",meal_date:meal_date,meal_up_id:meal_up_id,meal_down_id:meal_down_id }, //请求参数
- async:false,
- dataType: "json",
- success: function (response) {
- if(response.errcode==0){
- //alert("改签成功");
- //window.location.href=window.location.href;
-
- var order_no=response.order_no;
- var line_info=response.line_info;
- //alert(line_info);
- var insertTable="";
- insertTable+="<tr id='copy'><td>"+line_info.start_area+"</td><td>"+line_info.end_area+"</td><td>"+line_info.line_code+'('+line_info.line_name+')'+"</td><td>"+line_info.start_time+"</td>";
- var departure_station='';
- var destination_station='';
- for(var item1 in line_info.departure_station){
- departure_station+="<option value ='"+item1+"'>"+line_info.departure_station[item1]+"</option>";
- }
- for(var item1 in line_info.destination_station){
- destination_station+="<option value ='"+item1+"'>"+line_info.destination_station[item1]+"</option>";
- }
- insertTable+="<td><select id='select_start_station' onChange='getEndStation();'>"+departure_station+"</select></td><td><select id='select_end_station' onChange='getStartStation();'>"+destination_station+"</select></td><td>"+line_info.seat+"</td><td>"+line_info.ticket_name+"</td><td><span style='color:#FF9900;font-family:Arial;'>¥"+line_info.price+"</span></td><td>"+line_info.in_stock+"</td><td><button style='border:none;background:none;' onclick='choice_button()' id='aaa'>选择</button></td></tr>";
-
- //insertTable+="<tr style='border-top:1px solid #797979;'><td colspan='10'></td><td>总额</td><td style='color:#FF9900;'><span style='font-family:Arial;'>¥</span>"+jieguo.total_rmb+"</td></tr>";
- //console.log(insertTable);
- $('#sample-table-4 tbody').html(insertTable);
- $('#sample-table-4 tbody').css("display","table-row-group");
- }else{
-
- $('#sample-table-4 tbody').css('display',"none");
- $('#sample-table-4 tbody').html('');
- alert("该日期下没有可改签的票");
- }
- },
- fail: function (status) {
- // 此处放失败后执行的代码
- }
- });
-
- $('#id-date-picker-1').val(meal_date);
- $('#choice_tickets').css('display','block');
-
- });
- $("#bounce").click(function(){
- $.ajax({
- url: "./json/change_back.php", //请求地址
- type: "POST", //请求方式
- data: { orderid: orderid,method:"bounce" }, //请求参数
- async:false,
- dataType: "json",
- success: function (response) {
- if(response.errcode==0){
- alert("退票成功");
- //window.location.href=window.location.href;
- ticketExist();
- }
- },
- fail: function (status) {
- // 此处放失败后执行的代码
- }
- });
- });
- $('#confirm_meal').click(function(){
- var status =$('#meal_tickets input:checkbox').attr("checked");
- if(status !="checked"){
- alert("未选择无法改签");
- }else{
- $.ajax({
- url: "./json/change_back.php", //请求地址
- type: "POST", //请求方式
- data: { orderid: orderid,method:"confirm_meal" }, //请求参数
- async:false,
- dataType: "json",
- success: function (response) {
- if(response.errcode==0){
- alert(response.errinfo);
- //window.location.href=window.location.href;
- //ticketExist();
- }
- },
- fail: function (status) {
- // 此处放失败后执行的代码
- }
- });
- }
- //alert(status);
- });
-
-
- $('#cancel_meal').click(function(){
- var checkboxObj=$('#meal_tickets input:checkbox');
- var status =checkboxObj.attr("checked");
- if(status !="checked"){
- alert("未选择无法取消");
- }else{
- checkboxObj.attr("checked",false);
- $('#meal_tickets').css("display","none");
- }
-
- });
- $('#search').click(function(){
- $("#sample-table-1 input[name='radio_exist']").each(function(){
- if(this.checked==true){
- meal_order_id=$(this).attr("order_id");
- meal_prod_id=$(this).attr("prod_id");
- meal_parent_prod_id=$(this).attr("parent_prod_id");
- meal_up_id=$(this).attr("up_station_id");
- meal_down_id=$(this).attr("down_station_id");
- meal_date =$('#id-date-picker-1').val();;
- //meal_date = '2016-08-08';
- $('#xm_prod_id').val(meal_prod_id);
- $('#xm_parent_prod_id').val(meal_parent_prod_id);
- $('#xm_order_id').val(meal_order_id);
- $('#xm_up_station_id').val(meal_up_id);
- $('#xm_down_station_id').val(meal_down_id);
-
- }
- });
-
- $.ajax({
- url: "./st-xm/Api/change_back.php", //请求地址
- type: "get", //请求方式
- data: {prodid: meal_prod_id,method:"meal",meal_date:meal_date,meal_up_id:meal_up_id,meal_down_id:meal_down_id }, //请求参数
- async:false,
- dataType: "json",
- success: function (response) {
-
- if(response.errcode==0){
-
- var order_no=response.order_no;
- var line_info=response.line_info;
- //alert(line_info);
- var insertTable="";
- insertTable+="<tr id='copy'><td>"+line_info.start_area+"</td><td>"+line_info.end_area+"</td><td>"+line_info.line_code+'('+line_info.line_name+')'+"</td><td>"+line_info.start_time+"</td>";
- var departure_station='';
- var destination_station='';
- for(var item1 in line_info.departure_station){
- departure_station+="<option value ='"+item1+"'>"+line_info.departure_station[item1]+"</option>";
- }
- for(var item1 in line_info.destination_station){
- destination_station+="<option value ='"+item1+"'>"+line_info.destination_station[item1]+"</option>";
- }
- insertTable+="<td><select id='select_start_station' onChange='getEndStation();'>"+departure_station+"</select></td><td><select id='select_end_station' onChange='getStartStation();'>"+destination_station+"</select></td><td>"+line_info.seat+"</td><td>"+line_info.ticket_name+"</td><td><span style='color:#FF9900;font-family:Arial;'>¥"+line_info.price+"</span></td><td>"+line_info.in_stock+"</td><td><button style='border:none;background:none;' onclick='choice_button()' id='aaa'>选择</button></td></tr>";
-
- //insertTable+="<tr style='border-top:1px solid #797979;'><td colspan='10'></td><td>总额</td><td style='color:#FF9900;'><span style='font-family:Arial;'>¥</span>"+jieguo.total_rmb+"</td></tr>";
- //console.log(insertTable);
- $('#sample-table-4 tbody').css("display","table-row-group");
- $('#sample-table-4 tbody').html(insertTable);
- }else{
- $('#sample-table-4 tbody').css('display',"none");
- $('#meal_tickets').css('display',"none");
- $('#sample-table-4 tbody').html('');
- $('#sample-table-3 tbody').html('');
- alert("该日期下没有可改签的票");
- }
- },
- fail: function (status) {
- // 此处放失败后执行的代码
- }
- });
- });
-
- $('#prev_day').click(function(){
-
-
- var date=$('#id-date-picker-1').val();
- if(date ==0){
- alert("日期不能为空");
- return;
- }
- var dateTime=date.split("-");
- var today=new Date(dateTime); //月份为0-11
- // var today=new Date(2006,0,12); //月份为0-11
-
- var yesterday_milliseconds=today.getTime()-1000*60*60*24;
- var yesterday=new Date();
- yesterday.setTime(yesterday_milliseconds);
-
- var strYear=yesterday.getFullYear();
- var strDay=yesterday.getDate();
- var strMonth=yesterday.getMonth()+1;
- if(strDay<10){
- strDay="0"+strDay;
- }
- if(strMonth<10)
- {
- strMonth="0"+strMonth;
- }
- var strYesterday=strYear+"-"+strMonth+"-"+strDay;
- $('#id-date-picker-1').val(strYesterday);
- });
- $('#next_day').click(function(){
- var date=$('#id-date-picker-1').val();
- if(date ==0){
- alert("日期不能为空");
- return;
- }
- var dateTime=date.split("-");
- var today=new Date(dateTime); //月份为0-11
- // var today=new Date(2006,0,12); //月份为0-11
- var yesterday_milliseconds=today.getTime()+1000*60*60*24;
- var yesterday=new Date();
- yesterday.setTime(yesterday_milliseconds);
-
- var strYear=yesterday.getFullYear();
- var strDay=yesterday.getDate();
- var strMonth=yesterday.getMonth()+1;
- if(strDay<10){
- strDay="0"+strDay;
- }
- if(strMonth<10)
- {
- strMonth="0"+strMonth;
- }
- var strYesterday=strYear+"-"+strMonth+"-"+strDay;
- $('#id-date-picker-1').val(strYesterday);
-
- });
-
- function ticketExist(){
-
- //var status=getQueryString("status");
- $.ajax({
- url: "./st-xm/Api/change_back.php", //请求地址
- type: "get", //请求方式
- data: { orderid: orderid,method:"getticket" }, //请求参数
- async:false,
- dataType: "json",
- success: function (response) {
-
- jieguo =response;
- },
- fail: function (status) {
- // 此处放失败后执行的代码
- }
- });
- if(jieguo.code==0){
- var order_no=jieguo.order_no;
- var line_info=jieguo.line_info;
- var insertTable="";
- for(var item in line_info){
- insertTable+="<tr><td><a href='#'>"+line_info[item].line_code+"</a>"+line_info[item].line_name+"</td><td>"+line_info[item].start_area+"</td><td>"+line_info[item].end_area+"</td>";
- var start_time='';
- var car_number='';
- var seat='';
- var ticket_name='';
- var seat_number='';
- var if_print='';
- var if_meal='';
- var if_bounce='';
- var price='';
- var choice='';
- for(var item1 in line_info[item].tickets){
- (line_info[item].tickets[item1].if_print==0)?aif_print="否":aif_print="是";
- (line_info[item].tickets[item1].if_meal==0)?aif_meal="否":aif_meal="是";
- (line_info[item].tickets[item1].if_bounce==0)?aif_bounce="-":aif_bounce="已退票";
- var radioId="xm_radio_"+item+"_"+item1;
- if(line_info[item].tickets[item1].if_bounce !=0){
- start_time+="<div class='padding gray'>"+line_info[item].tickets[item1].start_time+"</div>";
- car_number+="<div class='padding gray'>"+line_info[item].tickets[item1].car_number+"</div>";
- seat+="<div class='padding gray'>"+line_info[item].tickets[item1].seat+"</div>";
- ticket_name+="<div class='padding gray'>"+line_info[item].tickets[item1].ticket_name+"</div>";
- seat_number+="<div class='padding gray'>"+line_info[item].tickets[item1].seat_number+"</div>";
- if_print+="<div class='padding gray'>"+aif_print+"</div>";
- if_meal+="<div id='"+radioId+"_meal' class='padding gray'>"+aif_meal+"</div>";
- if_bounce+="<div id='"+radioId+"_bounce' class='padding gray'>"+aif_bounce+"</div>";
- price+="<div class='padding gray' style='color:#FF9900;'><span style='font-family:Arial;'>¥</span>"+line_info[item].tickets[item1].price+"</div>";
- choice+="<div class='padding gray'><input type='radio' onclick='checkBoxClick(this)' order_id='"+line_info[item].tickets[item1].order_id+"' parent_prod_id='"+line_info[item].tickets[item1].parent_prod_id+"' prod_id='"+line_info[item].tickets[item1].prod_id+"' up_station_id='"+line_info[item].tickets[item1].up_station_id+"' down_station_id='"+line_info[item].tickets[item1].down_station_id+"' pid='0' name='radio_exist' id='"+radioId+"' disabled='disabled' style='margin:0;'></div>"
- }else{
- start_time+="<div class='padding'>"+line_info[item].tickets[item1].start_time+"</div>";
- car_number+="<div class='padding'>"+line_info[item].tickets[item1].car_number+"</div>";
- seat+="<div class='padding'>"+line_info[item].tickets[item1].seat+"</div>";
- ticket_name+="<div class='padding'>"+line_info[item].tickets[item1].ticket_name+"</div>";
- seat_number+="<div class='padding'>"+line_info[item].tickets[item1].seat_number+"</div>";
- if_print+="<div class='padding'>"+aif_print+"</div>";
- if_meal+="<div id='"+radioId+"_meal' class='padding'>"+aif_meal+"</div>";
- if_bounce+="<div id='"+radioId+"_bounce' class='padding'>"+aif_bounce+"</div>";
- price+="<div class='padding' style='color:#FF9900;'><span style='font-family:Arial;'>¥</span>"+line_info[item].tickets[item1].price+"</div>";
- choice+="<div class='padding'> <input type='radio' onclick='checkBoxClick(this)' order_id='"+line_info[item].tickets[item1].order_id+"' parent_prod_id='"+line_info[item].tickets[item1].parent_prod_id+"' prod_id='"+line_info[item].tickets[item1].prod_id+"' up_station_id='"+line_info[item].tickets[item1].up_station_id+"' down_station_id='"+line_info[item].tickets[item1].down_station_id+"' pid='0' name='radio_exist' id='"+radioId+"' style='margin:0;'></div>"
- }
- }
- insertTable+="<td>"+start_time+"</td><td>"+car_number+"</td><td>"+seat+"</td><td>"+ticket_name+"</td><td>"+seat_number+"</td><td>"+if_print+"</td><td>"+if_meal+"</td><td>"+if_bounce+"</td><td>"+price+"</td><td>"+choice+"</td></tr>";
- }
- //insertTable+="<tr style='border-top:1px solid #797979;'><td colspan='10'></td><td>总额</td><td style='color:#FF9900;'><span style='font-family:Arial;'>¥</span>"+jieguo.total_rmb+"</td></tr>";
- //console.log(insertTable);
- $('#sample-table-1 tbody').html(insertTable);
- $('#xm_show').css("display","block");
- }else{
- alert(jieguo.info);
- $('#xm_show').html("");
- }
- return jieguo;
- }
- function checkBoxClick(checkbox){
-
- if(checkbox.checked==true){
- var checkId=checkbox.id;
- if($("#"+checkId+"_meal").text()=='否'){
- $("#meal").attr("disabled",false);
- }else{
- $("#meal").attr("disabled","disabled");
- }
- //checkBoxObj.attr("checked","checked");
- //var pid=checkBoxObj.attr("pid");
-
-
- //$("#bounce").attr("disabled",false);
- if($("#"+checkId+"_bounce").text()=='-'){
- //$("#meal").attr("disabled",false);
- $("#bounce").attr("disabled",false);
- }else{
- $("#bounce").attr("disabled","disabled");
- }
-
-
- }
- }
- function checkBoxClick1(checkbox){
- var id=checkbox.id;
- //alert(id);
- if(checkbox.checked==true){
- //checkbox.setAttribute("checked","checked");
- $("#"+id).attr("checked","checked");
- }else{
- //checkbox.setAttribute("checked",false);
- $("#"+id).attr("checked",false);
- }
- }
- function choiceClose(){
- $('#choice_tickets').css('display','none');
- $('#meal_tickets').css("display","none");
- }
-
- function choice_button(){
- var start_area=$('#copy td:nth-child(1)').text();
- var end_area=$('#copy td:nth-child(2)').text();
- var line=$('#copy td:nth-child(3)').text();
- var start_date=$('#copy td:nth-child(4)').text();
- var start_up=$('#copy td:nth-child(5) select option:selected').text().split(" ");
- var start_date_time=start_date+' '+start_up[1];
-
- var seat_type=$('#copy td:nth-child(7)').text();
- var crowd=$('#copy td:nth-child(8)').text();
- var price=$('#copy td:nth-child(9)').text();
- var stock=$('#copy td:nth-child(10)').text();
- var xm_prod_id=$('#xm_prod_id').val();
- var xm_order_id=$('#xm_order_id').val();
- var xm_run_id=$('#copy td:nth-child(5) select option:selected').val();
- var insertTable="";
-
- insertTable+="<tr><td>"+line+"</td><td>"+start_area+"</td><td>"+end_area+"</td><td>"+start_date_time+"</td>";
- insertTable+="<td>"+seat_type+"</td><td>"+crowd+"</td><td>否</td><td>否</td><td>-</td><td><span style='color:#FF9900;font-family:Arial;'>"+price+"</span></td><td><input id='"+xm_prod_id+'-'+xm_order_id+"' type='checkbox' onclick='checkBoxClick1(this)'></td></tr>";
- $('#meal_tickets_order_id').val(xm_order_id);
- $('#meal_tickets_run_id').val(xm_run_id);
- $('#sample-table-3 tbody').html(insertTable);
-
- //$('#meal_tickets').css('display',"none");
- $('#meal_tickets').css("display","block");
-
- /* alert(start_area);
- alert(end_area);
- alert(line);
- alert(start_date);
- alert(seat_type);
- alert(crowd);
- alert(price);
- alert(stock); */
- //alert($('#copy td:nth-child(5) select').val());
- //alert($('#copy td:nth-child(5) select option:selected').text());
- /*
- var prod_id =$('#xm_prod_id').val();
- var parent_prod_id =$('#xm_parent_prod_id').val();
- $.ajax({
- url: "./st-xm/Api/change_back.php", //请求地址
- type: "get", //请求方式
- data: { prod_id: prod_id,method:"mealticket",parent_prod_id:parent_prod_id}, //请求参数
- async:false,
- dataType: "json",
- success: function (response) {
- if(response.errcode==0){
- var order_no=response.order_no;
- var line_info=response.line_info;
- var insertTable="";
- var checkboxId="xm_checkbox_0";
- (line_info.if_print==0)?aif_print="否":aif_print="是";
- (line_info.if_meal==0)?aif_meal="否":aif_meal="是";
- (line_info.if_bounce==0)?aif_bounce="-":aif_bounce="已退票";
- insertTable+="<tr><td>"+line_info.line_code+line_info.line_name+"</td><td>"+line_info.start_area+"</td><td>"+line_info.end_area+"</td><td>"+line_info.start_time+"</td>";
- insertTable+="<td>"+line_info.seat+"</td><td>"+line_info.ticket_name+"</td><td>"+aif_print+"</td><td>"+aif_meal+"</td><td>"+aif_bounce+"</td><td><span style='color:#FF9900;font-family:Arial;'>¥"+line_info.price+"</span></td><td><input id='"+checkboxId+"' type='checkbox' onclick='checkBoxClick1(this)'></td></tr>";
- //insertTable+="<tr style='border-top:1px solid #797979;'><td colspan='10'></td><td>总额</td><td style='color:#FF9900;'><span style='font-family:Arial;'>¥</span>"+jieguo.total_rmb+"</td></tr>";
- //console.log(insertTable);
- $('#sample-table-3 tbody').html(insertTable);
- }else{
- alert(response.info);
- $('#meal_tickets').html("");
- }
- },
- fail: function (status) {
- // 此处放失败后执行的代码
- }
- });
- $('#meal_tickets').css("display","block");*/
-
- }
- function getEndStation(){
- var x1=document.getElementById('select_start_station');
- var ops=x1.getElementsByTagName('option');
- var x2=document.getElementById('select_end_station');
- var ops2=x2.getElementsByTagName('option');
- for (var i = 0; i < ops.length; i++) {
- if (ops[i].selected==true) {
- ops2[i].selected=true;
- };
- };
- }
- function getStartStation(){
- var x1=document.getElementById('select_start_station');
- var ops=x1.getElementsByTagName('option');
- var x2=document.getElementById('select_end_station');
- var ops2=x2.getElementsByTagName('option');
- for (var i = 0; i < ops2.length; i++) {
- if (ops2[i].selected==true) {
- ops[i].selected=true;
- };
- };
- }
- function getQueryString(name) {
- var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
- var r = window.location.search.substr(1).match(reg);
- if (r != null) return unescape(r[2]); return '';
- }
- </script>
- </body>
- <!--<script src="js/master.js"></script> -->
- </html>
|