|
|
|
@ -122,7 +122,7 @@ |
|
|
|
<div class="layui-form-item"> |
|
|
|
<label class="layui-form-label">出库类别:</label> |
|
|
|
<div class="layui-input-block"> |
|
|
|
<select name="outType"> |
|
|
|
<select name="outType" id="outType"> |
|
|
|
<option></option> |
|
|
|
<option th:each="bt,iterStar:${btList}" |
|
|
|
th:value="${bt?.getId()}" |
|
|
|
@ -322,8 +322,12 @@ |
|
|
|
<div class="layui-form-item"> |
|
|
|
<label class="layui-form-label">出库类别:</label> |
|
|
|
<div class="layui-input-block"> |
|
|
|
<input name="outType" placeholder="请填写相关原因及申请原因" value="" |
|
|
|
class="layui-input"/> |
|
|
|
<select name="outType" id="outTypeForGroup"> |
|
|
|
<option></option> |
|
|
|
<option th:each="bt,iterStar:${btList}" |
|
|
|
th:value="${bt?.getId()}" |
|
|
|
th:text="${bt?.getTypeName()}"></option> |
|
|
|
</select> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="layui-form-item"> |
|
|
|
@ -1927,74 +1931,80 @@ |
|
|
|
form.on('select()', function (data) { |
|
|
|
|
|
|
|
let id = data.elem.id; |
|
|
|
let idNum = id.split("unit")[1]; |
|
|
|
let unit = ""; |
|
|
|
let mcode = ""; |
|
|
|
let depositoryId = "-1"; |
|
|
|
// 用于标志是否为物料出库(默认为物料) |
|
|
|
let flag = true; |
|
|
|
if (id.indexOf('unit') !== -1) { |
|
|
|
unit = data.value; |
|
|
|
if (depositoryDisplay !== "none") { |
|
|
|
depositoryId = $("#showDepository" + idNum).val(); |
|
|
|
if(id.indexOf('outType') === -1){ |
|
|
|
let idNum = id.split("unit")[1]; |
|
|
|
let unit = ""; |
|
|
|
let mcode = ""; |
|
|
|
let depositoryId = "-1"; |
|
|
|
// 用于标志是否为物料出库(默认为物料) |
|
|
|
let flag = true; |
|
|
|
if (id.indexOf('unit') !== -1) { |
|
|
|
unit = data.value; |
|
|
|
if (depositoryDisplay !== "none") { |
|
|
|
depositoryId = $("#showDepository" + idNum).val(); |
|
|
|
} |
|
|
|
} |
|
|
|
} else if (id.indexOf('ForGroup') === -1) { |
|
|
|
// 获取当前选中的仓库id是在物料出库下 |
|
|
|
depositoryId = data.value; |
|
|
|
idNum = id.split('showDepository')[1]; |
|
|
|
unit = $("#unit" + idNum).val(); |
|
|
|
} else if (id.indexOf("ForGroup") !== -1) { |
|
|
|
depositoryId = data.value; |
|
|
|
idNum = id.split('showDepositoryForGroup')[1]; |
|
|
|
flag = false; |
|
|
|
} |
|
|
|
if (flag) { |
|
|
|
mcode = $("#code" + idNum).val(); |
|
|
|
if (mcode === "" || mcode === undefined || mcode === null) { |
|
|
|
layer.msg("请输入物料的正确编码!", {icon: 0, time: 1000}, function () { |
|
|
|
$("#quantity" + idNum).val("") |
|
|
|
}); |
|
|
|
} else { |
|
|
|
let val = $("#quantity" + idNum).val(); |
|
|
|
if (val !== null && val !== undefined && val !== '') { |
|
|
|
var req = {}; |
|
|
|
req.mcode = mcode; |
|
|
|
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", |
|
|
|
type: "post", |
|
|
|
data: JSON.stringify(req), |
|
|
|
dataType: 'json', |
|
|
|
contentType: "application/json;charset=utf-8", |
|
|
|
success: function (res) { |
|
|
|
var flag = res.data; |
|
|
|
if (!flag) { // 如果当前数目不合适 |
|
|
|
layer.msg("当前单个仓库中物料数量不足", {icon: 0, time: 500}, function () { |
|
|
|
layer.close(loading2); |
|
|
|
$("#quantity" + idNum).val(""); |
|
|
|
}, |
|
|
|
); |
|
|
|
} else { |
|
|
|
layer.close(loading2) |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
else if (id.indexOf('ForGroup') === -1) { |
|
|
|
// 获取当前选中的仓库id是在物料出库下 |
|
|
|
depositoryId = data.value; |
|
|
|
idNum = id.split('showDepository')[1]; |
|
|
|
unit = $("#unit" + idNum).val(); |
|
|
|
} |
|
|
|
else if (id.indexOf("ForGroup") !== -1) { |
|
|
|
depositoryId = data.value; |
|
|
|
idNum = id.split('showDepositoryForGroup')[1]; |
|
|
|
flag = false; |
|
|
|
} |
|
|
|
if (flag) { |
|
|
|
mcode = $("#code" + idNum).val(); |
|
|
|
if (mcode === "" || mcode === undefined || mcode === null) { |
|
|
|
layer.msg("请输入物料的正确编码!", {icon: 0, time: 1000}, function () { |
|
|
|
$("#quantity" + idNum).val("") |
|
|
|
}); |
|
|
|
} else { |
|
|
|
let val = $("#quantity" + idNum).val(); |
|
|
|
if (val !== null && val !== undefined && val !== '') { |
|
|
|
var req = {}; |
|
|
|
req.mcode = mcode; |
|
|
|
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", |
|
|
|
type: "post", |
|
|
|
data: JSON.stringify(req), |
|
|
|
dataType: 'json', |
|
|
|
contentType: "application/json;charset=utf-8", |
|
|
|
success: function (res) { |
|
|
|
var flag = res.data; |
|
|
|
if (!flag) { // 如果当前数目不合适 |
|
|
|
layer.msg("当前单个仓库中物料数量不足", {icon: 0, time: 500}, function () { |
|
|
|
layer.close(loading2); |
|
|
|
$("#quantity" + idNum).val(""); |
|
|
|
}, |
|
|
|
); |
|
|
|
} else { |
|
|
|
layer.close(loading2) |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
let elem = {}; |
|
|
|
elem.id = "quantityForGroup" + idNum; |
|
|
|
groupQuantityIsTrue(elem) |
|
|
|
else { |
|
|
|
let elem = {}; |
|
|
|
elem.id = "quantityForGroup" + idNum; |
|
|
|
groupQuantityIsTrue(elem) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|