diff --git a/target/classes/templates/pages/application/application-out_temporaryValue.html b/target/classes/templates/pages/application/application-out_temporaryValue.html index 77645540..71fcf3d6 100644 --- a/target/classes/templates/pages/application/application-out_temporaryValue.html +++ b/target/classes/templates/pages/application/application-out_temporaryValue.html @@ -558,6 +558,16 @@ barCode.empty(); } } + if (depositoryDisplay !== "none") { + $("#showDepository" + idNumber).empty(); + let depositoryList = d.depositoryList; + if(depositoryList !== null) { + for (let i = 0; i < depositoryList.length; i++) { + $("#showDepository" + idNumber).append(new Option(depositoryList[i].dname, depositoryList[i].id)); + } + } + form.render(); + } layer.close(loading2); } } @@ -655,6 +665,15 @@ barCode.empty(); } } + if (depositoryDisplay !== "none") { + $("#showDepository" + idNumber).empty(); + let depositoryList = material.depositoryList; + if(depositoryList !== null) { + for (let i = 0; i < depositoryList.length; i++) { + $("#showDepository" + idNumber).append(new Option(depositoryList[i].dname, depositoryList[i].id)); + } + } + } form.render(); layer.close(loading2); } @@ -747,6 +766,16 @@ barCode.empty(); } } + if (depositoryDisplay !== "none") { + $("#showDepository" + idNumber).empty(); + let depositoryList = material.depositoryList; + if(depositoryList !== null){ + for (let i = 0; i < depositoryList.length; i++) { + $("#showDepository" + idNumber).append(new Option(depositoryList[i].dname, depositoryList[i].id)); + } + } + form.render(); + } materialName.value = material.mname; materialId.value = material.id; codeValue.value = material.code; @@ -818,6 +847,15 @@ for (let i = 0; i < unitList.length; i++) { $("#unit" + idNumber).append(new Option(unitList[i].newUnit, unitList[i].newUnit)); } + if (depositoryDisplay !== "none") { + $("#showDepository" + idNumber).empty(); + let depositoryList = data.depositoryList; + if(depositoryList !== null) { + for (let i = 0; i < depositoryList.length; i++) { + $("#showDepository" + idNumber).append(new Option(depositoryList[i].dname, depositoryList[i].id)); + } + } + } form.render(); layer.close(loading2); } else { @@ -932,6 +970,15 @@ $.each(data.splitInfoList, function (index, item) { $("#unit" + idNumber).append(new Option(item.newUnit, item.newUnit)); }); + if (depositoryDisplay !== "none") { + $("#showDepository" + idNumber).empty(); + let depositoryList = data.depositoryList; + if(depositoryList !== null) { + for (let i = 0; i < depositoryList.length; i++) { + $("#showDepository" + idNumber).append(new Option(depositoryList[i].dname, depositoryList[i].id)); + } + } + } form.render(); materialName.value = data.mname; materialId.value = data.id; @@ -961,6 +1008,9 @@ req.quantity = val; req.unit = unit; req.placeId = -1; + if (depositoryDisplay !== "none") { + req.depositoryId = $("#showDepository" + id).val(); + } let loading2 = layer.open({type: 3, shade: [0.25, '#000'], icon: 2, speed: 0}); $.ajax({ url: "/material/MaterialQuantityIsTrue", @@ -1061,10 +1111,22 @@ }; form.on('select()', function (data) { - let unit = data.value; + let id = data.elem.id; let idNum = id.split("unit")[1]; - let mcode = $("#code" + idNum).val(); + 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("") @@ -1077,6 +1139,9 @@ 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", @@ -1101,11 +1166,9 @@ } } + }); - $('body').on('click', '[data-refresh]', function () { - location.reload(); - }) })