|
|
|
|
<!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">
|
|
|
|
|
</head>
|
|
|
|
|
<body>
|
|
|
|
|
<style>
|
|
|
|
|
.inputdiv{
|
|
|
|
|
display:flex;background-color: #fff;height: 38px;line-height: 38px;border: 1px solid rgb(238, 238, 238);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.layui-form-label{
|
|
|
|
|
padding: 9px 0px;
|
|
|
|
|
text-align: left;
|
|
|
|
|
}
|
|
|
|
|
.layui-input-block{
|
|
|
|
|
margin-left: 80px;
|
|
|
|
|
}
|
|
|
|
|
.lay-step{
|
|
|
|
|
display: none;
|
|
|
|
|
}
|
|
|
|
|
.layui-form-select .layui-input{
|
|
|
|
|
border-style: none;
|
|
|
|
|
}
|
|
|
|
|
</style>
|
|
|
|
|
|
|
|
|
|
<div class="layuimini-container">
|
|
|
|
|
<div class="layuimini-main">
|
|
|
|
|
<div class="layui-fluid">
|
|
|
|
|
<div class="layui-card">
|
|
|
|
|
<div class="layui-card-body" style="padding-top: 40px;">
|
|
|
|
|
<!-- 入库申请提交-->
|
|
|
|
|
<div class="layui-carousel" id="stepForm" lay-filter="stepForm" style="margin: 0 auto;">
|
|
|
|
|
<div carousel-item>
|
|
|
|
|
<div>
|
|
|
|
|
<form class="layui-form layui-form-pane" style="margin: 0 auto;max-width: 460px;">
|
|
|
|
|
<div class="layui-form-item">
|
|
|
|
|
<label class="layui-form-label">物料名称:</label>
|
|
|
|
|
<div class="layui-input-block" style="margin: 0px;">
|
|
|
|
|
<div class="inputdiv">
|
|
|
|
|
<input type="text" th:value="${materialById.getMname()}" placeholder="请选择物料" class="layui-input"
|
|
|
|
|
id="openSonByMaterial" style="border-style: none"
|
|
|
|
|
lay-verify="required"/>
|
|
|
|
|
<i class="layui-icon layui-icon-search" style="display: inline" id="selectMaterial"></i>
|
|
|
|
|
</div>
|
|
|
|
|
<input type="text" th:value="${materialById.getId()}" name="mid" class="layui-input" id="mid"
|
|
|
|
|
style="display: none" lay-verify="required" />
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="layui-form-item">
|
|
|
|
|
<label class="layui-form-label">物料编码:</label>
|
|
|
|
|
<div class="layui-input-block">
|
|
|
|
|
<input id="code" name="code" th:value="${materialById.getCode()}" type="text" placeholder="请填写入物料编码" value=""
|
|
|
|
|
class="layui-input" lay-verify="required">
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="layui-form-item">
|
|
|
|
|
<label class="layui-form-label">生产日期:</label>
|
|
|
|
|
<div class="layui-input-block">
|
|
|
|
|
<input type="text" name="producedDate" id="producedDate" placeholder="请填写生产日期" onclick="selectDate(this)"
|
|
|
|
|
autocomplete="off" class="layui-input" lay-verify="required">
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="layui-form-item">
|
|
|
|
|
<label class="layui-form-label">物料单价:</label>
|
|
|
|
|
<div class="layui-input-block">
|
|
|
|
|
<input name="price" type="number" placeholder="请填写入物料单价" th:value="${materialById.getPrice()}"
|
|
|
|
|
class="layui-input" lay-verify="number">
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="layui-form-item">
|
|
|
|
|
<label class="layui-form-label">物料数量:</label>
|
|
|
|
|
<div class="layui-input-block">
|
|
|
|
|
<input name="quantity" type="number" placeholder="请填写入物料数量" th:value="${materialById.getQuantity()}"
|
|
|
|
|
class="layui-input" lay-verify="number">
|
|
|
|
|
</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="${depository.getDname()}"
|
|
|
|
|
id="openSonByDepository" readonly
|
|
|
|
|
lay-verify="required"/>
|
|
|
|
|
<input type="text" name="depositoryId" class="layui-input" id="depositoryId" th:value="${depository.getId()}"
|
|
|
|
|
style="display: none" lay-verify="required"/>
|
|
|
|
|
<input type="text" name="placeId" class="layui-input" id="placeId" value="0"
|
|
|
|
|
style="display: none" lay-verify="required"/>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="layui-form-item">
|
|
|
|
|
<label class="layui-form-label">备注说明:</label>
|
|
|
|
|
<div class="layui-input-block">
|
|
|
|
|
<input name="applyRemark" placeholder="请填写相关原因及申请原因" value=""
|
|
|
|
|
class="layui-input"/>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="layui-form-item">
|
|
|
|
|
<div class="layui-input-block" style="bottom: 15px">
|
|
|
|
|
<button class="layui-btn" lay-submit lay-filter="formStep" style="margin-left: 15%">
|
|
|
|
|
 提交 
