334 lines
16 KiB
Vue
334 lines
16 KiB
Vue
<template>
|
|
<!DOCTYPE html>
|
|
<section class="content">
|
|
<div class="box box-primary">
|
|
<div class="box-body">
|
|
<section class="content-header">
|
|
<h1 id="itemTitle"></h1>
|
|
</section>
|
|
<div id="toolbar">
|
|
<div class="col-lg-12">
|
|
|
|
<div class="col-sm-3">
|
|
<label htmlFor="erbanNo" class="col-sm-4 control-label">族长音萌号:</label>
|
|
<div class="col-sm-8">
|
|
<input type="text" class="input-sm form-control" name="erbanNo" id="erbanNo"
|
|
placeholder="多个之间用,隔开">
|
|
</div>
|
|
</div>
|
|
|
|
<div class="col-sm-3">
|
|
<label htmlFor="clanId" class="col-sm-4 control-label">家族id:</label>
|
|
<div class="col-sm-8">
|
|
<input type="text" class="input-sm form-control" name="clanId" id="clanId"
|
|
placeholder="多个之间用,隔开">
|
|
</div>
|
|
</div>
|
|
|
|
<div class="col-sm-3">
|
|
<label class="col-sm-4 control-label">开始时间:</label>
|
|
<div class="col-sm-8">
|
|
<input type="text" class="input-sm datetime" name="queryStartDate" id="queryStartDate">
|
|
</div>
|
|
</div>
|
|
<div class="col-sm-3">
|
|
<label class="col-sm-4 control-label">结束时间:</label>
|
|
<div class="col-sm-8">
|
|
<input type="text" class="input-sm datetime" name="queryEndDate" id="queryEndDate">
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="col-sm-12">
|
|
<button class="btn btn-default js-quick-search js-quick-search-1 active" data-days="1">
|
|
昨天
|
|
</button>
|
|
<button class="btn btn-default js-quick-search js-quick-search-7" data-days="7">
|
|
最近7天
|
|
</button>
|
|
<button class="btn btn-default js-quick-search js-quick-search-30" data-days="30">
|
|
最近30天
|
|
</button>
|
|
</div>
|
|
<div class="col-sm-12">
|
|
<button id="btnSearch" class="btn btn-default">
|
|
<i class="glyphicon glyphicon-search"></i>查询
|
|
</button>
|
|
<button type="button" class="btn btn-primary" id="exportclanFlowstatsList">导出</button>
|
|
</div>
|
|
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<!-- .content -->
|
|
<div id="table"></div>
|
|
|
|
</div>
|
|
</section>
|
|
|
|
|
|
<!-- 详情弹窗列表 -->
|
|
<div class="modal fade" id="editModal" tabindex="-1" role="dialog" aria-labelledby="modalLabel">
|
|
<div class="modal-dialog" role="document">
|
|
<div class="modal-content">
|
|
<div class="modal-header">
|
|
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
|
|
aria-hidden="true">×</span>
|
|
</button>
|
|
<h4 class="modal-title" id="editModalLabel">流水详情</h4>
|
|
</div>
|
|
<form id="form" action="" method="post" target="_blank">
|
|
<input type="hidden" name="queryStartDate" id="queryStartDateExport">
|
|
<input type="hidden" name="queryEndDate" id="queryEndDateExport">
|
|
<input type="hidden" name="clanId" id="clanIdExport">
|
|
</form>
|
|
<div class="modal-body">
|
|
<div id="toolbar2">
|
|
<div class="col-sm-12">
|
|
<button id="flowDetailBtn" class="btn btn-sm btn-primary">总计导出</button>
|
|
<button id="flowDetailByDayBtn" class="btn btn-sm btn-primary">按天导出</button>
|
|
</div>
|
|
</div>
|
|
<div id="table2"></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
<script>
|
|
import TableHelper from '@/utils/bootstrap-table-helper';
|
|
import { formatTime, param } from '@/utils/maintainer';
|
|
|
|
export default {
|
|
name: "ClanFlowStatisAdminView",
|
|
setup() { },
|
|
created() {
|
|
this.$nextTick(function () {
|
|
this.initData();
|
|
});
|
|
},
|
|
methods: {
|
|
initData() {
|
|
$(function () {
|
|
let clanFlowstatsListQueryParams = {};
|
|
$('.datetime').datetimepicker({
|
|
format: 'yyyy-mm-dd 00:00:00',
|
|
autoclose: true
|
|
});
|
|
$("#queryStartDate").datetimepicker({
|
|
minView: "month",
|
|
language: 'zh-CN',
|
|
todayBtn: 1,
|
|
autoclose: 1
|
|
}).on("changeDate", function (event) {
|
|
$("#queryEndDate").datetimepicker('setStartDate', event.date);
|
|
});
|
|
$("#queryEndDate").datetimepicker({
|
|
minView: "month",
|
|
language: 'zh-CN',
|
|
todayBtn: 1,
|
|
autoclose: 1,
|
|
useCurrent: false
|
|
}).on("changeDate", function (event) {
|
|
$("#queryStartDate").datetimepicker('setEndDate', event.date);
|
|
});
|
|
initDefaultDate();
|
|
function initDefaultDate() {
|
|
var today = new Date();
|
|
today.setHours(0);
|
|
today.setMinutes(0);
|
|
today.setSeconds(0);
|
|
today.setMilliseconds(0);
|
|
var oneDay = 1000 * 24 * 60 * 60;
|
|
var startDate = new Date(today.getTime() - oneDay);
|
|
$('#queryStartDate').val(startDate.format("yyyy-MM-dd hh:mm:ss"));
|
|
$('#queryEndDate').val(today.format("yyyy-MM-dd hh:mm:ss"));
|
|
}
|
|
$('.js-quick-search').on('click', function () {
|
|
$('.js-quick-search').removeClass('active')
|
|
$(this).addClass('active');
|
|
setSearchTimeUseQuickWay($(this));
|
|
TableHelper.doRefresh('#table');
|
|
});
|
|
function setSearchTimeUseQuickWay(quickDom) {
|
|
const days = quickDom.attr("data-days");
|
|
const today = new Date(new Date().setHours(0, 0, 0, 0));
|
|
const todayStr = formatTime(today);
|
|
const startTime = formatTime(new Date(today.getTime() - days * 24 * 60 * 60 * 1000));
|
|
$('#queryStartDate').val(startTime);
|
|
$('#queryEndDate').val(todayStr);
|
|
}
|
|
buildTable();
|
|
// 列表设置
|
|
function buildTable() {
|
|
$('#table').bootstrapTable('destroy');
|
|
// 清空分页组件的容器
|
|
$('.fixed-table-pagination').empty();
|
|
$('#table').bootstrapTable({
|
|
cache: false,
|
|
striped: true,
|
|
showRefresh: false,
|
|
pageSize: 10000,
|
|
pagination: true,
|
|
pageList: [50],
|
|
sidePagination: "server", //表示服务端请求
|
|
queryParamsType: "undefined",
|
|
queryParams: function queryParams(params) {
|
|
var param = {
|
|
queryClanIdStr: $('#clanId').val(),
|
|
queryErbanNoStr: $('#erbanNo').val(),
|
|
queryStartDate: $('#queryStartDate').val(),
|
|
queryEndDate: $('#queryEndDate').val()
|
|
};
|
|
clanFlowstatsListQueryParams = param;
|
|
return param;
|
|
},
|
|
uniqueId: 'id',
|
|
toolbar: '#toolbar',
|
|
url: '/admin/clan/clanFlowstatsList.action',
|
|
onLoadSuccess: function (res) { //加载成功时执行
|
|
if (res.code == undefined || res.code === 200) {
|
|
console.log("加载成功!");
|
|
} else {
|
|
$("#tipMsg").text(res.message);
|
|
$("#tipModal").modal('show');
|
|
}
|
|
},
|
|
onLoadError: function (res) { //加载失败时执行
|
|
console.log("load fail");
|
|
},
|
|
columns: [
|
|
{ field: 'clanName', title: '家族名称', align: 'center', width: '5%' },
|
|
{ field: 'clanErbanNo', title: '族长音萌号', align: 'center', width: '5%' },
|
|
{ field: 'clanElderNick', title: '族长昵称', align: 'center', width: '5%' },
|
|
{ field: 'clanId', title: '家族id', align: 'center', width: '10%' },
|
|
{ field: 'roomIncome', title: '房间总流水', align: 'center', width: '10%' },
|
|
{ field: 'bagIncome', title: '背包礼物总流水', align: 'center', width: '10%' },
|
|
{ field: 'normalGiftIncome', title: '普通礼物总流水', align: 'center', width: '10%' },
|
|
{ field: 'giftUv', title: '送礼人数', align: 'center', width: '10%' },
|
|
{ field: 'newUserSendGiftNum', title: '新用户送礼人数', align: 'center', width: '10%' },
|
|
{ field: 'validNum', title: '有效上档主播', align: 'center', width: '10%' },
|
|
{ field: 'queryTime', title: '流水统计时间', align: 'center', width: '10%' },
|
|
{
|
|
field: 'clanId',
|
|
title: '备注',
|
|
align: 'center',
|
|
width: '10%',
|
|
formatter: function (val) {
|
|
console.log("clanId = " + val);
|
|
return '<button id="btnEdit" name="btnEdit" class="btn btn-sm btn-success opt-edit" data-id=' + val + '>' +
|
|
'<i class="glyphicon glyphicon-edit"></i>详情</button>';
|
|
}
|
|
}
|
|
]
|
|
});
|
|
}
|
|
// 查询刷新
|
|
$('#btnSearch').on('click', function () {
|
|
TableHelper.doRefresh('#table');
|
|
});
|
|
// 详情列表信息
|
|
$("#table").on("click", '.opt-edit', function () {
|
|
let clanId = $(this).attr("data-id");
|
|
$('#table2').bootstrapTable('destroy');
|
|
// 清空分页组件的容器
|
|
$('.fixed-table-pagination').empty();
|
|
$('#table2').bootstrapTable({
|
|
columns: [
|
|
{ field: 'clanName', title: '家族名称', align: 'center', width: '5%' },
|
|
{ field: 'clanErbanNo', title: '家族音萌号', align: 'center', width: '5%' },
|
|
{ field: 'clanId', title: '家族id', align: 'center', width: '5%' },
|
|
{ field: 'roomTitle', title: '房间名称', align: 'center', width: '5%' },
|
|
{ field: 'roomErbanNo', title: '房主音萌号', align: 'center', width: '5%' },
|
|
{ field: 'roomIncome', title: '房间流水', align: 'center', width: '5%' },
|
|
{ field: 'bagIncome', title: '背包流水', align: 'center', width: '5%' },
|
|
{ field: 'normalGiftIncome', title: '普通礼物流水', align: 'center', width: '5%' },
|
|
{ field: 'intoRoomNum', title: '进房人数', align: 'center', width: '5%' },
|
|
{ field: 'sendUserNum', title: '送礼人数', align: 'center', width: '5%' },
|
|
{ field: 'intoRoomNewUserNum', title: '进房新用户数', align: 'center', width: '5%' },
|
|
{ field: 'sendNewUserNum', title: '新用户送礼人数', align: 'center', width: '5%' },
|
|
{ field: 'newUserSendGiftGold', title: '新用户送礼总额', align: 'center', width: '5%' },
|
|
{ field: 'openRoomTime', title: '开厅时长', align: 'center', width: '5%' },
|
|
{ field: 'validNum', title: '有效主播数量', align: 'center', width: '5%' },
|
|
{ field: 'newUserNextKeepNum', title: '新用户进房次留', align: 'center', width: '5%' },
|
|
],
|
|
//undefinedText: "0",
|
|
cache: false,
|
|
striped: true,
|
|
showRefresh: false,
|
|
pageSize: 20,
|
|
pageList: [20, 50, 100],
|
|
pagination: true,
|
|
//search: false,
|
|
sidePagination: "server", //表示服务端请求
|
|
queryParamsType: "undefined",
|
|
queryParams: function queryParams(params) { //设置查询参数
|
|
var param = {
|
|
clanId: clanId,
|
|
queryStartDate: $('#queryStartDate').val(),
|
|
queryEndDate: $('#queryEndDate').val()
|
|
};
|
|
return param;
|
|
},
|
|
uniqueId: 'id',
|
|
toolbar: '#toolbar2',
|
|
url: '/admin/clan/clanFlowDetailList.action',
|
|
onLoadSuccess: function (res) { //加载成功时执行
|
|
console.log("加载成功!");
|
|
$("#editModal").modal('show');
|
|
$('#clanIdExport').val(clanId);
|
|
},
|
|
onLoadError: function (res) { //加载失败时执行
|
|
console.log("load fail");
|
|
}
|
|
});
|
|
})
|
|
// 总计导出
|
|
$('#flowDetailBtn').on('click', function () {
|
|
var form = $("#form");
|
|
form.attr("action", "/admin/clan/exportFlowDetail.action");
|
|
$('#queryStartDateExport').val($('#queryStartDate').val());
|
|
$('#queryEndDateExport').val($('#queryEndDate').val());
|
|
form.submit();
|
|
})
|
|
// 按天导出
|
|
$('#flowDetailByDayBtn').on('click', function () {
|
|
var form = $("#form");
|
|
form.attr("action", "/admin/clan/exportFlowDetailByDay.action");
|
|
$('#queryStartDateExport').val($('#queryStartDate').val());
|
|
$('#queryEndDateExport').val($('#queryEndDate').val());
|
|
form.submit();
|
|
})
|
|
$("#exportclanFlowstatsList").on("click", function () {
|
|
window.location.href = `/admin/clan/exportclanFlowstatsList?${param(clanFlowstatsListQueryParams)}`
|
|
});
|
|
});
|
|
}
|
|
}
|
|
};
|
|
</script>
|
|
|
|
<style scoped>
|
|
.control-label {
|
|
padding-right: 0;
|
|
margin-right: 0;
|
|
}
|
|
|
|
.col-sm-3 {
|
|
padding-right: 0;
|
|
padding-left: 0;
|
|
}
|
|
|
|
.col-sm-8 {
|
|
padding-right: 0;
|
|
padding-left: 0;
|
|
}
|
|
|
|
#editModal .modal-dialog {
|
|
width: 1200px;
|
|
height: 80%;
|
|
}
|
|
</style>
|