|
|
@ -373,7 +373,15 @@ |
|
|
required lay-verify="number" placeholder="请填写组合数量"/> |
|
|
required lay-verify="number" placeholder="请填写组合数量"/> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
<div class="layui-form-item" id="depositoryIdForGroup" |
|
|
|
|
|
th:style="'display:'+${display}"> |
|
|
|
|
|
<label class="layui-form-label">仓库:</label> |
|
|
|
|
|
<div class="layui-input-block"> |
|
|
|
|
|
<select name="depositoryId" id="showDepositoryForGroup"> |
|
|
|
|
|
|
|
|
|
|
|
</select> |
|
|
|
|
|
</div> |
|
|
|
|
|
</div> |
|
|
<div class="layui-form-item"> |
|
|
<div class="layui-form-item"> |
|
|
<label class="layui-form-label">项目:</label> |
|
|
<label class="layui-form-label">项目:</label> |
|
|
<div class="layui-input-block"> |
|
|
<div class="layui-input-block"> |
|
|
@ -874,6 +882,15 @@ |
|
|
<input type="number" name=` + "quantity" + NewIdNumber + ` class="layui-input" id=` + "quantityForGroup" + NewIdNumber + ` |
|
|
<input type="number" name=` + "quantity" + NewIdNumber + ` class="layui-input" id=` + "quantityForGroup" + NewIdNumber + ` |
|
|
required lay-verify="number" onblur="groupQuantityIsTrue(this)" placeholder="请填写组合数量"/> |
|
|
required lay-verify="number" onblur="groupQuantityIsTrue(this)" placeholder="请填写组合数量"/> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
</div> |
|
|
|
|
|
<div class="layui-form-item" id=` + "depositoryIdForGroup" + NewIdNumber + ` |
|
|
|
|
|
style="display:` + depositoryDisplay + `"> |
|
|
|
|
|
<label class="layui-form-label">仓库:</label> |
|
|
|
|
|
<div class="layui-input-block"> |
|
|
|
|
|
<select name=` + "depositoryId" + NewIdNumber + ` id=` + "showDepositoryForGroup" + NewIdNumber + `> |
|
|
|
|
|
|
|
|
|
|
|
</select> |
|
|
|
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
<div class="layui-form-item"> |
|
|
<div class="layui-form-item"> |
|
|
<label class="layui-form-label">项目:</label> |
|
|
<label class="layui-form-label">项目:</label> |
|
|
@ -1156,6 +1173,17 @@ |
|
|
// 赋值给gname |
|
|
// 赋值给gname |
|
|
gnameItem.value = data[0].gname; |
|
|
gnameItem.value = data[0].gname; |
|
|
gidItem.value = data[0].gid; |
|
|
gidItem.value = data[0].gid; |
|
|
|
|
|
let satisfyDepositoryList = data[0].satisfyDepositoryList; |
|
|
|
|
|
if (depositoryDisplay !== "none") { |
|
|
|
|
|
var idNumber = gidItem.name.split("gid")[1]; |
|
|
|
|
|
$("#showDepositoryForGroup" + idNumber).empty(); |
|
|
|
|
|
if (satisfyDepositoryList !== null) { |
|
|
|
|
|
for (let i = 0; i < satisfyDepositoryList.length; i++) { |
|
|
|
|
|
$("#showDepositoryForGroup" + idNumber).append(new Option(satisfyDepositoryList[i].dname, satisfyDepositoryList[i].id)); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
form.render(); |
|
|
|
|
|
} |
|
|
for (let i = 0; i < data.length; i++) { |
|
|
for (let i = 0; i < data.length; i++) { |
|
|
CoverpageForGroup(pid, data[i]); |
|
|
CoverpageForGroup(pid, data[i]); |
|
|
} |
|
|
} |
|
|
@ -1354,6 +1382,17 @@ |
|
|
} |
|
|
} |
|
|
// 赋值给gname |
|
|
// 赋值给gname |
|
|
gcodeItem.value = data[0].gcode; |
|
|
gcodeItem.value = data[0].gcode; |
|
|
|
|
|
let satisfyDepositoryList = data[0].satisfyDepositoryList; |
|
|
|
|
|
if (depositoryDisplay !== "none") { |
|
|
|
|
|
var idNumber = gidItem.name.split("gid")[1]; |
|
|
|
|
|
$("#showDepositoryForGroup" + idNumber).empty(); |
|
|
|
|
|
if (satisfyDepositoryList !== null) { |
|
|
|
|
|
for (let i = 0; i < satisfyDepositoryList.length; i++) { |
|
|
|
|
|
$("#showDepositoryForGroup" + idNumber).append(new Option(satisfyDepositoryList[i].dname, satisfyDepositoryList[i].id)); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
form.render(); |
|
|
|
|
|
} |
|
|
for (let i = 0; i < data.length; i++) { |
|
|
for (let i = 0; i < data.length; i++) { |
|
|
CoverpageForGroup(pid, data[i]); |
|
|
CoverpageForGroup(pid, data[i]); |
|
|
} |
|
|
} |
|
|
@ -1444,6 +1483,17 @@ |
|
|
// 赋值给gname |
|
|
// 赋值给gname |
|
|
gidItem.value = data[0].gid; |
|
|
gidItem.value = data[0].gid; |
|
|
gcodeItem.value = data[0].gcode; |
|
|
gcodeItem.value = data[0].gcode; |
|
|
|
|
|
let satisfyDepositoryList = data[0].satisfyDepositoryList; |
|
|
|
|
|
if (depositoryDisplay !== "none") { |
|
|
|
|
|
var idNumber = gidItem.name.split("gid")[1]; |
|
|
|
|
|
$("#showDepositoryForGroup" + idNumber).empty(); |
|
|
|
|
|
if (satisfyDepositoryList !== null) { |
|
|
|
|
|
for (let i = 0; i < satisfyDepositoryList.length; i++) { |
|
|
|
|
|
$("#showDepositoryForGroup" + idNumber).append(new Option(satisfyDepositoryList[i].dname, satisfyDepositoryList[i].id)); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
form.render(); |
|
|
|
|
|
} |
|
|
for (let i = 0; i < data.length; i++) { |
|
|
for (let i = 0; i < data.length; i++) { |
|
|
CoverpageForGroup(pid, data[i]); |
|
|
CoverpageForGroup(pid, data[i]); |
|
|
} |
|
|
} |
|
|
@ -1827,7 +1877,7 @@ |
|
|
var gid = $("#gid" + id).val(); // 获取到当前输入的物料编码 |
|
|
var gid = $("#gid" + id).val(); // 获取到当前输入的物料编码 |
|
|
if (gid === "" || gid === undefined || gid === null) { |
|
|
if (gid === "" || gid === undefined || gid === null) { |
|
|
layer.msg("请输入正确的组合!", {icon: 0, time: 500}, function () { |
|
|
layer.msg("请输入正确的组合!", {icon: 0, time: 500}, function () { |
|
|
$("#quantityForGroup" + id).val(""); |
|
|
$("#quantityForGroup" + id).val("") |
|
|
}); |
|
|
}); |
|
|
} else { |
|
|
} else { |
|
|
let val = $("#quantityForGroup" + id).val(); |
|
|
let val = $("#quantityForGroup" + id).val(); |
|
|
@ -1835,6 +1885,9 @@ |
|
|
var req = {}; |
|
|
var req = {}; |
|
|
req.gid = gid; |
|
|
req.gid = gid; |
|
|
req.quantity = val; |
|
|
req.quantity = val; |
|
|
|
|
|
if (depositoryDisplay !== "none") { |
|
|
|
|
|
req.depositoryId = $("#showDepositoryForGroup" + id).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({ |
|
|
$.ajax({ |
|
|
url: "/group/groupQuantityIsTrue", |
|
|
url: "/group/groupQuantityIsTrue", |
|
|
@ -1850,8 +1903,8 @@ |
|
|
icon: 0, |
|
|
icon: 0, |
|
|
time: 1000 |
|
|
time: 1000 |
|
|
}, function () { |
|
|
}, function () { |
|
|
|
|
|
layer.close(loading2); |
|
|
$("#quantityForGroup" + id).val(""); |
|
|
$("#quantityForGroup" + id).val(""); |
|
|
layer.close(loading2) |
|
|
|
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
} else { |
|
|
} else { |
|
|
@ -1863,6 +1916,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(); |
|
|
|
|
|
} |
|
|
|
|
|
} 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) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
selectConstructionUnit = function (obj) { |
|
|
selectConstructionUnit = function (obj) { |
|
|
let id = obj.id; |
|
|
let id = obj.id; |
|
|
@ -1916,64 +2043,6 @@ |
|
|
}); |
|
|
}); |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
form.on('select()', function (data) { |
|
|
|
|
|
|
|
|
|
|
|
let id = data.elem.id; |
|
|
|
|
|
let idNum = id.split("unit")[1]; |
|
|
|
|
|
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("") |
|
|
|
|
|
}); |
|
|
|
|
|
} 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) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
// 用于选择代领用户 |
|
|
// 用于选择代领用户 |
|
|
selectUser = function (obj) { |
|
|
selectUser = function (obj) { |
|
|
|