完成用户分配模块

This commit is contained in:
yubaolee
2016-10-19 10:03:24 +08:00
parent 3b99938df1
commit 5d2569dddd
6 changed files with 61 additions and 58 deletions

View File

@@ -11,43 +11,32 @@
// </copyright>
// <summary>分配组织</summary>
// ***********************************************************************
layui.use(['layer', 'form'], function () {
var form = layui.form();
$(document).ready(function () {
$.CurrentDialog.find("#btnAccess").on("click", function () {
var ids = ztree.getSelected();
if (ids == null) return;
$.post('/RelevanceManager/Assign', {
type: $("#moduleType").val(),
firstId: $('#firstId').val(),
secIds: ids
}, function (json) {
json = $.parseJSON(json);
if (json.statusCode != "200") {
$(this).alertmsg('warn', json.message);
return;
}
selected.reLoad();
});
});
$.CurrentDialog.find("#btnDelAccess").on("click", function () {
var ids = selected.getSelected();
if (ids == null) return;
$.post('/RelevanceManager/UnAssign', {
type: $("#moduleType").val(),
firstId: $('#firstId').val(),
secIds: ids
}, function (json) {
json = $.parseJSON(json);
if (json.statusCode != "200") {
$(this).alertmsg('warn', json.message);
return;
}
selected.reLoad();
});
form.on('checkbox', function (data) {
if (data.elem.checked)
{
$.post('/RelevanceManager/Assign', {
type: $("#moduleType").val(),
firstId: $('#firstId').val(),
secIds: data.value
}, function (json) {
json = $.parseJSON(json);
});
}
else
{
$.post('/RelevanceManager/UnAssign', {
type: $("#moduleType").val(),
firstId: $('#firstId').val(),
secIds: data.value
}, function (json) {
json = $.parseJSON(json);
});
}
});
});