Commit 746f6023 authored by agping's avatar agping

经纪人修改

parent 551606ba
...@@ -117,26 +117,33 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'text!temp/phoneBinding_temp ...@@ -117,26 +117,33 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'text!temp/phoneBinding_temp
return; return;
} }
agent.id = $(this).attr("data-id"); agent.id = $(this).attr("data-id");
var user_info_obj = JSON.parse(decodeURIComponent(sessionStorage.getItem('pcUserInfo'))); //读取缓存
// console.log(user_info_obj);
var params = { var params = {
}; };
params.id = $(this).attr("data-id"); params.id = $(this).attr("data-id");
var str = $.trim($(this).html()); var str = $.trim($(this).html());
if (str === "正常") { if (str === "允许") {
$(this).attr('class','btn1 btn-default is_show2'); $(this).attr('class','btn1 btn-default is_show2');
params.type = 1; params.type = 1;
$(this).html('冻结'); $(this).html('解绑');
} else if (str === "冻结") { } else if (str === "解绑") {
$(this).attr('class','btn1 btn-info is_show2'); $(this).attr('class','btn1 btn-info is_show2');
params.type = 0; params.type = 0;
$(this).html('正常'); $(this).html('允许');
} else { };
params.type = 2;
}
$.ajax({//禁用 $.ajax({//禁用
'type': 'POST', 'type': 'POST',
'url': '/index/updateStatus', 'url': '/index/updateDevice',
data: { "ids": agent.id, "status": params.type }, data: { "agent_id": agent.agent_id, "id": params.id,"operator_id": user_info_obj.id,"is_forbidden": params.type },
/* $params = array(
"agent_id" => 1,//解绑或者绑定的经纪人id
"id" => 1, //关系id
"operator_id" => 12,//操作人id 登陆后台的经纪人id
"is_forbidden" => 0,//0正常 1禁止
);*/
dataType: "json", dataType: "json",
success: function (data) { success: function (data) {
if (data.code != 200) { if (data.code != 200) {
...@@ -302,16 +309,11 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'text!temp/phoneBinding_temp ...@@ -302,16 +309,11 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'text!temp/phoneBinding_temp
}, },
//手机绑定权限 //手机绑定权限
getPhoneBindingList: function (pageNo) { getPhoneBindingList: function (pageNo) {
// agent.pageNo = pageNo;
var params = {}; var params = {};
// params.pageNo = agent.pageNo;
// params.pageSize = agent.pageSize;
params.agent_id =agent.agent_id; params.agent_id =agent.agent_id;
console.log(agent.agent_id); console.log(agent.agent_id);
// params.groupname = $("input[name='groupname']").val();
// params.store_name = $("input[name='store_name']").val();
$.ajax({ $.ajax({
url: 'index/deviceList', url: '/index/deviceList',
type: 'GET', type: 'GET',
async: true, async: true,
data: params, data: params,
...@@ -319,11 +321,10 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'text!temp/phoneBinding_temp ...@@ -319,11 +321,10 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'text!temp/phoneBinding_temp
success: function (data) { success: function (data) {
var temp = document.getElementById('phone_binding_tpl').innerHTML; var temp = document.getElementById('phone_binding_tpl').innerHTML;
var doTempl = doT.template(temp); var doTempl = doT.template(temp);
$("#agent_phone_binding").html(doTempl(data.data.list)); $("#agent_phone_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 ();
} }
}) })
}, },
......
...@@ -2,13 +2,13 @@ ...@@ -2,13 +2,13 @@
[% if(it) { %] [% if(it) { %]
[% for(var item in it){ %] [% for(var item in it){ %]
<tr class="text-center"> <tr class="text-center">
<td>[%= it[item]["name"] %]</td> <td>[%= it[item]["model"] %]</td>
<td>[%= it[item]["id"] %]</td> <td>[%= it[item]["create_time"] %]</td>
<td> <td>
[% if(it[item]["status"] == 0) { %] [% if(it[item]["is_forbidden"] == 0) { %]
<a class="btn1 btn-info is_show2" data-toggle="modal" data-id='[%= it[item]["id"] %]'>正常</a> <a class="btn1 btn-info is_show2" data-toggle="modal" data-id='[%= it[item]["id"] %]'>解绑</a>
[% }else if(it[item]["status"] == 1) { %] [% }else if(it[item]["is_forbidden"] == 1) { %]
<a class="btn1 btn-default is_show2" data-toggle="modal" data-id='[%= it[item]["id"] %]'>冻结</a> <a class="btn1 btn-default is_show2" data-toggle="modal" data-id='[%= it[item]["id"] %]'>允许</a>
[% }else{ %] [% }else{ %]
<a class="btn1 btn-default" data-toggle="modal" data-id='[%= it[item]["id"] %]'>离职</a> <a class="btn1 btn-default" data-toggle="modal" data-id='[%= it[item]["id"] %]'>离职</a>
[% } %] [% } %]
......
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