新增个人信息修改
This commit is contained in:
@ -138,15 +138,27 @@ $(function(){
|
||||
}
|
||||
// 获取选中复选框项
|
||||
$.getCheckeds = function (_name) {
|
||||
var roleIds = "";
|
||||
var checkeds = "";
|
||||
$('input:checkbox[name="' + _name + '"]:checked').each(function(i) {
|
||||
if (0 == i) {
|
||||
roleIds = $(this).val();
|
||||
checkeds = $(this).val();
|
||||
} else {
|
||||
roleIds += ("," + $(this).val());
|
||||
checkeds += ("," + $(this).val());
|
||||
}
|
||||
});
|
||||
return roleIds;
|
||||
return checkeds;
|
||||
}
|
||||
// 获取选中复选框项
|
||||
$.getSelects = function (_name) {
|
||||
var selects = "";
|
||||
$('#' + _name + ' option:selected').each(function (i) {
|
||||
if (0 == i) {
|
||||
selects = $(this).val();
|
||||
} else {
|
||||
selects += ("," + $(this).val());
|
||||
}
|
||||
});
|
||||
return selects;
|
||||
}
|
||||
// 复选框事件绑定
|
||||
if ($.fn.select2 !== undefined) {
|
||||
|
@ -51,9 +51,10 @@ function add() {
|
||||
var password = $("input[name='password']").val();
|
||||
var email = $("input[name='email']").val();
|
||||
var phonenumber = $("input[name='phonenumber']").val();
|
||||
var sex = $("input[name='sex']:checked").val();
|
||||
var status = $("input[name='status']").is(':checked') == true ? 0 : 1;
|
||||
var roleIds = $.getCheckeds("role");
|
||||
var postIds = $("#post").val() + "";
|
||||
var postIds = $.getSelects("post");
|
||||
$.ajax({
|
||||
cache : true,
|
||||
type : "POST",
|
||||
@ -66,6 +67,7 @@ function add() {
|
||||
"password": password,
|
||||
"email": email,
|
||||
"phonenumber": phonenumber,
|
||||
"sex": sex,
|
||||
"status": status,
|
||||
"roleIds": roleIds,
|
||||
"postIds": postIds
|
||||
|
@ -27,9 +27,10 @@ function update() {
|
||||
var password = $("input[name='password']").val();
|
||||
var email = $("input[name='email']").val();
|
||||
var phonenumber = $("input[name='phonenumber']").val();
|
||||
var sex = $("input[name='sex']:checked").val();
|
||||
var status = $("input[name='status']").is(':checked') == true ? 0 : 1;
|
||||
var roleIds = $.getCheckeds("role");
|
||||
var postIds = $("#post").val() + "";
|
||||
var postIds = $.getSelects("post");
|
||||
$.ajax({
|
||||
cache : true,
|
||||
type : "POST",
|
||||
@ -41,6 +42,7 @@ function update() {
|
||||
"password": password,
|
||||
"email": email,
|
||||
"phonenumber": phonenumber,
|
||||
"sex": sex,
|
||||
"status": status,
|
||||
"roleIds": roleIds,
|
||||
"postIds": postIds
|
||||
|
Reference in New Issue
Block a user