Commit eda976fb authored by agping's avatar agping

解绑

parent 298f47ae
...@@ -458,6 +458,7 @@ ...@@ -458,6 +458,7 @@
<div class="modal-body"> <div class="modal-body">
<form class="form-horizontal"> <form class="form-horizontal">
<div class="form-group"> <div class="form-group">
<button type="button" class="btn btn-primary del-record" style="margin: 6px;">清空解绑设备记录</button>
<table class="table table-striped table-bordered table-hover table-condensed"> <table class="table table-striped table-bordered table-hover table-condensed">
<thead> <thead>
<tr> <tr>
......
...@@ -134,6 +134,9 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'text!temp/phoneBinding_temp ...@@ -134,6 +134,9 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'text!temp/phoneBinding_temp
agent.agent_id = $(this).attr("data-id"); agent.agent_id = $(this).attr("data-id");
agent.getPhoneBindingList(browser_version); agent.getPhoneBindingList(browser_version);
}); });
$(document).on("click", ".del-record", function() { //点击绑定电脑(清除绑定)
agent.getPhoneBindingDelList();
});
$(document).on("click", ".pc-bundling", function() { //点击绑定电脑 $(document).on("click", ".pc-bundling", function() { //点击绑定电脑
agent.agent_id = $(this).attr("data-id"); agent.agent_id = $(this).attr("data-id");
agent.getPcBindingList(); agent.getPcBindingList();
...@@ -883,6 +886,27 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'text!temp/phoneBinding_temp ...@@ -883,6 +886,27 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'text!temp/phoneBinding_temp
} }
}) })
}, },
//手机绑定权限(清除绑定)
getPhoneBindingDelList: function(pageNo) {
var params = {};
params.agent_id = agent.agent_id;
$.ajax({
url: '/index/deviceList', //电脑绑定权限
type: 'GET',
async: true,
data: params,
dataType: 'json',
success: function(data) {
var temp = document.getElementById('phone_del_binding_tpl').innerHTML;
var doTempl = doT.template(temp);
$("#agent_phone_binding").html(doTempl(data.data));
console.log(555)
/*分页代码*/
add_page(data.data.total, pageNo, agent.pageSize, agent.getList);
$('.J_preview').preview();
}
})
},
//电脑绑定权限 //电脑绑定权限
getPcBindingList: function(pageNo) { getPcBindingList: function(pageNo) {
var params = {}; var params = {};
...@@ -896,13 +920,14 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'text!temp/phoneBinding_temp ...@@ -896,13 +920,14 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'text!temp/phoneBinding_temp
success: function(data) { success: function(data) {
var temp = document.getElementById('pc_binding_tpl').innerHTML; var temp = document.getElementById('pc_binding_tpl').innerHTML;
var doTempl = doT.template(temp); var doTempl = doT.template(temp);
$("#agent_pc_binding").html(doTempl(data.data)); // $("#agent_pc_binding").html(doTempl(data.data));
/*分页代码*/ /*分页代码*/
add_page(data.data.total, pageNo, agent.pageSize, agent.getList); add_page(data.data.total, pageNo, agent.pageSize, agent.getList);
$('.J_preview').preview(); $('.J_preview').preview();
} }
}) })
}, },
//记录状态 //记录状态
stateRecordList: function(pageNo) { stateRecordList: function(pageNo) {
var params = {}; var params = {};
......
...@@ -31,4 +31,41 @@ ...@@ -31,4 +31,41 @@
<td colspan="8" style="text-align:center;"> 暂无数据</td> <td colspan="8" style="text-align:center;"> 暂无数据</td>
</tr> </tr>
[% } %] [% } %]
</script>
<script id="phone_del_binding_tpl" type="text/template">
[% if(it) { %]
[% for(var item in it){ %]
<tr class="text-center">
[% if(it[item]["is_forbidden"] != 1){ %]
<td>[% if(it[item]["is_pc"] == 1) { %]
电脑端
[% }else if(it[item]["is_pc"] == 0) { %]
手机端
[% }else if(it[item]["is_pc"] == 2){ %]
Windows客户端
[% }else{%]
其他
[%} %]
</td>
<td>[%= it[item]["model"] %]</td>
<td>[%= it[item]["create_time"] %]</td>
<td>
[% if(it[item]["is_forbidden"] == 0) { %]
<a class="btn1 btn-default is_show2" data-toggle="modal" data-id='[%= it[item]["id"] %]'>解绑</a>
[% }else if(it[item]["is_forbidden"] == 1) { %]
<a class="btn1 btn-info is_show2" data-toggle="modal" data-id='[%= it[item]["id"] %]'>允许</a>
[% }else{ %]
<a class="btn1 btn-default" data-toggle="modal" data-id='[%= it[item]["id"] %]'>离职</a>
[% } %]
<!--<a class="btn1 btn-info review-images" href="#modal-time" data-toggle="modal" data-img='[%= it[item]["scene_photo"] %]'>允许</a>-->
</td>
[% } %]
</tr>
[% } %]
[% }else{ %]
<tr>
<td colspan="8" style="text-align:center;"> 暂无数据</td>
</tr>
[% } %]
</script> </script>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment