/** * Created by luocj on 2016/12/8. */ // var order_id = getPar('order_id'); // var order_id = getPar('org_id'); //order_id=" + order_id + "&order_status=" + order_status + "&org_id=" + org_id + "&hotel_id=" + hotel_id + "&org_name=" + getPar('org_name') + "&room_type=" + room_type1 var order_id = getPar('order_id'); var order_status = getPar('order_status'); var org_id = getPar('org_id'); var hotel_id = getPar('hotel_id'); var org_name = getPar('org_name'); var room_type1 = getPar('room_type'); var main_tr = $('.main_tr').prop('outerHTML'); var memo_tr = $('.memo_tr').prop('outerHTML'); var tr1 = $('.second_style').prop('outerHTML'); window.onload = function () { getOrderDetail(); getUpStatus(); downBookingRecord(); toOrderLog() }; //获取订单详情 function getOrderDetail() { if (order_id) { $.ajax({ url: base_api, type: 'post', dataType: 'json', data: { order_id: order_id, type: 'order_HotelOrderDetail' }, success: function (res_data) { ZZLog(res_data); if (res_data['order_id']) { setMainInfo(res_data); } else { return; } }, error: function (e) { ZZLog(e); } }) } } function setMainInfo(data) { $('#order_id').text('订单号:' + data['order_id']); $('#order_status').text(data['order_status_name']); if (data['order_confirm_code'] != null) { $('#make_sure_num').text('酒店确认号:' + data['order_confirm_code']); } $('#hotel_name').text(data['hotel_name']); $('#product_name').text(data['room_name']); $('#org_name_down').text(data['org_name']); $('#org_name').text('订单渠道:' + data['org_name']); $('#start_date').text(data['start_date']); $('#end_date').text(data['end_date']); $('#org_num').text(data['org_num']); $('#customer_name').text(data['customer_name']); $('#phone').text(data['customer_mobile']); //替换主表 var sumHTML = ''; for (var i = 0, m = data['one_day'].length; i < m; i++) { var dict = data['one_day'][i]; var HTML = main_tr; HTML = HTML.replace('[入住日期]', dict['start_date']); HTML = HTML.replace('[数量]', dict['count']); HTML = HTML.replace('[结算价]', parseFloat(dict['order_price'] / dict['count']).toFixed(2)); HTML = HTML.replace('[佣金]', parseFloat(dict['commission']).toFixed(2)); HTML = HTML.replace('[结算价总额]', parseFloat(dict['order_price']).toFixed(2)); HTML = HTML.replace('[销售利润]', parseFloat(dict['profit_value']).toFixed(2)); sumHTML += HTML; } $('#sum_price').text(data['all_price']); $('#sum_profit').text(data['all_profit']); $('#make_order_list').html(sumHTML); $('#main_table').show(); //替换备注 if (data['memo'].length>0){ var sumDownHTML = ''; for (var j = 0, n = data['memo'].length; j < n; j++) { var dict1 = data['memo'][j]; var HTML1 = memo_tr; if (dict1['memo_type'] == 0) { HTML1 = HTML1.replace('[备注类型]', '公共备注'); } else { HTML1 = HTML1.replace('[备注类型]', '内部备注'); } HTML1 = HTML1.replace('[备注内容]', dict1['memo_info']); if (dict1['user_name'] != '') { HTML1 = HTML1.replace('[备注人]', dict1['user_name']); } else { HTML1 = HTML1.replace('[备注人]', ''); } HTML1 = HTML1.replace('[备注时间]', getLocalTime(dict1['time'])); sumDownHTML += HTML1; } $('#memo_body').html(sumDownHTML); $('.note').show(); } var days = data.one_day.length; $('#datediff').html('共 ' + days + ' 晚'); } //获取上方状态栏 function getUpStatus() { if (order_id) { $.ajax({ url: base_api, type: 'post', dataType: 'json', data: { order_id: order_id, type: 'order_ModifyHTOrder', op: 'order_status' }, success: function (res_data) { ZZLog(res_data); if (res_data['order_status'].length>0){ for (var i = 0, m = res_data['order_status'].length;i