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.
145 lines
6.1 KiB
145 lines
6.1 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="${post.getId()}" style="display: none">
|
|
<input type="text" id="organization" name="organization" th:value="${post.getAdministrativeorganization()}" style="display: none">
|
|
<input type="text" id="oldDepository" name="oldDepository" th:value="${post.getDepositoryId()}" 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="${post.getName()}" class="layui-input">
|
|
<tip>填写自己管理账号的名称。</tip>
|
|
</div>
|
|
</div>
|
|
<div class=" layui-form-item" style="display: none">
|
|
<label class="layui-form-label required">权限:</label>
|
|
<div class="layui-inline " style="margin-bottom: 10px">
|
|
<select name="authority" class="layui-input-inline" >
|
|
<option value="">请选择权限</option>
|
|
<option th:each="role,iterStar:${roles}" th:value="${role?.getId()}" th:text="${role?.getName()}" >系统管理员</option>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
<div class=" layui-form-item" >
|
|
<label class="layui-form-label required">负责仓库:</label>
|
|
<div class="layui-inline" style="margin-bottom: 10px">
|
|
<!--<select name="depositoryId" lay-verify="required">
|
|
<option value="">请选择仓库</option>
|
|
<option value="0">全部仓库</option>
|
|
<option th:each="depository,iterStar:${depositories}" th:value="${depository?.getId()}" th:text="${depository?.getDname()}" >外芯仓库</option>
|
|
</select>-->
|
|
<input type="text" th:value="${post.getDepositoryName()}" placeholder="请选择仓库" class="layui-input" id="openSonByDepository" readonly
|
|
lay-verify="required"/>
|
|
<input type="text" th:value="${post.getDepositoryId()}" 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>
|
|
// 用于标志是否为第一次提交
|
|
let flagForForm = false;
|
|
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'
|
|
});
|
|
var organization = document.getElementById("organization").value
|
|
//监听提交
|
|
form.on('submit(saveBtn)', function (data) {
|
|
if(!flagForForm){
|
|
flagForForm = true;
|
|
data=data.field;
|
|
//去除对应的仓库id
|
|
if (data.depositoryId===""){
|
|
delete data.depositoryId;
|
|
}
|
|
$.ajax({
|
|
url: "/company/postRole_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>
|