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
return;
}
agent.id = $(this).attr("data-id");
var user_info_obj = JSON.parse(decodeURIComponent(sessionStorage.getItem('pcUserInfo'))); //读取缓存
// console.log(user_info_obj);
var params = {
};
params.id = $(this).attr("data-id");
var str = $.trim($(this).html());
if (str === "正常") {
if (str === "允许") {
$(this).attr('class','btn1 btn-default is_show2');
params.type = 1;
$(this).html('冻结');
} else if (str === "冻结") {
$(this).html('解绑');
} else if (str === "解绑") {
$(this).attr('class','btn1 btn-info is_show2');
params.type = 0;
$(this).html('正常');
} else {
params.type = 2;
}
$(this).html('允许');
};
$.ajax({//禁用
'type': 'POST',
'url': '/index/updateStatus',
data: { "ids": agent.id, "status": params.type },
'url': '/index/updateDevice',
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",
success: function (data) {
if (data.code != 200) {
......@@ -302,16 +309,11 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'text!temp/phoneBinding_temp
},
//手机绑定权限
getPhoneBindingList: function (pageNo) {
// agent.pageNo = pageNo;
var params = {};
// params.pageNo = agent.pageNo;
// params.pageSize = agent.pageSize;
params.agent_id =agent.agent_id;
console.log(agent.agent_id);
// params.groupname = $("input[name='groupname']").val();
// params.store_name = $("input[name='store_name']").val();
$.ajax({
url: 'index/deviceList',
url: '/index/deviceList',
type: 'GET',
async: true,
data: params,
......@@ -319,11 +321,10 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'text!temp/phoneBinding_temp
success: function (data) {
var temp = document.getElementById('phone_binding_tpl').innerHTML;
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);
$ ('.J_preview').preview ();
}
})
},
......
......@@ -2,13 +2,13 @@
[% if(it) { %]
[% for(var item in it){ %]
<tr class="text-center">
<td>[%= it[item]["name"] %]</td>
<td>[%= it[item]["id"] %]</td>
<td>[%= it[item]["model"] %]</td>
<td>[%= it[item]["create_time"] %]</td>
<td>
[% if(it[item]["status"] == 0) { %]
<a class="btn1 btn-info is_show2" data-toggle="modal" data-id='[%= it[item]["id"] %]'>正常</a>
[% }else if(it[item]["status"] == 1) { %]
<a class="btn1 btn-default is_show2" data-toggle="modal" data-id='[%= it[item]["id"] %]'>冻结</a>
[% if(it[item]["is_forbidden"] == 0) { %]
<a class="btn1 btn-info is_show2" data-toggle="modal" data-id='[%= it[item]["id"] %]'>解绑</a>
[% }else if(it[item]["is_forbidden"] == 1) { %]
<a class="btn1 btn-default 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>
[% } %]
......
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