41 changed files with 1817 additions and 1450 deletions
@ -1,115 +1,127 @@ |
|||
<!DOCTYPE html> |
|||
<html lang="en" xmlns:th="http://www.thymeleaf.org"> |
|||
<head> |
|||
<meta charset="utf-8"> |
|||
<title>分步表单</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/js/lay-module/step-lay/step.css" media="all"> |
|||
<meta charset="utf-8"> |
|||
<title>分步表单</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/js/lay-module/step-lay/step.css" media="all"> |
|||
</head> |
|||
|
|||
<body> |
|||
<form class="layui-form layui-form-pane" action="" > |
|||
<div class="layui-form-item" style="display:none;"> |
|||
<label class="layui-form-label">类型编号</label> |
|||
<div class="layui-input-block"> |
|||
<input type="text" th:value="${record.getOldId()}" name="id" required lay-verify="required" autocomplete="off" class="layui-input" readonly="readonly"> |
|||
<form class="layui-form layui-form-pane" action=""> |
|||
<div class="layui-form-item" style="display:none;"> |
|||
<label class="layui-form-label">类型编号</label> |
|||
<div class="layui-input-block"> |
|||
<input type="text" th:value="${record.getOldId()}" name="id" required lay-verify="required" |
|||
autocomplete="off" class="layui-input" readonly="readonly"> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="layui-form-item"> |
|||
<label class="layui-form-label">类型名称</label> |
|||
<div class="layui-input-block"> |
|||
<input type="text" th:value="${record.getTname()}" name="tname" required lay-verify="required" autocomplete="off" class="layui-input"> |
|||
<div class="layui-form-item"> |
|||
<label class="layui-form-label">类型名称</label> |
|||
<div class="layui-input-block"> |
|||
<input type="text" th:value="${record.getTname()}" name="tname" required lay-verify="required" |
|||
autocomplete="off" class="layui-input"> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="layui-form-item"> |
|||
<label class="layui-form-label">类型介绍</label> |
|||
<div class="layui-input-block"> |
|||
<input type="text" th:value="${record.getIntroduce()}" name="introduce" required lay-verify="required" autocomplete="off" class="layui-input"> |
|||
<label class="layui-form-label">类型介绍</label> |
|||
<div class="layui-input-block"> |
|||
<input type="text" th:value="${record.getIntroduce()}" name="introduce" required lay-verify="required" |
|||
autocomplete="off" class="layui-input"> |
|||
</div> |
|||
</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" id="openSonByMateralType" readonly th:value="${parentType == null ?'': parentType.getTname()}" /> |
|||
<input type="text" id="materialTypeId" placeholder="请选择物料类型" name="parentId" class="layui-input" th:value="${parentType == null ?'' :parentType.getOldId()}" 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" id="openSonByMateralType" readonly |
|||
th:value="${parentType == null ?'': parentType.getTname()}"/> |
|||
<input type="text" id="materialTypeId" placeholder="请选择物料类型" name="parentId" class="layui-input" |
|||
th:value="${parentType == null ?'' :parentType.getOldId()}" style="display: none"/> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="layui-form-item" style="display: none"> |
|||
<label class="layui-form-label">状态</label> |
|||
<div class="layui-input-block"> |
|||
<input type="checkbox" name="state" lay-skin="switch" lay-text="启用|禁用" th:checked="${record.getState() == 1}"> |
|||
<div class="layui-form-item" style="display: none"> |
|||
<label class="layui-form-label">状态</label> |
|||
<div class="layui-input-block"> |
|||
<input type="checkbox" name="state" lay-skin="switch" lay-text="启用|禁用" |
|||
th:checked="${record.getState() == 1}"> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="layui-form-item"> |
|||
<div class="layui-input-block"> |
|||
<button class="layui-btn" lay-submit lay-filter="formDemo">立即提交</button> |
|||
<button type="reset" class="layui-btn layui-btn-primary">重置</button> |
|||
<div class="layui-form-item"> |
|||
<div class="layui-input-block"> |
|||
<button class="layui-btn" lay-submit lay-filter="formDemo">立即提交</button> |
|||
<button type="reset" class="layui-btn layui-btn-primary">重置</button> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
<script src="/static/lib/layui-v2.6.3/layui.js" charset="utf-8"></script> |
|||
<script> |
|||
layui.use('form', function(){ |
|||
var form = layui.form, $ = layui.$; |
|||
// 用于标志是否为第一次提交 |
|||
let flagForForm = false; |
|||
layui.use('form', function () { |
|||
var form = layui.form, $ = layui.$; |
|||
|
|||
|
|||
$('#openSonByMateralType').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: '/selectType', |
|||
success: function(layero, index){ |
|||
var children = layero.children(); |
|||
var content = $(children[1]); |
|||
var iframeChildren = $(content.children()); |
|||
content.css('height','100%'); |
|||
iframeChildren.css('height','100%'); |
|||
} |
|||
}); |
|||
}); |
|||
$('#openSonByMateralType').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: '/selectType', |
|||
success: function (layero, index) { |
|||
var children = layero.children(); |
|||
var content = $(children[1]); |
|||
var iframeChildren = $(content.children()); |
|||
content.css('height', '100%'); |
|||
iframeChildren.css('height', '100%'); |
|||
} |
|||
}); |
|||
}); |
|||
|
|||
//提交 |
|||
form.on('submit(formDemo)', function (data) { |
|||
if (!flagForForm) { |
|||
flagForForm = true; |
|||
data = data.field; |
|||
$.ajax({ |
|||
url: "/materialType/materialType_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 () { |
|||
window.location = '/materialType_view'; |
|||
var index = parent.layer.getFrameIndex(window.name); |
|||
parent.layer.close(index);//关闭当前页 |
|||
}) |
|||
} |
|||
} |
|||
}) |
|||
} |
|||
|
|||
//提交 |
|||
form.on('submit(formDemo)', function(data){ |
|||
data = data.field; |
|||
$.ajax({ |
|||
url: "/materialType/materialType_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(){ |
|||
window.location='/materialType_view'; |
|||
var index = parent.layer.getFrameIndex(window.name); |
|||
parent.layer.close(index);//关闭当前页 |
|||
}) |
|||
} |
|||
} |
|||
}) |
|||
return false; |
|||
return false; |
|||
}); |
|||
}); |
|||
}); |
|||
</script> |
|||
|
|||
</body> |
|||
|
|||
Loading…
Reference in new issue