<div class="layui-fluid layui-anim febs-anim" id="febs-user" lay-title="跟单分红">
|
<div class="layui-row febs-container">
|
<div class="layui-col-md12">
|
<div class="layui-card">
|
<div class="layui-card-body febs-table-full">
|
<form class="layui-form layui-table-form" lay-filter="user-table-form">
|
<div class="layui-row">
|
<div class="layui-col-md10">
|
<div class="layui-form-item">
|
<div class="layui-inline">
|
<div class="layui-input-inline">
|
<input type="text" placeholder="手机号/邮箱/邀请码" name="account"
|
autocomplete="off" class="layui-input">
|
</div>
|
</div>
|
<div class="layui-inline">
|
<div class="layui-input-inline">
|
<input type="text" placeholder="上级UID" name="refererId"
|
autocomplete="off" class="layui-input">
|
</div>
|
</div>
|
<div class="layui-inline">
|
<div class="layui-input-block">
|
<input type="radio" name="timeType" value="1" title="今日">
|
<input type="radio" name="timeType" value="2" title="昨日">
|
<input type="radio" name="timeType" value="3" title="本周">
|
<input type="radio" name="timeType" value="4" title="本月">
|
</div>
|
</div>
|
</div>
|
</div>
|
<div class="layui-col-md2 layui-col-sm12 layui-col-xs12 table-action-area">
|
<div class="layui-btn layui-btn-sm layui-btn-primary febs-button-blue-plain table-action"
|
id="query">
|
<i class="layui-icon"></i>
|
</div>
|
<div class="layui-btn layui-btn-sm layui-btn-primary febs-button-green-plain table-action"
|
id="reset">
|
<i class="layui-icon"></i>
|
</div>
|
</div>
|
</div>
|
</form>
|
<table lay-filter="userTable" lay-data="{id: 'userTable'}"></table>
|
</div>
|
</div>
|
</div>
|
</div>
|
</div>
|
<!-- 表格字段状态格式化 start -->
|
<script type="text/html" id="open-type">
|
{{#
|
var openType = {
|
1: {title: '开多', color : 'blue'},
|
2: {title: '开空', color : 'red'},
|
3: {title: '平多', color : 'blue'},
|
4: {title: '平空', color : 'red'}
|
}[d.orderType];
|
}}
|
<span class="layui-badge febs-bg-{{openType.color}}">{{ openType.title }}</span>
|
</script>
|
<script type="text/html" id="closing-type">
|
{{#
|
var closingType = {
|
0: {title: '-'},
|
2: {title: '平多'},
|
3: {title: '平空'},
|
4: {title: '爆仓平多'},
|
5: {title: '爆仓平空'},
|
6: {title: '止盈平多'},
|
7: {title: '止盈平空'},
|
8: {title: '止损平多'},
|
9: {title: '止损平空'},
|
}[d.closingType];
|
}}
|
<span>{{ closingType.title }}</span>
|
</script>
|
|
<script type="text/html" id="contract-type">
|
{{#
|
var contractType = {
|
1: {title: '普通合约'},
|
2: {title: '跟单合约'},
|
}[d.contractType];
|
}}
|
<span>{{ contractType.title }}</span>
|
</script>
|
<script type="text/html" id="loseOrProfit">
|
{{# if(d.orderType == 3 || d.orderType == 4){ }}
|
{{# if(d.rewardAmount >= 0){ }}
|
<span style="color: green">{{ d.rewardAmount }}</span>
|
{{# } else { }}
|
<span style="color: red">{{ d.rewardAmount }}</span>
|
{{# } }}
|
{{# } }}
|
</script>
|
<!-- 表格字段状态格式化 start -->
|
|
<script data-th-inline="none" type="text/javascript">
|
// 引入组件并初始化
|
layui.use(['dropdown', 'jquery', 'laydate', 'form', 'table', 'febs', 'treeSelect'], function () {
|
var $ = layui.jquery,
|
laydate = layui.laydate,
|
febs = layui.febs,
|
form = layui.form,
|
table = layui.table,
|
$view = $('#febs-user'),
|
$query = $view.find('#query'),
|
$reset = $view.find('#reset'),
|
$searchForm = $view.find('form'),
|
sortObject = {field: 'createTime', type: null},
|
tableIns,
|
timeType;
|
|
form.render();
|
|
// 表格初始化
|
initTable();
|
// 初始化表格操作栏各个按钮功能
|
table.on('tool(userTable)', function (obj) {
|
var data = obj.data,
|
layEvent = obj.event;
|
if (layEvent === 'seeFollowerInfo') {
|
febs.modal.open('跟单分红', 'contract/seeFollowerInfo/' + data.id, {
|
area: $(window).width() <= 750 ? '90%' : '80%',
|
offset: '30px',
|
btn2: function () {
|
layer.closeAll();
|
},
|
cancel: function(){
|
var index=parent.layer.getFrameIndex(window.name); //获取当前窗口的name
|
parent.layer.close(index);//关闭当前窗口
|
window.parent.location.reload();//刷新
|
}
|
});
|
$query.click();
|
}
|
});
|
|
// 查询按钮
|
$query.on('click', function () {
|
var params = $.extend(getQueryParams(), {field: sortObject.field, order: sortObject.type});
|
tableIns.reload({where: params, page: {curr: 1}});
|
});
|
|
// 刷新按钮
|
$reset.on('click', function () {
|
$searchForm[0].reset();
|
sortObject.type = 'null';
|
timeType = null;
|
tableIns.reload({where: getQueryParams(), page: {curr: 1}, initSort: sortObject});
|
});
|
|
function initTable() {
|
tableIns = febs.table.init({
|
elem: $view.find('table'),
|
id: 'userTable',
|
url: ctx + 'order/getHistoryDocumentaryList',
|
cols: [[
|
{type: 'checkbox'},
|
{field: 'orderNo', title: '订单编号', minWidth: 180, align: 'center'},
|
{field: 'symbol', title: '合约名称', minWidth: 100, align: 'center'},
|
{title: '跟单分红',
|
templet: function (d) {
|
return '<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="seeFollowerInfo" shiro:hasPermission="user:update">查看</button>'
|
}, minWidth: 100,align:'center'},
|
{ title: '合约类型', templet: '#contract-type', minWidth: 100, align: 'center'},
|
{field: 'refererId', title: '上级UID', minWidth: 100, align: 'center'},
|
{field: 'name', title: '姓名', minWidth: 130, align: 'center'},
|
{field: 'phone', title: '联系方式', minWidth: 130, align: 'center'},
|
{field: 'email', title: '邮箱', minWidth: 140, align: 'center'},
|
{title: '开仓类型', templet: '#open-type', minWidth: 100, align: 'center'},
|
{field: 'entrustPrice', title: '委托价', minWidth: 100, align: 'center'},
|
{field: 'openingPrice', title: '开仓价', minWidth: 130, align: 'center'},
|
{field: 'openingFeeAmount', title: '开仓手续费', minWidth: 130, align: 'center'},
|
{field: 'openingTime', title: '开仓时间', minWidth: 180, align: 'center'},
|
{field: 'bondAmount', title: '保证金', minWidth: 120, align: 'center'},
|
{field: 'symbolCnt', title: '成交量', minWidth: 100, align: 'center'},
|
{field: 'stopProfitPrice', title: '止盈', minWidth: 100, align: 'center'},
|
{field: 'stopLossPrice', title: '止损', minWidth: 120, align: 'center'},
|
{field: 'holdAmount', title: '持仓费', minWidth: 140, align: 'center'},
|
{templet: '#loseOrProfit', title: '平仓盈亏', minWidth: 140, align: 'center'},
|
{field: 'closingPrice', title: '平仓价', minWidth: 140, align: 'center'},
|
{field: 'closingFeeAmount', title: '平仓手续费', minWidth: 140, align: 'center'},
|
{ title: '平仓类型', templet: '#closing-type', minWidth: 100, align: 'center'},
|
{field: 'closingTime', title: '平仓时间', minWidth: 180, align: 'center'},
|
]]
|
});
|
}
|
|
// 获取查询参数
|
function getQueryParams() {
|
var type = $searchForm.find('input[name="timeType"]:checked').val();
|
if (type) {
|
timeType = type;
|
}
|
return {
|
timeType : timeType,
|
name: $searchForm.find('input[name="account"]').val().trim(),
|
refererId: $searchForm.find('input[name="refererId"]').val().trim(),
|
invalidate_ie_cache: new Date()
|
};
|
}
|
})
|
</script>
|