49 changed files with 2133 additions and 1779 deletions
@ -1,115 +1,127 @@ |
|||||
<!DOCTYPE html> |
<!DOCTYPE html> |
||||
<html lang="en" xmlns:th="http://www.thymeleaf.org"> |
<html lang="en" xmlns:th="http://www.thymeleaf.org"> |
||||
<head> |
<head> |
||||
<meta charset="utf-8"> |
<meta charset="utf-8"> |
||||
<title>分步表单</title> |
<title>分步表单</title> |
||||
<meta name="renderer" content="webkit"> |
<meta name="renderer" content="webkit"> |
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> |
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> |
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=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/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/css/public.css" media="all"> |
||||
<link rel="stylesheet" href="/static/js/lay-module/step-lay/step.css" media="all"> |
<link rel="stylesheet" href="/static/js/lay-module/step-lay/step.css" media="all"> |
||||
</head> |
</head> |
||||
|
|
||||
<body> |
<body> |
||||
<form class="layui-form layui-form-pane" action="" > |
<form class="layui-form layui-form-pane" action=""> |
||||
<div class="layui-form-item" style="display:none;"> |
<div class="layui-form-item" style="display:none;"> |
||||
<label class="layui-form-label">类型编号</label> |
<label class="layui-form-label">类型编号</label> |
||||
<div class="layui-input-block"> |
<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"> |
<input type="text" th:value="${record.getOldId()}" name="id" required lay-verify="required" |
||||
|
autocomplete="off" class="layui-input" readonly="readonly"> |
||||
|
</div> |
||||
</div> |
</div> |
||||
</div> |
<div class="layui-form-item"> |
||||
<div class="layui-form-item"> |
<label class="layui-form-label">类型名称</label> |
||||
<label class="layui-form-label">类型名称</label> |
<div class="layui-input-block"> |
||||
<div class="layui-input-block"> |
<input type="text" th:value="${record.getTname()}" name="tname" required lay-verify="required" |
||||
<input type="text" th:value="${record.getTname()}" name="tname" required lay-verify="required" autocomplete="off" class="layui-input"> |
autocomplete="off" class="layui-input"> |
||||
|
</div> |
||||
</div> |
</div> |
||||
</div> |
|
||||
<div class="layui-form-item"> |
<div class="layui-form-item"> |
||||
<label class="layui-form-label">类型介绍</label> |
<label class="layui-form-label">类型介绍</label> |
||||
<div class="layui-input-block"> |
<div class="layui-input-block"> |
||||
<input type="text" th:value="${record.getIntroduce()}" name="introduce" required lay-verify="required" autocomplete="off" class="layui-input"> |
<input type="text" th:value="${record.getIntroduce()}" name="introduce" required lay-verify="required" |
||||
|
autocomplete="off" class="layui-input"> |
||||
|
</div> |
||||
</div> |
</div> |
||||
</div> |
<div class="layui-form-item"> |
||||
<div class="layui-form-item"> |
<label class="layui-form-label">父级类型:</label> |
||||
<label class="layui-form-label">父级类型:</label> |
<div class="layui-input-block"> |
||||
<div class="layui-input-block"> |
<input type="text" placeholder="请选择物料类型" class="layui-input" id="openSonByMateralType" readonly |
||||
<input type="text" placeholder="请选择物料类型" class="layui-input" id="openSonByMateralType" readonly th:value="${parentType == null ?'': parentType.getTname()}" /> |
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" /> |
<input type="text" id="materialTypeId" placeholder="请选择物料类型" name="parentId" class="layui-input" |
||||
|
th:value="${parentType == null ?'' :parentType.getOldId()}" style="display: none"/> |
||||
|
</div> |
||||
</div> |
</div> |
||||
</div> |
<div class="layui-form-item" style="display: none"> |
||||
<div class="layui-form-item" style="display: none"> |
<label class="layui-form-label">状态</label> |
||||
<label class="layui-form-label">状态</label> |
<div class="layui-input-block"> |
||||
<div class="layui-input-block"> |
<input type="checkbox" name="state" lay-skin="switch" lay-text="启用|禁用" |
||||
<input type="checkbox" name="state" lay-skin="switch" lay-text="启用|禁用" th:checked="${record.getState() == 1}"> |
th:checked="${record.getState() == 1}"> |
||||
|
</div> |
||||
</div> |
</div> |
||||
</div> |
<div class="layui-form-item"> |
||||
<div class="layui-form-item"> |
<div class="layui-input-block"> |
||||
<div class="layui-input-block"> |
<button class="layui-btn" lay-submit lay-filter="formDemo">立即提交</button> |
||||
<button class="layui-btn" lay-submit lay-filter="formDemo">立即提交</button> |
<button type="reset" class="layui-btn layui-btn-primary">重置</button> |
||||
<button type="reset" class="layui-btn layui-btn-primary">重置</button> |
</div> |
||||
</div> |
</div> |
||||
</div> |
|
||||
</form> |
</form> |
||||
<script src="/static/lib/layui-v2.6.3/layui.js" charset="utf-8"></script> |
<script src="/static/lib/layui-v2.6.3/layui.js" charset="utf-8"></script> |
||||
<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(){ |
$('#openSonByMateralType').on('click', function () { |
||||
layer.open({ |
layer.open({ |
||||
type: 2, |
type: 2, |
||||
title: '弹窗内容', |
title: '弹窗内容', |
||||
skin: 'layui-layer-rim', |
skin: 'layui-layer-rim', |
||||
maxmin: true, |
maxmin: true, |
||||
shadeClose: true, //点击遮罩关闭层 |
shadeClose: true, //点击遮罩关闭层 |
||||
area: ['70%', '70%'], |
area: ['70%', '70%'], |
||||
move : '.layui-layer-title', |
move: '.layui-layer-title', |
||||
fixed:false, |
fixed: false, |
||||
content: '/selectType', |
content: '/selectType', |
||||
success: function(layero, index){ |
success: function (layero, index) { |
||||
var children = layero.children(); |
var children = layero.children(); |
||||
var content = $(children[1]); |
var content = $(children[1]); |
||||
var iframeChildren = $(content.children()); |
var iframeChildren = $(content.children()); |
||||
content.css('height','100%'); |
content.css('height', '100%'); |
||||
iframeChildren.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);//关闭当前页 |
||||
|
}) |
||||
|
} |
||||
|
} |
||||
|
}) |
||||
|
} |
||||
|
|
||||
//提交 |
return false; |
||||
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; |
|
||||
}); |
}); |
||||
}); |
|
||||
</script> |
</script> |
||||
|
|
||||
</body> |
</body> |
||||
|
|||||
Loading…
Reference in new issue