diff --git a/src/main/resources/templates/pages/application/application-in.html b/src/main/resources/templates/pages/application/application-in.html
index 9c8dcea7..8e2aee93 100644
--- a/src/main/resources/templates/pages/application/application-in.html
+++ b/src/main/resources/templates/pages/application/application-in.html
@@ -904,51 +904,54 @@
var materialId = materialName.parentNode.parentNode.childNodes[3];
var req = {};
data = data.split(",")[0];
- req.mname = data;
- $.ajax({
- url: "/material/findMaterialByCondition",
- type: "post",
- dataType: 'json',
- data: JSON.stringify(req),
- contentType: "application/json;charset=utf-8",
- success: function (d) {
- if (d.count > 1) {
- layer.msg("请点击右侧搜索确定物品");
- materialId.value = "";
- codeValue.value = "";
- return false;
- } else if (d.count === 0) {
- layer.msg("没有该物品,请确认输入是否正确");
- materialId.value = "";
- codeValue.value = "";
- materialName.value = "";
- return false;
- } else {
- var idNumber = materialId.name.split("mid")[1];
- var material = d.data[0];
- materialName.value = material.mname;
- materialId.value = material.mid;
- codeValue.value = material.code;
- var shelfLife = material.shelfLife;
- if (shelfLife !== null && shelfLife !== undefined) {
- $("#" + "producedDateItem" + idNumber).show();
- $("#" + "producedDate" + idNumber).attr("lay-verify", "required");
+ if(data !== ""){
+ req.mname = data;
+ $.ajax({
+ url: "/material/findMaterialByCondition",
+ type: "post",
+ dataType: 'json',
+ data: JSON.stringify(req),
+ contentType: "application/json;charset=utf-8",
+ success: function (d) {
+ if (d.count > 1) {
+ layer.msg("请点击右侧搜索确定物品");
+ materialId.value = "";
+ codeValue.value = "";
+ return false;
+ } else if (d.count === 0) {
+ layer.msg("没有该物品,请确认输入是否正确");
+ materialId.value = "";
+ codeValue.value = "";
+ materialName.value = "";
+ return false;
} else {
- $("#" + "producedDateItem" + idNumber).hide();
+ var idNumber = materialId.name.split("mid")[1];
+ var material = d.data[0];
+ materialName.value = material.mname;
+ materialId.value = material.mid;
+ codeValue.value = material.code;
+ var shelfLife = material.shelfLife;
+ if (shelfLife !== null && shelfLife !== undefined) {
+ $("#" + "producedDateItem" + idNumber).show();
+ $("#" + "producedDate" + idNumber).attr("lay-verify", "required");
+ } else {
+ $("#" + "producedDateItem" + idNumber).hide();
+ form.render();
+ }
+ var unit = $("#unit" + idNumber);
+ unit.empty();
+ $("#unit" + idNumber).append(new Option(material.unit, "-1"));
+ var unitList = material["splitInfoList"];
+ for (let i = 0; i < unitList.length; i++) {
+ $("#unit" + idNumber).append(new Option(unitList[i].newUnit, unitList[i].newUnit));
+ }
form.render();
- }
- var unit = $("#unit" + idNumber);
- unit.empty();
- $("#unit" + idNumber).append(new Option(material.unit, "-1"));
- var unitList = material["splitInfoList"];
- for (let i = 0; i < unitList.length; i++) {
- $("#unit" + idNumber).append(new Option(unitList[i].newUnit, unitList[i].newUnit));
- }
- form.render();
+ }
}
- }
- });
+ });
+ }
+
};
// 用于扫码入库
scanCodeInStorage = function (obj) {
diff --git a/src/main/resources/templates/pages/application/application-in_scanQrCode.html b/src/main/resources/templates/pages/application/application-in_scanQrCode.html
index 6a6504cb..dbd3d1d9 100644
--- a/src/main/resources/templates/pages/application/application-in_scanQrCode.html
+++ b/src/main/resources/templates/pages/application/application-in_scanQrCode.html
@@ -806,51 +806,55 @@
var materialName = materialItem[1];
var materialId = materialName.parentNode.parentNode.childNodes[3];
var req = {};
- req.mname = data;
- $.ajax({
- url: "/material/findMaterialByCondition",
- type: "post",
- dataType: 'json',
- data: JSON.stringify(req),
- contentType: "application/json;charset=utf-8",
- success: function (d) {
- if (d.count > 1) {
- layer.msg("请点击右侧搜索确定物品");
- materialId.value = "";
- codeValue.value = "";
- return false;
- } else if (d.count === 0) {
- layer.msg("没有该物品,请确认输入是否正确");
- materialId.value = "";
- codeValue.value = "";
- materialName.value = "";
- return false;
- } else {
- var idNumber = materialId.name.split("mid")[1];
- var material = d.data[0];
- materialName.value = material.mname;
- materialId.value = material.mid;
- codeValue.value = material.code;
- var shelfLife = material.shelfLife;
- if (shelfLife !== null && shelfLife !== undefined) {
- $("#" + "producedDateItem" + idNumber).show();
- $("#" + "producedDate" + idNumber).attr("lay-verify", "required");
+ data = data.split(",")[0];
+ if(data !== ""){
+ req.mname = data;
+ $.ajax({
+ url: "/material/findMaterialByCondition",
+ type: "post",
+ dataType: 'json',
+ data: JSON.stringify(req),
+ contentType: "application/json;charset=utf-8",
+ success: function (d) {
+ if (d.count > 1) {
+ layer.msg("请点击右侧搜索确定物品");
+ materialId.value = "";
+ codeValue.value = "";
+ return false;
+ } else if (d.count === 0) {
+ layer.msg("没有该物品,请确认输入是否正确");
+ materialId.value = "";
+ codeValue.value = "";
+ materialName.value = "";
+ return false;
} else {
- $("#" + "producedDateItem" + idNumber).hide();
+ var idNumber = materialId.name.split("mid")[1];
+ var material = d.data[0];
+ materialName.value = material.mname;
+ materialId.value = material.mid;
+ codeValue.value = material.code;
+ var shelfLife = material.shelfLife;
+ if (shelfLife !== null && shelfLife !== undefined) {
+ $("#" + "producedDateItem" + idNumber).show();
+ $("#" + "producedDate" + idNumber).attr("lay-verify", "required");
+ } else {
+ $("#" + "producedDateItem" + idNumber).hide();
+ form.render();
+ }
+ var unit = $("#unit" + idNumber);
+ unit.empty();
+ $("#unit" + idNumber).append(new Option(material.unit, "-1"));
+ var unitList = material["splitInfoList"];
+ for (let i = 0; i < unitList.length; i++) {
+ $("#unit" + idNumber).append(new Option(unitList[i].newUnit, unitList[i].newUnit));
+ }
form.render();
- }
- var unit = $("#unit" + idNumber);
- unit.empty();
- $("#unit" + idNumber).append(new Option(material.unit, "-1"));
- var unitList = material["splitInfoList"];
- for (let i = 0; i < unitList.length; i++) {
- $("#unit" + idNumber).append(new Option(unitList[i].newUnit, unitList[i].newUnit));
- }
- form.render();
+ }
}
- }
- });
+ });
+ }
+
};
scanBarCode = function (obj) {
diff --git a/src/main/resources/templates/pages/application/application-out.html b/src/main/resources/templates/pages/application/application-out.html
index 1f1c6fb4..0a4ea6a6 100644
--- a/src/main/resources/templates/pages/application/application-out.html
+++ b/src/main/resources/templates/pages/application/application-out.html
@@ -1184,72 +1184,76 @@
// 条形码条码
var barCodeItem = barCodeChildren.childNodes[3];
var req = {};
- req.mname = data;
- $.ajax({
- url: "/material/findInventoryByCondition",
- type: "post",
- dataType: 'json',
- data: JSON.stringify(req),
- contentType: "application/json;charset=utf-8",
- success: function (d) {
- if (d.count > 1) {
- layer.msg("请点击右侧搜索确定物品");
- materialId.value = "";
- codeValue.value = "";
- return false;
- } else if (d.count === 0) {
- layer.msg("没有该物品,请确认输入是否正确");
- materialId.value = "";
- codeValue.value = "";
- materialName.value = "";
- return false;
- } else {
- var idNumber = materialId.name.split("mid")[1];
- var material = d.data[0];
- var unit = $("#unit" + idNumber);
- unit.empty();
- $("#unit" + idNumber).append(new Option(material.unit, "-1"));
- var unitList = material["splitInfoList"];
- if(unitList !== null && unitList != undefined){
- for (let i = 0; i < unitList.length; i++) {
- $("#unit" + idNumber).append(new Option(unitList[i].newUnit, unitList[i].newUnit));
+ data = data.split(",")[0];
+ if(data !== ""){
+ req.mname = data;
+ $.ajax({
+ url: "/material/findInventoryByCondition",
+ type: "post",
+ dataType: 'json',
+ data: JSON.stringify(req),
+ contentType: "application/json;charset=utf-8",
+ success: function (d) {
+ if (d.count > 1) {
+ layer.msg("请点击右侧搜索确定物品");
+ materialId.value = "";
+ codeValue.value = "";
+ return false;
+ } else if (d.count === 0) {
+ layer.msg("没有该物品,请确认输入是否正确");
+ materialId.value = "";
+ codeValue.value = "";
+ materialName.value = "";
+ return false;
+ } else {
+ var idNumber = materialId.name.split("mid")[1];
+ var material = d.data[0];
+ var unit = $("#unit" + idNumber);
+ unit.empty();
+ $("#unit" + idNumber).append(new Option(material.unit, "-1"));
+ var unitList = material["splitInfoList"];
+ if(unitList !== null && unitList != undefined){
+ for (let i = 0; i < unitList.length; i++) {
+ $("#unit" + idNumber).append(new Option(unitList[i].newUnit, unitList[i].newUnit));
+ }
+ form.render();
}
- form.render();
- }
- var materialAndBarCodeList = material["materialAndBarCodeList"];
- if (materialAndBarCodeList.length > 0) {
- // 如果有对应的条形码
- var barCodeInput = barCodeItem.childNodes[1].childNodes[1];
- var barCodeImg = barCodeItem.childNodes[1].childNodes[3];
- var id = barCodeInput.id;
- $("#" + id).remove();
- $("#barCode" + idNumber).empty();
- var barCode = $("#barCode" + idNumber);
- if (barCode.length > 0) {
- barCode.empty();
- } else {
- var barCodeSelect = `
+ var materialAndBarCodeList = material["materialAndBarCodeList"];
+ if (materialAndBarCodeList.length > 0) {
+ // 如果有对应的条形码
+ var barCodeInput = barCodeItem.childNodes[1].childNodes[1];
+ var barCodeImg = barCodeItem.childNodes[1].childNodes[3];
+ var id = barCodeInput.id;
+ $("#" + id).remove();
+ $("#barCode" + idNumber).empty();
+ var barCode = $("#barCode" + idNumber);
+ if (barCode.length > 0) {
+ barCode.empty();
+ } else {
+ var barCodeSelect = `
`;
- $("#" + barCodeImg.id).before(barCodeSelect);
- }
- form.render();
- $.each(materialAndBarCodeList, function (index, item) {
- $("#barCode" + idNumber).append(new Option(item.bmcode, item.id));//往下拉菜单里添加元素
- });
- form.render();
- } else {
- var barCode = $("#barCode" + idNumber);
- if (barCode.length > 0) {
- barCode.empty();
+ $("#" + barCodeImg.id).before(barCodeSelect);
+ }
+ form.render();
+ $.each(materialAndBarCodeList, function (index, item) {
+ $("#barCode" + idNumber).append(new Option(item.bmcode, item.id));//往下拉菜单里添加元素
+ });
+ form.render();
+ } else {
+ var barCode = $("#barCode" + idNumber);
+ if (barCode.length > 0) {
+ barCode.empty();
+ }
}
+ materialName.value = material.mname;
+ materialId.value = material.id;
+ codeValue.value = material.code;
}
- materialName.value = material.mname;
- materialId.value = material.id;
- codeValue.value = material.code;
}
- }
- });
+ });
+ }
+
};
// 扫描物料条码
diff --git a/src/main/resources/templates/pages/application/application-transfer.html b/src/main/resources/templates/pages/application/application-transfer.html
index 7deba19e..d2363958 100644
--- a/src/main/resources/templates/pages/application/application-transfer.html
+++ b/src/main/resources/templates/pages/application/application-transfer.html
@@ -801,80 +801,84 @@
// 条形码条码
var barCodeItem = barCodeChildren.childNodes[3];
var req = {};
- req.mname = data;
- $.ajax({
- url: "/material/findInventoryByCondition",
- type: "post",
- dataType: 'json',
- data:JSON.stringify(req),
- contentType: "application/json;charset=utf-8",
- success: function (d) {
- if(d.count > 1){
- layer.msg("请点击右侧搜索确定物品");
- materialId.value = "";
- codeValue.value = "";
- return false;
- }else if(d.count === 0){
- layer.msg("没有该物品,请确认输入是否正确");
- materialId.value = "";
- codeValue.value = "";
- materialName.value = "";
- return false;
- }
- else{
- var idNumber = materialId.name.split("mid")[1];
- var material = d.data[0];
- var unit = $("#unit" + idNumber);
- unit.empty();
- $("#unit" + idNumber).append(new Option(material.unit, "-1"));
- var unitList = material["splitInfoList"];
- if(unitList !== null && unitList != undefined){
- for (let i = 0; i < unitList.length; i++) {
- $("#unit" + idNumber).append(new Option(unitList[i].newUnit, unitList[i].newUnit));
- }
- form.render();
+ data = data.split(",")[0];
+ if(data !== ""){
+ req.mname = data;
+ $.ajax({
+ url: "/material/findInventoryByCondition",
+ type: "post",
+ dataType: 'json',
+ data:JSON.stringify(req),
+ contentType: "application/json;charset=utf-8",
+ success: function (d) {
+ if(d.count > 1){
+ layer.msg("请点击右侧搜索确定物品");
+ materialId.value = "";
+ codeValue.value = "";
+ return false;
+ }else if(d.count === 0){
+ layer.msg("没有该物品,请确认输入是否正确");
+ materialId.value = "";
+ codeValue.value = "";
+ materialName.value = "";
+ return false;
}
- var materialAndBarCodeList = material["materialAndBarCodeList"];
- if (materialAndBarCodeList.length > 0) {
- // 如果有对应的条形码
- var barCodeInput = barCodeItem.childNodes[1].childNodes[1];
- var barCodeImg = barCodeItem.childNodes[1].childNodes[3];
- var id = barCodeInput.id;
- $("#" + id).remove();
- $("#barCode" + idNumber).empty();
- var barCode = $("#barCode" + idNumber);
- if (barCode.length > 0) {
- barCode.empty();
- } else {
- var barCodeSelect = `
+ else{
+ var idNumber = materialId.name.split("mid")[1];
+ var material = d.data[0];
+ var unit = $("#unit" + idNumber);
+ unit.empty();
+ $("#unit" + idNumber).append(new Option(material.unit, "-1"));
+ var unitList = material["splitInfoList"];
+ if(unitList !== null && unitList != undefined){
+ for (let i = 0; i < unitList.length; i++) {
+ $("#unit" + idNumber).append(new Option(unitList[i].newUnit, unitList[i].newUnit));
+ }
+ form.render();
+ }
+ var materialAndBarCodeList = material["materialAndBarCodeList"];
+ if (materialAndBarCodeList.length > 0) {
+ // 如果有对应的条形码
+ var barCodeInput = barCodeItem.childNodes[1].childNodes[1];
+ var barCodeImg = barCodeItem.childNodes[1].childNodes[3];
+ var id = barCodeInput.id;
+ $("#" + id).remove();
+ $("#barCode" + idNumber).empty();
+ var barCode = $("#barCode" + idNumber);
+ if (barCode.length > 0) {
+ barCode.empty();
+ } else {
+ var barCodeSelect = `
`;
- $("#" + barCodeImg.id).before(barCodeSelect);
+ $("#" + barCodeImg.id).before(barCodeSelect);
+ }
+ form.render();
+ $.each(materialAndBarCodeList, function (index, item) {
+ $("#barCode" + idNumber).append(new Option(item.bmcode, item.id));//往下拉菜单里添加元素
+ });
+ form.render();
}
- form.render();
- $.each(materialAndBarCodeList, function (index, item) {
- $("#barCode" + idNumber).append(new Option(item.bmcode, item.id));//往下拉菜单里添加元素
+ else {
+ var barCode = $("#barCode" + idNumber);
+ if (barCode.length > 0) {
+ barCode.empty();
+ }
+ }
+
+ $('#place' + idNumber).empty();
+ $.each(material.placePList, function (index, item) {
+ $('#place' + idNumber).append(new Option(item.depositoryName + "-" + item.code, item.id));//往下拉菜单里添加元素
});
form.render();
+ materialName.value = material.mname;
+ materialId.value = material.id;
+ codeValue.value = material.code;
}
- else {
- var barCode = $("#barCode" + idNumber);
- if (barCode.length > 0) {
- barCode.empty();
- }
- }
-
- $('#place' + idNumber).empty();
- $.each(material.placePList, function (index, item) {
- $('#place' + idNumber).append(new Option(item.depositoryName + "-" + item.code, item.id));//往下拉菜单里添加元素
- });
- form.render();
- materialName.value = material.mname;
- materialId.value = material.id;
- codeValue.value = material.code;
}
- }
- });
+ });
+ }
+
};
// 用于打开仓库树形菜单
diff --git a/src/main/resources/templates/pages/application/application-transfer_back.html b/src/main/resources/templates/pages/application/application-transfer_back.html
index 582197ce..ce06e4d1 100644
--- a/src/main/resources/templates/pages/application/application-transfer_back.html
+++ b/src/main/resources/templates/pages/application/application-transfer_back.html
@@ -439,34 +439,38 @@
var materialName = materialItem[1];
var materialId = materialName.parentNode.parentNode.childNodes[3];
var req = {};
- req.mname = data;
- $.ajax({
- url: "/material/findMaterialByCondition",
- type: "post",
- dataType: 'json',
- data:JSON.stringify(req),
- contentType: "application/json;charset=utf-8",
- success: function (d) {
- if(d.count > 1){
- layer.msg("请点击右侧搜索确定物品");
- materialId.value = "";
- codeValue.value = "";
- return false;
- }else if(d.count === 0){
- layer.msg("没有该物品,请确认输入是否正确");
- materialId.value = "";
- codeValue.value = "";
- materialName.value = "";
- return false;
- }
- else{
- var material = d.data[0];
- materialName.value = material.mname;
- materialId.value = material.id;
- codeValue.value = material.code;
+ data = data.split(",")[0];
+ if(data !== ""){
+ req.mname = data;
+ $.ajax({
+ url: "/material/findMaterialByCondition",
+ type: "post",
+ dataType: 'json',
+ data:JSON.stringify(req),
+ contentType: "application/json;charset=utf-8",
+ success: function (d) {
+ if(d.count > 1){
+ layer.msg("请点击右侧搜索确定物品");
+ materialId.value = "";
+ codeValue.value = "";
+ return false;
+ }else if(d.count === 0){
+ layer.msg("没有该物品,请确认输入是否正确");
+ materialId.value = "";
+ codeValue.value = "";
+ materialName.value = "";
+ return false;
+ }
+ else{
+ var material = d.data[0];
+ materialName.value = material.mname;
+ materialId.value = material.id;
+ codeValue.value = material.code;
+ }
}
- }
- });
+ });
+ }
+
};
// 用于打开仓库树形菜单
diff --git a/src/main/resources/templates/pages/group/group-add_back.html b/src/main/resources/templates/pages/group/group-add_back.html
index 022a4b08..c4e84745 100644
--- a/src/main/resources/templates/pages/group/group-add_back.html
+++ b/src/main/resources/templates/pages/group/group-add_back.html
@@ -727,72 +727,76 @@
// 条形码条码
var barCodeItem = barCodeChildren.childNodes[3];
var req = {};
- req.mname = data;
- $.ajax({
- url: "/material/findMaterialByCondition",
- type: "post",
- dataType: 'json',
- data: JSON.stringify(req),
- contentType: "application/json;charset=utf-8",
- success: function (d) {
- if (d.count > 1) {
- layer.msg("请点击右侧搜索确定物品");
- materialId.value = "";
- codeValue.value = "";
- return false;
- } else if (d.count === 0) {
- layer.msg("没有该物品,请确认输入是否正确");
- materialId.value = "";
- codeValue.value = "";
- materialName.value = "";
- return false;
- } else {
- var idNumber = materialId.name.split("mid")[1];
- var material = d.data[0];
- var unit = $("#unit" + idNumber);
- unit.empty();
- $("#unit" + idNumber).append(new Option(material.unit, "-1"));
- var unitList = material["splitInfoList"];
- if (unitList !== null && unitList != undefined) {
- for (let i = 0; i < unitList.length; i++) {
- $("#unit" + idNumber).append(new Option(unitList[i].newUnit, unitList[i].newUnit));
+ data = data.split(",")[0];
+ if(data !== ""){
+ req.mname = data;
+ $.ajax({
+ url: "/material/findMaterialByCondition",
+ type: "post",
+ dataType: 'json',
+ data: JSON.stringify(req),
+ contentType: "application/json;charset=utf-8",
+ success: function (d) {
+ if (d.count > 1) {
+ layer.msg("请点击右侧搜索确定物品");
+ materialId.value = "";
+ codeValue.value = "";
+ return false;
+ } else if (d.count === 0) {
+ layer.msg("没有该物品,请确认输入是否正确");
+ materialId.value = "";
+ codeValue.value = "";
+ materialName.value = "";
+ return false;
+ } else {
+ var idNumber = materialId.name.split("mid")[1];
+ var material = d.data[0];
+ var unit = $("#unit" + idNumber);
+ unit.empty();
+ $("#unit" + idNumber).append(new Option(material.unit, "-1"));
+ var unitList = material["splitInfoList"];
+ if (unitList !== null && unitList != undefined) {
+ for (let i = 0; i < unitList.length; i++) {
+ $("#unit" + idNumber).append(new Option(unitList[i].newUnit, unitList[i].newUnit));
+ }
+ form.render();
}
- form.render();
- }
- var materialAndBarCodeList = material["materialAndBarCodeList"];
- if (materialAndBarCodeList.length > 0) {
- // 如果有对应的条形码
- var barCodeInput = barCodeItem.childNodes[1].childNodes[1];
- var barCodeImg = barCodeItem.childNodes[1].childNodes[3];
- var id = barCodeInput.id;
- $("#" + id).remove();
- $("#barCode" + idNumber).empty();
- var barCode = $("#barCode" + idNumber);
- if (barCode.length > 0) {
- barCode.empty();
- } else {
- var barCodeSelect = `
+ var materialAndBarCodeList = material["materialAndBarCodeList"];
+ if (materialAndBarCodeList.length > 0) {
+ // 如果有对应的条形码
+ var barCodeInput = barCodeItem.childNodes[1].childNodes[1];
+ var barCodeImg = barCodeItem.childNodes[1].childNodes[3];
+ var id = barCodeInput.id;
+ $("#" + id).remove();
+ $("#barCode" + idNumber).empty();
+ var barCode = $("#barCode" + idNumber);
+ if (barCode.length > 0) {
+ barCode.empty();
+ } else {
+ var barCodeSelect = `
`;
- $("#" + barCodeImg.id).before(barCodeSelect);
- }
- form.render();
- $.each(materialAndBarCodeList, function (index, item) {
- $("#barCode" + idNumber).append(new Option(item.bmcode, item.id));//往下拉菜单里添加元素
- });
- form.render();
- } else {
- var barCode = $("#barCode" + idNumber);
- if (barCode.length > 0) {
- barCode.empty();
+ $("#" + barCodeImg.id).before(barCodeSelect);
+ }
+ form.render();
+ $.each(materialAndBarCodeList, function (index, item) {
+ $("#barCode" + idNumber).append(new Option(item.bmcode, item.id));//往下拉菜单里添加元素
+ });
+ form.render();
+ } else {
+ var barCode = $("#barCode" + idNumber);
+ if (barCode.length > 0) {
+ barCode.empty();
+ }
}
+ materialName.value = material.mname;
+ materialId.value = material.id;
+ codeValue.value = material.code;
}
- materialName.value = material.mname;
- materialId.value = material.id;
- codeValue.value = material.code;
}
- }
- });
+ });
+ }
+
};
diff --git a/src/main/resources/templates/pages/split/split_add.html b/src/main/resources/templates/pages/split/split_add.html
index 11c1df04..b75c1af2 100644
--- a/src/main/resources/templates/pages/split/split_add.html
+++ b/src/main/resources/templates/pages/split/split_add.html
@@ -226,66 +226,70 @@
let materialName = $("#mname");
var data = materialName.val().split(",")[0];
var req = {};
- req.mname = data;
- let materialId = $("#mid");
- let codeValue = $("#code");
- let version = $("#version");
- let typeName = $("#typeName");
- let unit = $("#unit");
- $.ajax({
- url: "/material/findMaterialByCondition",
- type: "post",
- dataType: 'json',
- data: JSON.stringify(req),
- contentType: "application/json;charset=utf-8",
- success: function (d) {
- if (d.count > 1) {
- layer.msg("请点击右侧搜索确定物品");
- materialId.val("");
- codeValue.val("");
- version.val("");
- typeName.val("");
- unit.empty();
- return false;
- } else if (d.count === 0) {
- layer.msg("没有该物品,请确认输入是否正确");
- materialId.val("");
- codeValue.val("");
- materialName.val("");
- version.val("");
- typeName.val("");
- unit.empty();
- return false;
- } else {
- var material = d.data[0];
- materialName.val(material.mname);
- materialId.val(material.mid);
- codeValue.val(material.code);
- version.val(material.version);
- typeName.val(material.typeName);
- unit.empty();
- unit.append(new Option(material.unit, material.unit));
- var splitInfoList = material["splitInfoList"];
- $.each(splitInfoList, function (index, item) {
- $("#unit").append(new Option(item.newUnit, item.newUnit));//往下拉菜单里添加元素
- });
- form.render();
-
- var materialAndBarCodeList = material["materialAndBarCodeList"];
-
- if (materialAndBarCodeList !== null && materialAndBarCodeList.length > 0) {
- // 如果有对应的条形码
- $("#barCode").empty();
- $.each(materialAndBarCodeList, function (index, item) {
- $("#barCode").append(new Option(item.bmcode, item.id));//往下拉菜单里添加元素
+ data = data.split(",")[0];
+ if(data !== ""){
+ req.mname = data;
+ let materialId = $("#mid");
+ let codeValue = $("#code");
+ let version = $("#version");
+ let typeName = $("#typeName");
+ let unit = $("#unit");
+ $.ajax({
+ url: "/material/findMaterialByCondition",
+ type: "post",
+ dataType: 'json',
+ data: JSON.stringify(req),
+ contentType: "application/json;charset=utf-8",
+ success: function (d) {
+ if (d.count > 1) {
+ layer.msg("请点击右侧搜索确定物品");
+ materialId.val("");
+ codeValue.val("");
+ version.val("");
+ typeName.val("");
+ unit.empty();
+ return false;
+ } else if (d.count === 0) {
+ layer.msg("没有该物品,请确认输入是否正确");
+ materialId.val("");
+ codeValue.val("");
+ materialName.val("");
+ version.val("");
+ typeName.val("");
+ unit.empty();
+ return false;
+ } else {
+ var material = d.data[0];
+ materialName.val(material.mname);
+ materialId.val(material.mid);
+ codeValue.val(material.code);
+ version.val(material.version);
+ typeName.val(material.typeName);
+ unit.empty();
+ unit.append(new Option(material.unit, material.unit));
+ var splitInfoList = material["splitInfoList"];
+ $.each(splitInfoList, function (index, item) {
+ $("#unit").append(new Option(item.newUnit, item.newUnit));//往下拉菜单里添加元素
});
form.render();
- } else {
- $("#barCode").empty();
+
+ var materialAndBarCodeList = material["materialAndBarCodeList"];
+
+ if (materialAndBarCodeList !== null && materialAndBarCodeList.length > 0) {
+ // 如果有对应的条形码
+ $("#barCode").empty();
+ $.each(materialAndBarCodeList, function (index, item) {
+ $("#barCode").append(new Option(item.bmcode, item.id));//往下拉菜单里添加元素
+ });
+ form.render();
+ } else {
+ $("#barCode").empty();
+ }
}
}
- }
- });
+ });
+ }
+
};
// 打开物料选择树
diff --git a/src/main/resources/templates/pages/split/split_edit.html b/src/main/resources/templates/pages/split/split_edit.html
index 3c26340e..1e36f450 100644
--- a/src/main/resources/templates/pages/split/split_edit.html
+++ b/src/main/resources/templates/pages/split/split_edit.html
@@ -223,47 +223,51 @@
let materialName = $("#mname");
var data = materialName.val();
var req = {};
- req.mname = data;
- let materialId = $("#mid");
- let codeValue = $("#code");
- let version = $("#version");
- let typeName = $("#typeName");
- let unit = $("#unit");
- $.ajax({
- url: "/material/findMaterialByCondition",
- type: "post",
- dataType: 'json',
- data: JSON.stringify(req),
- contentType: "application/json;charset=utf-8",
- success: function (d) {
- if (d.count > 1) {
- layer.msg("请点击右侧搜索确定物品");
- materialId.val("");
- codeValue.val("");
- version.val("");
- typeName.val("");
- unit.val("");
- return false;
- } else if (d.count === 0) {
- layer.msg("没有该物品,请确认输入是否正确");
- materialId.val("");
- codeValue.val("");
- materialName.val("");
- version.val("");
- typeName.val("");
- unit.val("");
- return false;
- } else {
- var material = d.data[0];
- materialName.val(material.mname);
- materialId.val(material.mid);
- codeValue.val(material.code);
- version.val(material.version);
- typeName.val(material.typeName);
- unit.val(material.unit);
+ data = data.split(",")[0];
+ if(data !== ""){
+ req.mname = data;
+ let materialId = $("#mid");
+ let codeValue = $("#code");
+ let version = $("#version");
+ let typeName = $("#typeName");
+ let unit = $("#unit");
+ $.ajax({
+ url: "/material/findMaterialByCondition",
+ type: "post",
+ dataType: 'json',
+ data: JSON.stringify(req),
+ contentType: "application/json;charset=utf-8",
+ success: function (d) {
+ if (d.count > 1) {
+ layer.msg("请点击右侧搜索确定物品");
+ materialId.val("");
+ codeValue.val("");
+ version.val("");
+ typeName.val("");
+ unit.val("");
+ return false;
+ } else if (d.count === 0) {
+ layer.msg("没有该物品,请确认输入是否正确");
+ materialId.val("");
+ codeValue.val("");
+ materialName.val("");
+ version.val("");
+ typeName.val("");
+ unit.val("");
+ return false;
+ } else {
+ var material = d.data[0];
+ materialName.val(material.mname);
+ materialId.val(material.mid);
+ codeValue.val(material.code);
+ version.val(material.version);
+ typeName.val(material.typeName);
+ unit.val(material.unit);
+ }
}
- }
- });
+ });
+ }
+
};
// 打开物料选择树
diff --git a/src/main/resources/templates/pages/stockTaking/stockTaking.html b/src/main/resources/templates/pages/stockTaking/stockTaking.html
index 7d609f2a..9148d144 100644
--- a/src/main/resources/templates/pages/stockTaking/stockTaking.html
+++ b/src/main/resources/templates/pages/stockTaking/stockTaking.html
@@ -1000,86 +1000,90 @@
var barCodeItem = barCodeChildren.childNodes[3];
var req = {};
- req.mname = data;
- req.depositoryId = depositoryId;
- req.placeId = placeId;
- $.ajax({
- url: "/material/findMaterialForTaking",
- type: "post",
- dataType: 'json',
- data: JSON.stringify(req),
- contentType: "application/json;charset=utf-8",
- success: function (d) {
- if (d.count > 1) {
- layer.msg("请点击右侧搜索确定物品");
- materialId.value = "";
- codeValue.value = "";
- textureChildren.childNodes[3].childNodes[1].value = "";
- versionChildren.childNodes[3].childNodes[1].value = "";
- unitChildren.childNodes[3].childNodes[1].value = "";
- inventoryChildren.childNodes[3].childNodes[1].value = "";
- return false;
- } else if (d.count === 0) {
- layer.msg("没有该物品,请确认输入是否正确");
- materialId.value = "";
- codeValue.value = "";
- materialName.value = "";
- materialTypeItem[1].value = '';
- materialTypeItem[3].value = "";
- textureChildren.childNodes[3].childNodes[1].value = "";
- versionChildren.childNodes[3].childNodes[1].value = "";
- unitChildren.childNodes[3].childNodes[1].value = "";
- inventoryChildren.childNodes[3].childNodes[1].value = "";
- return false;
- } else {
- var material = d.data;
- materialName.value = material.mname;
- materialId.value = material.id;
- codeValue.value = material.code;
- materialTypeItem[1].value = material.typeName;
- materialTypeItem[3].value = material.typeId;
- textureChildren.childNodes[3].childNodes[1].value = material.texture === null || material.texture === undefined ? '' : material.texture;
- versionChildren.childNodes[3].childNodes[1].value = material.version === null || material.version === undefined ? '' : material.version;
- inventoryChildren.childNodes[3].childNodes[1].value = material.quantity;
- var idNumber = materialId.name.split("mid")[1];
- // 获取物料与条形码的对应关系
- var materialAndBarCodeList = material["materialAndBarCodeList"];
- if (materialAndBarCodeList !== null && materialAndBarCodeList.length > 0) {
- var barCodeInput = barCodeItem.childNodes[1].childNodes[1];
- var barCodeImg = barCodeItem.childNodes[1].childNodes[3];
- var id = barCodeInput.id;
- form.render();
- $.each(materialAndBarCodeList, function (index, item) {
- $("#barCode" + idNumber).append(new Option(item.bmcode, item.id));//往下拉菜单里添加元素
- });
- form.render();
- }
- let unitItem = $("#unit" + idNumber);
- unitItem.empty();
- unitItem.append(new Option(material.unit, "-1"));
- let splitInfoList = material.splitInfoList;
- if (splitInfoList.length > 0) {
- $.each(splitInfoList, function (index, item) {
- unitItem.append(new Option(item.newUnit, item.newUnit));
- })
- }
- var shelfLife = d.shelfLife;
- if (shelfLife !== null && shelfLife !== undefined) {
- $("#" + "producedDateItem" + idNumber).show();
- var producedDateList = d['producedDateList'];
- if (producedDateList !== null && producedDateList !== undefined && producedDateList.length > 0) {
- $.each(producedDateList, function (index, item) {
- $("#" + "producedDate" + idNumber).append(new Option(item, item));
+ data = data.split(",")[0];
+ if(data !== ""){
+ req.mname = data;
+ req.depositoryId = depositoryId;
+ req.placeId = placeId;
+ $.ajax({
+ url: "/material/findMaterialForTaking",
+ type: "post",
+ dataType: 'json',
+ data: JSON.stringify(req),
+ contentType: "application/json;charset=utf-8",
+ success: function (d) {
+ if (d.count > 1) {
+ layer.msg("请点击右侧搜索确定物品");
+ materialId.value = "";
+ codeValue.value = "";
+ textureChildren.childNodes[3].childNodes[1].value = "";
+ versionChildren.childNodes[3].childNodes[1].value = "";
+ unitChildren.childNodes[3].childNodes[1].value = "";
+ inventoryChildren.childNodes[3].childNodes[1].value = "";
+ return false;
+ } else if (d.count === 0) {
+ layer.msg("没有该物品,请确认输入是否正确");
+ materialId.value = "";
+ codeValue.value = "";
+ materialName.value = "";
+ materialTypeItem[1].value = '';
+ materialTypeItem[3].value = "";
+ textureChildren.childNodes[3].childNodes[1].value = "";
+ versionChildren.childNodes[3].childNodes[1].value = "";
+ unitChildren.childNodes[3].childNodes[1].value = "";
+ inventoryChildren.childNodes[3].childNodes[1].value = "";
+ return false;
+ } else {
+ var material = d.data;
+ materialName.value = material.mname;
+ materialId.value = material.id;
+ codeValue.value = material.code;
+ materialTypeItem[1].value = material.typeName;
+ materialTypeItem[3].value = material.typeId;
+ textureChildren.childNodes[3].childNodes[1].value = material.texture === null || material.texture === undefined ? '' : material.texture;
+ versionChildren.childNodes[3].childNodes[1].value = material.version === null || material.version === undefined ? '' : material.version;
+ inventoryChildren.childNodes[3].childNodes[1].value = material.quantity;
+ var idNumber = materialId.name.split("mid")[1];
+ // 获取物料与条形码的对应关系
+ var materialAndBarCodeList = material["materialAndBarCodeList"];
+ if (materialAndBarCodeList !== null && materialAndBarCodeList.length > 0) {
+ var barCodeInput = barCodeItem.childNodes[1].childNodes[1];
+ var barCodeImg = barCodeItem.childNodes[1].childNodes[3];
+ var id = barCodeInput.id;
+ form.render();
+ $.each(materialAndBarCodeList, function (index, item) {
+ $("#barCode" + idNumber).append(new Option(item.bmcode, item.id));//往下拉菜单里添加元素
+ });
+ form.render();
+ }
+ let unitItem = $("#unit" + idNumber);
+ unitItem.empty();
+ unitItem.append(new Option(material.unit, "-1"));
+ let splitInfoList = material.splitInfoList;
+ if (splitInfoList.length > 0) {
+ $.each(splitInfoList, function (index, item) {
+ unitItem.append(new Option(item.newUnit, item.newUnit));
})
}
- form.render();
- } else {
- $("#" + "producedDateItem" + idNumber).hide();
- form.render();
+ var shelfLife = d.shelfLife;
+ if (shelfLife !== null && shelfLife !== undefined) {
+ $("#" + "producedDateItem" + idNumber).show();
+ var producedDateList = d['producedDateList'];
+ if (producedDateList !== null && producedDateList !== undefined && producedDateList.length > 0) {
+ $.each(producedDateList, function (index, item) {
+ $("#" + "producedDate" + idNumber).append(new Option(item, item));
+ })
+ }
+ form.render();
+ } else {
+ $("#" + "producedDateItem" + idNumber).hide();
+ form.render();
+ }
}
}
- }
- });
+ });
+ }
+
} else {
layer.msg("请先选择盘点位置或负责人", {
icon: 0,