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.
 
 
 
 

63 regels
2.0 KiB

  1. //
  2. // 作者:fudr
  3. // 时间:2016-10-09
  4. // 描述:酒店日志
  5. //
  6. var tr_order_str = ''; //订单列表de tr
  7. window.onload = function() {
  8. tr_order_str = $('#123').prop('outerHTML'); //获取tr中所有的字符串
  9. getAllSelector();
  10. }
  11. function getAllSelector() {
  12. var apiurl = base_api + "?type=log_HotelLogLogInformation&name=getAllSelector";
  13. ZZLog(apiurl);
  14. $.getJSON(apiurl, function(res_data) {
  15. ZZLog(res_data);
  16. var area_list = res_data['result'];
  17. //alert(area_list);
  18. var areaHTML = '<option value="0" selected="selected" style="font-size: 12px;">全部</option>';
  19. for(var i = 0, m = area_list.length; i < m; i++) {
  20. var tempDict = area_list[i];
  21. var tempHTML = '<option value="0" style="font-size: 12px;">全部</option>';
  22. tempHTML = tempHTML.replace('全部', tempDict['user_name']);
  23. tempHTML = tempHTML.replace('value="0"', 'value=' + tempDict['id']);
  24. areaHTML += tempHTML;
  25. }
  26. $('#operator').html(areaHTML);
  27. })
  28. }
  29. function getLogInfo() {
  30. var name = "getLogInfo";
  31. var operator = $('#operator').val();
  32. var startDate = $('#start_date').val();
  33. var endDate = $('#end_date').val();
  34. var apiurl = base_api + "?type=log_HotelLogLogInformation&name=" + name + "&operator=" + operator + "&startDate=" + startDate + "&endDate=" + endDate;
  35. ZZLog(apiurl);
  36. $.getJSON(apiurl, function(res_data) {
  37. ZZLog(res_data);
  38. // if (res_data['code'] != "0") {
  39. // alert(res_data['info']);
  40. // } else {
  41. //地区
  42. //alert(1);
  43. var area_list = res_data['result'];
  44. //alert(area_list);
  45. var areaHTML = '';
  46. for(var i = 0, m = area_list.length; i < m; i++) {
  47. var tempDict = area_list[i];
  48. var tempHTML = tr_order_str;
  49. tempHTML = tempHTML.replace('操作人', tempDict['user_name']===null?tempDict['user_name']:'');
  50. tempHTML = tempHTML.replace('操作时间', tempDict['create_time']===null?tempDict['create_time']:'');
  51. tempHTML = tempHTML.replace('操作内容', tempDict['log_desc']===null?tempDict['log_desc']:'');
  52. areaHTML += tempHTML;
  53. }
  54. //alert(1);
  55. $('#tableOrder').html(areaHTML);
  56. // }
  57. })
  58. }