|
|
|
@ -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> |
|
|
|
|