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.
284 lines
13 KiB
284 lines
13 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.6.3/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">
|
|
<input style="display:none;" id="nowDay" th:value="${nowDay}">
|
|
<input style="display:none;" id="display" th:value="${display}">
|
|
<input style="display: none" th:value="${number}" id="number">
|
|
<a id="refresh" href="javascript:" data-refresh="刷新"><i class="fa fa-refresh"></i></a>
|
|
|
|
<div class="layui-collapse">
|
|
<div class="layui-colla-item">
|
|
<h2 class="layui-colla-title">搜索</h2>
|
|
<div class="layui-colla-content">
|
|
<div style="margin: 10px 10px 10px 10px">
|
|
<form class="layui-form layui-form-pane" action="">
|
|
<div class="layui-form-item">
|
|
|
|
|
|
<div class="layui-inline">
|
|
<label class="layui-form-label">种类</label>
|
|
<div class="layui-input-block">
|
|
<input type="text" placeholder="请选择物料类型" class="layui-input"
|
|
id="openSonByMateralType"
|
|
readonly/>
|
|
<input type="text" id="materialTypeId" placeholder="请选择物料类型"
|
|
name="materialTypeId"
|
|
class="layui-input" style="display: none"/>
|
|
</div>
|
|
</div>
|
|
<div class="layui-inline">
|
|
<label class="layui-form-label">物料名称</label>
|
|
<div class="layui-input-block">
|
|
<input type="text" name="mname" autocomplete="off" class="layui-input"
|
|
placeholder="请输入物料名称">
|
|
</div>
|
|
</div>
|
|
<div class="layui-inline">
|
|
<label class="layui-form-label">型号</label>
|
|
<div class="layui-input-block">
|
|
<input type="text" class="layui-input" id="version" name="version"
|
|
autocomplete="off"
|
|
placeholder="请输入物料型号"/>
|
|
</div>
|
|
</div>
|
|
<div class="layui-inline">
|
|
<label class="layui-form-label">物料编码</label>
|
|
<div class="layui-input-block">
|
|
<input type="text" name="code" autocomplete="off" class="layui-input"
|
|
placeholder="请输入物料编码">
|
|
</div>
|
|
</div>
|
|
<div class="layui-inline">
|
|
<label class="layui-form-label">状态</label>
|
|
<div class="layui-input-block">
|
|
<select name="state">
|
|
<option value="">请选择状态</option>
|
|
<option value="1">启用</option>
|
|
<option value="2">禁用</option>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
<div class="layui-inline">
|
|
<button type="submit" class="layui-btn layui-btn-primary" lay-submit
|
|
lay-filter="data-search-btn"><i class="layui-icon"></i> 搜 索
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<ul class="flow-default" id="LAY_material"></ul>
|
|
|
|
<div id="showImportData"
|
|
style="height: 500px;width: 500px;position: absolute;overflow: auto;top: 10%;left: 25%;background: #ffffff;z-index: 1231234;display: none">
|
|
<div onclick="closeShowDataMessage()" style="position: absolute; right: 0; top: 2%; cursor: pointer;">
|
|
<i class="fa fa-window-close-o"></i>
|
|
</div>
|
|
<div id="showDataContent"></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<a id="returnTop" style="display:none;" class="layui-return-top" href="#top"><i class="fa fa-level-up"></i></a>
|
|
|
|
<script src="/static/lib/layui-v2.6.3/layui.js" charset="utf-8"></script>
|
|
<script src="/static/lib/jquery-3.4.1/jquery-3.4.1.min.js"></script>
|
|
<script src="/static/js/Customize/public.js"></script>
|
|
<script>
|
|
function bindTableToolbarFunction() {
|
|
|
|
}
|
|
|
|
function showDetail() {
|
|
|
|
}
|
|
|
|
function closeShowDataMessage() {
|
|
|
|
}
|
|
|
|
let socket = null;
|
|
|
|
let newIndexShade;
|
|
|
|
|
|
layui.use(['form', 'table', 'upload', 'flow'], function () {
|
|
var $ = layui.jquery,
|
|
form = layui.form,
|
|
table = layui.table,
|
|
flow = layui.flow,
|
|
upload = layui.upload;
|
|
|
|
let takingPre = 0;
|
|
let size = 8;
|
|
|
|
$('#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%');
|
|
}
|
|
});
|
|
});
|
|
|
|
|
|
flow.load({
|
|
elem: '#LAY_material' //流加载容器
|
|
, done: function (page, next) { //执行下一页的回调
|
|
let result;
|
|
let lis = [];
|
|
$.get('/material/material?page=' + page + '&size=' + size, function (res) {
|
|
result = res.data;
|
|
lis.push("<div class='clearfix'>");
|
|
for (let i = 0; i < result.length; i++) {
|
|
let brandItem ='<p>' + "物料品牌:"+result[i].brand + '</p>';
|
|
if(result[i].brand === ""){
|
|
brandItem = "";
|
|
}
|
|
lis.push('<li style="width:100%;margin-top: 10px;float:left;border: 1px solid #9999996e;"><div class="layui-card my-shadow my-card flow1" onclick="showDetail('
|
|
+ result[i].id + ')"><div class="layui-card-header"><h2>' + "物料名称:"+result[i].mname + '</h2></div>');
|
|
lis.push('<div class="layui-col-md4 my-info" style="margin-left: 15px; color: #999;font-size: 15px;">'
|
|
+ '<p>' + "物料编码:"+result[i].code + '</p>'
|
|
+ '<p>' +"物料型号:"+ result[i].version + '</p>'
|
|
+ brandItem
|
|
+ '</div></div></li>');
|
|
}
|
|
lis.push('</div>');
|
|
takingPre += result.length;
|
|
//执行下一页渲染,第二参数为:满足“加载更多”的条件,即后面仍有分页
|
|
//pages为Ajax返回的总页数,只有当前页小于总页数的情况下,才会继续出现加载更多
|
|
next(lis.join(''), takingPre < res.count);
|
|
});
|
|
}
|
|
});
|
|
|
|
|
|
// 监听搜索操作
|
|
form.on('submit(data-search-btn)', function (data) {
|
|
var req = {};
|
|
data = data.field;
|
|
req.type = 1;
|
|
if (data.mname !== '') {
|
|
req.mname = data.mname;
|
|
}
|
|
if (data.version !== '') {
|
|
req.version = data.version;
|
|
}
|
|
if (data.materialTypeId !== '') {
|
|
req.materialTypeId = data.materialTypeId;
|
|
}
|
|
if (data.state !== '') {
|
|
req.state = data.state;
|
|
}
|
|
if (data.code !== '') {
|
|
req.code = data.code
|
|
}
|
|
updateFlow(req);
|
|
return false;
|
|
});
|
|
|
|
updateFlow = function (req) {
|
|
$("#LAY_material").empty();
|
|
takingPre = 0;
|
|
flow.load({
|
|
elem: '#LAY_material' //流加载容器
|
|
, done: function (page, next) { //执行下一页的回调
|
|
let result;
|
|
let lis = [];
|
|
req.page = page;
|
|
req.size = size;
|
|
$.ajax({
|
|
url: "/material/material",
|
|
type: "get",
|
|
data: req,
|
|
dataType: "json",
|
|
contentType: "application/json;charset=utf-8",
|
|
success: function (res) {
|
|
result = res.data;
|
|
lis.push("<div class='clearfix'>");
|
|
for (let i = 0; i < result.length; i++) {
|
|
let brandItem ='<p>' + "物料品牌:"+result[i].brand + '</p>';
|
|
if(result[i].brand === ""){
|
|
brandItem = "";
|
|
}
|
|
lis.push('<li style="width:100%;margin-top: 10px;float:left;border: 1px solid #9999996e;"><div class="layui-card my-shadow my-card flow1" onclick="showDetail('
|
|
+ result[i].id + ')"><div class="layui-card-header"><h2>' + "物料名称:"+result[i].mname + '</h2></div>');
|
|
lis.push('<div class="layui-col-md4 my-info" style="margin-left: 15px; color: #999;font-size: 15px;">'
|
|
+ '<p>' + "物料编码:"+result[i].code + '</p>'
|
|
+ '<p>' +"物料型号:"+ result[i].version + '</p>'
|
|
+ brandItem
|
|
+ '</div></div></li>');
|
|
}
|
|
lis.push('</div>');
|
|
takingPre += result.length;
|
|
//执行下一页渲染,第二参数为:满足“加载更多”的条件,即后面仍有分页
|
|
//pages为Ajax返回的总页数,只有当前页小于总页数的情况下,才会继续出现加载更多
|
|
next(lis.join(''), takingPre < res.count);
|
|
}
|
|
});
|
|
}
|
|
});
|
|
};
|
|
|
|
|
|
showDetail = function (obj) {
|
|
var index = layer.open({
|
|
title: '物料信息详情',
|
|
type: 2,
|
|
shade: 0.2,
|
|
maxmin: true,
|
|
shadeClose: true,
|
|
area: ['100%', '100%'],
|
|
content: '/material_view?id=' + obj,
|
|
end: function () {
|
|
//执行搜索重载
|
|
table.reload('currentTableId', {
|
|
url: '/material/material',
|
|
page: {
|
|
curr: 1
|
|
}
|
|
}, 'data');
|
|
}
|
|
});
|
|
$(window).on("resize", function () {
|
|
layer.full(index);
|
|
});
|
|
return false;
|
|
}
|
|
|
|
$('body').on('click', '[data-refresh]', function () {
|
|
location.reload();
|
|
})
|
|
});
|
|
</script>
|
|
|
|
</body>
|
|
</html>
|