| <div class="layui-fluid layui-anim febs-anim" id="trader-profit" 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> | 
|                             </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="user-option"> | 
|     <span shiro:lacksPermission="user:view,user:update,user:delete"> | 
|         <span class="layui-badge-dot febs-bg-orange"></span> 无权限 | 
|     </span> | 
|     <a lay-event="edit" shiro:hasPermission="user:update"><i | 
|             class="layui-icon febs-edit-area febs-blue"></i></a> | 
| </script> | 
| <!-- 表格操作栏 end --> | 
| <script data-th-inline="none" type="text/javascript"> | 
|     // 引入组件并初始化 | 
|     layui.use([ 'jquery', 'form', 'table', 'febs'], function () { | 
|         var $ = layui.jquery, | 
|             febs = layui.febs, | 
|             form = layui.form, | 
|             table = layui.table, | 
|             $view = $('#trader-profit'), | 
|             $query = $view.find('#query'), | 
|             $reset = $view.find('#reset'), | 
|             $searchForm = $view.find('form'), | 
|             sortObject = {field: 'phone', type: null}, | 
|             tableIns; | 
|   | 
|         form.render(); | 
|   | 
|         // 表格初始化 | 
|         initTable(); | 
|   | 
|         // 初始化表格操作栏各个按钮功能 | 
|         table.on('tool(userTable)', function (obj) { | 
|             var data = obj.data, | 
|                 layEvent = obj.event; | 
|   | 
|             if (layEvent === 'edit') { | 
|                 febs.modal.open('交易员审核', 'modules/documentary/traderDetail/' + data.id, { | 
|                     btn: ['确认', '取消'], | 
|                     yes: function (index, layero) { | 
|                         $('#user-update').find('#submit').trigger('click'); | 
|                     }, | 
|                     btn2: function () { | 
|                         layer.closeAll(); | 
|                     } | 
|                 }); | 
|             } | 
|   | 
|             if (layEvent === 'seeFollowerInfo') { | 
|                 febs.modal.open('跟随者详情', 'modules/documentary/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(); | 
|             } | 
|             if (layEvent === 'modifyProfitRatio') { | 
|                 febs.modal.open('收益率修改', 'modules/documentary/modifyProfitRatio/' + data.id, { | 
|                     btn: ['确认', '取消'], | 
|                     yes: function (index, layero) { | 
|                         $('#user-update').find('#submit').trigger('click'); | 
|                     }, | 
|                     btn2: function () { | 
|                         layer.closeAll(); | 
|                     } | 
|                 }); | 
|                 $query.click(); | 
|             } | 
|             if (layEvent === 'getOut') { | 
|                 febs.modal.confirm('确认', '您是否要踢出该交易员?', function () { | 
|                     confirmUsers(data.id); | 
|                 }); | 
|             } | 
|             if (layEvent === 'getOn') { | 
|                 febs.modal.confirm('确认', '您是否推荐当前交易员?', function () { | 
|                     confirmUsersGetOn(data.id); | 
|                 }); | 
|             } | 
|             if (layEvent === 'getOutFrist') { | 
|                 febs.modal.confirm('确认', '您是否取消推荐当前交易员?', function () { | 
|                     confirmUsersGetOutFrist(data.id); | 
|                 }); | 
|             } | 
|             if (layEvent === 'getFull') { | 
|                 febs.modal.confirm('确认', '您是否要设置成【满员】状态?', function () { | 
|                     cancelUsers(data.id); | 
|                 }); | 
|             } | 
|         }); | 
|   | 
|         function confirmUsers(id) { | 
|             febs.get(ctx + 'documentary/traderGetOut/' + id, null, function () { | 
|                 febs.alert.success('踢出成功'); | 
|                 $query.click(); | 
|             }); | 
|         } | 
|         function confirmUsersGetOn(id) { | 
|             febs.get(ctx + 'documentary/traderGetOn/' + id, null, function () { | 
|                 febs.alert.success('设置成功'); | 
|                 $query.click(); | 
|             }); | 
|         } | 
|         function confirmUsersGetOutFrist(id) { | 
|             febs.get(ctx + 'documentary/traderGetOutFrist/' + id, null, function () { | 
|                 febs.alert.success('设置成功'); | 
|                 $query.click(); | 
|             }); | 
|         } | 
|         function cancelUsers(id) { | 
|             febs.get(ctx + 'documentary/traderGetFull/' + id, null, function () { | 
|                 febs.alert.success('设置成功'); | 
|                 $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(); | 
|             tableIns.reload({where: getQueryParams(), page: {curr: 1}}); | 
|         }); | 
|   | 
|         function initTable() { | 
|             tableIns = febs.table.init({ | 
|                 elem: $view.find('table'), | 
|                 id: 'userTable', | 
|                 url: ctx + 'documentary/traderProfitInfo', | 
|                 cols: [[ | 
|                     {field: 'phone', title: '手机号', minWidth: 100,align:'left'}, | 
|                     {field: 'realName', title: '姓名', minWidth: 100,align:'left'}, | 
|                     {field: 'inviteId', title: '邀请码UID', minWidth: 80,align:'center'}, | 
|                     {field: 'profitRatio', title: '利润率', minWidth: 80,align:'center'}, | 
|                     {field: 'profitRatioTotal', title: '总返利润', minWidth: 80,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'}, | 
|                     {field: 'totalProfitRatio', title: '累计收益率', minWidth: 80,align:'center'}, | 
|                     {field: 'totalProfit', title: '带单总收益', minWidth: 80,align:'center'}, | 
|                     {field: 'followerTotalProfit', title: '跟随者总收益', minWidth: 80,align:'center'}, | 
|                     {field: 'winRate', title: '胜率', minWidth: 80,align:'center'}, | 
|                     {field: 'totalFollowerCnt', title: '累计跟随人数', minWidth: 80,align:'center'}, | 
|                     {field: 'totalOrderCnt', title: '交易笔数', minWidth: 80,align:'center'}, | 
|                     {field: 'accountType', title: '账号类型', | 
|                         templet: function (d) { | 
|                             if (d.accountType === 2) { | 
|                                 return '<span style="color:green;">测试账号</span>' | 
|                             } else if (d.accountType === 1) { | 
|                                 return '<span style="color:red;">正常账号</span>' | 
|                             }else{ | 
|                                 return '' | 
|                             } | 
|                         }, minWidth: 80,align:'center'}, | 
|                     {field: 'email', title: '邮箱', minWidth: 100,align:'left'}, | 
|                 ]] | 
|             }); | 
|         } | 
|   | 
|         // 获取查询参数 | 
|         function getQueryParams() { | 
|             return { | 
|                 account: $searchForm.find('input[name="account"]').val().trim(), | 
|             }; | 
|         } | 
|   | 
|     }) | 
| </script> |