|
- /**
- * Created by luocj on 2016/11/23.
- */
- var order_id = getPar('order_id');
- var tr = $('.order_list').prop('outerHTML');
- window.onload = function () {
- getHotelDetail();
- downBookingRecord()
- };
- function getHotelDetail() {
- var param = {
- type: 'order_OutHotelOrderList',
- op: 'getOrderDetail',
- order_id: order_id
- };
- $.ajax({
- data: param,
- url: base_api,
- dataType: 'json',
- type: 'post',
- success: function (res_data) {
- ZZLog(res_data);
- setDataBody(res_data);
- },
- error: function (e) {
- ZZAlertInfo(e)
- }
- })
- }
- function setDataBody(res_data) {
- //替换上左
- $('#order_id').text('订 单 号: '+order_id);
- if (res_data['order_status']==148 || res_data['order_status']==383){
- $('#order_status').text('已取消');
- }else if(res_data['order_status']==313){
- $('#order_status').text('待发单');
- }else if(res_data['order_status']==198) {
- $('#order_status').text('待确认');
- }else if(res_data['order_status']==314) {
- $('#order_status').text('已安排');
- }else if(res_data['order_status']==147) {
- $('#order_status').text('已完成');
- }
- if (res_data['order_confirm']!==null){
- $('#make_sure_num').text('酒店确认号:'+res_data['order_confirm']);
- }else {
- $('#make_sure_num').text('');
- }
- //替换下方预订信息
- $('#hotel_name').text(res_data['parent_prod_name']);
- $('#product_name').text(res_data['prod_name']);
- $('#start_date').text(res_data['prod_start_station_date']);
- $('#end_date').text(res_data['prod_end_station_date']);
- $('#datediff').text('共 ' + res_data['sum_night'] + ' 晚');
- $('#time').text(res_data['child_detail'][0]['run_time']);
- $('#contacts').text(res_data['customer_name']);
- $('#phone').text(res_data['customer_mobile']);
- var customer_memo = res_data['customer_memo'];
- var notes = customer_memo.split('||');
- var user_org_id = getCookie('user_org_id');
- $.each(notes, function (key, item) {
- if(item != ''){
- var tmp = item.split('|');
- var div_note = '<div style="margin-top: 20px" class="note"><span style="width: 70px;display: inline-block"></span>';
- var note = '';
-
- note += ' <label id="contacts" type="text" >'+ tmp[3]+'</label>';
- if(user_org_id == 0 || tmp[2] == 0){
- if(key == 0){
- $(".note").append(note);
- }
- else{
-
- $(".note:last").after(div_note+ note + '</div>');
- }
- }
- }
- })
- //订单详情
- var sum = '';
- var sum_price = 0;
- for (var i=0;i<res_data['child_detail'].length;i++){
- var HTML = tr;
- var dict =res_data['child_detail'][i];
- HTML = HTML.replace('[入住日期]',dict['run_date']);
- HTML = HTML.replace('[数量]',dict['num']);
- HTML = HTML.replace('[结算价]',dict['base_price']);
- HTML = HTML.replace('[结算价总额]',dict['total']);
- sum+=HTML;
- sum_price+=parseInt(dict['total']);
- }
- $('#make_order_list').html(sum);
- $('#benefit').text(sum_price);
- //end 替换下方预订信息
- //替换右上方状态栏
- for (var j=0;j<res_data['order_status_detail'].length;j++){
- var dict_name = res_data['order_status_detail'][j]['order_status_name'];
- var dict_time = res_data['order_status_detail'][j]['create_time'];
- if (dict_name=='待发单'){
- $('#step1').addClass('active');
- $('#step2').addClass('active');
- $('#create_date').text(dict_time);
- $('#pay_date').text(dict_time);
- }else if (dict_name=='待确认'){
- $('#step3').addClass('active');
- $('#send_date').text(dict_time);
- }else if (dict_name=='已安排'){
- $('#step4').addClass('active');
- $('#arr_date').text(dict_time);
- }else if (dict_name=='已完成'){
- $('#step5').addClass('active');
- $('#finish_date').text(dict_time);
- }else if (dict_name=='已取消'){
- $('#step3').hide();
- $('#step4').hide();
- $('#step5').addClass('active');
- $('#may_cancel').text('已取消');
- $('#finish_date').text(dict_time);
- }
- }
- }
- //点击下载附件
- function downBookingRecord() {
- $('#down_record').on('click', function () {
- window.location.href = "/zz-jd/st-ht/HTcontrol.php?type=order_ModifyHTOrder&op=export&order_id=" + order_id;
- })
- }
|