diff --git a/src/main/resources/templates/pages/application/application-out.html b/src/main/resources/templates/pages/application/application-out.html
index 147271a7..66492234 100644
--- a/src/main/resources/templates/pages/application/application-out.html
+++ b/src/main/resources/templates/pages/application/application-out.html
@@ -1400,8 +1400,7 @@
}
}
})
- }
- else {
+ } else {
gcodeItem.value = '';
gidItem.value = '';
let childNodes = parent.childNodes;
@@ -1821,13 +1820,16 @@
// 用于标志是否为物料出库(默认为物料)
let flag = true;
if (id.indexOf('unit') !== -1) {
+ if (depositoryDisplay !== "none") {
+ depositoryId = $("#showDepository" + idNum).val();
+ }
unit = data.value;
- } else if (!(id.indexOf('ForGroup'))) {
+ } else if (id.indexOf('ForGroup') === -1) {
// 获取当前选中的仓库id是在物料出库下
depositoryId = data.value;
idNum = id.split('showDepository')[1];
unit = $("#unit" + idNum).val();
- } else if (id.indexOf("ForGroup")) {
+ } else if (id.indexOf("ForGroup") !== -1) {
depositoryId = data.value;
idNum = id.split('showDepositoryForGroup')[1];
flag = false;
diff --git a/src/main/resources/templates/pages/applicationForStorageCenter/application-out.html b/src/main/resources/templates/pages/applicationForStorageCenter/application-out.html
index 6f2ab335..c607f04a 100644
--- a/src/main/resources/templates/pages/applicationForStorageCenter/application-out.html
+++ b/src/main/resources/templates/pages/applicationForStorageCenter/application-out.html
@@ -373,7 +373,15 @@
required lay-verify="number" placeholder="请填写组合数量"/>
+
+
@@ -1156,6 +1173,17 @@
// 赋值给gname
gnameItem.value = data[0].gname;
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++) {
CoverpageForGroup(pid, data[i]);
}
@@ -1354,6 +1382,17 @@
}
// 赋值给gname
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++) {
CoverpageForGroup(pid, data[i]);
}
@@ -1444,6 +1483,17 @@
// 赋值给gname
gidItem.value = data[0].gid;
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++) {
CoverpageForGroup(pid, data[i]);
}
@@ -1827,7 +1877,7 @@
var gid = $("#gid" + id).val(); // 获取到当前输入的物料编码
if (gid === "" || gid === undefined || gid === null) {
layer.msg("请输入正确的组合!", {icon: 0, time: 500}, function () {
- $("#quantityForGroup" + id).val("");
+ $("#quantityForGroup" + id).val("")
});
} else {
let val = $("#quantityForGroup" + id).val();
@@ -1835,6 +1885,9 @@
var req = {};
req.gid = gid;
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});
$.ajax({
url: "/group/groupQuantityIsTrue",
@@ -1850,8 +1903,8 @@
icon: 0,
time: 1000
}, function () {
+ layer.close(loading2);
$("#quantityForGroup" + id).val("");
- layer.close(loading2)
});
} 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) {
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) {
diff --git a/src/main/resources/templates/pages/applicationForStorageCenter/application-out_back.html b/src/main/resources/templates/pages/applicationForStorageCenter/application-out_back.html
index 7d14cf0d..8e8b4144 100644
--- a/src/main/resources/templates/pages/applicationForStorageCenter/application-out_back.html
+++ b/src/main/resources/templates/pages/applicationForStorageCenter/application-out_back.html
@@ -597,6 +597,9 @@
let depositoryId = "-1";
if (id.indexOf('unit') !== -1) {
unit = data.value;
+ if (depositoryDisplay !== "none") {
+ depositoryId = $("#showDepository" + idNum).val();
+ }
} else {
// 获取当前选中的仓库id
depositoryId = data.value;
diff --git a/src/main/resources/templates/pages/applicationForStorageCenter/application-out_temporaryValue.html b/src/main/resources/templates/pages/applicationForStorageCenter/application-out_temporaryValue.html
index c32f6765..9b4c9856 100644
--- a/src/main/resources/templates/pages/applicationForStorageCenter/application-out_temporaryValue.html
+++ b/src/main/resources/templates/pages/applicationForStorageCenter/application-out_temporaryValue.html
@@ -1175,6 +1175,9 @@
let depositoryId = "-1";
if (id.indexOf('unit') !== -1) {
unit = data.value;
+ if (depositoryDisplay !== "none") {
+ depositoryId = $("#showDepository" + idNum).val();
+ }
} else {
// 获取当前选中的仓库id
depositoryId = data.value;