176 lines
8.5 KiB
Vue
176 lines
8.5 KiB
Vue
<template>
|
||
<section class="content">
|
||
<div class="box box-primary">
|
||
<div class="box-body">
|
||
<!-- Content Header (Page header) -->
|
||
<section class="content-header">
|
||
<h1 id="itemTitle"></h1>
|
||
</section>
|
||
<!-- .content -->
|
||
<div id="table"></div>
|
||
<div id="toolbar">
|
||
<form id="searchForm" action="/admin/gamePartner/order/orderExport" method="get" target="_blank">
|
||
<div class="col-sm-12">
|
||
<label for="fromErBanNo" class="col-sm-2 control-label">下单用户id:</label>
|
||
<div class="col-sm-2"><input type="text" class="form-control" name="fromErBanNo"
|
||
id="fromErBanNo"></div>
|
||
<label for="gameId" class="col-sm-2 control-label">下单游戏:</label>
|
||
<div class="col-sm-2">
|
||
<select name="gameId" id="gameId" data-btn-class="btn-warning" class="form-control">
|
||
<option value="" selected="selected">全部</option>
|
||
</select>
|
||
</div>
|
||
<label for="orderNo" class="col-sm-2 control-label">订单号:</label>
|
||
<div class="col-sm-2"><input type="text" class="form-control" name="orderNo" id="orderNo"></div>
|
||
</div>
|
||
<div class="col-sm-12">
|
||
<label for="startTime" class="col-sm-2 control-label">下单时间:</label>
|
||
<div class="col-sm-2"><input type="text" class="form-control" name="startTime" id="startTime">
|
||
</div>
|
||
<label for="endTime" class="col-sm-2 control-label">-</label>
|
||
<div class="col-sm-2"><input type="text" class="form-control" name="endTime" id="endTime"></div>
|
||
<label for="toErBanNo" class="col-sm-2 control-label">接单用户id:</label>
|
||
<div class="col-sm-2"><input type="text" class="form-control" name="toErBanNo" id="toErBanNo">
|
||
</div>
|
||
</div>
|
||
</form>
|
||
<button id="btnSearch" class="btn btn-default">
|
||
<i class="glyphicon glyphicon-search"></i>查询
|
||
</button>
|
||
<button id="btnExport" class="btn btn-default">
|
||
<i class="glyphicon glyphicon-export"></i>导出
|
||
</button>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</section>
|
||
|
||
<div class="modal fade" id="tipModal" tabindex="-1" role="dialog" aria-labelledby="modalLabel">
|
||
<div class="modal-dialog" role="document">
|
||
<div class="modal-content">
|
||
<div class="modal-header">
|
||
<h4 class="modal-title">提示信息</h4>
|
||
</div>
|
||
<div class="modal-body" id="tipMsg"></div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</template>
|
||
<script>
|
||
import TableHelper from '@/utils/bootstrap-table-helper';
|
||
export default {
|
||
name: "GamePartnerOrderView",
|
||
setup() { },
|
||
created() {
|
||
this.$nextTick(function () {
|
||
this.initData();
|
||
});
|
||
},
|
||
methods: {
|
||
initData() {
|
||
$(function () {
|
||
getGamePartnerInfo();
|
||
$('#table').bootstrapTable('destroy');
|
||
// 清空分页组件的容器
|
||
$('.fixed-table-pagination').empty();
|
||
$('#table').bootstrapTable({
|
||
columns: [
|
||
{ field: 'orderNo', title: '订单号', align: 'center', width: '5%' },
|
||
{ field: 'fromErBanNo', title: '下单用户id', align: 'center', width: '5%' },
|
||
{ field: 'fromNick', title: '下单用户昵称', align: 'center', width: '5%' },
|
||
{ field: 'toErBanNo', title: '接单用户id', align: 'center', width: '5%' },
|
||
{ field: 'toNick', title: '接单用户昵称', align: 'center', width: '5%' },
|
||
{ field: 'income', title: '接单用户收益(水晶)', align: 'center', width: '5%' },
|
||
{ field: 'gameName', title: '下单游戏', align: 'center', width: '5%' },
|
||
{ field: 'inning', title: '下单局数', align: 'center', width: '5%' },
|
||
{ field: 'amount', title: '下单金额', align: 'center', width: '5%' },
|
||
{ field: 'orderTime', title: '下单时间', align: 'center', width: '5%' },
|
||
],
|
||
cache: false,
|
||
striped: true,
|
||
showRefresh: false,
|
||
pageSize: 20,
|
||
pagination: true,
|
||
pageList: [20, 50, 100],
|
||
search: false,
|
||
sidePagination: "server", //表示服务端请求
|
||
//设置为undefined可以获取pageNumber,pageSize,searchText,sortName,sortOrder
|
||
//设置为limit可以获取limit, offset, search, sort, order
|
||
queryParamsType: "undefined",
|
||
queryParams: function queryParams(params) { //设置查询参数
|
||
var param = {
|
||
page: params.pageNumber,
|
||
pageSize: params.pageSize,
|
||
fromErBanNo: $('#fromErBanNo').val(),
|
||
toErBanNo: $('#toErBanNo').val(),
|
||
gameId: $('#gameId').val(),
|
||
orderNo: $('#orderNo').val(),
|
||
startTime: $('#startTime').val(),
|
||
endTime: $('#endTime').val(),
|
||
};
|
||
return param;
|
||
},
|
||
toolbar: '#toolbar',
|
||
url: '/admin/gamePartner/order/orderPage',
|
||
onLoadSuccess: function () { //加载成功时执行
|
||
console.log("load success");
|
||
},
|
||
onLoadError: function () { //加载失败时执行
|
||
console.log("load fail");
|
||
}
|
||
});
|
||
var picker1 = $("#startTime").datetimepicker({
|
||
format: 'yyyy-mm-dd hh:ii:00',
|
||
todayBtn: true,
|
||
autoclose: true,
|
||
});
|
||
var picker2 = $("#endTime").datetimepicker({
|
||
format: 'yyyy-mm-dd hh:ii:00',
|
||
todayBtn: true,
|
||
autoclose: true
|
||
});
|
||
picker1.on('changeDate', function () {
|
||
var date = $('#startTime').datepicker('getDate');
|
||
picker2.datepicker('setStartDate', date);
|
||
});
|
||
picker2.on('changeDate', function () {
|
||
var date = $('#endTime').datepicker('getDate');
|
||
picker1.datepicker('setEndDate', date);
|
||
});
|
||
//导出功能
|
||
$("#btnExport").on('click', function () {
|
||
$("#searchForm").submit();
|
||
});
|
||
// 查询刷新
|
||
$('#btnSearch').on('click', function () {
|
||
TableHelper.doRefresh('#table');
|
||
});
|
||
//游戏
|
||
function getGamePartnerInfo() {
|
||
var array;
|
||
$.ajax({
|
||
type: "get",
|
||
url: "/admin/gamePartner/info/listAll",
|
||
dataType: "json",
|
||
async: false,
|
||
success: function (json) {
|
||
if (json.success == 'true' || json.code == 200) {
|
||
array = json.data;
|
||
}
|
||
}
|
||
});
|
||
var $select = $('#gameId');
|
||
for (let i = 0; i < array.length; i++) {
|
||
var $option = $('<option value="' + array[i].gameId + '" />');
|
||
$option.html(array[i].gameName);
|
||
$select.append($option);
|
||
}
|
||
return array;
|
||
}
|
||
});
|
||
}
|
||
}
|
||
};
|
||
</script>
|
||
|