已废弃
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.

118 lines
4.8 KiB

<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="utf-8">
<title>layui</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">
<link rel="stylesheet" href="/static/lib/layui-v2.6.3/css/layui.css" media="all">
<link rel="stylesheet" href="/static/css/public.css" media="all">
<link rel="stylesheet" href="/static/lib/font-awesome-4.7.0/css/font-awesome.min.css" media="all">
<style>
body {
background-color: #ffffff;
}
</style>
</head>
<body>
<div class="layui-form layuimini-form">
<a id="refresh" href="javascript:" data-refresh="刷新"><i class="fa fa-refresh"></i></a>
<input type="text" name="userid" th:value="${userByPort.getId()}" style="display: none">
<input type="text" name="roleId" th:value="${roleId}" style="display: none">
<div class="layui-form-item">
<label class="layui-form-label required">用户名</label>
<div class="layui-input-block">
<input type="text" lay-verify="required" lay-reqtext="用户名不能为空" placeholder="请输入用户名" th:value="${userByPort.getName()}" class="layui-input" readonly>
<tip>填写自己管理账号的名称。</tip>
</div>
</div>
<div class=" layui-form-item" >
<label class="layui-form-label required">负责仓库:</label>
<div class="layui-inline" style="margin-bottom: 10px">
<input type="text" placeholder="请选择仓库" class="layui-input" id="openSonByDepository" readonly th:value="${userByPort.getDepositoryName()}"
lay-verify="required"/>
<input type="text" th:value="${depositoryId}" name="depositoryId" class="layui-input" id="depositoryId" style="display: none" lay-verify="required"/>
</div>
</div>
<div class="layui-form-item">
<div class="layui-input-block">
<button class="layui-btn layui-btn-normal" lay-submit lay-filter="saveBtn">确认保存</button>
</div>
</div>
</div>
<script src="/static/lib/layui-v2.6.3/layui.js" charset="utf-8"></script>
<script>
layui.use(['form','layer','laydate'], function () {
var form = layui.form,
layer = layui.layer,
laydate=layui.laydate,
$ = layui.$;
$('#openSonByDepository').on('click', function(){
layer.open({
type: 2,
title: '弹窗内容',
skin: 'layui-layer-rim',
maxmin: true,
shadeClose: true, //点击遮罩关闭层
area: ['70%', '70%'],
move : '.layui-layer-title',
fixed:false,
content: '/selectDepository?type=2',
success: function(layero, index){
var children = layero.children();
var content = $(children[1]);
var iframeChildren = $(content.children());
content.css('height','100%');
iframeChildren.css('height','100%');
}
});
});
//日期
laydate.render({
elem: '#date'
});
//监听提交
form.on('submit(saveBtn)', function (data) {
data=data.field;
//去除对应的仓库id
if (data.depositoryId===""){
delete data.depositoryId;
}
$.ajax({
url: "/sys/userRole_edit",
type: 'post',
dataType: 'json',
contentType: "application/json;charset=utf-8",
data: JSON.stringify(data),
beforeSend: function () {
this.layerIndex = layer.load(0, {shade: [0.5, '#393D49']});
},
success: function (data) {
layer.close(this.layerIndex);
if (data.status >= 300) {
layer.msg(data.statusInfo.message);//失败的表情
return;
} else {
layer.msg("修改成功", {
icon: 6,//成功的表情
time: 500 //1秒关闭(如果不配置,默认是3秒)
},function(){
var index = parent.layer.getFrameIndex(window.name);
parent.layer.close(index);//关闭当前页
})
}
}
});
return false;
});
$('body').on('click', '[data-refresh]', function () {
location.reload();
})
});
</script>
</body>
</html>