Browse Source

修改系统内部审批流程

lwx_dev
erdanergou 3 years ago
parent
commit
289b467b46
  1. 13
      src/main/java/com/dreamchaser/depository_manage/service/impl/DepositoryRecordServiceImpl.java
  2. 138
      src/main/resources/templates/pages/applicationForStorageCenter/application-out.html
  3. 111
      src/main/resources/templates/pages/applicationForStorageCenter/application-out_admin.html
  4. 103
      src/main/resources/templates/pages/applicationForStorageCenter/application-out_back.html
  5. 107
      src/main/resources/templates/pages/applicationForStorageCenter/application-out_temporaryValue.html
  6. 138
      target/classes/templates/pages/applicationForStorageCenter/application-out.html
  7. 111
      target/classes/templates/pages/applicationForStorageCenter/application-out_admin.html
  8. 103
      target/classes/templates/pages/applicationForStorageCenter/application-out_back.html
  9. 107
      target/classes/templates/pages/applicationForStorageCenter/application-out_temporaryValue.html

13
src/main/java/com/dreamchaser/depository_manage/service/impl/DepositoryRecordServiceImpl.java

@ -2414,7 +2414,8 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
redisPool.getRedisTemplateByDb(14).opsForHash().putAll(redisOutKey, stringObjectMap); redisPool.getRedisTemplateByDb(14).opsForHash().putAll(redisOutKey, stringObjectMap);
redisPool.getRedisTemplateByDb(14).expire(redisOutKey, 72, TimeUnit.HOURS); redisPool.getRedisTemplateByDb(14).expire(redisOutKey, 72, TimeUnit.HOURS);
}); });
} else { }
else {
// 如果是通过仓库 // 如果是通过仓库
@ -3074,11 +3075,13 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
// 获取所有仓库 // 获取所有仓库
List<Depository> depositoryAll = depositoryMapper.findDepositoryAll(); List<Depository> depositoryAll = depositoryMapper.findDepositoryAll();
for (Depository depositoryById : depositoryByIds) { for (Depository depositoryById : depositoryByIds) {
// 获取当前仓库的顶级仓库
Depository parentDepository = findParentDepository(depositoryById, depositoryAll); Depository parentDepository = findParentDepository(depositoryById, depositoryAll);
if (parentDepository.getDname().contains("办公")) { if (!parentDepository.getDname().contains("前置仓")) {
// 设置为true // 如果不是前置仓下的仓库
flagForZXCWorkWarehouse = true; if (depositoryById.getDname().contains("办公")) {
// 如果是中心仓下的办公用品库
flagForZXCWorkWarehouse = true;
}
} }
} }
if (!flagForZXCWorkWarehouse) { if (!flagForZXCWorkWarehouse) {

138
src/main/resources/templates/pages/applicationForStorageCenter/application-out.html

@ -122,7 +122,7 @@
<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">
<select name="outType"> <select name="outType" id="outType">
<option></option> <option></option>
<option th:each="bt,iterStar:${btList}" <option th:each="bt,iterStar:${btList}"
th:value="${bt?.getId()}" th:value="${bt?.getId()}"
@ -322,8 +322,12 @@
<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">
<input name="outType" placeholder="请填写相关原因及申请原因" value="" <select name="outType" id="outTypeForGroup">
class="layui-input"/> <option></option>
<option th:each="bt,iterStar:${btList}"
th:value="${bt?.getId()}"
th:text="${bt?.getTypeName()}"></option>
</select>
</div> </div>
</div> </div>
<div class="layui-form-item"> <div class="layui-form-item">
@ -1927,74 +1931,80 @@
form.on('select()', function (data) { form.on('select()', function (data) {
let id = data.elem.id; let id = data.elem.id;
let idNum = id.split("unit")[1]; if(id.indexOf('outType') === -1){
let unit = ""; let idNum = id.split("unit")[1];
let mcode = ""; let unit = "";
let depositoryId = "-1"; let mcode = "";
// 用于标志是否为物料出库(默认为物料) let depositoryId = "-1";
let flag = true; // 用于标志是否为物料出库(默认为物料)
if (id.indexOf('unit') !== -1) { let flag = true;
unit = data.value; if (id.indexOf('unit') !== -1) {
if (depositoryDisplay !== "none") { unit = data.value;
depositoryId = $("#showDepository" + idNum).val(); if (depositoryDisplay !== "none") {
depositoryId = $("#showDepository" + idNum).val();
}
} }
} else if (id.indexOf('ForGroup') === -1) { else if (id.indexOf('ForGroup') === -1) {
// 获取当前选中的仓库id是在物料出库下 // 获取当前选中的仓库id是在物料出库下
depositoryId = data.value; depositoryId = data.value;
idNum = id.split('showDepository')[1]; idNum = id.split('showDepository')[1];
unit = $("#unit" + idNum).val(); unit = $("#unit" + idNum).val();
} else if (id.indexOf("ForGroup") !== -1) { }
depositoryId = data.value; else if (id.indexOf("ForGroup") !== -1) {
idNum = id.split('showDepositoryForGroup')[1]; depositoryId = data.value;
flag = false; idNum = id.split('showDepositoryForGroup')[1];
} flag = false;
if (flag) { }
mcode = $("#code" + idNum).val(); if (flag) {
if (mcode === "" || mcode === undefined || mcode === null) { mcode = $("#code" + idNum).val();
layer.msg("请输入物料的正确编码!", {icon: 0, time: 1000}, function () { if (mcode === "" || mcode === undefined || mcode === null) {
$("#quantity" + idNum).val("") 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 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 { else {
let elem = {}; let elem = {};
elem.id = "quantityForGroup" + idNum; elem.id = "quantityForGroup" + idNum;
groupQuantityIsTrue(elem) groupQuantityIsTrue(elem)
}
} }
}); });

111
src/main/resources/templates/pages/applicationForStorageCenter/application-out_admin.html

@ -109,7 +109,7 @@
<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">
<select name="outType"> <select name="outType" id="outType">
<option></option> <option></option>
<option th:each="bt,iterStar:${btList}" <option th:each="bt,iterStar:${btList}"
th:value="${bt?.getId()}" th:value="${bt?.getId()}"
@ -283,8 +283,12 @@
<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">
<input name="outType" placeholder="请填写相关原因及申请原因" value="" <select name="outType" id="outTypeForGroup">
class="layui-input"/> <option></option>
<option th:each="bt,iterStar:${btList}"
th:value="${bt?.getId()}"
th:text="${bt?.getTypeName()}"></option>
</select>
</div> </div>
</div> </div>
<div class="layui-form-item"> <div class="layui-form-item">
@ -1945,60 +1949,65 @@
form.on('select()', function (data) { form.on('select()', function (data) {
let id = data.elem.id; let id = data.elem.id;
let idNum = id.split("unit")[1]; if(id.indexOf('outType') === -1){
let unit = ""; let idNum = id.split("unit")[1];
let mcode = ""; let unit = "";
let depositoryId = "-1"; let mcode = "";
if (id.indexOf('unit') !== -1) { let depositoryId = "-1";
unit = data.value; if (id.indexOf('unit') !== -1) {
} else { unit = data.value;
// 获取当前选中的仓库id }
depositoryId = data.value; else {
idNum = id.split('showDepository')[1]; // 获取当前选中的仓库id
unit = $("#unit" + idNum).val(); 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)
}
} }
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)
}
}
});
}
}
} }
}); });
}) })
</script> </script>

