Browse Source

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

lwx_dev
erdanergou 3 years ago
parent
commit
4a7a57b869
  1. 83
      src/main/resources/templates/pages/depository/table-stock_mobile.html
  2. 3
      target/classes/com/dreamchaser/depository_manage/mapper/MaterialMapper.xml
  3. 33
      target/classes/templates/pages/depository/table-stock.html

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

@ -49,9 +49,11 @@
<div class="layui-inline">
<label class="layui-form-label">类型</label>
<div class="layui-input-block">
<input type="text" placeholder="请选择物料类型" class="layui-input" id="openSonByMateralType"
<input type="text" placeholder="请选择物料类型" class="layui-input"
id="openSonByMateralType"
readonly/>
<input type="text" id="materialTypeId" placeholder="请选择物料类型" name="materialTypeId"
<input type="text" id="materialTypeId" placeholder="请选择物料类型"
name="materialTypeId"
class="layui-input" style="display: none"/>
</div>
</div>
@ -117,7 +119,7 @@
}
function updateFlow(){
function updateFlow() {
}
@ -146,6 +148,7 @@
$.get('/material/findInventory?page=' + page + '&size=' + size, function (res) {
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('
@ -161,6 +164,7 @@
takingPre += result.length;
//执行下一页渲染,第二参数为:满足“加载更多”的条件,即后面仍有分页
//pages为Ajax返回的总页数,只有当前页小于总页数的情况下,才会继续出现加载更多
next(lis.join(''), takingPre < res.count);
});
}
@ -239,52 +243,49 @@
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);
}
});
}
updateFlow(req);
//执行搜索重载
return false;
});
updateFlow = function(res){
updateFlow = function (req) {
$("#LAY_Inventory").empty();
takingPre = 0;
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>');
let result = [];
req.page = page;
req.size = size;
$.ajax({
url: "/material/findInventory",
type: "get",
data: 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++) {
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);
}
});
takingPre += result.length;
//执行下一页渲染,第二参数为:满足“加载更多”的条件,即后面仍有分页
//pages为Ajax返回的总页数,只有当前页小于总页数的情况下,才会继续出现加载更多
next(lis.join(''), takingPre < res.count);
}
})
};
@ -315,7 +316,9 @@
});
return false;
}
});
</script>
</body>

3
target/classes/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
target/classes/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',

Loading…
Cancel
Save