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

132 lines
5.5 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/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>
<div class="layuimini-container">
<div class="layuimini-main">
<input id="depositoryId" type="text" th:value="${depositoryId}" style="display: none">
<input id="state" type="text" th:value="${state}" style="display: none">
<table class="layui-hide" id="currentTableId" lay-filter="currentTableFilter"></table>
</div>
</div>
<script type="text/html" id="currentTableBar">
{{# if(d.state == "进行中"){ }}
<a class="layui-btn layui-btn-normal layui-btn-xs data-count-edit" lay-event="scanQrCode">扫码</a>
{{# } }}
</script>
<script src="/static/lib/layui-v2.8.6/layui.js" charset="utf-8"></script>
<script>
layui.use(['form', 'table', 'laydate'], function () {
var $ = layui.jquery,
form = layui.form,
table = layui.table,
laydate = layui.laydate;
var depositoryId = $("#depositoryId").val();
// 0未完成1已完成
var state = $("#state").val();
table.render({
elem: "#currentTableId",
url: '/depositoryRecord/ApplicationOutMinByDid',
parseData: function (res) { //res 即为原始返回的数据
return {
"status": res.status, //解析接口状态
"message": res.statusInfo.message, //解析提示文本
"count": res.count, //解析数据长度
"data": res.data //解析数据列表
};
},
request: {
pageName: 'page', //页码的参数名称,默认:page
limitName: 'size' //每页数据量的参数名,默认:limit
},
where: {
"depositoryId": depositoryId,
"state": state
},
response: {
statusName: 'status' //规定数据状态的字段名称,默认:code
, statusCode: 200 //规定成功的状态码,默认:0
, msgName: 'message' //规定状态信息的字段名称,默认:msg
, countName: 'count' //规定数据总数的字段名称,默认:count
, dataName: 'data' //规定数据列表的字段名称,默认:data
},
height: 'full-255',//固定高度-即固定表头固定第一行首行
toolbar: '#toolbarDemo',
//这里layui和thymeleaf冲突了,要加个空格
cols: [
[
{title: '操作', width: 100, toolbar: '#currentTableBar', align: "center"},
{field: 'code', width: 200, title: '提交编码', sort: true},
{field: 'mname', width: 120, title: '物料名称'},
{field: 'version', width: 120, title: '规格型号'},
{field: 'mcode', width: 120, title: '物料编码'},
{field: 'producedDate', width: 120, title: '生产日期'},
{field: 'depositoryName', width: 120, title: '仓库名称'},
{field: 'pcode', width: 120, title: '库位编码'},
{field: 'showQuantity', width: 200, title: '数量'},
{field: 'applicantName', width: 150, title: '申请人'},
{field: 'applicantTime', width: 200, title: '申请时间', sort: true},
{field: 'applyRemark', width: 200, title: '备注'},
{field: 'state', width: 200, title: '状态'},
{field: 'checkerName', width: 200, title: '处理人'}
]
],
limits: [10, 15, 20, 25, 50,100],
limit: 10,
page: true,
skin: 'line',
done: function (res, curr, count) {
}
});
table.on('tool(currentTableFilter)', function (obj) {
let data = obj.data;
if (obj.event === 'scanQrCode') {
layer.open({
type: 2,
title: '扫码',
skin: 'layui-layer-rim',
maxmin: true,
shadeClose: true, //点击遮罩关闭层
area: ['100%', '100%'],
move: '.layui-layer-title',
fixed: false,
content: '/scanQrCodeByOut?id=' + data.id,
end: function () {
table.reloadData('currentTableId', {
url: '/depositoryRecord/ApplicationOutMinByDid',
page: {
curr: 1
}
}, 'data');
}
})
}
});
$('body').on('click', '[data-refresh]', function () {
location.reload();
})
});
</script>
</body>
</html>