|
|
|
|
|
</button>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</form>
|
|
|
|
|
</div>
|
|
|
|
|
<div>
|
|
|
|
|
<form class="layui-form" style="margin: 0 auto;max-width: 460px;padding-top: 40px;">
|
|
|
|
|
<div style="text-align: center;margin-top: 90px;">
|
|
|
|
|
<i class="layui-icon layui-circle"
|
|
|
|
|
style="color: white;font-size:30px;font-weight:bold;background: #52C41A;padding: 20px;line-height: 80px;"></i>
|
|
|
|
|
<div style="font-size: 24px;color: #333;font-weight: 500;margin-top: 30px;">
|
|
|
|
|
提交成功
|
|
|
|
|
</div>
|
|
|
|
|
<div style="text-align: center;margin-top: 50px;">
|
|
|
|
|
<button class="layui-btn next">再填写一次</button>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
</form>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<hr>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<script src="/static/lib/layui-v2.6.3/layui.js" charset="utf-8"></script>
|
|
|
|
|
<script src="/static/js/lay-config.js?v=1.0.4" charset="utf-8"></script>
|
|
|
|
|
<script>
|
|
|
|
|
layui.use(['form', 'step','laydate'], function () {
|
|
|
|
|
var $ = layui.$,
|
|
|
|
|
form = layui.form,
|
|
|
|
|
laydate = layui.laydate,
|
|
|
|
|
step = layui.step;
|
|
|
|
|
|
|
|
|
|
var mid = $("#mid").val();
|
|
|
|
|
var depositoryId = $("#depositoryId").val();
|
|
|
|
|
|
|
|
|
|
laydate.render({
|
|
|
|
|
elem: '#producedDate'
|
|
|
|
|
, format: 'yyyy-MM-dd'
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
$("#code").blur(function () {
|
|
|
|
|
var code = $(this).val();
|
|
|
|
|
var req = {};
|
|
|
|
|
req.code = code;
|
|
|
|
|
req.type = "in";
|
|
|
|
|
$.ajax({
|
|
|
|
|
url: "/material/findMatrialByCode",
|
|
|
|
|
type: "get",
|
|
|
|
|
dataType: 'json',
|
|
|
|
|
data:(req),
|
|
|
|
|
contentType: "application/json;charset=utf-8",
|
|
|
|
|
success: function (d) {
|
|
|
|
|
var d = d.data;
|
|
|
|
|
if(d == null){
|
|
|
|
|
layer.msg("没有该编码,请确认是否输入正确");
|
|
|
|
|
$("#openSonByMaterial").val("");
|
|
|
|
|
$("#mid").val("");
|
|
|
|
|
$("#code").val("");
|
|
|
|
|
}else{
|
|
|
|
|
$("#openSonByMaterial").val(d.mname);
|
|
|
|
|
$("#mid").val(d.id);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
$("#openSonByMaterial").blur(function () {
|
|
|
|
|
var data = $(this).val();
|
|
|
|
|
var req = {};
|
|
|
|
|
req.mname = data;
|
|
|
|
|
$.ajax({
|
|
|
|
|
url: "/material/findMaterialByCondition",
|
|
|
|
|
type: "post",
|
|
|
|
|
dataType: 'json',
|
|
|
|
|
data:JSON.stringify(req),
|
|
|
|
|
contentType: "application/json;charset=utf-8",
|
|
|
|
|
success: function (d) {
|
|
|
|
|
if(d.count > 1){
|
|
|
|
|
layer.msg("请点击右侧搜索确定物品");
|
|
|
|
|
$("#mid").val("");
|
|
|
|
|
$("#code").val("");
|
|
|
|
|
return false;
|
|
|
|
|
}else if(d.count === 0){
|
|
|
|
|
layer.msg("没有该物品,请确认输入是否正确");
|
|
|
|
|
$("#mid").val("");
|
|
|
|
|
$("#code").val("");
|
|
|
|
|
$("#openSonByMaterial").val("");
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
else{
|
|
|
|
|
var material = d.data[0];
|
|
|
|
|
$("#openSonByMaterial").val(material.mname)
|
|
|
|
|
$("#mid").val(material.id);
|
|
|
|
|
$("#code").val(material.code);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
$('#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=1',
|
|
|
|
|
success: function(layero, index){
|
|
|
|
|
var children = layero.children();
|
|
|
|
|
var content = $(children[1]);
|
|
|
|
|
var iframeChildren = $(content.children());
|
|
|
|
|
content.css('height','100%');
|
|
|
|
|
iframeChildren.css('height','100%');
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$('#selectMaterial').on('click', function () {
|
|
|
|
|
var mname = $("#openSonByMaterial").val();
|
|
|
|
|
layer.open({
|
|
|
|
|
type: 2,
|
|
|
|
|
title: '弹窗内容',
|
|
|
|
|
skin: 'layui-layer-rim',
|
|
|
|
|
maxmin: true,
|
|
|
|
|
shadeClose: true, //点击遮罩关闭层
|
|
|
|
|
area: ['70%', '70%'],
|
|
|
|
|
move : '.layui-layer-title',
|
|
|
|
|
fixed:false,
|
|
|
|
|
// content: '/selectMaterial?mname='+mname+'&type=1',
|
|
|
|
|
content: '/getMaterialAll?mname=' + mname + '&type=1',
|
|
|
|
|
end: function () {
|
|
|
|
|
var mid = $("#mid").val();
|
|
|
|
|
$.ajax({
|
|
|
|
|
url: "/material/findMatrialById?mid=" + mid,
|
|
|
|
|
type: "get",
|
|
|
|
|
dataType: 'json',
|
|
|
|
|
contentType: "application/json;charset=utf-8",
|
|
|
|
|
success: function (d) {
|
|
|
|
|
var code = d.data.code;
|
|
|
|
|
if(code === undefined){
|
|
|
|
|
code = "";
|
|
|
|
|
}
|
|
|
|
|
$("#code").val(code)
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
success: function(layero, index){
|
|
|
|
|
var children = layero.children();
|
|
|
|
|
var content = $(children[1]);
|
|
|
|
|
var iframeChildren = $(content.children());
|
|
|
|
|
content.css('height','100%');
|
|
|
|
|
iframeChildren.css('height','100%');
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
step.render({
|
|
|
|
|
elem: '#stepForm',
|
|
|
|
|
filter: 'stepForm',
|
|
|
|
|
width: '100%', //设置容器宽度
|
|
|
|
|
stepWidth: '750px',
|
|
|
|
|
height: '600px',
|
|
|
|
|
stepItems: [{
|
|
|
|
|
title: '填写信息'
|
|
|
|
|
}, {
|
|
|
|
|
title: '提交成功'
|
|
|
|
|
}]
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
form.on('submit(formStep)', function (data) {
|
|
|
|
|
data = data.field;
|
|
|
|
|
data.type = 1;
|
|
|
|
|
var params = [];
|
|
|
|
|
data.params = params;
|
|
|
|
|
$.ajax({
|
|
|
|
|
url: "/depositoryRecord/applicationIn",
|
|
|
|
|
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.detail);//失败的表情
|
|
|
|
|
return;
|
|
|
|
|
} else {
|
|
|
|
|
layer.msg("申请提交成功", {
|
|
|
|
|
icon: 6,//成功的表情
|
|
|
|
|
time: 500 //1秒关闭(如果不配置,默认是3秒)
|
|
|
|
|
}, function () {
|
|
|
|
|
step.next('#stepForm');
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
complete: function () {
|
|
|
|
|
layer.close(this.layerIndex);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
return false;
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
form.on('submit(formStep2)', function (data) {
|
|
|
|
|
step.next('#stepForm');
|
|
|
|
|
return false;
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$('.pre').click(function () {
|
|
|
|
|
step.pre('#stepForm');
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
$('.next').click(function () {
|
|
|
|
|
step.next('#stepForm');
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
</script>
|
|
|
|
|
</body>
|
|
|
|
|
</html>
|