|
|
@ -48,19 +48,13 @@ |
|
|
lay-filter="data-search-btn"><i class="layui-icon"></i> 搜 索 |
|
|
lay-filter="data-search-btn"><i class="layui-icon"></i> 搜 索 |
|
|
</button> |
|
|
</button> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
</form> |
|
|
</form> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
<div class="layui-btn-container"> |
|
|
|
|
|
<button class="layui-btn layui-btn-primary select_this" th:each="material,iterStar:${materialList}" |
|
|
<ul class="flow-default" id="LAY_Inventory"></ul> |
|
|
th:value="${material.getCode()}" |
|
|
|
|
|
th:text="${material.getMname()+','+(material.getVersion() == null ? '' :material.getVersion())}"> |
|
|
|
|
|
<i class="layui-icon layui-icon-down layui-font-12"></i> |
|
|
|
|
|
</button> |
|
|
|
|
|
</div> |
|
|
|
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
|
|
|
@ -68,17 +62,32 @@ |
|
|
<script src="/static/js/lay-config.js?v=1.0.4" charset="utf-8"></script> |
|
|
<script src="/static/js/lay-config.js?v=1.0.4" charset="utf-8"></script> |
|
|
|
|
|
|
|
|
<script> |
|
|
<script> |
|
|
layui.use(['layer',"form"], function () { |
|
|
function updateFlow() { |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function chooseThis() { |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
layui.use(['layer', "form", "flow"], function () { |
|
|
var $ = layui.jquery, |
|
|
var $ = layui.jquery, |
|
|
form = layui.form, |
|
|
form = layui.form, |
|
|
|
|
|
flow = layui.flow, |
|
|
layer = layui.layer; |
|
|
layer = layui.layer; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let takingPre = 0; |
|
|
|
|
|
let size = 8; |
|
|
|
|
|
|
|
|
let mcode = $("#mcode").val(); |
|
|
let mcode = $("#mcode").val(); |
|
|
|
|
|
let depositoryId = $("#depositoryId").val(); |
|
|
|
|
|
let pid = $("#pid").val(); |
|
|
|
|
|
|
|
|
// 给每个按钮添加点击事件 |
|
|
// 给每个按钮添加点击事件 |
|
|
$(".select_this").on("click", function () { |
|
|
chooseThis = function (code) { |
|
|
// 获取当前点击物料编码 |
|
|
// 获取当前点击物料编码 |
|
|
var code = this.value; |
|
|
code = String(code); |
|
|
// 获取当前点击物料名称 |
|
|
// 获取当前点击物料名称 |
|
|
if (code !== mcode) { |
|
|
if (code !== mcode) { |
|
|
// 如果点击的不是要出库的物料 |
|
|
// 如果点击的不是要出库的物料 |
|
|
@ -93,14 +102,14 @@ |
|
|
var index = parent.layer.getFrameIndex(window.name); |
|
|
var index = parent.layer.getFrameIndex(window.name); |
|
|
parent.layer.close(index); |
|
|
parent.layer.close(index); |
|
|
} |
|
|
} |
|
|
}); |
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
form.on('submit(data-search-btn)', function (data) { |
|
|
form.on('submit(data-search-btn)', function (data) { |
|
|
var req = {}; |
|
|
var req = {}; |
|
|
data = data.field; |
|
|
data = data.field; |
|
|
req.depositoryId = $("#depositoryId").val(); |
|
|
req.depositoryId = depositoryId; |
|
|
req.pid = $("#pid").val(); |
|
|
req.pid = pid; |
|
|
if (data.mname !== '') { |
|
|
if (data.mname !== '') { |
|
|
req.mname = data.mname.trim(); |
|
|
req.mname = data.mname.trim(); |
|
|
} |
|
|
} |
|
|
@ -110,6 +119,19 @@ |
|
|
if (data.mcode !== '') { |
|
|
if (data.mcode !== '') { |
|
|
req.mcode = data.mcode.trim(); |
|
|
req.mcode = data.mcode.trim(); |
|
|
} |
|
|
} |
|
|
|
|
|
updateFlow(req); |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
flow.load({ |
|
|
|
|
|
elem: '#LAY_Inventory' //流加载容器 |
|
|
|
|
|
, done: function (page, next) { //执行下一页的回调 |
|
|
|
|
|
let result; |
|
|
|
|
|
let lis = []; |
|
|
|
|
|
let req = {}; |
|
|
|
|
|
req.depositoryId = depositoryId; |
|
|
|
|
|
req.pid = pid; |
|
|
|
|
|
req.page = page; |
|
|
|
|
|
req.size = size; |
|
|
$.ajax({ |
|
|
$.ajax({ |
|
|
url: "/material/findInventoryForCompleteOutTask", |
|
|
url: "/material/findInventoryForCompleteOutTask", |
|
|
type: "post", |
|
|
type: "post", |
|
|
@ -117,10 +139,82 @@ |
|
|
dataType: "json", |
|
|
dataType: "json", |
|
|
contentType: "application/json;charset=utf-8", |
|
|
contentType: "application/json;charset=utf-8", |
|
|
success: function (res) { |
|
|
success: function (res) { |
|
|
console.log(res) |
|
|
result = res.data; |
|
|
|
|
|
lis.push("<div class='clearfix'>"); |
|
|
|
|
|
for (let i = 0; i < result.length; i++) { |
|
|
|
|
|
|
|
|
|
|
|
let brand = result[i].brand; |
|
|
|
|
|
let brandItem = '<p>' + "物料品牌:" + brand + '</p>'; |
|
|
|
|
|
if (brand === "" || brand === null) { |
|
|
|
|
|
brandItem = ""; |
|
|
|
|
|
} |
|
|
|
|
|
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="chooseThis(' |
|
|
|
|
|
+ result[i].code + ')"><div class="layui-card-header"><h3 style="font-weight: bold">' + result[i].mname + '</h3></div>'); |
|
|
|
|
|
lis.push('<div class="layui-col-md4 my-info" style="margin-left: 15px; color: #666;font-size: 15px;">' |
|
|
|
|
|
+ '<p>' + "物料编码:" + result[i].code + '</p>' |
|
|
|
|
|
+ '<p>' + "物料型号:" + result[i].version + '</p>' |
|
|
|
|
|
+ brandItem |
|
|
|
|
|
+ '<p>' + "物料类型:" + result[i].typeName + '</p>' |
|
|
|
|
|
+ '</div></div></li>'); |
|
|
|
|
|
} |
|
|
|
|
|
lis.push('</div>'); |
|
|
|
|
|
takingPre += result.length; |
|
|
|
|
|
//执行下一页渲染,第二参数为:满足“加载更多”的条件,即后面仍有分页 |
|
|
|
|
|
//pages为Ajax返回的总页数,只有当前页小于总页数的情况下,才会继续出现加载更多 |
|
|
|
|
|
|
|
|
|
|
|
next(lis.join(''), takingPre < res.count); |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
updateFlow = function (req) { |
|
|
|
|
|
$("#LAY_Inventory").empty(); |
|
|
|
|
|
takingPre = 0; |
|
|
|
|
|
flow.load({ |
|
|
|
|
|
elem: '#LAY_Inventory' //流加载容器 |
|
|
|
|
|
, done: function (page, next) { //执行下一页的回调 |
|
|
|
|
|
let lis = []; |
|
|
|
|
|
let result = []; |
|
|
|
|
|
req.page = page; |
|
|
|
|
|
req.size = size; |
|
|
|
|
|
$.ajax({ |
|
|
|
|
|
url: "/material/findInventoryForCompleteOutTask", |
|
|
|
|
|
type: "post", |
|
|
|
|
|
data: JSON.stringify(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++) { |
|
|
|
|
|
let brand = result[i].brand; |
|
|
|
|
|
let brandItem = '<p>' + "物料品牌:" + brand + '</p>'; |
|
|
|
|
|
if (brand === "" || brand === null) { |
|
|
|
|
|
brandItem = ""; |
|
|
|
|
|
} |
|
|
|
|
|
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="chooseThis(' |
|
|
|
|
|
+ result[i].code + ')"><div class="layui-card-header"><h3 style="font-weight: bold">' + result[i].mname + '</h3></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>' |
|
|
|
|
|
+ brandItem |
|
|
|
|
|
+ '<p>' + "物料类型:" + result[i].typeName + '</p>' |
|
|
|
|
|
+ '</div></div></li>'); |
|
|
|
|
|
} |
|
|
|
|
|
lis.push('</div>'); |
|
|
|
|
|
takingPre += result.length; |
|
|
|
|
|
|
|
|
|
|
|
//执行下一页渲染,第二参数为:满足“加载更多”的条件,即后面仍有分页 |
|
|
|
|
|
//pages为Ajax返回的总页数,只有当前页小于总页数的情况下,才会继续出现加载更多 |
|
|
|
|
|
next(lis.join(''), takingPre < res.count); |
|
|
|
|
|
} |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
}; |
|
|
}) |
|
|
}) |
|
|
</script> |
|
|
</script> |
|
|
</body> |
|
|
</body> |
|
|
|