|
|
|
|
<!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.8.6/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">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<fieldset class="table-search-fieldset">
|
|
|
|
|
<legend>搜索信息</legend>
|
|
|
|
|
<div style="margin: 10px 10px 10px 10px">
|
|
|
|
|
<form class="layui-form layui-form-pane" action="">
|
|
|
|
|
<input style="display: none" th:value="${type}" id="selectDepositoryType">
|
|
|
|
|
<div class="layui-form-item">
|
|
|
|
|
<div class="layui-inline">
|
|
|
|
|
<label class="layui-form-label">申请时间</label>
|
|
|
|
|
<div class="layui-input-block" >
|
|
|
|
|
<input type="text" style="display:inline;width: 130px;" id="startDate" name="startDate" autocomplete="off" placeholder="开始日期" class="layui-input">
|
|
|
|
|
-
|
|
|
|
|
<input type="text" style="display:inline;width: 130px;" id="endDate" name="endDate" autocomplete="off" placeholder="结束日期" class="layui-input">
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="layui-inline">
|
|
|
|
|
<label class="layui-form-label">仓库:</label>
|
|
|
|
|
<div class="layui-input-block">
|
|
|
|
|
<input type="text" placeholder="请选择仓库" class="layui-input"
|
|
|
|
|
id="openSonByDepository" readonly onclick="openDepositoryTree(this)"
|
|
|
|
|
/>
|
|
|
|
|
<input type="text" name="depositoryId" class="layui-input" id="depositoryId"
|
|
|
|
|
style="display: none"/>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<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" name="mcode" 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" class="layui-input" id="code" name="code" autocomplete="off" placeholder="请填写申请记录编码"/>
|
|
|
|
|
</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>
|
|
|
|
|
</fieldset>
|
|
|
|
|
|
|
|
|
|
<script type="text/html" id="toolbarDemo">
|
|
|
|
|
<div class="layui-btn-container">
|
|
|
|
|
<button class="layui-btn layui-btn-normal layui-btn-sm data-add-btn" lay-event="add"> 添加</button>
|
|
|
|
|
<button class="layui-btn layui-btn-sm layui-btn-danger data-delete-btn" lay-event="delete" th:style="'display:'+${display}"> 删除</button>
|
|
|
|
|
</div>
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<table class="layui-hide" id="currentTableId" lay-filter="currentTableFilter"></table>
|
|
|
|
|
|
|
|
|
|
<script id="applicationInCode" type="text/html">
|
|
|
|
|
<a id="{{d.id}}" onclick="showDetail(this)">{{d.aircode}}</a>
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<script type="text/html" id="currentTableBar">
|
|
|
|
|
<a class="layui-btn layui-btn-normal layui-btn-xs data-count-edit" lay-event="detail">详情</a>
|
|
|
|
|
<a class="layui-btn layui-btn-xs layui-btn-danger data-count-delete" lay-event="delete" th:style="'display:'+${display}">删除</a>
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<script src="/static/lib/layui-v2.8.6/layui.js" charset="utf-8"></script>
|
|
|
|
|
<script>
|
|
|
|
|
// 用于加载仓库菜单
|
|
|
|
|
function openDepositoryTree(obj) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function selectMaterialByName(obj) {
|
|
|
|
|
}
|
|
|
|
|
function showDetail(){
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
layui.use(['form', 'table', 'laydate'], function () {
|
|
|
|
|
var $ = layui.jquery,
|
|
|
|
|
form = layui.form,
|
|
|
|
|
table = layui.table,
|
|
|
|
|
laydate = layui.laydate;
|
|
|
|
|
|
|
|
|
|
// 用于打开仓库树形菜单
|
|
|
|
|
openDepositoryTree = function (obj) {
|
|
|
|
|
var parent = obj.parentNode.parentNode.parentNode;
|
|
|
|
|
var parentId = parent.id;
|
|
|
|
|
let selectDepositoryType = $("#selectDepositoryType").val();
|
|
|
|
|
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='+selectDepositoryType+'&clickObj=' + parentId,
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//日期
|
|
|
|
|
laydate.render({
|
|
|
|
|
elem: '#startDate',
|
|
|
|
|
type: 'datetime'
|
|
|
|
|
}); //日期
|
|
|
|
|
laydate.render({
|
|
|
|
|
elem: '#endDate',
|
|
|
|
|
type: 'datetime'
|
|
|
|
|
});
|
|
|
|
|
table.render({
|
|
|
|
|
elem: "#currentTableId",
|
|
|
|
|
url: '/depositoryRecord/applicationInView',
|
|
|
|
|
parseData: function (res) { //res 即为原始返回的数据
|
|
|
|
|
return {
|
|
|
|
|
"status": res.status, //解析接口状态
|
|
|
|
|
"message": res.statusInfo.message, //解析提示文本
|
|
|
|
|
"count": res.count, //解析数据长度
|
|
|
|
|
"data": res.data //解析数据列表
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
height: 'full-255',//固定高度-即固定表头固定第一行首行
|
|
|
|
|
request: {
|
|
|
|
|
pageName: 'page', //页码的参数名称,默认:page
|
|
|
|
|
limitName: 'size' //每页数据量的参数名,默认:limit
|
|
|
|
|
},
|
|
|
|
|
where: {},
|
|
|
|
|
response: {
|
|
|
|
|
statusName: 'status' //规定数据状态的字段名称,默认:code
|
|
|
|
|
, statusCode: 200 //规定成功的状态码,默认:0
|
|
|
|
|
, msgName: 'message' //规定状态信息的字段名称,默认:msg
|
|
|
|
|
, countName: 'count' //规定数据总数的字段名称,默认:count
|
|
|
|
|
, dataName: 'data' //规定数据列表的字段名称,默认:data
|
|
|
|
|
},
|
|
|
|
|
toolbar: '#toolbarDemo',
|
|
|
|
|
defaultToolbar: ['filter', 'exports', 'print'],
|
|
|
|
|
//这里layui和thymeleaf冲突了,要加个空格
|
|
|
|
|
cols: [
|
|
|
|
|
[
|
|
|
|
|
{type: "checkbox", width: 50},
|
|
|
|
|
{field: 'aircode',title: '存货编码', width: 150, templet: '#applicationInCode'},
|
|
|
|
|
{field: 'mname', width: 150, title: '物料名称'},
|
|
|
|
|
{field: 'mversion', width: 150, title: '规格型号'},
|
|
|
|
|
{field: 'airUnit', width: 100, title: '计量单位'},
|
|
|
|
|
{field: 'mcode', width: 150, title: '存货编码'},
|
|
|
|
|
{field: 'quantity', width: 150, title: '数量', sort: true},
|
|
|
|
|
{field: 'depositoryName', width: 150, title: '仓库名称'},
|
|
|
|
|
{field: 'applicantName', width: 200, title: '提交人'},
|
|
|
|
|
{field: 'adminorgName', width: 150, title: '提交人部门'},
|
|
|
|
|
{field: 'applicantTime', width: 200, title: '提交时间', sort: true},
|
|
|
|
|
{field: 'applyRemark', width: 200, title: '备注'},
|
|
|
|
|
{field: 'airstate', width: 200, title: '状态'},
|
|
|
|
|
{title: '操作', minWidth: 150, toolbar: '#currentTableBar', align: "center"}
|
|
|
|
|
]
|
|
|
|
|
],
|
|
|
|
|
limits: [10, 15, 20, 25, 50,100],
|
|
|
|
|
limit: 10,
|
|
|
|
|
page: true,
|
|
|
|
|
skin: 'line',
|
|
|
|
|
done: function () {
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// 监听搜索操作
|
|
|
|
|
form.on('submit(data-search-btn)', function (data) {
|
|
|
|
|
var req = {};
|
|
|
|
|
data = data.field;
|
|
|
|
|
if (data.mname !== '') {
|
|
|
|
|
req.mname = data.mname.trim();
|
|
|
|
|
}
|
|
|
|
|
if (data.depositoryId !== '') {
|
|
|
|
|
req.depositoryId = data.depositoryId;
|
|
|
|
|
}
|
|
|
|
|
if (data.startDate !== '') {
|
|
|
|
|
req.startDate = data.startDate;
|
|
|
|
|
}
|
|
|
|
|
if (data.endDate !== '') {
|
|
|
|
|
req.endDate = data.endDate;
|
|
|
|
|
}
|
|
|
|
|
if (data.code !== '') {
|
|
|
|
|
req.code = data.code.trim();
|
|
|
|
|
}
|
|
|
|
|
if (data.mcode !== '') {
|
|
|
|
|
req.mcode = data.mcode.trim();
|
|
|
|
|
}
|
|
|
|
|
if (data.version !== '') {
|
|
|
|
|
req.version = data.version.trim();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//执行搜索重载
|
|
|
|
|
table.reloadData('currentTableId', {
|
|
|
|
|
url: '/depositoryRecord/applicationInView',
|
|
|
|
|
page: {
|
|
|
|
|
curr: 1
|
|
|
|
|
},
|
|
|
|
|
where: req
|
|
|
|
|
}, 'data');
|
|
|
|
|
return false;
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* toolbar监听事件
|
|
|
|
|
*/
|
|
|
|
|
table.on('toolbar(currentTableFilter)', function (obj) {
|
|
|
|
|
if (obj.event === 'add') { // 监听添加操作
|
|
|
|
|
var index = layer.open({
|
|
|
|
|
title: '入库申请',
|
|
|
|
|
type: 2,
|
|
|
|
|
shade: 0.2,
|
|
|
|
|
maxmin: true,
|
|
|
|
|
shadeClose: true,
|
|
|
|
|
area: ['100%', '100%'],
|
|
|
|
|
content: '/application_in',
|
|
|
|
|
});
|
|
|
|
|
$(window).on("resize", function () {
|
|
|
|
|
layer.full(index);
|
|
|
|
|
});
|
|
|
|
|
} else if (obj.event === 'delete') { // 监听删除操作
|
|
|
|
|
var checkStatus = table.checkStatus('currentTableId')
|
|
|
|
|
, data = checkStatus.data;
|
|
|
|
|
var req = {};
|
|
|
|
|
req.ids = [];
|
|
|
|
|
for (i = 0, len = data.length; i < len; i++) {
|
|
|
|
|
req.ids[i] = data[i].id;
|
|
|
|
|
}
|
|
|
|
|
if (req.ids.length > 0) {
|
|
|
|
|
layer.confirm('真的删除么', {icon: 2, title: '提示'}, function (index) {
|
|
|
|
|
$.ajax({
|
|
|
|
|
url: '/depositoryRecord/deleteApplicationInRecord',
|
|
|
|
|
type: 'post',
|
|
|
|
|
dataType: 'json',
|
|
|
|
|
contentType: "application/json;charset=utf-8",
|
|
|
|
|
data: JSON.stringify(req),
|
|
|
|
|
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.message);//失败的表情
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
layer.msg("删除成功", {
|
|
|
|
|
icon: 6,//成功的表情
|
|
|
|
|
time: 500 //1秒关闭(如果不配置,默认是3秒)
|
|
|
|
|
});
|
|
|
|
|
//执行搜索重载
|
|
|
|
|
table.reloadData('currentTableId', {
|
|
|
|
|
url: '/depositoryRecord/applicationInView',
|
|
|
|
|
page: {
|
|
|
|
|
curr: 1
|
|
|
|
|
}
|
|
|
|
|
}, 'data');
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
} else {
|
|
|
|
|
layer.msg("未选中记录,请确认!");
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
//监听表格复选框选择
|
|
|
|
|
table.on('checkbox(currentTableFilter)', function (obj) {
|
|
|
|
|
console.log(obj)
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
table.on('tool(currentTableFilter)', function (obj) {
|
|
|
|
|
let data = obj.data;
|
|
|
|
|
if (obj.event === 'detail') {
|
|
|
|
|
var index = layer.open({
|
|
|
|
|
title: '入库信息详情',
|
|
|
|
|
type: 2,
|
|
|
|
|
shade: 0.2,
|
|
|
|
|
maxmin: true,
|
|
|
|
|
shadeClose: true,
|
|
|
|
|
area: ['100%', '100%'],
|
|
|
|
|
content: '/form_step_look?id=' + data.id,
|
|
|
|
|
});
|
|
|
|
|
$(window).on("resize", function () {
|
|
|
|
|
layer.full(index);
|
|
|
|
|
});
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
else if (obj.event === 'delete') {
|
|
|
|
|
var req = {};
|
|
|
|
|
req.id = data.id;
|
|
|
|
|
layer.confirm('真的删除么', {icon: 2, title: '提示'}, function (index) {
|
|
|
|
|
$.ajax({
|
|
|
|
|
url: '/depositoryRecord/deleteApplicationInRecord',
|
|
|
|
|
type: 'post',
|
|
|
|
|
dataType: 'json',
|
|
|
|
|
contentType: "application/json;charset=utf-8",
|
|
|
|
|
data: JSON.stringify(req),
|
|
|
|
|
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.message);//失败的表情
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
obj.del();
|
|
|
|
|
layer.msg("删除成功", {
|
|
|
|
|
icon: 6,//成功的表情
|
|
|
|
|
time: 500 //1秒关闭(如果不配置,默认是3秒)
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
//用于实现物料名称搜索
|
|
|
|
|
selectMaterialByName = function (obj) {
|
|
|
|
|
// 输入code
|
|
|
|
|
var data = obj.value;
|
|
|
|
|
// 获取对应元素
|
|
|
|
|
var req = {};
|
|
|
|
|
layer.open({
|
|
|
|
|
type: 2,
|
|
|
|
|
title: '弹窗内容',
|
|
|
|
|
skin: 'layui-layer-rim',
|
|
|
|
|
maxmin: true,
|
|
|
|
|
shadeClose: true, //点击遮罩关闭层
|
|
|
|
|
area: ['70%', '70%'],
|
|
|
|
|
content: '/getMaterialAll?type=1&mname=""',
|
|
|
|
|
move: '.layui-layer-title',
|
|
|
|
|
fixed: false
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
showDetail = function (obj) {
|
|
|
|
|
var index = layer.open({
|
|
|
|
|
title: '入库信息详情',
|
|
|
|
|
type: 2,
|
|
|
|
|
shade: 0.2,
|
|
|
|
|
maxmin: true,
|
|
|
|
|
shadeClose: true,
|
|
|
|
|
area: ['100%', '100%'],
|
|
|
|
|
content: '/form_step_look?id=' + obj.id,
|
|
|
|
|
});
|
|
|
|
|
$(window).on("resize", function () {
|
|
|
|
|
layer.full(index);
|
|
|
|
|
});
|
|
|
|
|
return false;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
$('body').on('click', '[data-refresh]', function () {
|
|
|
|
|
location.reload();
|
|
|
|
|
})
|
|
|
|
|
});
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
</body>
|
|
|
|
|
</html>
|