已废弃
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.
 
 
 
 
 
 

146 lines
7.3 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.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">
<link rel="stylesheet" href="/static/lib/font-awesome-4.7.0/css/font-awesome.min.css" media="all">
</head>
<body>
<a id="refresh" href="javascript:" data-refresh="刷新"><i class="fa fa-refresh"></i></a>
<div class="layui-bg-gray">
<input id="depositoryId" type="text" th:value="${depositoryId}" style="display: none">
<input id="state" type="text" th:value="${state}" style="display: none">
<fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
<legend th:text="${depository.getDname()}"></legend>
</fieldset>
<ul class="flow-default" id="LAY_demo1"></ul>
</div>
<script src="/static/lib/layui-v2.6.3/layui.js" charset="utf-8"></script>
<script>
//先声明
function openDetail1(data) {
};
layui.use(['form', 'table','flow'], function () {
var $ = layui.jquery,
flow = layui.flow;
var depositoryId = $("#depositoryId").val();
// 0未完成1已完成
var state = $("#state").val();
let pre=0;
flow.load({
elem: '#LAY_demo1' //指定列表容器
,done: function(page, next){ //到达临界点(默认滚动触发),触发下一页
//以jQuery的Ajax请求为例,请求下一页数据(注意:page是从2开始返回)
var size=5; // 每页的数量
var req = {};
req.page = page;
req.size = size;
req.depositoryId = depositoryId;
req.state = state;
var lis = [];
$.ajax({
url:'/depositoryRecord/ApplicationOutMinByDid',
type:"get",
dataType: 'json',
contentType: "application/json;charset=utf-8",
data: req,
success:function (d) {
var data = d.data;
if(state === "0") {
for (let i = 0; i < data.length; i++) {
let producedDate = data[i].producedDate === null?"":data[i].producedDate;
let materialVersion = data[i].version === null ?"":data[i].version;
// 头部信息
lis.push('<li style="width:100%;">' +
'<div class="layui-card my-shadow my-card flow1"' +
' onclick="openDetail1(' + data[i].id + ')"><div class="layui-card-header"><h2>'
+ data[i].applicantName + '的');
lis.push('出库请求</h2></div>');
// 申请信息
lis.push('<div class="layui-col-md4 my-card-context">' +
'<h4> 物料名称:' + data[i].mname + '</h4>' +
'<h4> 规格型号:' + materialVersion + '</h4>' +
'<h4> 物料编码:' + data[i].mcode + '</h4>' +
'<h4> 出库数量:' + data[i].showQuantity + '</h4>' +
'<h4> 生产日期:' + producedDate + '</h4>' +
'<h4> 所处库位:' + data[i].pcode + '</h4>' +
'<div>备注:<h4> ' + data[i].applyRemark + '</h4></div>' +
'</div>');
// 底部信息
lis.push('<div class="layui-col-md4 my-time" style="margin-left: 15px; color: #999;font-size: 12px;">'
+ data[i].applicantTime + '</div></div></li><hr>');
}
}else{
for (let i = 0; i < data.length; i++) {
let producedDate = data[i].producedDate === null?"":data[i].producedDate;
let materialVersion = data[i].version === null ?"":data[i].version;
// 头部信息
lis.push('<li style="width:100%;">' +
'<div class="layui-card my-shadow my-card flow1"><div class="layui-card-header"><h2>'
+ data[i].applicantName + '的');
lis.push('出库请求</h2></div>');
// 申请信息
lis.push('<div class="layui-col-md4 my-card-context">' +
'<h4> 物料名称:' + data[i].mname + '</h4>' +
'<h4> 规格型号:' + materialVersion + '</h4>' +
'<h4> 物料编码:' + data[i].mcode + '</h4>' +
'<h4> 出库数量:' + data[i].quantity + '</h4>' +
'<h4> 处理人:' + data[i].checkerName + '</h4>' +
'<h4> 生产日期:' + producedDate+ '</h4>' +
'<h4> 所处库位:' + data[i].pcode + '</h4>' +
'<div>备注:<h4> ' + data[i].applyRemark + '</h4></div>' +
'</div>');
// 底部信息
lis.push('<div class="layui-col-md4 my-time" style="margin-left: 15px; color: #999;font-size: 12px;">'
+ data[i].applicantTime + '</div></div></li><hr>');
}
}
lis.push('</div>');
pre+=data.length;
//执行下一页渲染,第二参数为:满足“加载更多”的条件,即后面仍有分页
//pages为Ajax返回的总页数,只有当前页小于总页数的情况下,才会继续出现加载更多
next(lis.join(''), pre < d.count);
}
});
}
});
openDetail1 = function (id) {
var index = layer.open({
type: 2,
title: '扫码',
skin: 'layui-layer-rim',
maxmin: true,
shadeClose: true, //点击遮罩关闭层
area: ['100%', '100%'],
move : '.layui-layer-title',
fixed:false,
content: '/scanBarOrQrCodeOut?id='+id,
end:function () {
parent.layer.close(index);//关闭当前页
}
})
};
$('body').on('click', '[data-refresh]', function () {
location.reload();
})
});
</script>
</body>
</html>