103
src/main/resources/templates/pages/applicationForStorageCenter/application-out_back.html

@ -104,7 +104,7 @@
<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">
<select name="outType"> <select name="outType" id="outType">
<option></option> <option></option>
<option th:each="bt,iterStar:${btList}" <option th:each="bt,iterStar:${btList}"
th:value="${bt?.getId()}" th:value="${bt?.getId()}"
@ -596,61 +596,66 @@
form.on('select()', function (data) { form.on('select()', function (data) {
let id = data.elem.id; let id = data.elem.id;
let unit = ""; if(id.indexOf('outType') === -1){
let mcode = ""; let unit = "";
let depositoryId = "-1"; let mcode = "";
if (id.indexOf('unit') !== -1) { let depositoryId = "-1";
unit = data.value; if (id.indexOf('unit') !== -1) {
if (depositoryDisplay !== "none") { unit = data.value;
depositoryId = $("#showDepository" + idNum).val(); if (depositoryDisplay !== "none") {
} depositoryId = $("#showDepository" + idNum).val();
} else {
// 获取当前选中的仓库id
depositoryId = data.value;
unit = $("#unit").val();
}
mcode = $("#code").val();
if (mcode === "" || mcode === undefined || mcode === null) {
layer.msg("请输入物料的正确编码!", {icon: 0, time: 500}, function () {
$("#quantity").val("")
});
} else {
let val = $("#quantity").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({ else {
url: "/material/MaterialQuantityIsTrue", // 获取当前选中的仓库id
type: "post", depositoryId = data.value;
data: JSON.stringify(req), unit = $("#unit").val();
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").val("");
},
);
} else {
layer.close(loading2)
}
} }
mcode = $("#code").val();
if (mcode === "" || mcode === undefined || mcode === null) {
layer.msg("请输入物料的正确编码!", {icon: 0, time: 500}, function () {
$("#quantity").val("")
}); });
} }
else {
let val = $("#quantity").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").val("");
},
);
} else {
layer.close(loading2)
}
}
});
}
}
} }
}); });

