|
|
|
@ -43,6 +43,15 @@ |
|
|
|
.lay-step { |
|
|
|
display: none; |
|
|
|
} |
|
|
|
|
|
|
|
#chooseBusinessType { |
|
|
|
position: fixed; |
|
|
|
width: 400px; |
|
|
|
bottom: 20px; |
|
|
|
left: 0; |
|
|
|
right: 0; |
|
|
|
margin: auto; |
|
|
|
} |
|
|
|
</style> |
|
|
|
</head> |
|
|
|
<body> |
|
|
|
@ -72,6 +81,17 @@ |
|
|
|
</div> |
|
|
|
</form> |
|
|
|
<ul class="flow-default" id="LAY_InventoryShow"></ul> |
|
|
|
<div class="layui-form-item " id="chooseBusinessType" style="display: none"> |
|
|
|
<div class="layui-input-block"> |
|
|
|
<button class="layui-btn layui-btn-customize" type="button" |
|
|
|
onclick="applicationIn()">入库申请 |
|
|
|
</button> |
|
|
|
|
|
|
|
<button class="layui-btn layui-btn-customize" type="button" |
|
|
|
onclick="applicationOut()">出库申请 |
|
|
|
</button> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
@ -89,12 +109,20 @@ |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
function applicationIn() { |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
function applicationOut() { |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
var depositoryId = "-1"; |
|
|
|
var placeId = "0"; |
|
|
|
|
|
|
|
layui.use(['form', 'step', 'flow', 'inputTag'], function () { |
|
|
|
layui.use(['form', 'step', 'flow', 'miniTab'], function () { |
|
|
|
var $ = layui.$, |
|
|
|
inputTag = layui.inputTag, |
|
|
|
miniTab = layui.miniTab, |
|
|
|
flow = layui.flow, |
|
|
|
dropdown = layui.dropdown, //下拉菜单 |
|
|
|
step = layui.step; |
|
|
|
@ -103,6 +131,8 @@ |
|
|
|
let takingPre = 0; |
|
|
|
let size = 8; |
|
|
|
|
|
|
|
let chooseIdList = []; |
|
|
|
|
|
|
|
$(function () { |
|
|
|
let loading2 = layer.open({type: 3, shade: [0.25, '#000'], icon: 2, speed: 0}); |
|
|
|
$.ajax({ |
|
|
|
@ -138,6 +168,16 @@ |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
$.ajax({ |
|
|
|
url: "/material/getTemporaryValue", |
|
|
|
type: "post", |
|
|
|
dataType: 'json', |
|
|
|
data: JSON.stringify({"type": "Out","simple":"true"}), |
|
|
|
contentType: "application/json;charset=utf-8", |
|
|
|
success: function (res) { |
|
|
|
chooseIdList = res.data; |
|
|
|
} |
|
|
|
}); |
|
|
|
layer.close(loading2); |
|
|
|
}); |
|
|
|
|
|
|
|
@ -179,8 +219,10 @@ |
|
|
|
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" onclick="showDetail(' + resultElement.iid + ')">' + |
|
|
|
'<div class="layui-card-header"><h2>' + "物料名称:" + resultElement.mname + '</h2></div>'); |
|
|
|
lis.push('<li style="width:100%;margin-top: 10px;float:left;border: 1px solid #9999996e;"><div class="layui-card my-shadow my-card flow1" >' + |
|
|
|
'<div class="layui-card-header" style="height: 100%;line-height: normal">' + |
|
|
|
'<input id=' + resultElement.iid + ' type="checkbox" style="position: absolute;right: 1%;height: 100%;width: 20px" onchange="chooseBusiness(this)" lay-skin="tag">' + |
|
|
|
'<h2>' + "物料名称:" + resultElement.mname + '</h2></div>'); |
|
|
|
lis.push('<div class="layui-col-md4 my-info" style="margin-left: 15px; color: #999;font-size: 15px;">' |
|
|
|
+ '<p>' + "物料编码:" + resultElement.mcode + '</p>' |
|
|
|
+ '<p>' + "物料型号:" + resultElement.version + '</p>' |
|
|
|
@ -194,26 +236,90 @@ |
|
|
|
//执行下一页渲染,第二参数为:满足“加载更多”的条件,即后面仍有分页 |
|
|
|
//pages为Ajax返回的总页数,只有当前页小于总页数的情况下,才会继续出现加载更多 |
|
|
|
next(lis.join(''), takingPre < res.count); |
|
|
|
checkedInputCheck() |
|
|
|
} |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
}); |
|
|
|
}; |
|
|
|
|
|
|
|
showDetail = function (obj) { |
|
|
|
var index = layer.open({ |
|
|
|
title: '库存信息详情', |
|
|
|
type: 2, |
|
|
|
shade: 0.2, |
|
|
|
maxmin: true, |
|
|
|
shadeClose: true, |
|
|
|
area: ['100%', '100%'], |
|
|
|
content: '/InventoryView?id=' + obj, |
|
|
|
|
|
|
|
chooseBusiness = function (obj) { |
|
|
|
// 获取当前点击结果 |
|
|
|
let checked = $(obj).prop("checked"); |
|
|
|
// 获取要处理的id |
|
|
|
let id = $(obj).attr("id"); |
|
|
|
if (checked) { |
|
|
|
// 保存出入库id到redis中 |
|
|
|
$.ajax({ |
|
|
|
url: "/material/temporaryValue", |
|
|
|
type: "post", |
|
|
|
dataType: 'json', |
|
|
|
data: JSON.stringify({"id": id, "type": "Out"}), |
|
|
|
contentType: "application/json;charset=utf-8", |
|
|
|
}); |
|
|
|
$(window).on("resize", function () { |
|
|
|
layer.full(index); |
|
|
|
$.ajax({ |
|
|
|
url: "/material/temporaryValue", |
|
|
|
type: "post", |
|
|
|
dataType: 'json', |
|
|
|
data: JSON.stringify({"id": id, "type": "In"}), |
|
|
|
contentType: "application/json;charset=utf-8", |
|
|
|
}); |
|
|
|
|
|
|
|
$("#chooseBusinessType").show(); |
|
|
|
} else { |
|
|
|
// 删除保存redis中的出入库id |
|
|
|
$.ajax({ |
|
|
|
url: "/material/delTemporaryValue", |
|
|
|
type: 'post', |
|
|
|
data: JSON.stringify({"id": id, "type": "Out"}), |
|
|
|
dataType: 'json', |
|
|
|
contentType: "application/json;charset=utf-8", |
|
|
|
success: function (res) { |
|
|
|
let data = res.data; |
|
|
|
if (data === 0) { |
|
|
|
$("#chooseBusinessType").hide(); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
|
|
|
|
$.ajax({ |
|
|
|
url: "/material/delTemporaryValue", |
|
|
|
type: 'post', |
|
|
|
data: JSON.stringify({"id": id, "type": "In"}), |
|
|
|
dataType: 'json', |
|
|
|
contentType: "application/json;charset=utf-8" |
|
|
|
}) |
|
|
|
} |
|
|
|
return false; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
applicationIn = function(){ |
|
|
|
miniTab.openNewTabByIframeNew({ |
|
|
|
href: "/application_In_temporaryValue", |
|
|
|
title: "入库申请" |
|
|
|
}); |
|
|
|
}; |
|
|
|
|
|
|
|
applicationOut = function () { |
|
|
|
miniTab.openNewTabByIframeNew({ |
|
|
|
href: "/application_Out_temporaryValue", |
|
|
|
title: "出库申请" |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
checkedInputCheck = function () { |
|
|
|
if(chooseIdList.length > 0){ |
|
|
|
for (const checkedId of chooseIdList) { |
|
|
|
$("#"+checkedId).attr("checked","checked"); |
|
|
|
} |
|
|
|
$("#chooseBusinessType").show(); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|
|