|
- //
- // 作者:fudr
- // 时间:2016-10-09
- // 描述:操作日志
- //
-
- $("#start_date").val(getDateTime(0, getLastWeek()));
- $("#end_date").val(getDateTime(0));
- var tr_order_str = ''; //订单列表de tr
- window.onload = function () {
- tr_order_str = $('#123').prop('outerHTML'); //获取tr中所有的字符串
- getAllSelector();
- getLogInfo();
- }
-
- function getAllSelector() {
- var hotel_id = getPar('hotel_id');
- var apiurl = base_api + "?type=log_LogLogInformation&name=getAllSelector&hotel_id=" + hotel_id;
- 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 hotel_id = getPar('hotel_id');
- var endDate = $('#end_date').val();
- var apiurl = base_api + "?type=log_LogLogInformation&name=" + name + "&hotel_id=" + hotel_id + "&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['room_name'] !== null ? tempDict['room_name'] : '-');
- 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);
-
- // }
- })
- }
|