107
src/main/resources/templates/pages/applicationForStorageCenter/application-out_temporaryValue.html

@ -82,7 +82,7 @@
<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">
<select name="outType"> <select name="outType" id="outType">
<option></option> <option></option>
<option th:each="bt,iterStar:${btList}" <option th:each="bt,iterStar:${btList}"
th:value="${bt?.getId()}" th:value="${bt?.getId()}"
@ -1176,63 +1176,68 @@
form.on('select()', function (data) { form.on('select()', function (data) {
let id = data.elem.id; let id = data.elem.id;
let idNum = id.split("unit")[1]; if(id.indexOf('outType') === -1){
let unit = ""; let idNum = id.split("unit")[1];
let mcode = ""; let unit = "";
let depositoryId = "-1"; let mcode = "";
if (id.indexOf('unit') !== -1) { let depositoryId = "-1";
unit = data.value; if (id.indexOf('unit') !== -1) {
if (depositoryDisplay !== "none") { unit = data.value;
depositoryId = $("#showDepository" + idNum).val(); if (depositoryDisplay !== "none") {
} depositoryId = $("#showDepository" + idNum).val();
} 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({ else {
url: "/material/MaterialQuantityIsTrue", // 获取当前选中的仓库id
type: "post", depositoryId = data.value;
data: JSON.stringify(req), idNum = id.split('showDepository')[1];
dataType: 'json', unit = $("#unit" + idNum).val();
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)
}
} }
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)
}
}
});
}
}
} }
}); });

138
target/classes/templates/pages/applicationForStorageCenter/application-out.html

