|
|
|
@ -128,6 +128,15 @@ |
|
|
|
</select> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="layui-form-item" id="depositoryId" |
|
|
|
th:style="'display:'+${display}"> |
|
|
|
<label class="layui-form-label">仓库:</label> |
|
|
|
<div class="layui-input-block"> |
|
|
|
<select name="depositoryId" id="showDepository"> |
|
|
|
|
|
|
|
</select> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="layui-form-item"> |
|
|
|
<label class="layui-form-label">备注说明:</label> |
|
|
|
<div class="layui-input-block"> |
|
|
|
@ -341,8 +350,8 @@ |
|
|
|
var params = []; |
|
|
|
|
|
|
|
// 用于标志当前表单是否第一次提交 |
|
|
|
let flagForForm = false; |
|
|
|
let GroupflagForForm = false; |
|
|
|
let flagForForm = false; |
|
|
|
let GroupflagForForm = false; |
|
|
|
|
|
|
|
// 用于暂存卡片个数(组合) |
|
|
|
var params2 = []; |
|
|
|
@ -355,6 +364,9 @@ |
|
|
|
step = layui.step; |
|
|
|
|
|
|
|
|
|
|
|
let depositoryDisplay = $("#depositoryId").css("display"); |
|
|
|
|
|
|
|
|
|
|
|
// 用于分步表单加载 |
|
|
|
step.render({ |
|
|
|
elem: '#stepForm', |
|
|
|
@ -382,7 +394,7 @@ |
|
|
|
|
|
|
|
// 提交(物料出库) |
|
|
|
form.on('submit(formStep)', function (data) { |
|
|
|
if(!flagForForm){ |
|
|
|
if (!flagForForm) { |
|
|
|
flagForForm = true; |
|
|
|
data = data.field; |
|
|
|
data.params = params; |
|
|
|
@ -408,6 +420,7 @@ |
|
|
|
} |
|
|
|
data.params = remove(data.params, Number(keyNumber)); |
|
|
|
} |
|
|
|
|
|
|
|
$.ajax({ |
|
|
|
url: "/depositoryRecord/applicationOut", |
|
|
|
type: 'post', |
|
|
|
@ -420,7 +433,7 @@ |
|
|
|
success: function (data) { |
|
|
|
layer.close(this.layerIndex); |
|
|
|
if (data.status >= 300) { |
|
|
|
layer.msg(data.statusInfo.message,{icon:0,time:500},function () { |
|
|
|
layer.msg(data.statusInfo.message, {icon: 0, time: 500}, function () { |
|
|
|
flagForForm = false; |
|
|
|
});//失败的表情 |
|
|
|
|
|
|
|
@ -445,7 +458,7 @@ |
|
|
|
|
|
|
|
// 提交(组合出库) |
|
|
|
form.on('submit(formStep2)', function (data) { |
|
|
|
if(!GroupflagForForm){ |
|
|
|
if (!GroupflagForForm) { |
|
|
|
GroupflagForForm = true; |
|
|
|
data = data.field; |
|
|
|
data.params = params2; |
|
|
|
@ -484,7 +497,7 @@ |
|
|
|
success: function (d) { |
|
|
|
layer.close(this.layerIndex); |
|
|
|
if (d.status >= 300) { |
|
|
|
layer.msg(data.statusInfo.message,{icon:0,time:500},function () { |
|
|
|
layer.msg(data.statusInfo.message, {icon: 0, time: 500}, function () { |
|
|
|
flagForForm = false; |
|
|
|
});//失败的表情 |
|
|
|
|
|
|
|
@ -577,6 +590,15 @@ |
|
|
|
<div class="layui-input-block"> |
|
|
|
<select id=` + "unit" + NewIdNumber + ` name=` + "unit" + NewIdNumber + `> |
|
|
|
|
|
|
|
</select> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="layui-form-item" id=` + "depositoryId" + NewIdNumber + ` |
|
|
|
style="display:` + depositoryDisplay + `"> |
|
|
|
<label class="layui-form-label">仓库:</label> |
|
|
|
<div class="layui-input-block"> |
|
|
|
<select name=` + "depositoryId" + NewIdNumber + ` id=` + "showDepository" + NewIdNumber + `> |
|
|
|
|
|
|
|
</select> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
@ -592,7 +614,14 @@ |
|
|
|
// 获取当前高度 |
|
|
|
var height = parseInt(($("#stepForm").css('height')).split("px")[0]); |
|
|
|
params.push(NewIdNumber); |
|
|
|
$("#stepForm").css("height", height + 422 + 'px'); |
|
|
|
|
|
|
|
if (depositoryDisplay === "none") { |
|
|
|
|
|
|
|
$("#stepForm").css("height", height + 422 + 'px'); |
|
|
|
} else { |
|
|
|
|
|
|
|
$("#stepForm").css("height", height + 435 + 'px'); |
|
|
|
} |
|
|
|
$("#" + parentId).after(materialItem); |
|
|
|
}; |
|
|
|
|
|
|
|
@ -734,7 +763,13 @@ |
|
|
|
// 获取祖父节点 |
|
|
|
var reparent = parent.parentNode; |
|
|
|
var height = parseInt(($("#stepForm").css('height')).split("px")[0]); |
|
|
|
$("#stepForm").css("height", height - 422 + 'px'); |
|
|
|
if (depositoryDisplay === "none") { |
|
|
|
|
|
|
|
$("#stepForm").css("height", height - 422 + 'px'); |
|
|
|
} else { |
|
|
|
|
|
|
|
$("#stepForm").css("height", height - 435 + 'px'); |
|
|
|
} |
|
|
|
params = remove(params, parentId); |
|
|
|
reparent.removeChild(parent); |
|
|
|
}; |
|
|
|
@ -784,7 +819,7 @@ |
|
|
|
req.code = code; |
|
|
|
req.type = "out"; |
|
|
|
if (code !== "") { |
|
|
|
let loading2 = layer.open({ type: 3, shade: [0.25, '#000'], icon: 2, speed: 0}); |
|
|
|
let loading2 = layer.open({type: 3, shade: [0.25, '#000'], icon: 2, speed: 0}); |
|
|
|
$.ajax({ |
|
|
|
url: "/material/findMatrialByCode", |
|
|
|
type: "get", |
|
|
|
@ -794,7 +829,7 @@ |
|
|
|
success: function (d) { |
|
|
|
var d = d.data; |
|
|
|
if (d == null) { |
|
|
|
layer.msg("仓库中暂无该物料",{icon:5,time:500},function () { |
|
|
|
layer.msg("仓库中暂无该物料", {icon: 5, time: 500}, function () { |
|
|
|
materialName.value = ""; |
|
|
|
materialId.value = ""; |
|
|
|
obj.value = ""; |
|
|
|
@ -815,7 +850,7 @@ |
|
|
|
for (let i = 0; i < unitList.length; i++) { |
|
|
|
$("#unit" + idNumber).append(new Option(unitList[i].newUnit, unitList[i].newUnit)); |
|
|
|
} |
|
|
|
form.render(); |
|
|
|
|
|
|
|
if (materialAndBarCodeList.length > 0) { |
|
|
|
// 如果有对应的条形码 |
|
|
|
var barCodeInput = barCodeItem.childNodes[1].childNodes[1]; |
|
|
|
@ -845,6 +880,16 @@ |
|
|
|
} |
|
|
|
layer.close(loading2) |
|
|
|
} |
|
|
|
if (depositoryDisplay !== "none") { |
|
|
|
$("#showDepository" + idNumber).empty(); |
|
|
|
let depositoryList = d.depositoryList; |
|
|
|
if (depositoryList !== null) { |
|
|
|
for (let i = 0; i < depositoryList.length; i++) { |
|
|
|
$("#showDepository" + idNumber).append(new Option(depositoryList[i].dname, depositoryList[i].id)); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
form.render(); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
@ -870,7 +915,7 @@ |
|
|
|
let req = {}; |
|
|
|
req.code = code; |
|
|
|
if (code !== "") { |
|
|
|
let loading2 = layer.open({ type: 3, shade: [0.25, '#000'], icon: 2, speed: 0}); |
|
|
|
let loading2 = layer.open({type: 3, shade: [0.25, '#000'], icon: 2, speed: 0}); |
|
|
|
$.ajax({ |
|
|
|
url: "/group/findGroupByCode", |
|
|
|
type: "post", |
|
|
|
@ -959,7 +1004,7 @@ |
|
|
|
|
|
|
|
var mid = materialId.value; |
|
|
|
if (mid !== '') { |
|
|
|
let loading2 = layer.open({ type: 3, shade: [0.25, '#000'], icon: 2, speed: 0}); |
|
|
|
let loading2 = layer.open({type: 3, shade: [0.25, '#000'], icon: 2, speed: 0}); |
|
|
|
$.ajax({ |
|
|
|
url: "/material/findMatrialById?mid=" + mid + "&type=out", |
|
|
|
type: "get", |
|
|
|
@ -1009,8 +1054,17 @@ |
|
|
|
barCode.empty(); |
|
|
|
} |
|
|
|
} |
|
|
|
layer.close(loading2); |
|
|
|
if (depositoryDisplay !== "none") { |
|
|
|
$("#showDepository" + idNumber).empty(); |
|
|
|
let depositoryList = material.depositoryList; |
|
|
|
if (depositoryList !== null) { |
|
|
|
for (let i = 0; i < depositoryList.length; i++) { |
|
|
|
$("#showDepository" + idNumber).append(new Option(depositoryList[i].dname, depositoryList[i].id)); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
form.render(); |
|
|
|
layer.close(loading2); |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
@ -1061,7 +1115,7 @@ |
|
|
|
end: function () { |
|
|
|
let gid = gidItem.value; |
|
|
|
if (gid !== '') { |
|
|
|
let loading2 = layer.open({ type: 3, shade: [0.25, '#000'], icon: 2, speed: 0}); |
|
|
|
let loading2 = layer.open({type: 3, shade: [0.25, '#000'], icon: 2, speed: 0}); |
|
|
|
let req = {}; |
|
|
|
req.gid = gid; |
|
|
|
$.ajax({ |
|
|
|
@ -1131,7 +1185,7 @@ |
|
|
|
|
|
|
|
if (gname !== '') { |
|
|
|
|
|
|
|
let loading2 = layer.open({ type: 3, shade: [0.25, '#000'], icon: 2, speed: 0}); |
|
|
|
let loading2 = layer.open({type: 3, shade: [0.25, '#000'], icon: 2, speed: 0}); |
|
|
|
var req = {}; |
|
|
|
req.gname = gname; |
|
|
|
$.ajax({ |
|
|
|
@ -1231,7 +1285,7 @@ |
|
|
|
data = data.split(",")[0]; |
|
|
|
if (data !== "") { |
|
|
|
req.mname = data; |
|
|
|
let loading2 = layer.open({ type: 3, shade: [0.25, '#000'], icon: 2, speed: 0}); |
|
|
|
let loading2 = layer.open({type: 3, shade: [0.25, '#000'], icon: 2, speed: 0}); |
|
|
|
$.ajax({ |
|
|
|
url: "/material/findInventoryByCondition", |
|
|
|
type: "post", |
|
|
|
@ -1240,14 +1294,14 @@ |
|
|
|
contentType: "application/json;charset=utf-8", |
|
|
|
success: function (d) { |
|
|
|
if (d.count > 1) { |
|
|
|
layer.msg("请点击右侧搜索确定物品",{icon:0,time:500},function () { |
|
|
|
layer.msg("请点击右侧搜索确定物品", {icon: 0, time: 500}, function () { |
|
|
|
layer.close(loading2); |
|
|
|
materialId.value = ""; |
|
|
|
codeValue.value = ""; |
|
|
|
}); |
|
|
|
return false; |
|
|
|
} else if (d.count === 0) { |
|
|
|
layer.msg("没有该物品,请确认输入是否正确",{icon:5,time:500},function() { |
|
|
|
layer.msg("没有该物品,请确认输入是否正确", {icon: 5, time: 500}, function () { |
|
|
|
materialId.value = ""; |
|
|
|
codeValue.value = ""; |
|
|
|
materialName.value = ""; |
|
|
|
@ -1295,6 +1349,16 @@ |
|
|
|
barCode.empty(); |
|
|
|
} |
|
|
|
} |
|
|
|
if (depositoryDisplay !== "none") { |
|
|
|
$("#showDepository" + idNumber).empty(); |
|
|
|
let depositoryList = material.depositoryList; |
|
|
|
if (depositoryList !== null) { |
|
|
|
for (let i = 0; i < depositoryList.length; i++) { |
|
|
|
$("#showDepository" + idNumber).append(new Option(depositoryList[i].dname, depositoryList[i].id)); |
|
|
|
} |
|
|
|
} |
|
|
|
form.render(); |
|
|
|
} |
|
|
|
materialName.value = material.mname; |
|
|
|
materialId.value = material.id; |
|
|
|
codeValue.value = material.code; |
|
|
|
@ -1325,7 +1389,7 @@ |
|
|
|
var req = {}; |
|
|
|
req.qrCode = result; |
|
|
|
req.codeFlag = 1; |
|
|
|
let loading2 = layer.open({ type: 3, shade: [0.25, '#000'], icon: 2, speed: 0}); |
|
|
|
let loading2 = layer.open({type: 3, shade: [0.25, '#000'], icon: 2, speed: 0}); |
|
|
|
$.ajax({ |
|
|
|
url: "/material/qywxApplicationOutScanBarCode", |
|
|
|
type: "post", |
|
|
|
@ -1366,6 +1430,15 @@ |
|
|
|
for (let i = 0; i < unitList.length; i++) { |
|
|
|
$("#unit" + idNumber).append(new Option(unitList[i].newUnit, unitList[i].newUnit)); |
|
|
|
} |
|
|
|
if (depositoryDisplay !== "none") { |
|
|
|
$("#showDepository" + idNumber).empty(); |
|
|
|
let depositoryList = data.depositoryList; |
|
|
|
if (depositoryList !== null) { |
|
|
|
for (let i = 0; i < depositoryList.length; i++) { |
|
|
|
$("#showDepository" + idNumber).append(new Option(depositoryList[i].dname, depositoryList[i].id)); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
form.render(); |
|
|
|
layer.close(loading2); |
|
|
|
} else { |
|
|
|
@ -1403,7 +1476,7 @@ |
|
|
|
var req = {}; |
|
|
|
req.qrCode = result; |
|
|
|
req.codeFlag = 2; |
|
|
|
let loading2 = layer.open({ type: 3, shade: [0.25, '#000'], icon: 2, speed: 0}); |
|
|
|
let loading2 = layer.open({type: 3, shade: [0.25, '#000'], icon: 2, speed: 0}); |
|
|
|
$.ajax({ |
|
|
|
url: "/material/qywxApplicationOutScanQrCode", |
|
|
|
type: "post", |
|
|
|
@ -1478,6 +1551,15 @@ |
|
|
|
$.each(data.splitInfoList, function (index, item) { |
|
|
|
$("#unit" + idNumber).append(new Option(item.newUnit, item.newUnit)); |
|
|
|
}); |
|
|
|
if (depositoryDisplay !== "none") { |
|
|
|
$("#showDepository" + idNumber).empty(); |
|
|
|
let depositoryList = data.depositoryList; |
|
|
|
if (depositoryList !== null) { |
|
|
|
for (let i = 0; i < depositoryList.length; i++) { |
|
|
|
$("#showDepository" + idNumber).append(new Option(depositoryList[i].dname, depositoryList[i].id)); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
form.render(); |
|
|
|
materialName.value = data.mname; |
|
|
|
materialId.value = data.id; |
|
|
|
@ -1507,6 +1589,9 @@ |
|
|
|
req.quantity = val; |
|
|
|
req.unit = unit; |
|
|
|
req.placeId = -1; |
|
|
|
if (depositoryDisplay !== "none") { |
|
|
|
req.depositoryId = $("#showDepository" + id).val(); |
|
|
|
} |
|
|
|
let loading2 = layer.open({type: 3, shade: [0.25, '#000'], icon: 2, speed: 0}); |
|
|
|
$.ajax({ |
|
|
|
url: "/material/MaterialQuantityIsTrue", |
|
|
|
@ -1518,12 +1603,14 @@ |
|
|
|
var flag = res.data; |
|
|
|
if (!flag) { // 如果当前数目不合适 |
|
|
|
layer.msg("当前单个仓库中物料数量不足", {icon: 0, time: 500}, function () { |
|
|
|
$("#quantity" + id).val(""); |
|
|
|
layer.close(loading2); |
|
|
|
}); |
|
|
|
layer.close(loading2); |
|
|
|
$("#quantity" + id).val(""); |
|
|
|
}, |
|
|
|
); |
|
|
|
} else { |
|
|
|
layer.close(loading2); |
|
|
|
layer.close(loading2) |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
@ -1544,7 +1631,7 @@ |
|
|
|
var req = {}; |
|
|
|
req.gid = gid; |
|
|
|
req.quantity = val; |
|
|
|
let loading2 = layer.open({ type: 3, shade: [0.25, '#000'], icon: 2, speed: 0}); |
|
|
|
let loading2 = layer.open({type: 3, shade: [0.25, '#000'], icon: 2, speed: 0}); |
|
|
|
$.ajax({ |
|
|
|
url: "/group/groupQuantityIsTrue", |
|
|
|
type: "post", |
|
|
|
@ -1563,7 +1650,7 @@ |
|
|
|
$("#quantityForGroup" + id).val(""); |
|
|
|
}); |
|
|
|
|
|
|
|
}else{ |
|
|
|
} else { |
|
|
|
layer.close(loading2); |
|
|
|
} |
|
|
|
} |
|
|
|
@ -1573,10 +1660,22 @@ |
|
|
|
}; |
|
|
|
|
|
|
|
form.on('select()', function (data) { |
|
|
|
let unit = data.value; |
|
|
|
|
|
|
|
let id = data.elem.id; |
|
|
|
let idNum = id.split("unit")[1]; |
|
|
|
let mcode = $("#code" + idNum).val(); |
|
|
|
let unit = ""; |
|
|
|
let mcode = ""; |
|
|
|
let depositoryId = "-1"; |
|
|
|
if (id.indexOf('unit') !== -1) { |
|
|
|
unit = data.value; |
|
|
|
} else { |
|
|
|
// 获取当前选中的仓库id |
|
|
|
depositoryId = data.value; |
|
|
|
idNum = id.split('showDepository')[1]; |
|
|
|
unit = $("#unit" + idNum).val(); |
|
|
|
|
|
|
|
} |
|
|
|
mcode = $("#code" + idNum).val(); |
|
|
|
if (mcode === "" || mcode === undefined || mcode === null) { |
|
|
|
layer.msg("请输入物料的正确编码!", {icon: 0, time: 500}, function () { |
|
|
|
$("#quantity" + idNum).val("") |
|
|
|
@ -1589,6 +1688,9 @@ |
|
|
|
req.quantity = val; |
|
|
|
req.unit = unit; |
|
|
|
req.placeId = -1; |
|
|
|
if (depositoryId !== "-1") { |
|
|
|
req.depositoryId = depositoryId; |
|
|
|
} |
|
|
|
let loading2 = layer.open({type: 3, shade: [0.25, '#000'], icon: 2, speed: 0}); |
|
|
|
$.ajax({ |
|
|
|
url: "/material/MaterialQuantityIsTrue", |
|
|
|
@ -1613,10 +1715,8 @@ |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
}); |
|
|
|
$('body').on('click', '[data-refresh]', function () { |
|
|
|
location.reload(); |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
}) |
|
|
|
|