|
|
|
@ -80,47 +80,51 @@ layui.use(['form', 'step', 'flow', 'table', 'inputTag'], function () { |
|
|
|
$("#LAY_FlowForMaterial").empty(); |
|
|
|
takingPre = 0; |
|
|
|
let req = {}; |
|
|
|
req.mid = $("#mid").val(); |
|
|
|
let mid = $("#mid").val(); |
|
|
|
req.mid = mid; |
|
|
|
req.size = size; |
|
|
|
flow.load({ |
|
|
|
elem: '#LAY_FlowForMaterial' //流加载容器
|
|
|
|
, done: function (page, next) { //执行下一页的回调
|
|
|
|
let result; |
|
|
|
let lis = []; |
|
|
|
req.page = page; |
|
|
|
$.ajax({ |
|
|
|
url: '/material/findMaterialByConditionForStockTaking', |
|
|
|
data: req, |
|
|
|
type: 'get', |
|
|
|
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 splitInventory = result[i].splitInventory; |
|
|
|
let keys = Object.keys(splitInventory); |
|
|
|
let InventoryItem = ""; |
|
|
|
for (let j = 0; j < keys.length; j++) { |
|
|
|
let key = keys[j]; |
|
|
|
let item = '<p>' + "计量单位:" + key + ";对应库存:" + splitInventory[key] + '</p>'; |
|
|
|
InventoryItem += item; |
|
|
|
if(mid !== ""){ |
|
|
|
flow.load({ |
|
|
|
elem: '#LAY_FlowForMaterial' //流加载容器
|
|
|
|
, done: function (page, next) { //执行下一页的回调
|
|
|
|
let result; |
|
|
|
let lis = []; |
|
|
|
req.page = page; |
|
|
|
$.ajax({ |
|
|
|
url: '/material/findMaterialByConditionForStockTaking', |
|
|
|
data: req, |
|
|
|
type: 'get', |
|
|
|
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 splitInventory = result[i].splitInventory; |
|
|
|
let keys = Object.keys(splitInventory); |
|
|
|
let InventoryItem = ""; |
|
|
|
for (let j = 0; j < keys.length; j++) { |
|
|
|
let key = keys[j]; |
|
|
|
let item = '<p>' + "计量单位:" + key + ";对应库存:" + splitInventory[key] + '</p>'; |
|
|
|
InventoryItem += item; |
|
|
|
} |
|
|
|
lis.push('<li style="width:100%;margin-top: 10px;float:left;border: 1px solid #9999996e;"><div class="layui-card my-shadow my-card flow1" iid='+result[i].id+' pid='+result[i].pid+' onclick="showDetail(this)">' + |
|
|
|
'<div class="layui-card-header"><h2>' + "所处位置:" + result[i].dname + "-" + result[i].kingdeecode + '</h2></div>'); |
|
|
|
lis.push('<div class="layui-col-md4 my-info" style="margin-left: 15px; color: #999;font-size: 15px;">' |
|
|
|
+ InventoryItem |
|
|
|
+ '</div></div></li>'); |
|
|
|
} |
|
|
|
lis.push('<li style="width:100%;margin-top: 10px;float:left;border: 1px solid #9999996e;"><div class="layui-card my-shadow my-card flow1" iid='+result[i].id+' pid='+result[i].pid+' onclick="showDetail(this)">' + |
|
|
|
'<div class="layui-card-header"><h2>' + "所处位置:" + result[i].dname + "-" + result[i].kingdeecode + '</h2></div>'); |
|
|
|
lis.push('<div class="layui-col-md4 my-info" style="margin-left: 15px; color: #999;font-size: 15px;">' |
|
|
|
+ InventoryItem |
|
|
|
+ '</div></div></li>'); |
|
|
|
lis.push('</div>'); |
|
|
|
takingPre += result.length; |
|
|
|
//执行下一页渲染,第二参数为:满足“加载更多”的条件,即后面仍有分页
|
|
|
|
//pages为Ajax返回的总页数,只有当前页小于总页数的情况下,才会继续出现加载更多
|
|
|
|
next(lis.join(''), takingPre < res.count); |
|
|
|
} |
|
|
|
lis.push('</div>'); |
|
|
|
takingPre += result.length; |
|
|
|
//执行下一页渲染,第二参数为:满足“加载更多”的条件,即后面仍有分页
|
|
|
|
//pages为Ajax返回的总页数,只有当前页小于总页数的情况下,才会继续出现加载更多
|
|
|
|
next(lis.join(''), takingPre < res.count); |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
@ -314,8 +318,8 @@ layui.use(['form', 'step', 'flow', 'table', 'inputTag'], function () { |
|
|
|
iframeChildren.css('height', '100%'); |
|
|
|
}, |
|
|
|
end: function () { |
|
|
|
var mid = $("#mid").val(); |
|
|
|
if (mid !== '') { |
|
|
|
if (mid !== "") { |
|
|
|
console.log(mid) |
|
|
|
let loading2 = layer.open({type: 3, shade: [0.25, '#000'], icon: 2, speed: 0}); |
|
|
|
$.ajax({ |
|
|
|
url: "/material/findMatrialById?mid=" + mid + "&type=out", |
|
|
|
|