You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
215 lines
9.5 KiB
215 lines
9.5 KiB
9 months ago
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||
|
<head>
|
||
|
<meta charset="utf-8" />
|
||
|
<title>添加--菜单管理</title>
|
||
|
<meta name="renderer" content="webkit" />
|
||
|
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
|
||
|
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
|
||
|
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
|
||
|
<meta name="apple-mobile-web-app-capable" content="yes" />
|
||
|
<meta name="format-detection" content="telephone=no" />
|
||
|
<link rel="stylesheet" href="../../layui/css/layui.css" media="all" />
|
||
|
<link rel="stylesheet" href="../../css/public.css" media="all" />
|
||
|
<link rel="stylesheet" href="../../iconfont/iconfont.css" media="all" />
|
||
|
<script type="text/javascript" src="../../js/jquery-2.1.3.min.js"></script>
|
||
|
<script type="text/javascript" src="../../js/jq_extend.js"></script>
|
||
|
<script type="text/javascript" src="../../js/fiseckey.js"></script>
|
||
|
</head>
|
||
|
<body class="childrenBody" style="height:90%">
|
||
|
<form class="layui-form" style="width: 90%; margin-top:15px">
|
||
|
<input id="Action" class="layui-input" type="hidden" />
|
||
|
<input id="id" class="layui-input" type="hidden" />
|
||
|
<input id="empId" class="layui-input " type="hidden" />
|
||
|
<input id="usersUid" class="layui-input" type="hidden" />
|
||
|
<input id="orgId" class="layui-input" type="hidden" />
|
||
|
|
||
|
<div class="layui-form-item layui-row layui-col-xs12">
|
||
|
<label class="layui-form-label label-required-next">
|
||
|
人员姓名:
|
||
|
</label>
|
||
|
<div class="layui-input-inline">
|
||
|
<input class="layui-input" id="empName" disabled="disabled" />
|
||
|
</div>
|
||
|
</div>
|
||
|
<div class="layui-form-item layui-row layui-col-xs12" id="isShow" style="display: none">
|
||
|
<div class="layui-inline">
|
||
|
<label class="layui-form-label label-required-next">
|
||
|
现在绑定的ukey:
|
||
|
</label>
|
||
|
<div class="layui-input-inline">
|
||
|
<input class="layui-input" id="ukey" disabled="disabled" />
|
||
|
</div>
|
||
|
</div>
|
||
|
</div>
|
||
|
<div class="layui-form-item layui-row layui-col-xs12">
|
||
|
<div class="layui-inline">
|
||
|
<label class="layui-form-label label-required-next">
|
||
|
ukey:
|
||
|
</label>
|
||
|
<div class="layui-input-inline">
|
||
|
<select id="ukey_list" lay-filter="ukey_list" lay-search="">
|
||
|
</select>
|
||
|
</div>
|
||
|
</div>
|
||
|
</div>
|
||
|
<div class="layui-form-item layui-row layui-col-xs12">
|
||
|
<div class="layui-inline">
|
||
|
<label class="layui-form-label label-required-next">
|
||
|
密码输入5次失败后
|
||
|
</label>
|
||
|
<div class="layui-input-inline" style="width: 80px">
|
||
|
<input class="layui-input" id="lockTime" type="number" placeholder="请填写" value="1" />
|
||
|
</div>
|
||
|
<div class="layui-form-mid layui-word-aux" style="color: #fff !important">分钟以后可以再次登录</div>
|
||
|
</div>
|
||
|
</div>
|
||
|
<div class="layui-center">
|
||
|
<a class="layui-btn layui-btn-normal addNews_btn" lay-filter="AddEdit" lay-submit=lay-submit>提交</a>
|
||
|
</div>
|
||
|
</form>
|
||
|
<script type="text/javascript" src="../../layui/layui.js"></script>
|
||
|
<link rel="stylesheet" href="../../css/bulletframe.css" media="all" />
|
||
|
|
||
|
<script type="text/javascript">
|
||
|
layui.config({
|
||
|
base: './'
|
||
|
}).use(['form', 'layer'], function () {
|
||
|
|
||
|
var form = layui.form,
|
||
|
layer = parent.layer === undefined ? layui.layer : top.layer;
|
||
|
|
||
|
var ukeyList = [], ukeyListStr = "", isAction = "Add";
|
||
|
try {
|
||
|
var keytype = "";
|
||
|
try {
|
||
|
keytype = devManage.deviceType.value;
|
||
|
} catch (e1) {
|
||
|
keytype = "F-OLD";
|
||
|
}
|
||
|
var result = SKFKEY.SKF_EnumDev(1, keytype);
|
||
|
var a = result.slice(6, result.length - 2);
|
||
|
ukeyList = a.split("|");
|
||
|
ukeyListStr = "";
|
||
|
ukeyList.forEach(function (obj, index, arr) {
|
||
|
ukeyListStr += "<option value='" + obj + "'>" + obj + "</option>";
|
||
|
});
|
||
|
console.log(ukeyListStr);
|
||
|
$("#ukey_list").append(ukeyListStr);
|
||
|
form.render('select');
|
||
|
} catch (e) {
|
||
|
console.log(e.message);
|
||
|
}
|
||
|
|
||
|
$.post("../../ashx/SysUsersUkeyHandler.ashx", {
|
||
|
Action: "getUserUkey",
|
||
|
usersUid: $.getUrlVar("userUid"),
|
||
|
random: new Date().getTime()//随机参数
|
||
|
}, function (res) {
|
||
|
if (res.code == '0') {
|
||
|
if (res.data.length > 0) {
|
||
|
var info = res.data[0];
|
||
|
isAction = "Edit";
|
||
|
$("#id").val(info.ID);
|
||
|
$("#ukey").val(info.UKEY);
|
||
|
$("#lockTime").val(info.LOCK_TIME);
|
||
|
$("#isShow").show();
|
||
|
}
|
||
|
} else {
|
||
|
layer.msg(res.msg, { icon: 7, time: 3000 });
|
||
|
}
|
||
|
})
|
||
|
|
||
|
function submitFun() {
|
||
|
//load提交
|
||
|
var index = layer.msg('数据提交中,请稍候', { icon: 16, time: false, shade: 0.8 });
|
||
|
$.post("../../ashx/SysUsersUkeyHandler.ashx", {
|
||
|
Action: isAction,
|
||
|
id: $("#id").val(),
|
||
|
empId: $("#empId").val(),
|
||
|
usersUid: $("#usersUid").val(),
|
||
|
empName: $("#empName").val(),
|
||
|
ukey: $("#ukey_list option:selected").text(),
|
||
|
lockTime: $("#lockTime").val(),
|
||
|
orgId: $("#orgId").val(),
|
||
|
random: new Date().getTime() //随机参数(员工表ID ","分割)
|
||
|
}, function (res) {
|
||
|
layer.close(index);
|
||
|
if (res.code == 1) {
|
||
|
top.layer.msg(res.msg, { icon: 1, time: 3000 });
|
||
|
parent.location.reload();
|
||
|
} else if (res.code == '-2') {
|
||
|
var index3 = layer.confirm(res.msg, {
|
||
|
btn: ['是', '否'],
|
||
|
icon: 3
|
||
|
}, function () {
|
||
|
//load提交
|
||
|
var index2 = layer.msg('数据提交中,请稍候', { icon: 16, time: false, shade: 0.8 });
|
||
|
$.post("../../ashx/SysUsersUkeyHandler.ashx", {
|
||
|
Action: "ForceEdit",
|
||
|
id: res.id,
|
||
|
empId: $("#empId").val(),
|
||
|
usersUid: $("#usersUid").val(),
|
||
|
empName: $("#empName").val(),
|
||
|
ukey: $("#ukey_list option:selected").text(),
|
||
|
lockTime: $("#lockTime").val(),
|
||
|
orgId: $("#orgId").val(),
|
||
|
random: new Date().getTime() //随机参数(员工表ID ","分割)
|
||
|
}, function (res) {
|
||
|
layer.close(index2);
|
||
|
layer.close(index3);
|
||
|
if (res.code == 1) {
|
||
|
top.layer.msg(res.msg, { icon: 1, time: 3000 });
|
||
|
parent.location.reload();
|
||
|
} else {
|
||
|
layer.msg(res.msg, { icon: 7, time: 3000 });
|
||
|
}
|
||
|
});
|
||
|
}, function () {
|
||
|
layer.close(index3);
|
||
|
return false;
|
||
|
});
|
||
|
} else {
|
||
|
layer.close(index);
|
||
|
layer.msg(res.msg, { icon: 7, time: 3000 });
|
||
|
}
|
||
|
});
|
||
|
layer.close(index);
|
||
|
return false;
|
||
|
}
|
||
|
|
||
|
form.on("submit(AddEdit)", function (data) {
|
||
|
if ($("#ukey_list option:selected").text() == "") {
|
||
|
layer.open({
|
||
|
content: 'ukey不能为空!',
|
||
|
icon: 7
|
||
|
})
|
||
|
return false;
|
||
|
}
|
||
|
if ($("#lockTime").val() == "") {
|
||
|
layer.open({
|
||
|
content: '密码输入5次失败后,账号锁定时长不能为空!',
|
||
|
icon: 7
|
||
|
})
|
||
|
return false;
|
||
|
}
|
||
|
if ($("#ukey").val() != "") {
|
||
|
var index = layer.confirm('是否要替换掉原有的ukey:' + $("#ukey").val(), {
|
||
|
icon: 3,
|
||
|
btn: ['是', '否']
|
||
|
}, function () {
|
||
|
submitFun();
|
||
|
}, function () {
|
||
|
layer.close(index);
|
||
|
return false;
|
||
|
});
|
||
|
} else {
|
||
|
submitFun();
|
||
|
}
|
||
|
})
|
||
|
})
|
||
|
|
||
|
</script>
|
||
|
</body>
|
||
|
</html>
|