|  |  |  | 
|---|
|  |  |  | <div class="col-md-2 col-xs-12"> | 
|---|
|  |  |  | <!-- 功能按钮部分 --> | 
|---|
|  |  |  | <div class=""> | 
|---|
|  |  |  | <button onclick="setUserSales('1')" type="button" | 
|---|
|  |  |  | class="btn btn-success btn-sm" matrix:btn="shopUser-exchangeScore"> | 
|---|
|  |  |  | <i class="fa fa-plus"></i>设为销售员 | 
|---|
|  |  |  | </button> | 
|---|
|  |  |  | <button onclick="setUserSales('0')" type="button" | 
|---|
|  |  |  | class="btn btn-success btn-sm" matrix:btn="shopUser-exchangeScore"> | 
|---|
|  |  |  | <i class="fa fa-minus-square"></i> 解除销售员 | 
|---|
|  |  |  | </button> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | <div class="col-md-10 col-xs-12"> | 
|---|
|  |  |  | 
|---|
|  |  |  | function buildOperate(value, row, index){ | 
|---|
|  |  |  | var html = ""; | 
|---|
|  |  |  | html += '<div class="btn-group">' | 
|---|
|  |  |  | if (row.userVip == 1) { | 
|---|
|  |  |  | html += btns[0].replace('VALUE',value) | 
|---|
|  |  |  | html += btns[1].replace('VALUE',value) | 
|---|
|  |  |  | } | 
|---|
|  |  |  | html += '</div>'; | 
|---|
|  |  |  | return html; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | function exchangeScore(_userId) { | 
|---|
|  |  |  | layer.open({ | 
|---|
|  |  |  | type : 2, | 
|---|
|  |  |  | title : "兑换积分", | 
|---|
|  |  |  | area : [ MUI.SIZE_L, '400px' ], | 
|---|
|  |  |  | maxmin : true, | 
|---|
|  |  |  | content : [ basePath+'/admin/bizUserScore/intoExchangePage?userId=' + _userId] | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | function getScoreFlow(_userId) { | 
|---|
|  |  |  | layer.open({ | 
|---|
|  |  |  | type : 2, | 
|---|
|  |  |  | title : "积分流水", | 
|---|
|  |  |  | area : [ MUI.SIZE_L, '400px' ], | 
|---|
|  |  |  | maxmin : true, | 
|---|
|  |  |  | content : [ basePath+'/admin/redirect/shop/user-score-flow?userId=' + _userId] | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //设置用户销售员身份 | 
|---|
|  |  |  | function setUserSales(_status) { | 
|---|
|  |  |  |  | 
|---|
|  |  |  | var ids = myGrid.getSelectItemsIds("userId"); | 
|---|
|  |  |  | if(ids.length < 1){ | 
|---|
|  |  |  | layer.msg("请选择要操作的数据", { | 
|---|
|  |  |  | icon : 5 | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | return false; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | var url = basePath + "/admin/bizUser/setUserSales?ids=" + ids + "&status=" + _status; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if(_status == '1'){ | 
|---|
|  |  |  | MTools.handleItem(url,"确认要将这" + ids.split(",").length + "个用户设置为销售员吗?",function(){ | 
|---|
|  |  |  | myGrid.serchData(1) | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | MTools.handleItem(url,"确认要取消这" + ids.split(",").length + "个用户的销售员身份吗?",function(){ | 
|---|
|  |  |  | myGrid.serchData(1) | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | </script> | 
|---|
|  |  |  | <!--权限按钮--> | 
|---|
|  |  |  | <script matrix:btn="shopUser-exchangeScore"> | 
|---|
|  |  |  | btns[0] = '<button  type="button" class="btn btn-info mr10" onClick="exchangeScore(\'VALUE\')">兑换积分</button>' | 
|---|
|  |  |  | </script> | 
|---|
|  |  |  | <script matrix:btn="shopUser-scoreFlow"> | 
|---|
|  |  |  | btns[1] = '<button type="button" class="btn btn-primary ml10" onClick="getScoreFlow(\'VALUE\')">查看流水</button>' | 
|---|
|  |  |  | </script> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | </body> | 
|---|
|  |  |  | </html> | 
|---|