Browse Source

修改入库功能

lwx_dev
erdanergou 3 years ago
parent
commit
053c819338
  1. 35
      src/main/resources/templates/pages/split/split_add.html
  2. 1
      target/classes/templates/pages/application/application-in.html
  3. 24
      target/classes/templates/pages/group/group-add_back.html

35
src/main/resources/templates/pages/split/split_add.html

@ -236,6 +236,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 materialId = $("#mid");
let codeValue = $("#code");
let version = $("#version");
@ -249,21 +250,27 @@
contentType: "application/json;charset=utf-8",
success: function (d) {
if (d.count > 1) {
layer.msg("请点击右侧搜索确定物品");
layer.msg("请点击右侧搜索确定物品",{icon:0,time:500},function () {
materialId.val("");
codeValue.val("");
version.val("");
typeName.val("");
unit.empty();
layer.close(loading2);
});
return false;
} else if (d.count === 0) {
layer.msg("没有该物品,请确认输入是否正确");
layer.msg("没有该物品,请确认输入是否正确",{icon:0,time:500},function () {
materialId.val("");
codeValue.val("");
materialName.val("");
version.val("");
typeName.val("");
unit.empty();
layer.close(loading2);
});
return false;
} else {
var material = d.data[0];
@ -292,6 +299,7 @@
} else {
$("#barCode").empty();
}
layer.close(loading2);
}
}
});
@ -323,6 +331,7 @@
end: function () {
var mid = $("#mid").val();
if (mid !== '') {
let loading2 = layer.open({ type: 3, shade: [0.25, '#000'], icon: 2, speed: 0});
$.ajax({
url: "/material/findMatrialById?mid=" + mid,
type: "get",
@ -349,7 +358,7 @@
if (materialAndBarCodeList !== null && materialAndBarCodeList.length > 0) {
// 如果有对应的条形码
$("#barCode").empty()
$("#barCode").empty();
$.each(materialAndBarCodeList, function (index, item) {
$("#barCode").append(new Option(item.bmcode, item.id));//往下拉菜单里添加元素
});
@ -358,6 +367,7 @@
$("#barCode").empty();
}
layer.close(loading2);
}
});
}
@ -385,6 +395,8 @@
var req = {};
req.qrCode = result;
req.codeFlag = 2;
let loading2 = layer.open({ type: 3, shade: [0.25, '#000'], icon: 2, speed: 0});
$.ajax({
url: "/material/qywxApplicationInScanQrCode",
type: "post",
@ -406,6 +418,7 @@
$("#version").val("");
$("#barCode").empty();
$("#unit").empty();
layer.close(loading2);
})
} else {
// 如果有对应关系
@ -441,6 +454,7 @@
unit.append(new Option(unitList[i].newUnit, unitList[i].newUnit));
}
form.render();
layer.close(loading2);
}
}
@ -470,6 +484,7 @@
let barCode = $("#barCode");
barCode.empty();
barCode.append(new Option(result, result));
let loading2 = layer.open({ type: 3, shade: [0.25, '#000'], icon: 2, speed: 0});
$.ajax({
url: "/material/qywxApplicationInScanBarCode",
type: "post",
@ -494,7 +509,7 @@
});
}
form.render();
layer.close(loading2);
}
else {
@ -509,6 +524,7 @@
$("#version").val("");
unit.empty();
$("#barCode").empty();
layer.close(loading2);
})
}
@ -533,6 +549,8 @@
var req = {};
req.code = code;
req.type = "in";
if(code !== ""){
let loading2 = layer.open({ type: 3, shade: [0.25, '#000'], icon: 2, speed: 0});
$.ajax({
url: "/material/findMatrialByCode",
type: "get",
@ -542,7 +560,7 @@
success: function (d) {
var d = d.data;
if (d == null) {
layer.msg("没有该编码,请确认是否输入正确");
layer.msg("没有该编码,请确认是否输入正确",{icon:0,time:500},function () {
$("#mname").val("");
$("#mid").val("");
$("#code").val("");
@ -551,6 +569,9 @@
$("#unit").empty();
$("#typeName").val("");
form.render();
layer.close(loading2);
});
} else {
$("#mname").val(d.mname);
@ -587,11 +608,13 @@
$(children[1]).empty();
}
}
layer.close(loading2);
}
}
});
}
};
})

