fanwensheng 3 years ago
parent
commit
e5c92bc530
  1. 50
      04.系统编码/App/Content/scripts/system-management/user-management/edit-password.js

50
04.系统编码/App/Content/scripts/system-management/user-management/edit-password.js

@ -10,28 +10,8 @@
this.Show = function (data) { this.Show = function (data) {
this.User = data; this.User = data;
this.InitOrgList(); console.log(this.User)
$('#edit-password-dialog').show(); $('#edit-password-dialog').show();
$("#username").textbox('setValue', data.RealName);
$("#account").textbox('setValue', data.LoginName);
//$("#password").textbox('setValue', data.LoginPassword);
parseInt($('#sex span').eq(0).attr('gender')) === data.Gender ? $('#sex span').eq(0).addClass('active') : $('#sex span').eq(0).removeClass('active');
parseInt($('#sex span').eq(1).attr('gender')) === data.Gender ? $('#sex span').eq(1).addClass('active') : $('#sex span').eq(1).removeClass('active');
};
this.InitOrgList = function () {
$.ajax({
type: "POST",
dataType: 'text',
url: '/OrgManagement/Query',
data: {
page: 1,
rows: 10000
},
success: function (result) {
console.log(this.User.OrgId)
}.bind(this)
});
}; };
this.OnSureButtonClick = function () { this.OnSureButtonClick = function () {
@ -49,12 +29,6 @@
alert('两次输入的密码不一致'); alert('两次输入的密码不一致');
return; return;
} else { } else {
//this.User.OrgId = $('#edit-dialog-org-list').combobox('getValue');
//this.User.Gender = parseInt($('#sex span.active').attr('gender'));
//this.User.RealName = $("#username").textbox('getValue');
//this.User.LoginName = $('#account').textbox('getValue');
//this.User.LoginPassword = $('#password').textbox('getValue');
this.EditUser(); this.EditUser();
this.HideDialog(); this.HideDialog();
} }
@ -62,24 +36,24 @@
this.HideDialog = function () { this.HideDialog = function () {
$('#edit-password-dialog').hide(); $('#edit-password-dialog').hide();
$('#password').textbox('setValue', '');
this.clearInput(); $('#confirm-password').textbox('setValue', '');
}; };
this.EditUser = function () { this.EditUser = function () {
console.log(this.User.Id);
console.log($('#password').textbox('getValue'))
$.ajax({ $.ajax({
type: "POST", type: "POST",
dataType: 'text', dataType: 'text',
url: '/UserManagement/Update', url: '/UserManagement/UpdatePassword',
data: this.User, data: {
success: function () { id: this.User.Id,
this.Parent.ReLoadTableData($('#org-list').combobox('getValue')); newPassword: $('#password').textbox('getValue'),
},
success: function (result) {
console.log(result)
}.bind(this) }.bind(this)
}); });
}; };
this.clearInput = function () {
$('#password').textbox('setValue', ''),
$('#confirm-password').textbox('setValue', '')
};
}; };
Loading…
Cancel
Save