You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

128 lines
4.5 KiB

  1. /**
  2. * Created by luocj on 2016/11/23.
  3. */
  4. var order_id = getPar('order_id');
  5. var tr = $('.order_list').prop('outerHTML');
  6. window.onload = function () {
  7. getHotelDetail();
  8. downBookingRecord()
  9. };
  10. function getHotelDetail() {
  11. var param = {
  12. type: 'order_OutHotelOrderList',
  13. op: 'getOrderDetail',
  14. order_id: order_id
  15. };
  16. $.ajax({
  17. data: param,
  18. url: base_api,
  19. dataType: 'json',
  20. type: 'post',
  21. success: function (res_data) {
  22. ZZLog(res_data);
  23. setDataBody(res_data);
  24. },
  25. error: function (e) {
  26. ZZAlertInfo(e)
  27. }
  28. })
  29. }
  30. function setDataBody(res_data) {
  31. //替换上左
  32. $('#order_id').text('订 单 号: '+order_id);
  33. if (res_data['order_status']==148 || res_data['order_status']==383){
  34. $('#order_status').text('已取消');
  35. }else if(res_data['order_status']==313){
  36. $('#order_status').text('待发单');
  37. }else if(res_data['order_status']==198) {
  38. $('#order_status').text('待确认');
  39. }else if(res_data['order_status']==314) {
  40. $('#order_status').text('已安排');
  41. }else if(res_data['order_status']==147) {
  42. $('#order_status').text('已完成');
  43. }
  44. if (res_data['order_confirm']!==null){
  45. $('#make_sure_num').text('酒店确认号:'+res_data['order_confirm']);
  46. }else {
  47. $('#make_sure_num').text('');
  48. }
  49. //替换下方预订信息
  50. $('#hotel_name').text(res_data['parent_prod_name']);
  51. $('#product_name').text(res_data['prod_name']);
  52. $('#start_date').text(res_data['prod_start_station_date']);
  53. $('#end_date').text(res_data['prod_end_station_date']);
  54. $('#datediff').text('共 ' + res_data['sum_night'] + ' 晚');
  55. $('#time').text(res_data['child_detail'][0]['run_time']);
  56. $('#contacts').text(res_data['customer_name']);
  57. $('#phone').text(res_data['customer_mobile']);
  58. var customer_memo = res_data['customer_memo'];
  59. var notes = customer_memo.split('||');
  60. var user_org_id = getCookie('user_org_id');
  61. $.each(notes, function (key, item) {
  62. if(item != ''){
  63. var tmp = item.split('|');
  64. var div_note = '<div style="margin-top: 20px" class="note"><span style="width: 70px;display: inline-block"></span>';
  65. var note = '';
  66. note += ' <label id="contacts" type="text" >'+ tmp[3]+'</label>';
  67. if(user_org_id == 0 || tmp[2] == 0){
  68. if(key == 0){
  69. $(".note").append(note);
  70. }
  71. else{
  72. $(".note:last").after(div_note+ note + '</div>');
  73. }
  74. }
  75. }
  76. })
  77. //订单详情
  78. var sum = '';
  79. var sum_price = 0;
  80. for (var i=0;i<res_data['child_detail'].length;i++){
  81. var HTML = tr;
  82. var dict =res_data['child_detail'][i];
  83. HTML = HTML.replace('[入住日期]',dict['run_date']);
  84. HTML = HTML.replace('[数量]',dict['num']);
  85. HTML = HTML.replace('[结算价]',dict['base_price']);
  86. HTML = HTML.replace('[结算价总额]',dict['total']);
  87. sum+=HTML;
  88. sum_price+=parseInt(dict['total']);
  89. }
  90. $('#make_order_list').html(sum);
  91. $('#benefit').text(sum_price);
  92. //end 替换下方预订信息
  93. //替换右上方状态栏
  94. for (var j=0;j<res_data['order_status_detail'].length;j++){
  95. var dict_name = res_data['order_status_detail'][j]['order_status_name'];
  96. var dict_time = res_data['order_status_detail'][j]['create_time'];
  97. if (dict_name=='待发单'){
  98. $('#step1').addClass('active');
  99. $('#step2').addClass('active');
  100. $('#create_date').text(dict_time);
  101. $('#pay_date').text(dict_time);
  102. }else if (dict_name=='待确认'){
  103. $('#step3').addClass('active');
  104. $('#send_date').text(dict_time);
  105. }else if (dict_name=='已安排'){
  106. $('#step4').addClass('active');
  107. $('#arr_date').text(dict_time);
  108. }else if (dict_name=='已完成'){
  109. $('#step5').addClass('active');
  110. $('#finish_date').text(dict_time);
  111. }else if (dict_name=='已取消'){
  112. $('#step3').hide();
  113. $('#step4').hide();
  114. $('#step5').addClass('active');
  115. $('#may_cancel').text('已取消');
  116. $('#finish_date').text(dict_time);
  117. }
  118. }
  119. }
  120. //点击下载附件
  121. function downBookingRecord() {
  122. $('#down_record').on('click', function () {
  123. window.location.href = "/zz-jd/st-ht/HTcontrol.php?type=order_ModifyHTOrder&op=export&order_id=" + order_id;
  124. })
  125. }