btxtgxq-system-population/src/main/resources/templates/house/save-quick.html
2023-11-24 11:28:25 +08:00

144 lines
6.7 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!doctype html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
<base th:href="${#request.getContextPath() + '/'}">
<meta charset="utf-8">
<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.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
<link rel="stylesheet" href="assets/fonts/font-awesome/css/font-awesome.css"/>
<link rel="stylesheet" href="assets/layuiadmin/layui/css/layui.css" media="all">
<link rel="stylesheet" href="assets/layuiadmin/style/admin.css" media="all">
</head>
<body>
<div class="layui-anim layui-anim-fadein">
<div class="layui-card">
<div class="layui-card-header">
<span class="layui-breadcrumb" lay-filter="breadcrumb" style="visibility: visible;">
<a class="close" href="javascript:void(0);">上级列表</a><span lay-separator="">/</span>
<a href="javascript:void(0);"><cite>快速建房</cite></a>
</span>
</div>
<div class="layui-card-body" style="padding: 15px;">
<form class="layui-form layui-form-pane" lay-filter="dataForm">
<div class="div-base-population-info">
<div class="layui-form-item">
<label class="layui-form-label" style="width: 140px;">每层每单元户数</label>
<div class="layui-input-block" style="margin-left: 140px;">
<input type="number" id="floorUnitHouseCount" name="floorUnitHouseCount" class="layui-input" value="" step="1" placeholder="请输入每层每单元户数" lay-verify="required|unsignInt">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label" style="width: 140px;">指定单元数</label>
<div class="layui-input-block" style="margin-left: 140px;">
<input type="number" id="appointNum" name="appointNum" class="layui-input" value="" step="1" placeholder="请输入指定单元数">
</div>
</div>
<div class="layui-form-item" pane>
<label class="layui-form-label">排序类型</label>
<div class="layui-input-block">
<input type="radio" name="sortType" lay-filter="sortType" value="1" title="重复排序" checked>
<input type="radio" name="sortType" lay-filter="sortType" value="2" title="连续排序">
</div>
</div>
<div class="layui-form-item" id="startNumDiv" style="display: none;">
<span style="color: red;font-size:14px;">*起始号码填入内容为:让您的录入房号从几开始。
比如说你想让房号从3开始那么你就填入3
房号就会是103104105....
203204205....
303304305....
</span>
<br/>
<label class="layui-form-label" style="width: 140px;">起始号码</label>
<div class="layui-input-block" style="margin-left: 140px;">
<input type="number" id="startNum" name="startNum" class="layui-input" value="" step="1" placeholder="请输入起始号码">
</div>
</div>
</div>
<div class="layui-form-item layui-layout-admin">
<div class="layui-input-block">
<div class="layui-footer" style="left: 0;">
<button type="button" class="layui-btn" lay-submit lay-filter="submitForm">提交新增</button>
<button type="button" class="layui-btn layui-btn-primary close">返回上级</button>
</div>
</div>
</div>
</form>
</div>
</div>
</div>
<script src="assets/layuiadmin/layui/layui.js"></script>
<script>
layui.config({
base: 'assets/layuiadmin/' //静态资源所在路径
}).extend({
index: 'lib/index' //主入口模块
}).use(['index', 'form', 'laydate', 'laytpl'], function(){
var $ = layui.$;
var form = layui.form;
var laytpl = layui.laytpl;
var laydate = layui.laydate;
var buildingId = top.restAjax.params(window.location.href).buildingId;
form.on('radio(sortType)', function(data){
//data.value为当前radio的value值即value属性值
if(data.value == 2) {
$('#startNumDiv').show();
}else {
$('#startNumDiv').hide();
}
});
function closeBox() {
parent.layer.close(parent.layer.getFrameIndex(window.name));
}
// 提交表单
form.on('submit(submitForm)', function(formData) {
var sortType = $('input[name=sortType]:checked').val();
if(2 == sortType) {
var startNum = $('#startNum').val();
if(!startNum) {
top.dialog.msg('起始号码不能为空');
return false;
}
}
top.dialog.confirm(top.dataMessage.commit, function(index) {
top.dialog.close(index);
var loadLayerIndex;
formData.field.buildingId = buildingId;
top.restAjax.post(top.restAjax.path('api/house/saveAuto', []), formData.field, null, function(code, data) {
top.dialog.msg('创建成功', {time: 1000}, function() {
closeBox();
});
}, function(code, data) {
top.dialog.msg(data.msg);
}, function() {
loadLayerIndex = top.dialog.msg(top.dataMessage.committing, {icon: 16, time: 0, shade: 0.3});
}, function() {
top.dialog.close(loadLayerIndex);
});
});
return false;
});
$('.close').on('click', function() {
closeBox();
});
// 校验
form.verify({
unsignInt: function(value, item) {
if(!(/(^[1-9]\d*$)/.test(value))) {
return '只能是正整数';
}
value = parseInt(value);
if(value <= 0) {
return '只能是正整数';
}
}
});
});
</script>
</body>
</html>