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

119 lines
5.3 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.8.6/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">
</head>
<body>
<div class="layuimini-container">
<div class="layuimini-main">
<fieldset class="table-search-fieldset">
<legend>施工单位创建</legend>
<div class="layui-fluid">
<div class="layui-card">
<div class="layui-card-body" style="padding-top: 40px;">
<div>
<form class="layui-form layui-form-pane"
style="margin: 0 auto;max-width: 700px;padding-top: 100px; padding-bottom: 200px"
lay-filter="form1">
<input th:value="${record.getId()}" name="id" id="id" style="display:none;"/>
<div class="layui-form-item">
<label class="layui-form-label">单位名称:</label>
<div class="layui-input-block">
<input type="text" placeholder="请填写施工单位名称" class="layui-input"
th:value="${record.getName()}"
name="name" lay-verify="required"/>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">地址:</label>
<div class="layui-input-block">
<input type="text" placeholder="请填写施工地址" class="layui-input"
th:value="${record.getAddress()}"
name="address"/>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">介绍:</label>
<div class="layui-input-block">
<input name="introduce" placeholder="请填写施工单位介绍..."
th:value="${record.getIntroduce()}"
class="layui-input"/>
</div>
</div>
<div class="layui-form-item">
<div class="layui-input-block">
<button class="layui-btn" lay-submit lay-filter="formStep">
&emsp;修改&emsp;
</button>
</div>
</div>
</form>
</div>
</div>
<hr>
</div>
</div>
</fieldset>
</div>
</div>
<script src="/static/lib/layui-v2.8.6/layui.js" charset="utf-8"></script>
<script>
var data;
// 用于标志是否为第一次提交
let flagForForm = false;
layui.use(['form', 'layer'], function () {
var $ = layui.jquery,
form = layui.form,
layer = layui.layer;
form.on('submit(formStep)', function (data) {
if(!flagForForm){
flagForForm = true;
$.ajax({
url: "/company/ConstructionUnitEdit",
type: 'post',
dataType: 'json',
contentType: "application/json;charset=utf-8",
data: JSON.stringify(data.field),
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: 1000 //1秒关闭(如果不配置,默认是3秒)
}, function () {
window.location = "/constructionUnitEdit?id="+$("#id").val();
});
}
}
});
}
return false;
});
$('body').on('click', '[data-refresh]', function () {
location.reload();
})
});
</script>
</body>
</html>