1
target/classes/templates/pages/application/application-in.html

@ -1550,7 +1550,6 @@
childNodes[i].remove()
}
}
layer.close(loading2)
}
};

24
target/classes/templates/pages/group/group-add_back.html

@ -413,6 +413,7 @@
var req = {};
req.qrCode = result;
req.codeFlag = 1;
let loading2 = layer.open({ type: 3, shade: [0.25, '#000'], icon: 2, speed: 0});
$.ajax({
url: "/material/qywxApplicationInScanBarCode",
type: "post",
@ -454,12 +455,14 @@
$("#unit" + idNumber).append(new Option(unitList[i].newUnit, unitList[i].newUnit));
}
form.render();
layer.close(loading2);
} else {
// 如果没有对应关系
layer.msg("对于编码:" + result + ",并未发现对应的物料", {
icon: 0,
time: 1000 //0.5秒关闭(如果不配置,默认是3秒)
}, function () {
layer.close(loading2);
})
}
@ -490,6 +493,7 @@
var req = {};
req.qrCode = result;
req.codeFlag = 2;
let loading2 = layer.open({ type: 3, shade: [0.25, '#000'], icon: 2, speed: 0});
$.ajax({
url: "/material/qywxApplicationInScanQrCode",
type: "post",
@ -558,6 +562,7 @@
materialName.value = data.mname;
materialId.value = data.mid;
materialCode.value = data.code;
layer.close(loading2);
}
})
}
@ -601,6 +606,7 @@
},
end: function () {
var mid = materialId.value;
let loading2 = layer.open({ type: 3, shade: [0.25, '#000'], icon: 2, speed: 0});
if (mid !== '') {
$.ajax({
url: "/material/findMatrialById?mid=" + mid,
@ -652,6 +658,7 @@
}
}
form.render();
layer.close(loading2);
}
});
}
@ -678,6 +685,7 @@
req.code = code;
req.type = "in";
if (code !== "") {
let loading2 = layer.open({ type: 3, shade: [0.25, '#000'], icon: 2, speed: 0});
$.ajax({
url: "/material/findMatrialByCode",
type: "get",
@ -687,11 +695,13 @@
success: function (d) {
var d = d.data;
if (d == null) {
layer.msg("仓库中暂无该物料");
layer.msg("仓库中暂无该物料",{icon:0,time:500},function () {
layer.close(loading2);
materialName.value = "";
materialId.value = "";
obj.value = "";
$('#place' + objId).empty();
});
} else {
materialName.value = d.mname;
@ -734,6 +744,7 @@
barCode.empty();
}
}
layer.close(loading2);
}
}
});
@ -759,6 +770,7 @@
data = data.split(",")[0];
if (data !== "") {
req.mname = data;
let loading2 = layer.open({ type: 3, shade: [0.25, '#000'], icon: 2, speed: 0});
$.ajax({
url: "/material/findMaterialByCondition",
type: "post",
@ -767,15 +779,20 @@
contentType: "application/json;charset=utf-8",
success: function (d) {
if (d.count > 1) {
layer.msg("请点击右侧搜索确定物品");
layer.msg("请点击右侧搜索确定物品",{icon:0,time:500},function () {
materialId.value = "";
codeValue.value = "";
layer.close(loading2);
});
return false;
} else if (d.count === 0) {
layer.msg("没有该物品,请确认输入是否正确");
layer.msg("没有该物品,请确认输入是否正确",{icon:5,time:500},function () {
materialId.value = "";
codeValue.value = "";
materialName.value = "";
layer.close(loading2);
});
return false;
} else {
var idNumber = materialId.name.split("mid")[1];
@ -821,6 +838,7 @@
materialName.value = material.mname;
materialId.value = material.id;
codeValue.value = material.code;
layer.close(loading2);
}
}
});

Loading…
Cancel
Save