@ -122,7 +122,7 @@
<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">
<select name="outType"> <select name="outType" id="outType">
<option></option> <option></option>
<option th:each="bt,iterStar:${btList}" <option th:each="bt,iterStar:${btList}"
th:value="${bt?.getId()}" th:value="${bt?.getId()}"
@ -322,8 +322,12 @@
<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">
<input name="outType" placeholder="请填写相关原因及申请原因" value="" <select name="outType" id="outTypeForGroup">
class="layui-input"/> <option></option>
<option th:each="bt,iterStar:${btList}"
th:value="${bt?.getId()}"
th:text="${bt?.getTypeName()}"></option>
</select>
</div> </div>
</div> </div>
<div class="layui-form-item"> <div class="layui-form-item">
@ -1927,74 +1931,80 @@
form.on('select()', function (data) { form.on('select()', function (data) {
let id = data.elem.id; let id = data.elem.id;
let idNum = id.split("unit")[1]; if(id.indexOf('outType') === -1){
let unit = ""; let idNum = id.split("unit")[1];
let mcode = ""; let unit = "";
let depositoryId = "-1"; let mcode = "";
// 用于标志是否为物料出库(默认为物料) let depositoryId = "-1";
let flag = true; // 用于标志是否为物料出库(默认为物料)
if (id.indexOf('unit') !== -1) { let flag = true;
unit = data.value; if (id.indexOf('unit') !== -1) {
if (depositoryDisplay !== "none") { unit = data.value;
depositoryId = $("#showDepository" + idNum).val(); if (depositoryDisplay !== "none") {
depositoryId = $("#showDepository" + idNum).val();
}
} }
} else if (id.indexOf('ForGroup') === -1) { else if (id.indexOf('ForGroup') === -1) {
// 获取当前选中的仓库id是在物料出库下 // 获取当前选中的仓库id是在物料出库下
depositoryId = data.value; depositoryId = data.value;
idNum = id.split('showDepository')[1]; idNum = id.split('showDepository')[1];
unit = $("#unit" + idNum).val(); unit = $("#unit" + idNum).val();
} else if (id.indexOf("ForGroup") !== -1) { }
depositoryId = data.value; else if (id.indexOf("ForGroup") !== -1) {
idNum = id.split('showDepositoryForGroup')[1]; depositoryId = data.value;
flag = false; idNum = id.split('showDepositoryForGroup')[1];
} flag = false;
if (flag) { }
mcode = $("#code" + idNum).val(); if (flag) {
if (mcode === "" || mcode === undefined || mcode === null) { mcode = $("#code" + idNum).val();
layer.msg("请输入物料的正确编码!", {icon: 0, time: 1000}, function () { if (mcode === "" || mcode === undefined || mcode === null) {
$("#quantity" + idNum).val("") 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 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 { else {
let elem = {}; let elem = {};
elem.id = "quantityForGroup" + idNum; elem.id = "quantityForGroup" + idNum;
groupQuantityIsTrue(elem) groupQuantityIsTrue(elem)
}
} }
}); });

111
target/classes/templates/pages/applicationForStorageCenter/application-out_admin.html

@ -109,7 +109,7 @@
<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">
<select name="outType"> <select name="outType" id="outType">
<option></option> <option></option>
<option th:each="bt,iterStar:${btList}" <option th:each="bt,iterStar:${btList}"
th:value="${bt?.getId()}" th:value="${bt?.getId()}"
@ -283,8 +283,12 @@
<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">
<input name="outType" placeholder="请填写相关原因及申请原因" value="" <select name="outType" id="outTypeForGroup">
class="layui-input"/> <option></option>
<option th:each="bt,iterStar:${btList}"
th:value="${bt?.getId()}"
th:text="${bt?.getTypeName()}"></option>
</select>
</div> </div>
</div> </div>
<div class="layui-form-item"> <div class="layui-form-item">
@ -1945,60 +1949,65 @@
form.on('select()', function (data) { form.on('select()', function (data) {
let id = data.elem.id; let id = data.elem.id;
let idNum = id.split("unit")[1]; if(id.indexOf('outType') === -1){
let unit = ""; let idNum = id.split("unit")[1];
let mcode = ""; let unit = "";
let depositoryId = "-1"; let mcode = "";
if (id.indexOf('unit') !== -1) { let depositoryId = "-1";
unit = data.value; if (id.indexOf('unit') !== -1) {
} else { unit = data.value;
// 获取当前选中的仓库id }
depositoryId = data.value; else {
idNum = id.split('showDepository')[1]; // 获取当前选中的仓库id
unit = $("#unit" + idNum).val(); 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)
}
} }
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)
}
}
});
}
}
} }
}); });
}) })
</script> </script>

