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.
 
 
 
 

70 rivejä
2.7 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. window.onload = function () {
  10. tr_order_str = $('#123').prop('outerHTML'); //获取tr中所有的字符串
  11. getAllSelector();
  12. getLogInfo();
  13. }
  14. function getAllSelector() {
  15. var hotel_id = getPar('hotel_id');
  16. var apiurl = base_api + "?type=log_LogLogInformation&name=getAllSelector&hotel_id=" + hotel_id;
  17. ZZLog(apiurl);
  18. $.getJSON(apiurl, function (res_data) {
  19. ZZLog(res_data);
  20. var area_list = res_data['result'];
  21. //alert(area_list);
  22. var areaHTML = '<option value="0" selected="selected" style="font-size: 12px;">全部</option>';
  23. for (var i = 0, m = area_list.length; i < m; i++) {
  24. var tempDict = area_list[i];
  25. var tempHTML = '<option value="0" style="font-size: 12px;">全部</option>';
  26. tempHTML = tempHTML.replace('全部', tempDict['user_name']);
  27. tempHTML = tempHTML.replace('value="0"', 'value=' + tempDict['id']);
  28. areaHTML += tempHTML;
  29. }
  30. $('#operator').html(areaHTML);
  31. })
  32. }
  33. function getLogInfo() {
  34. var name = "getLogInfo";
  35. var operator = $('#operator').val();
  36. var startDate = $('#start_date').val();
  37. var hotel_id = getPar('hotel_id');
  38. var endDate = $('#end_date').val();
  39. var apiurl = base_api + "?type=log_LogLogInformation&name=" + name + "&hotel_id=" + hotel_id + "&operator=" + operator + "&startDate=" + startDate + "&endDate=" + endDate;
  40. ZZLog(apiurl);
  41. $.getJSON(apiurl, function (res_data) {
  42. ZZLog(res_data);
  43. // if (res_data['code'] != "0") {
  44. // alert(res_data['info']);
  45. // } else {
  46. //地区
  47. //alert(1);
  48. var area_list = res_data['result'];
  49. //alert(area_list);
  50. var areaHTML = '';
  51. for (var i = 0, m = area_list.length; i < m; i++) {
  52. var tempDict = area_list[i];
  53. var tempHTML = tr_order_str;
  54. tempHTML = tempHTML.replace('湖景大床房', tempDict['room_name'] !== null ? tempDict['room_name'] : '-');
  55. tempHTML = tempHTML.replace('操作人', tempDict['user_name'] !== null ? tempDict['user_name'] : '-');
  56. tempHTML = tempHTML.replace('操作时间', tempDict['create_time'] !== null ? tempDict['create_time'] : '-');
  57. tempHTML = tempHTML.replace('操作内容', tempDict['log_desc'] !== null ? tempDict['log_desc'] : '-');
  58. areaHTML += tempHTML;
  59. }
  60. //alert(1);
  61. $('#tableOrder').html(areaHTML);
  62. // }
  63. })
  64. }