|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- //
- // 作者:fudr
- // 时间:2016-10-09
- // 描述:酒店日志
- //
- var tr_order_str = ''; //订单列表de tr
- window.onload = function() {
- tr_order_str = $('#123').prop('outerHTML'); //获取tr中所有的字符串
- getAllSelector();
- }
-
- function getAllSelector() {
- var apiurl = base_api + "?type=log_HotelLogLogInformation&name=getAllSelector";
- ZZLog(apiurl);
- $.getJSON(apiurl, function(res_data) {
- ZZLog(res_data);
- var area_list = res_data['result'];
- //alert(area_list);
- var areaHTML = '<option value="0" selected="selected" style="font-size: 12px;">全部</option>';
- for(var i = 0, m = area_list.length; i < m; i++) {
- var tempDict = area_list[i];
- var tempHTML = '<option value="0" style="font-size: 12px;">全部</option>';
- tempHTML = tempHTML.replace('全部', tempDict['user_name']);
- tempHTML = tempHTML.replace('value="0"', 'value=' + tempDict['id']);
- areaHTML += tempHTML;
- }
- $('#operator').html(areaHTML);
-
- })
- }
-
- function getLogInfo() {
- var name = "getLogInfo";
- var operator = $('#operator').val();
- var startDate = $('#start_date').val();
- var endDate = $('#end_date').val();
- var apiurl = base_api + "?type=log_HotelLogLogInformation&name=" + name + "&operator=" + operator + "&startDate=" + startDate + "&endDate=" + endDate;
-
- ZZLog(apiurl);
- $.getJSON(apiurl, function(res_data) {
- ZZLog(res_data);
- // if (res_data['code'] != "0") {
- // alert(res_data['info']);
- // } else {
- //地区
- //alert(1);
- var area_list = res_data['result'];
- //alert(area_list);
- var areaHTML = '';
- for(var i = 0, m = area_list.length; i < m; i++) {
- var tempDict = area_list[i];
- var tempHTML = tr_order_str;
- tempHTML = tempHTML.replace('操作人', tempDict['user_name']===null?tempDict['user_name']:'');
- tempHTML = tempHTML.replace('操作时间', tempDict['create_time']===null?tempDict['create_time']:'');
- tempHTML = tempHTML.replace('操作内容', tempDict['log_desc']===null?tempDict['log_desc']:'');
- areaHTML += tempHTML;
- }
- //alert(1);
- $('#tableOrder').html(areaHTML);
-
- // }
- })
- }
|