103
target/classes/templates/pages/applicationForStorageCenter/application-out_back.html

@ -104,7 +104,7 @@
<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">
<select name="outType"> <select name="outType" id="outType">
<option></option> <option></option>
<option th:each="bt,iterStar:${btList}" <option th:each="bt,iterStar:${btList}"
th:value="${bt?.getId()}" th:value="${bt?.getId()}"
@ -596,61 +596,66 @@
form.on('select()', function (data) { form.on('select()', function (data) {
let id = data.elem.id; let id = data.elem.id;
let unit = ""; if(id.indexOf('outType') === -1){
let mcode = ""; let unit = "";
let depositoryId = "-1"; let mcode = "";
if (id.indexOf('unit') !== -1) { let depositoryId = "-1";
unit = data.value; if (id.indexOf('unit') !== -1) {
if (depositoryDisplay !== "none") { unit = data.value;
depositoryId = $("#showDepository" + idNum).val(); if (depositoryDisplay !== "none") {
} depositoryId = $("#showDepository" + idNum).val();
} else {
// 获取当前选中的仓库id
depositoryId = data.value;
unit = $("#unit").val();
}
mcode = $("#code").val();
if (mcode === "" || mcode === undefined || mcode === null) {
layer.msg("请输入物料的正确编码!", {icon: 0, time: 500}, function () {
$("#quantity").val("")
});
} else {
let val = $("#quantity").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({ else {
url: "/material/MaterialQuantityIsTrue", // 获取当前选中的仓库id
type: "post", depositoryId = data.value;
data: JSON.stringify(req), unit = $("#unit").val();
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").val("");
},
);
} else {
layer.close(loading2)
}
} }
mcode = $("#code").val();
if (mcode === "" || mcode === undefined || mcode === null) {
layer.msg("请输入物料的正确编码!", {icon: 0, time: 500}, function () {
$("#quantity").val("")
}); });
} }
else {
let val = $("#quantity").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").val("");
},
);
} else {
layer.close(loading2)
}
}
});
}
}
} }
}); });

107
target/classes/templates/pages/applicationForStorageCenter/application-out_temporaryValue.html

@ -82,7 +82,7 @@
<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">
<select name="outType"> <select name="outType" id="outType">
<option></option> <option></option>
<option th:each="bt,iterStar:${btList}" <option th:each="bt,iterStar:${btList}"
th:value="${bt?.getId()}" th:value="${bt?.getId()}"
@ -1176,63 +1176,68 @@
form.on('select()', function (data) { form.on('select()', function (data) {
let id = data.elem.id; let id = data.elem.id;
let idNum = id.split("unit")[1]; if(id.indexOf('outType') === -1){
let unit = ""; let idNum = id.split("unit")[1];
let mcode = ""; let unit = "";
let depositoryId = "-1"; let mcode = "";
if (id.indexOf('unit') !== -1) { let depositoryId = "-1";
unit = data.value; if (id.indexOf('unit') !== -1) {
if (depositoryDisplay !== "none") { unit = data.value;
depositoryId = $("#showDepository" + idNum).val(); if (depositoryDisplay !== "none") {
} depositoryId = $("#showDepository" + idNum).val();
} 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({ else {
url: "/material/MaterialQuantityIsTrue", // 获取当前选中的仓库id
type: "post", depositoryId = data.value;
data: JSON.stringify(req), idNum = id.split('showDepository')[1];
dataType: 'json', unit = $("#unit" + idNum).val();
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)
}
} }
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)
}
}
});
}
}
} }
}); });

Loading…
Cancel
Save