优化用户模块

This commit is contained in:
季圣华
2019-11-10 00:06:39 +08:00
parent 26174e8d96
commit 57d7043b85
3 changed files with 47 additions and 52 deletions

View File

@@ -115,16 +115,16 @@
pageList: initPageNum,
columns: [[
{field: 'id', width: 35, align: "center", checkbox: true},
{title: '角色名称', field: 'name', width: 200},
{
title: '操作', field: 'op', align: "center", width: 130, formatter: function (value, rec) {
title: '操作', field: 'op', align: "center", width: 80, formatter: function (value, rec) {
var str = '';
var rowInfo = rec.id + 'AaBb' + rec.name;
str += '<img src="/js/easyui-1.3.5/themes/icons/pencil.png" style="cursor: pointer;" onclick="editRole(\'' + rowInfo + '\');"/>&nbsp;<a onclick="editRole(\'' + rowInfo + '\');" style="text-decoration:none;color:black;" href="javascript:void(0)">编辑</a>&nbsp;&nbsp;';
str += '<img src="/js/easyui-1.3.5/themes/icons/edit_remove.png" style="cursor: pointer;" onclick="deleteRole(' + rec.id + ');"/>&nbsp;<a onclick="deleteRole(' + rec.id + ');" style="text-decoration:none;color:black;" href="javascript:void(0)">删除</a>&nbsp;&nbsp;';
str += '<img src="/js/easyui-1.3.5/themes/icons/pencil.png" style="cursor: pointer;" onclick="editRole(\'' + rowInfo + '\');"/>&nbsp;&nbsp;&nbsp;';
str += '<img src="/js/easyui-1.3.5/themes/icons/edit_remove.png" style="cursor: pointer;" onclick="deleteRole(' + rec.id + ');"/>';
return str;
}
}
},
{title: '角色名称', field: 'name', width: 200}
]],
toolbar: [
{

View File

@@ -114,6 +114,17 @@
pageList: initPageNum,
columns: [[
{field: 'id', width: 35, align: "center", checkbox:true},
{
title: '操作', field: 'op', align: "center", width: 80, formatter: function (value, rec) {
var str = '';
var rowInfo = rec.id + 'AaBb' + rec.companyName + 'AaBb' + rec.companyContacts + 'AaBb' + rec.companyAddress
+ 'AaBb' + rec.companyTel + 'AaBb' + rec.companyFax + 'AaBb' + rec.companyPostCode
+ 'AaBb' + rec.depotFlag + 'AaBb' + rec.customerFlag;
str += '<img src="/js/easyui-1.3.5/themes/icons/pencil.png" style="cursor: pointer;" onclick="editSystemConfig(\'' + rowInfo + '\');"/>&nbsp;&nbsp;&nbsp;';
str += '<img src="/js/easyui-1.3.5/themes/icons/edit_remove.png" style="cursor: pointer;" onclick="deleteSystemConfig(' + rec.id + ');"/>';
return str;
}
},
{title: '公司名称', field: 'companyName', width: 150},
{title: '联系人', field: 'companyContacts', width: 80, align: "center"},
{title: '公司地址', field: 'companyAddress', width: 150, align: "center"},
@@ -131,17 +142,6 @@
formatter: function (value) {
return parseFlag(value);
}
},
{
title: '操作', field: 'op', width: 160, formatter: function (value, rec) {
var str = '';
var rowInfo = rec.id + 'AaBb' + rec.companyName + 'AaBb' + rec.companyContacts + 'AaBb' + rec.companyAddress
+ 'AaBb' + rec.companyTel + 'AaBb' + rec.companyFax + 'AaBb' + rec.companyPostCode
+ 'AaBb' + rec.depotFlag + 'AaBb' + rec.customerFlag;
str += '<img src="/js/easyui-1.3.5/themes/icons/pencil.png" style="cursor: pointer;" onclick="editSystemConfig(\'' + rowInfo + '\');"/>&nbsp;<a onclick="editSystemConfig(\'' + rowInfo + '\');" style="text-decoration:none;color:black;" href="javascript:void(0)">编辑</a>&nbsp;&nbsp;';
str += '<img src="/js/easyui-1.3.5/themes/icons/edit_remove.png" style="cursor: pointer;" onclick="deleteSystemConfig(' + rec.id + ');"/>&nbsp;<a onclick="deleteSystemConfig(' + rec.id + ');" style="text-decoration:none;color:black;" href="javascript:void(0)">删除</a>&nbsp;&nbsp;';
return str;
}
}
]],
toolbar: [

View File

@@ -176,6 +176,19 @@
pageList: initPageNum,
columns: [[
{field: 'id', width: 35, align: "center", checkbox:true},
{
title: '操作', field: 'isystem', align: "center", width: 80, formatter: function (value, rec, index) {
var str = '';
str += '<img src="/js/easyui-1.3.5/themes/icons/pencil.png" style="cursor: pointer;" onclick="editUser(\'' + index + '\');"/>&nbsp;&nbsp;&nbsp;';
if (rec.id != rec.tenantId) {
str += '<img src="/js/easyui-1.3.5/themes/icons/edit_remove.png" style="cursor: pointer;" onclick="deleteUser(' + rec.id + ');"/>';
}
else {
str += '';
}
return str;
}
},
{title: '登录名称', field: 'loginame', width: 80},
{title: '用户名称', field: 'username', width: 80, align: "center"},
{title: '职位', field: 'position', width: 115, align: "center"},
@@ -184,24 +197,7 @@
{title: '电话号码', field: 'phonenum', width: 150, align: "center"},
{title: '用户排序', field: 'userBlngOrgaDsplSeq', width: 60, align: "center"},
{title: '描述', field: 'description', width: 130},
{field: 'orgaId',hidden:true, width: 10},
{
title: '操作', field: 'isystem', width: 150, formatter: function (value, rec) {
var str = '';
var rowInfo = rec.id + 'AaBb' + rec.username + 'AaBb' + rec.loginame + 'AaBb' + rec.position
+ 'AaBb' + rec.orgAbr + 'AaBb' + rec.email + 'AaBb' + rec.phonenum + 'AaBb' + rec.ismanager
+ 'AaBb' + rec.isystem + 'AaBb' + rec.description+'AaBb'+rec.orgaId+'AaBb'+rec.orgaUserRelId
+'AaBb' + rec.userBlngOrgaDsplSeq ;
str += '<img src="/js/easyui-1.3.5/themes/icons/pencil.png" style="cursor: pointer;" onclick="editUser(\'' + rowInfo + '\');"/>&nbsp;<a onclick="editUser(\'' + rowInfo + '\');" style="text-decoration:none;color:black;" href="javascript:void(0)">编辑</a>&nbsp;&nbsp;';
if (rec.id != rec.tenantId) {
str += '<img src="/js/easyui-1.3.5/themes/icons/edit_remove.png" style="cursor: pointer;" onclick="deleteUser(' + rec.id + ');"/>&nbsp;<a onclick="deleteUser(' + rec.id + ');" style="text-decoration:none;color:black;" href="javascript:void(0)">删除</a>&nbsp;&nbsp;';
}
else {
str += '';
}
return str;
}
}
{field: 'orgaId',hidden:true, width: 10}
]],
toolbar: [
{
@@ -282,7 +278,7 @@
url: "/user/deleteUser",
dataType: "json",
data: ({
ids: userID,
ids: userID
}),
success: function (res) {
if(res && res.code != 200) {
@@ -442,32 +438,31 @@
});
//编辑用户信息
function editUser(usernameTotalInfo) {
var usernameInfo = usernameTotalInfo.split("AaBb");
function editUser(index) {
var rowsdata = $("#tableData").datagrid("getRows")[index];
var row = {
username: usernameInfo[1],
loginame: usernameInfo[2],
position: usernameInfo[3],
email: usernameInfo[5],
phonenum: usernameInfo[6],
description: usernameInfo[9],
orgAbr: usernameInfo[4]=='undefined'?'':usernameInfo[4],
orgaId: usernameInfo[10]=='undefined'?'':usernameInfo[10],
orgaUserRelId:usernameInfo[11]=='undefined'?'':usernameInfo[11],
userBlngOrgaDsplSeq:usernameInfo[12]=='undefined'?'':usernameInfo[12]
username: rowsdata.username,
loginame: rowsdata.loginame,
position: rowsdata.position,
email: rowsdata.email,
phonenum: rowsdata.phonenum,
description: rowsdata.description,
orgAbr: rowsdata.orgAbr,
orgaId: rowsdata.orgaId,
orgaUserRelId: rowsdata.orgaUserRelId,
userBlngOrgaDsplSeq: rowsdata.userBlngOrgaDsplSeq
};
oldLoginName = usernameInfo[1];
oldLoginName = rowsdata.username;
$('#userDlg').dialog('open').dialog('setTitle', '<img src="/js/easyui-1.3.5/themes/icons/pencil.png"/>&nbsp;编辑用户信息');
$(".window-mask").css({width: webW, height: webH});
$('#usernameFM').form('load', row);
userID = usernameInfo[0];
userID = rowsdata.id;
//焦点在名称输入框==定焦在输入文字后面
$("#username").val("").focus().val(usernameInfo[1]);
$("#username").val("").focus().val(rowsdata.username);
$("#loginame").attr("readonly","readonly");
/**机构选择*/
$("#selectType").val("org");
url = '/user/updateUser?id=' + usernameInfo[0];
url = '/user/updateUser?id=' + rowsdata.id;
}