代码拉取完成,页面将自动刷新
同步操作将从 天辰/AssetsSysHtml 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
<!DOCTYPE html>
<html class="x-admin-sm">
<head>
<meta charset="UTF-8">
<title>学校固定资产管理系统</title>
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<link rel="stylesheet" href="./css/font.css">
<link rel="stylesheet" href="./css/xadmin.css">
<link rel="stylesheet" href="./lib/layui/css/modules/layer/default/layer.css">
<script type="text/javascript" src="./lib/layui/layui.js" charset="utf-8"></script>
<script type="text/javascript" src="./js/xadmin.js"></script>
<script src="./js/MD5.js" charset="utf-8"></script>
<!-- 让IE8/9支持媒体查询,从而兼容栅格 -->
<!--[if lt IE 9]>
<script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
<script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="layui-fluid">
<div class="layui-row">
<form class="layui-form" lay-filter="userinfo">
<div class="layui-form-item">
<label for="L_phone" class="layui-form-label">手机号</label>
<div class="layui-input-inline">
<input type="text" id="L_phone" name="PhoneNum" placeholder="唯一登录凭证" lay-verify="phone" autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label for="L_passWord" class="layui-form-label">密码</label>
<div class="layui-input-inline">
<input type="text" id="L_passWord" name="PassWord" placeholder="不填默认不修改密码" autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label for="L_username" class="layui-form-label">用户名</label>
<div class="layui-input-inline">
<input type="text" id="L_username" name="UserName" lay-verify="required" autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label for="L_email" class="layui-form-label">Email</label>
<div class="layui-input-inline">
<input type="text" id="L_email" name="Email" lay-verify="email" autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label for="L_department" class="layui-form-label">所在部门</label>
<div class="layui-input-inline" style="width: 190px;">
<select id="L_department" name="DepartmentId" lay-filter="department" lay-verify="required">
<option value="">请选择</option>
</select>
</div>
</div>
<div class="layui-form-item">
<label for="L_repass" class="layui-form-label"></label>
<button class="layui-btn layui-btn-lg" style="width:190px" lay-submit="" lay-filter="edit">修改用户</button>
</div>
</form>
</div>
</div>
<script>layui.use(['form', 'layer', 'jquery'],
function () {
var userId = parent.pid;
$ = layui.jquery;
var form = layui.form,
layer = layui.layer;
//获取部门
$.ajax({
type: "GET",
//取消异步方法加载完成后获取用户信息
async: false,
headers: { "token": sessionStorage.getItem("token") },
url: sessionStorage.getItem("api") + "department/noadmininfos",
dataType: "Json",
success: function (res) {
if (res.Code == 200) {
var html = '';
for (var i = 0; i < res.Data.Count; i++) {
var item = res.Data.Data[i];
html += '<option value="' + item.Id + '">' + item.DepartmentName + '</option>'
}
$("#L_department").append(html);
form.render();
} else {
layer.msg(res.ErrorMessage);
}
}
})
//获取用户信息
$.ajax({
type: "GET",
headers: { "token": sessionStorage.getItem("token") },
url: sessionStorage.getItem("api") + "users/" + userId + "/account",
dataType: "Json",
success: function (res) {
if (res.Code == 200) {
var user = res.Data
//初始化表单
form.val("userinfo", {
"PhoneNum": user.PhoneNum
, "PassWord": user.PassWord
, "UserName": user.UserName
, "Email": user.Email
, "DepartmentId": user.DepartmentId
});
form.render();
} else {
layer.msg(res.ErrorMessage);
}
}
})
//监听提交
form.on('submit(edit)',
function (data) {
if(data.field.PassWord!="")
{
data.field.PassWord = md5(data.field.PassWord);
}else{
data.field.PassWord=null;
}
$.ajax({
type: "Put",
headers: { "token": sessionStorage.getItem("token") },
url: sessionStorage.getItem("api")+ "users/" + userId + "/account",
data: data.field,
contentType: "application/x-www-form-urlencoded",
dataType: "Json",
success: function (res) {
if (res.Code == 200) {
layer.closeAll('loading');
layer.msg(res.Data, {
time: 1500
}, function () {
//关闭当前frame
xadmin.close();
// 对父窗口进行刷新
xadmin.father_reload();
})
} else {
layer.closeAll('loading');
layer.msg(res.ErrorMessage);
}
}
});
return false;
});
});
</script>
</body>
</html>
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。