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.
221 lines
10 KiB
221 lines
10 KiB
<!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.8.6/css/layui.css" media="all">
|
|
<link rel="stylesheet" href="/static/lib/font-awesome-4.7.0/css/font-awesome.min.css" media="all">
|
|
<link rel="stylesheet" href="/static/css/public.css" media="all">
|
|
</head>
|
|
<body>
|
|
<input th:value="${mcode}" style="display:none;" id="mcode">
|
|
<input th:value="${depositoryId}" style="display:none;" id="depositoryId">
|
|
<input th:value="${pid}" style="display:none;" id="pid">
|
|
<div class="layuimini-container">
|
|
<div class="layuimini-main">
|
|
<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-inline">
|
|
<label class="layui-form-label">物料名称:</label>
|
|
<div class="layui-input-block">
|
|
<input id="mname" name="mname" type="text" placeholder="请填写物料名称"
|
|
class="layui-input"/>
|
|
</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="mcode" autocomplete="off" class="layui-input"
|
|
placeholder="请填写物料编码">
|
|
</div>
|
|
</div>
|
|
<div class="layui-inline">
|
|
<button type="button" class="layui-btn layui-btn-primary" lay-submit
|
|
lay-filter="data-search-btn"><i class="layui-icon"></i> 搜 索
|
|
</button>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<ul class="flow-default" id="LAY_Inventory"></ul>
|
|
</div>
|
|
</div>
|
|
|
|
<script src="/static/lib/layui-v2.8.6/layui.js" charset="utf-8"></script>
|
|
<script src="/static/js/lay-config.js?v=1.0.4" charset="utf-8"></script>
|
|
|
|
<script>
|
|
function updateFlow() {
|
|
|
|
}
|
|
|
|
function chooseThis() {
|
|
|
|
}
|
|
|
|
layui.use(['layer', "form", "flow"], function () {
|
|
var $ = layui.jquery,
|
|
form = layui.form,
|
|
flow = layui.flow,
|
|
layer = layui.layer;
|
|
|
|
|
|
let takingPre = 0;
|
|
let size = 8;
|
|
|
|
let mcode = $("#mcode").val();
|
|
let depositoryId = $("#depositoryId").val();
|
|
let pid = $("#pid").val();
|
|
|
|
// 给每个按钮添加点击事件
|
|
chooseThis = function (code) {
|
|
// 获取当前点击物料编码
|
|
code = String(code);
|
|
// 获取当前点击物料名称
|
|
if (code !== mcode) {
|
|
// 如果点击的不是要出库的物料
|
|
layer.msg("请选择正确物料", {
|
|
icon: 0,
|
|
time: 500
|
|
}, function () {
|
|
$("#flagForSelect", window.parent.document).val(false);
|
|
})
|
|
} else {
|
|
$("#flagForSelect", window.parent.document).val(true);
|
|
var index = parent.layer.getFrameIndex(window.name);
|
|
parent.layer.close(index);
|
|
}
|
|
};
|
|
|
|
|
|
form.on('submit(data-search-btn)', function (data) {
|
|
var req = {};
|
|
data = data.field;
|
|
req.depositoryId = depositoryId;
|
|
req.pid = pid;
|
|
if (data.mname !== '') {
|
|
req.mname = data.mname.trim();
|
|
}
|
|
if (data.version !== '') {
|
|
req.version = data.version.trim();
|
|
}
|
|
if (data.mcode !== '') {
|
|
req.mcode = data.mcode.trim();
|
|
}
|
|
updateFlow(req);
|
|
});
|
|
|
|
flow.load({
|
|
elem: '#LAY_Inventory' //流加载容器
|
|
, done: function (page, next) { //执行下一页的回调
|
|
let result;
|
|
let lis = [];
|
|
let req = {};
|
|
req.depositoryId = depositoryId;
|
|
req.pid = pid;
|
|
req.page = page;
|
|
req.size = size;
|
|
$.ajax({
|
|
url: "/material/findInventoryForCompleteOutTask",
|
|
type: "post",
|
|
data: JSON.stringify(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 brand = result[i].brand;
|
|
let brandItem = '<p>' + "物料品牌:" + brand + '</p>';
|
|
if (brand === "" || brand === null) {
|
|
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="chooseThis('
|
|
+ result[i].code + ')"><div class="layui-card-header"><h3 style="font-weight: bold">' + result[i].mname + '</h3></div>');
|
|
lis.push('<div class="layui-col-md4 my-info" style="margin-left: 15px; color: #666;font-size: 15px;">'
|
|
+ '<p>' + "物料编码:" + result[i].code + '</p>'
|
|
+ '<p>' + "物料型号:" + result[i].version + '</p>'
|
|
+ brandItem
|
|
+ '<p>' + "物料类型:" + result[i].typeName + '</p>'
|
|
+ '</div></div></li>');
|
|
}
|
|
lis.push('</div>');
|
|
takingPre += result.length;
|
|
//执行下一页渲染,第二参数为:满足“加载更多”的条件,即后面仍有分页
|
|
//pages为Ajax返回的总页数,只有当前页小于总页数的情况下,才会继续出现加载更多
|
|
|
|
next(lis.join(''), takingPre < res.count);
|
|
}
|
|
})
|
|
|
|
}
|
|
});
|
|
|
|
updateFlow = function (req) {
|
|
$("#LAY_Inventory").empty();
|
|
takingPre = 0;
|
|
flow.load({
|
|
elem: '#LAY_Inventory' //流加载容器
|
|
, done: function (page, next) { //执行下一页的回调
|
|
let lis = [];
|
|
let result = [];
|
|
req.page = page;
|
|
req.size = size;
|
|
$.ajax({
|
|
url: "/material/findInventoryForCompleteOutTask",
|
|
type: "post",
|
|
data: JSON.stringify(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 brand = result[i].brand;
|
|
let brandItem = '<p>' + "物料品牌:" + brand + '</p>';
|
|
if (brand === "" || brand === null) {
|
|
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="chooseThis('
|
|
+ result[i].code + ')"><div class="layui-card-header"><h3 style="font-weight: bold">' + result[i].mname + '</h3></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
|
|
+ '<p>' + "物料类型:" + result[i].typeName + '</p>'
|
|
+ '</div></div></li>');
|
|
}
|
|
lis.push('</div>');
|
|
takingPre += result.length;
|
|
|
|
//执行下一页渲染,第二参数为:满足“加载更多”的条件,即后面仍有分页
|
|
//pages为Ajax返回的总页数,只有当前页小于总页数的情况下,才会继续出现加载更多
|
|
next(lis.join(''), takingPre < res.count);
|
|
}
|
|
});
|
|
|
|
}
|
|
})
|
|
};
|
|
})
|
|
</script>
|
|
</body>
|
|
</html>
|