提交 207c3dff 编写于 作者: doc_wei's avatar doc_wei

feat: 用户管理修改

上级 d2f4091c
......@@ -45,17 +45,9 @@ layui.config({
}
}},
{ field: 'userIdCard', title: '身份证', align: 'center', width: 160 },
{ field: 'userSex', title: '性别', width: 60, align: 'center', templet: function (d) {
if(d.userSex == '0'){
return "保密";
} else if (d.userSex == '1'){
return "";
} else if (d.userSex == '2'){
return "";
} else {
return "参数错误";
}
}},
{ field: 'userSex', title: '性别', width: 60, rowspan: '2', templet: function (d) {
return skyeyeClassEnumUtil.getEnumDataNameByCodeAndKey("sexEnum", 'id', d.userSex, 'name');
}},
{ field: 'state', title: '状态', width: 60, align: 'center', templet: function (d) {
if(d.state == '1'){
return "<span class='state-up'>在职</span>";
......
layui.config({
base: basePath,
version: skyeyeVersion
}).extend({
window: 'js/winui.window'
}).define(['window', 'jquery', 'winui', 'laydate', 'form'], function (exports) {
winui.renderColor();
var index = parent.layer.getFrameIndex(window.name);
var $ = layui.$,
form = layui.form,
laydate = layui.laydate;
var id = GetUrlParam("id");
var startTime = laydate.render({
elem: '#startTime', //指定元素
format: 'yyyy-MM-dd',
min: minDate(),
theme: 'grid',
done:function(value, date){
endTime.config.min = {
year: date.year,
month: date.month - 1,//关键
date: date.date,
hours: date.hours,
minutes: date.minutes,
seconds: date.seconds
};
}
});
var endTime = laydate.render({
elem: '#endTime', //指定元素
format: 'yyyy-MM-dd',
min: minDate(),
theme: 'grid',
done:function(value, date){
startTime.config.max = {
year: date.year,
month: date.month - 1,//关键
date: date.date,
hours: date.hours,
minutes: date.minutes,
seconds: date.seconds
}
}
});
// 设置最小可选的日期
function minDate(){
var now = new Date();
return now.getFullYear() + "-" + (now.getMonth() + 1) + "-" + now.getDate();
}
AjaxPostUtil.request({url: reqBasePath + "querySysEveUserById", params: {id: id}, type: 'json', method: "GET", callback: function (json) {
skyeyeClassEnumUtil.showEnumDataListByClassName("userIsTermOfValidity", 'radio', "isTermOfValidity", json.bean.isTermOfValidity, form);
if (json.bean.isTermOfValidity == 1) {
$(".effectiveDate").hide();
} else if (json.bean.isTermOfValidity == 2) {
$(".effectiveDate").show();
$("#startTime").val(json.bean.startTime);
$("#endTime").val(json.bean.endTime);
}
}});
form.on('radio(isTermOfValidityFilter)', function (data) {
let val = data.value;
if (val == 1) {
$(".effectiveDate").hide();
} else if (val == 2) {
$(".effectiveDate").show();
}
});
matchingLanguage();
form.render();
form.on('submit(resetUserEffectiveDate)', function(data) {
if (winui.verifyForm(data.elem)) {
var params = {
id: id,
isTermOfValidity: dataShowType.getData('isTermOfValidity'),
startTime: $("#startTime").val(),
endTime: $("#endTime").val()
};
AjaxPostUtil.request({url: reqBasePath + "resetUserEffectiveDate", params: params, type: 'json', method: "POST", callback: function (json) {
parent.layer.close(index);
parent.refreshCode = '0';
}});
}
return false;
});
$("body").on("click", "#cancle", function() {
parent.layer.close(index);
});
});
\ No newline at end of file
......@@ -8,13 +8,64 @@ layui.config({
version: skyeyeVersion
}).extend({
window: 'js/winui.window'
}).define(['window', 'table', 'jquery', 'winui', 'tableSelect'], function (exports) {
}).define(['window', 'table', 'jquery', 'winui', 'tableSelect', 'laydate'], function (exports) {
winui.renderColor();
layui.use(['form'], function (form) {
var index = parent.layer.getFrameIndex(window.name);
var $ = layui.$,
tableSelect = layui.tableSelect;
tableSelect = layui.tableSelect,
laydate = layui.laydate;
var startTime = laydate.render({
elem: '#startTime', //指定元素
format: 'yyyy-MM-dd',
min: minDate(),
theme: 'grid',
done:function(value, date){
endTime.config.min = {
year: date.year,
month: date.month - 1,//关键
date: date.date,
hours: date.hours,
minutes: date.minutes,
seconds: date.seconds
};
}
});
var endTime = laydate.render({
elem: '#endTime', //指定元素
format: 'yyyy-MM-dd',
min: minDate(),
theme: 'grid',
done:function(value, date){
startTime.config.max = {
year: date.year,
month: date.month - 1,//关键
date: date.date,
hours: date.hours,
minutes: date.minutes,
seconds: date.seconds
}
}
});
// 设置最小可选的日期
function minDate(){
var now = new Date();
return now.getFullYear() + "-" + (now.getMonth() + 1) + "-" + now.getDate();
}
skyeyeClassEnumUtil.showEnumDataListByClassName("userIsTermOfValidity", 'radio', "isTermOfValidity", '', form);
$(".effectiveDate").hide();
form.on('radio(isTermOfValidityFilter)', function (data) {
let val = data.value;
if (val == 1) {
$(".effectiveDate").hide();
} else if (val == 2) {
$(".effectiveDate").show();
}
});
form.verify({
password : function(value, item) {
if(value.length < 6){
......@@ -46,17 +97,9 @@ layui.config({
return '<a rowId="' + d.id + '" class="notice-title-click">' + d.jobNumber + '</a>';
}},
{ field: 'userName', title: '员工姓名', width: 100 },
{ field: 'userSex', title: '性别', width: 60, templet: function (d) {
if(d.userSex == '0'){
return "保密";
} else if (d.userSex == '1'){
return "";
} else if (d.userSex == '2'){
return "";
} else {
return "参数错误";
}
}}
{ field: 'userSex', title: '性别', width: 60, rowspan: '2', templet: function (d) {
return skyeyeClassEnumUtil.getEnumDataNameByCodeAndKey("sexEnum", 'id', d.userSex, 'name');
}},
]]
},
done: function (elem, data) {
......@@ -88,7 +131,7 @@ layui.config({
staffId: staffId,
userCode: $("#userCode").val(),
password: $("#password").val(),
isTermOfValidity: $("#isTermOfValidity").val()
isTermOfValidity: dataShowType.getData('isTermOfValidity')
}
AjaxPostUtil.request({url: reqBasePath + "sysAdd005", params: params, type: 'json', method: "POST", callback: function (json) {
parent.layer.close(index);
......
......@@ -23,33 +23,32 @@ layui.config({
limits: getLimits(),
limit: getLimit(),
cols: [[
{ title: systemLanguage["com.skyeye.serialNumber"][languageType], type: 'numbers', fixed: 'left' },
{ field: 'userCode', title: '账号', width: 120, fixed: 'left' },
{ field: 'userName', title: '姓名', align: 'left', width: 100, fixed: 'left', templet: function (d) {
{ title: systemLanguage["com.skyeye.serialNumber"][languageType], type: 'numbers', rowspan: '2', fixed: 'left' },
{ field: 'userCode', title: '账号', width: 120, fixed: 'left', rowspan: '2' },
{ field: 'userName', title: '姓名', align: 'left', width: 100, fixed: 'left', rowspan: '2', templet: function (d) {
return '<a lay-event="details" class="notice-title-click">' + d.userName + '</a>';
}},
{ field: 'jobNumber', title: '工号', align: 'left', width: 100, fixed: 'left'},
{ field: 'email', title: '邮箱', width: 100 },
{ field: 'sexName', title: '性别', width: 60, templet: function (d) {
if(d.sexName == '0') {
return "保密";
} else if (d.sexName == '1'){
return "";
} else if (d.sexName == '2'){
return "";
} else {
return "参数错误";
}
{ field: 'jobNumber', title: '工号', align: 'left', width: 100, fixed: 'left', rowspan: '2' },
{ field: 'state', title: '有效期', align: 'center', width: 90, colspan: 3},
{ field: 'email', title: '邮箱', width: 100, rowspan: '2' },
{ field: 'userSex', title: '性别', width: 60, rowspan: '2', templet: function (d) {
return skyeyeClassEnumUtil.getEnumDataNameByCodeAndKey("sexEnum", 'id', d.userSex, 'name');
}},
{ field: 'companyName', title: '所属公司', width: 150 },
{ field: 'departmentName', title: '所属部门', width: 120},
{ field: 'jobName', title: '担任职位', width: 120},
{ field: 'userLock', title: '是否锁定', align: 'center', width: 90, templet: '#checkboxTpl', unresize: true},
{ field: 'roleName', title: '角色', width: 120},
{ field: 'createName', title: systemLanguage["com.skyeye.createName"][languageType], width: 120 },
{ field: 'createTime', title: systemLanguage["com.skyeye.createTime"][languageType], align: 'center', width: 150 },
{ title: systemLanguage["com.skyeye.operation"][languageType], fixed: 'right', align: 'center', width: 150, toolbar: '#tableBar'}
]],
{ field: 'companyName', title: '所属公司', rowspan: '2', width: 150 },
{ field: 'departmentName', title: '所属部门', rowspan: '2', width: 120},
{ field: 'jobName', title: '担任职位', rowspan: '2', width: 120},
{ field: 'userLock', title: '是否锁定', rowspan: '2', align: 'center', width: 90, templet: '#checkboxTpl', unresize: true},
{ field: 'roleName', title: '角色', rowspan: '2', width: 120},
{ field: 'createName', title: systemLanguage["com.skyeye.createName"][languageType], rowspan: '2', width: 120 },
{ field: 'createTime', title: systemLanguage["com.skyeye.createTime"][languageType], rowspan: '2', align: 'center', width: 150 },
{ title: systemLanguage["com.skyeye.operation"][languageType], fixed: 'right', align: 'center', rowspan: '2', width: 250, toolbar: '#tableBar'}
], [
{ field: 'isTermOfValidity', title: '类型', align: 'center', width: 100, templet: function (d) {
return skyeyeClassEnumUtil.getEnumDataNameByCodeAndKey("userIsTermOfValidity", 'id', d.isTermOfValidity, 'name');
}},
{ field: 'startTime', title: '开始时间', align: 'center', width: 100 },
{ field: 'endTime', title: '结束时间', align: 'center', width: 100 },
]],
done: function(json) {
matchingLanguage();
initTableSearchUtil.initAdvancedSearch(this, json.searchFilter, form, "请输入账号、员工姓名、员工工号", function () {
......@@ -71,6 +70,8 @@ layui.config({
systemCommonUtil.showPicImg(fileBasePath + data.userPhoto);
} else if (layEvent === 'details') { // 员工详情
details(data);
} else if (layEvent === 'resetUserEffectiveDate') { // 重置有效期
resetUserEffectiveDate(data);
}
});
......@@ -78,7 +79,7 @@ layui.config({
// 监听锁定操作
form.on('checkbox(lockDemo)', function(obj) {
if(obj.elem.checked){
if (obj.elem.checked) {
// 锁定
lock(obj.value);
} else {
......@@ -88,15 +89,15 @@ layui.config({
});
// 锁定
function lock(id){
AjaxPostUtil.request({url: reqBasePath + "sys002", params: {rowId: id}, type: 'json', method: "PUT", callback: function (json) {
function lock(id) {
AjaxPostUtil.request({url: reqBasePath + "sys002", params: {id: id}, type: 'json', method: "PUT", callback: function (json) {
winui.window.msg("已成功锁定,该账号目前无法登录.", {icon: 1, time: 2000});
}});
}
// 解锁
function unlock(id){
AjaxPostUtil.request({url: reqBasePath + "sys003", params: {rowId: id}, type: 'json', method: "PUT", callback: function (json) {
function unlock(id) {
AjaxPostUtil.request({url: reqBasePath + "sys003", params: {id: id}, type: 'json', method: "PUT", callback: function (json) {
winui.window.msg("账号恢复正常.", {icon: 1, time: 2000});
}});
}
......@@ -114,6 +115,19 @@ layui.config({
loadTable();
}});
}
// 重置有效期
function resetUserEffectiveDate(data) {
_openNewWindows({
url: "../../tpl/sysEveUser/resetUserEffectiveDate.html?id=" + data.id,
title: "重置有效期",
pageId: "resetUserEffectiveDate",
area: ['90vw', '90vh'],
callBack: function (refreshCode) {
winui.window.msg(systemLanguage["com.skyeye.successfulOperation"][languageType], {icon: 1, time: 2000});
loadTable();
}});
}
// 绑定角色
function bindRole(data) {
......
......@@ -28,7 +28,7 @@ layui.config({
form.on('submit(formEditPwdBean)', function (data) {
if (winui.verifyForm(data.elem)) {
var params = {
rowId: parent.rowId,
id: parent.rowId,
password: $("#password").val(),
};
......
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
<link href="../../assets/lib/layui/css/layui.css" rel="stylesheet" />
<link href="../../assets/lib/winui/css/winui.css" rel="stylesheet" />
</head>
<body>
<div style="padding:20px; margin:0 auto;">
<form class="layui-form" action="" id="showForm" autocomplete="off">
<div class="layui-form-item layui-col-xs12">
<span class="hr-title">基础信息</span><hr>
</div>
<div class="layui-form-item layui-col-xs12">
<label class="layui-form-label">有效期<i class="red">*</i></label>
<div class="layui-input-block winui-radio" id="isTermOfValidity">
</div>
</div>
<div class="layui-form-item layui-col-xs6 effectiveDate">
<label class="layui-form-label">有效开始时间<i class="red">*</i></label>
<div class="layui-input-block">
<input type="text" id="startTime" name="startTime" placeholder="请选择开始时间" class="layui-input"/>
</div>
</div>
<div class="layui-form-item layui-col-xs6 effectiveDate">
<label class="layui-form-label">有效结束时间<i class="red">*</i></label>
<div class="layui-input-block">
<input type="text" id="endTime" name="endTime" placeholder="请选择结束时间" class="layui-input"/>
</div>
</div>
<div class="layui-form-item layui-col-xs12">
<div class="layui-input-block">
<button class="winui-btn" id="cancle"><language showName="com.skyeye.cancel"></language></button>
<button class="winui-btn" lay-submit lay-filter="resetUserEffectiveDate"><language showName="com.skyeye.save"></language></button>
</div>
</div>
</form>
</div>
<script src="../../assets/lib/layui/layui.js"></script>
<script src="../../assets/lib/layui/custom.js"></script>
<script type="text/javascript">
layui.config({base: '../../js/sysEveUser/'}).use('resetUserEffectiveDate');
</script>
</body>
</html>
\ No newline at end of file
......@@ -21,10 +21,21 @@
</div>
<div class="layui-form-item layui-col-xs12">
<label class="layui-form-label">有效期<i class="red">*</i></label>
<div class="layui-input-block winui-radio">
<input type="radio" id="isTermOfValidity" name="isTermOfValidity" value="1" title="长期有效" checked="checked"/>
<div class="layui-input-block winui-radio" id="isTermOfValidity">
</div>
</div>
<div class="layui-form-item layui-col-xs6 effectiveDate">
<label class="layui-form-label">有效开始时间<i class="red">*</i></label>
<div class="layui-input-block">
<input type="text" id="startTime" name="startTime" placeholder="请选择开始时间" class="layui-input"/>
</div>
</div>
<div class="layui-form-item layui-col-xs6 effectiveDate">
<label class="layui-form-label">有效结束时间<i class="red">*</i></label>
<div class="layui-input-block">
<input type="text" id="endTime" name="endTime" placeholder="请选择结束时间" class="layui-input"/>
</div>
</div>
<div class="layui-form-item layui-col-xs6">
<label class="layui-form-label">密码<i class="red">*</i></label>
<div class="layui-input-block">
......
......@@ -21,12 +21,15 @@
</script>
<script type="text/html" id="tableBar">
{{# if(auth('1552960326068')){ }}
{{# if (auth('1552960326068')) { }}
<a class="layui-btn layui-btn-xs layui-btn-normal" lay-event="edit">重置密码</a>
{{# } }}
{{# if(auth('1552960399251')){ }}
{{# if (auth('1552960399251')) { }}
<a class="layui-btn layui-btn-xs" lay-event="bindRole">绑定角色</a>
{{# } }}
{{# if (auth('1721130435799')) { }}
<a class="layui-btn layui-btn-xs layui-btn-normal" lay-event="resetUserEffectiveDate">重置有效期</a>
{{# } }}
</script>
</div>
<script src="../../assets/lib/layui/layui.js"></script>
......
......@@ -18,6 +18,7 @@
"checkDayType": {"name": "日程插件上的类型(包含日程的)", "className": "skyeye-pro#com.skyeye.common.enumeration.CheckDayType"},
"userStaffType": {"name": "员工类型", "className": "skyeye-pro#com.skyeye.personnel.classenum.UserStaffType"},
"pageOpenType": {"name": "页面布局打开方式", "className": "skyeye-pro#com.skyeye.operate.classenum.PageOpenType"},
"userIsTermOfValidity": {"name": "用户是否长期有效", "className": "skyeye-pro#com.skyeye.personnel.classenum.UserIsTermOfValidity"},
"menuType": {"name": "APP菜单类型", "className": "skyeye-pro#com.skyeye.menu.classenum.MenuType"},
"urlType": {"name": "APP菜单URL类型", "className": "skyeye-pro#com.skyeye.menu.classenum.UrlType"},
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册