Commit ec73d58d authored by agping's avatar agping

手机绑定

parent 03309383
......@@ -110,6 +110,40 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'text!temp/phoneBinding_temp
}
});
});
//手机绑定状态切换
$(document).delegate(".is_show2", "click", function () {//点击禁用
if (!confirm('是否继续?')) {
return;
}
agent.id = $(this).attr("data-id");
var params = {
};
params.id = $(this).attr("data-id");
var str = $.trim($(this).html());
if (str === "正常") {
$(this).attr('class','btn1 btn-default is_show2');
params.type = 1;
$(this).html('冻结');
} else if (str === "冻结") {
$(this).attr('class','btn1 btn-info is_show2');
params.type = 0;
$(this).html('正常');
} else {
params.type = 2;
}
$.ajax({//禁用
'type': 'POST',
'url': '/index/updateStatus',
data: { "ids": agent.id, "status": params.type },
dataType: "json",
success: function (data) {
if (data.code != 200) {
alert("禁用失败!")
}
}
});
});
},
Submit_user: function () {//提交变更的信息
var group_id = $("#edit_role").val();
......
......@@ -6,9 +6,9 @@
<td>[%= it[item]["id"] %]</td>
<td>
[% if(it[item]["status"] == 0) { %]
<a class="btn1 btn-info is_show" 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) { %]
<a class="btn1 btn-default is_show" 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{ %]
<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