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.
 
 
 
 

91 lines
3.4 KiB

  1. //
  2. // 作者:fudr
  3. // 时间:2016-10-09
  4. // 描述:操作日志
  5. //
  6. $("#start_date").val(getDateTime(0, getLastWeek()));
  7. $("#end_date").val(getDateTime(0));
  8. var tr_order_str = ''; //订单列表de tr
  9. var order_id = getPar('order_id');
  10. var room_type = getPar('room_type');
  11. var refresh_flag = true;
  12. window.onload = function () {
  13. tr_order_str = $('#123').prop('outerHTML'); //获取tr中所有的字符串
  14. getAllSelector();
  15. getLogInfo();
  16. toOrderDetail()
  17. };
  18. function getAllSelector() {
  19. var apiurl = base_api + "?type=log_LogLogInformation&name=getAllSelector";
  20. ZZLog(apiurl);
  21. $.getJSON(apiurl, function (res_data) {
  22. ZZLog(res_data);
  23. var area_list = res_data['result'];
  24. //alert(area_list);
  25. var areaHTML = '<option value="0" selected="selected" style="font-size: 12px;">全部</option>';
  26. for (var i = 0, m = area_list.length; i < m; i++) {
  27. var tempDict = area_list[i];
  28. var tempHTML = '<option value="0" style="font-size: 12px;">全部</option>';
  29. tempHTML = tempHTML.replace('全部', tempDict['user_name']);
  30. tempHTML = tempHTML.replace('value="0"', 'value=' + tempDict['id']);
  31. areaHTML += tempHTML;
  32. }
  33. $('#operator').html(areaHTML);
  34. })
  35. }
  36. function getLogInfo() {
  37. var name = "getHotelDetail";
  38. var operator = $('#operator').val();
  39. if(refresh_flag){
  40. var startDate = "2016-01-01";
  41. var endDate = "2099-12-31";
  42. }else{
  43. var startDate = $('#start_date').val();
  44. var endDate = $('#end_date').val();
  45. }
  46. refresh_flag = false;
  47. order_id = getPar('order_id');
  48. var apiurl = base_api + "?type=log_LogLogInformation&name=" + name + "&operator=" + operator + "&startDate=" + startDate + "&endDate=" + endDate + "&order_id=" + order_id;
  49. ZZLog(apiurl);
  50. $.getJSON(apiurl, function (res_data) {
  51. ZZLog(res_data);
  52. // if (res_data['code'] != "0") {
  53. // alert(res_data['info']);
  54. // } else {
  55. //地区
  56. //alert(1);
  57. var area_list = res_data['result'];
  58. //alert(area_list);
  59. var areaHTML = '';
  60. for (var i = 0, m = area_list.length; i < m; i++) {
  61. var tempDict = area_list[i];
  62. var tempHTML = tr_order_str;
  63. if (tempDict['room_name'] === null) {
  64. tempHTML = tempHTML.replace('湖景大床房', "-");
  65. } else {
  66. tempHTML = tempHTML.replace('湖景大床房', tempDict['room_name']);
  67. }
  68. tempHTML = tempHTML.replace('操作人', tempDict['user_name']);
  69. tempHTML = tempHTML.replace('操作时间', tempDict['create_time']);
  70. tempHTML = tempHTML.replace('操作内容', tempDict['log_desc']);
  71. areaHTML += tempHTML;
  72. }
  73. //alert(1);
  74. $('#tableOrder').html(areaHTML);
  75. // }
  76. })
  77. }
  78. function toOrderDetail() {
  79. $('#detail').on('click', function () {
  80. var order_id = getPar('order_id');
  81. var order_status = getPar('order_status');
  82. var org_id = getPar('org_id');
  83. var hotel_id = getPar('hotel_id');
  84. var org_name = getPar('org_name');
  85. window.location.href = "./hotel_order_detail.html?order_id=" + order_id + "&order_status=" + order_status + "&org_id=" + org_id + "&hotel_id=" + hotel_id + "&org_name=" + org_name + "&room_type=" + room_type;
  86. })
  87. }