Browse Source

在库存查询页面添加根据类型查询

lwx_dev
erdanergou 3 years ago
parent
commit
bd25105cea
  1. 3
      src/main/java/com/dreamchaser/depository_manage/controller/MaterialController.java
  2. 3
      src/main/java/com/dreamchaser/depository_manage/mapper/MaterialMapper.xml
  3. 33
      src/main/resources/templates/pages/depository/table-stock.html
  4. 106
      src/main/resources/templates/pages/depository/table-stock_mobile.html

3
src/main/java/com/dreamchaser/depository_manage/controller/MaterialController.java

@ -176,6 +176,9 @@ public class MaterialController {
if (!flag) {
// 如果不是一次成功
page = ObjectFormatUtil.toInteger(map.get("page"));
if(page == null){
page = 1;
}
if (size - list.size() != size) {
// 如果当前不是崭新一页
map.put("begin", 0);

3
src/main/java/com/dreamchaser/depository_manage/mapper/MaterialMapper.xml

@ -633,6 +633,9 @@
<include refid="allColumnsAndTypeNameOnViewByInventory"/>
from findInventory
where depositoryId = #{depositoryId}
<if test="materialTypeId != null">
AND mtid = #{materialTypeId}
</if>
<if test="begin != null and size != null">
LIMIT #{begin},#{size}
</if>

33
src/main/resources/templates/pages/depository/table-stock.html

@ -29,6 +29,15 @@
<input type="text" name="placeId" id="placeId" style="display: none">
</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="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">
@ -133,6 +142,27 @@
upload = layui.upload,
table = layui.table;
$('#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%');
}
});
});
$('#openSonByDepository').on('click', function () {
layer.open({
@ -286,6 +316,9 @@
if (data.version !== '') {
req.version = data.version.trim();
}
if (data.materialTypeId !== '') {
req.materialTypeId = data.materialTypeId;
}
//执行搜索重载
table.reload('currentTableId', {
url: '/material/findInventory',

106
src/main/resources/templates/pages/depository/table-stock_mobile.html

@ -27,8 +27,10 @@
</style>
<div class="layuimini-container">
<div class="layuimini-main">
<fieldset class="table-search-fieldset">
<legend id="top">搜索信息</legend>
<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">
<input style="display: none" th:value="${number}" id="number">
<form class="layui-form layui-form-pane" action="">
@ -36,13 +38,23 @@
<div class="layui-inline">
<label class="layui-form-label">仓库</label>
<div class="layui-input-block">
<input type="text" placeholder="请选择仓库" class="layui-input" id="openSonByDepository"
<input type="text" placeholder="请选择仓库" class="layui-input"
id="openSonByDepository"
readonly/>
<input type="text" name="depositoryId" class="layui-input" id="depositoryId"
style="display: none"/>
<input type="text" name="placeId" id="placeId" style="display: none">
</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="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">
@ -60,7 +72,8 @@
<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"
<input type="text" class="layui-input" id="version" name="version"
autocomplete="off"
placeholder="请填写物料型号"/>
</div>
</div>
@ -73,7 +86,10 @@
</div>
</form>
</div>
</fieldset>
</div>
</div>
</div>
<ul class="flow-default" id="LAY_Inventory"></ul>
@ -101,17 +117,21 @@
}
function updateFlow(){
}
let socket = null;
let newIndexShade;
layui.use(['form', 'table', 'upload', 'flow'], function () {
layui.use(['form', 'upload', 'flow', 'element'], function () {
var $ = layui.jquery,
form = layui.form,
upload = layui.upload,
flow = layui.flow,
table = layui.table;
element = layui.element;
let takingPre = 0;
let size = 8;
@ -134,6 +154,7 @@
+ '<p>' + result[i].code + '</p>'
+ '<p>' + result[i].version + '</p>'
+ '<p>' + "品牌:" + result[i].brand + '</p>'
+ '<p>' + result[i].typeName + '</p>'
+ '</div></div></li>');
}
lis.push('</div>');
@ -166,8 +187,26 @@
});
});
$('#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%');
}
});
});
// 用于进行渲染库位编码
@ -197,10 +236,59 @@
if (data.version !== '') {
req.version = data.version.trim();
}
if (data.materialTypeId !== '') {
req.materialTypeId = data.materialTypeId;
}
if(Object.keys(req).length === 0){
updateFlow({"data":[]})
}else{
$.ajax({
url: "/material/findInventory",
type: "get",
data: req,
dataType: "json",
contentType: "application/json;charset=utf-8",
success:function (res) {
takingPre = 0;
$("#LAY_Inventory").empty();
updateFlow(res);
}
});
}
//执行搜索重载
return false;
});
updateFlow = function(res){
flow.load({
elem: '#LAY_Inventory' //流加载容器
, done: function (page, next) { //执行下一页的回调
let lis = [];
let result = res.data;
lis.push("<div class='clearfix'>");
for (let i = 0; i < result.length; i++) {
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>'
+ '<p>' + "品牌:" + result[i].brand + '</p>'
+ '<p>' + result[i].typeName + '</p>'
+ '</div></div></li>');
}
lis.push('</div>');
takingPre += result.length;
//执行下一页渲染,第二参数为:满足“加载更多”的条件,即后面仍有分页
//pages为Ajax返回的总页数,只有当前页小于总页数的情况下,才会继续出现加载更多
next(lis.join(''), takingPre < res.count);
}
})
};
closeShowDataMessage = function () {
$("#layui-layer-shade-x" + newIndexShade).remove();

Loading…
Cancel
Save