领料出库修改

This commit is contained in:
hayu 2025-11-26 18:34:17 +08:00
parent 3652eed44e
commit fc3b62d426
2 changed files with 56 additions and 10 deletions

View File

@ -127,7 +127,7 @@
<div class="machinesInfo" style="margin-top:5px;margin-bottom:5px;" id="machinesInfoNum"> <div class="machinesInfo" style="margin-top:5px;margin-bottom:5px;" id="machinesInfoNum">
</div> </div>
<div class="machinesInfo" id="machinesInfo"></div> <div class="machinesInfo" id="machinesInfos"></div>
<div class="machinesInfoOutStock" id="machinesInfoOutStock" style="margin-top:10px"></div> <div class="machinesInfoOutStock" id="machinesInfoOutStock" style="margin-top:10px"></div>
</div> </div>
<div class="mui-bar mui-bar-footer" style="padding: 0px;"> <div class="mui-bar mui-bar-footer" style="padding: 0px;">

View File

@ -84,12 +84,12 @@ function showCounts(type,num){
var notOutNum = (preOutNum - alOutNum); var notOutNum = (preOutNum - alOutNum);
html += "<div class='countInfo'>" html += "<div class='countInfo'>"
html += "&ensp;<span class='preCount' id='preCount'>总数:"+preOutNum+"</span>&ensp;<span class='preCount' id='preCount'>未出库数:"+notOutNum+"</span></div>"; html += "&ensp;<span class='preCount' id='preCount'>总数:"+preOutNum+"</span>&ensp;<span class='preCount' id='preCount'>未出库数:"+notOutNum+"</span></div>";
$("#machinesInfoCounts").append(html); $("#machinesInfoCounts").html(html);
}else{ }else{
var notOutNum = (preOutNum - num); var notOutNum = (preOutNum - num);
html += "<div class='countInfo'>" html += "<div class='countInfo'>"
html += "&ensp;<span class='preCount' id='preCount'>总数:"+preOutNum+"</span>&ensp;<span class='preCount' id='preCount'>未出库数:"+notOutNum+"</span></div>"; html += "&ensp;<span class='preCount' id='preCount'>总数:"+preOutNum+"</span>&ensp;<span class='preCount' id='preCount'>未出库数:"+notOutNum+"</span></div>";
$("#machinesInfoCounts").append(html); $("#machinesInfoCounts").html(html);
} }
} }
@ -109,7 +109,7 @@ function sureSerch() {
} }
var notOutNum = (preOutNum - alOutNum); var notOutNum = (preOutNum - alOutNum);
$("#machinesInfo").html(""); $("#machinesInfos").html("");
$("#machinesInfoNum").html(""); $("#machinesInfoNum").html("");
var deviceCode = $("#deviceCode").val(); var deviceCode = $("#deviceCode").val();
// alert(typeId,deviceCode); // alert(typeId,deviceCode);
@ -119,7 +119,7 @@ function sureSerch() {
}); });
$.ajax({ $.ajax({
type: "post", type: "post",
url: bnsUrl + "/backstage/machine/findByLikeCode", url: bnsUrl + "/backstage/machine/findByLikeCodeNew",
data: { data: {
typeId:typeId, typeId:typeId,
deviceCode: deviceCode, deviceCode: deviceCode,
@ -164,14 +164,14 @@ function sureSerch() {
html += "</div>"; html += "</div>";
html += "<input type='checkbox' class='device-checkbox' data-id='" + id + "' style='margin-left:120px;' />"; html += "<input type='checkbox' class='device-checkbox' data-id='" + id + "' style='margin-left:120px;' />";
html += "</div>"; html += "</div>";
$("#machinesInfo").append(html); $("#machinesInfos").append(html);
} }
} else { } else {
html = ""; html = "";
html += "<div class='inclode'>" html += "<div class='inclode'>"
html += "<span class='noneData' id='noneData'>请输入设备编码</span><br /></div>"; html += "<span class='noneData' id='noneData'>请输入设备编码</span><br /></div>";
$("#machinesInfo").append(html); $("#machinesInfos").append(html);
} }
}, },
error: function(XMLHttpRequest, textStatus, errorThrown) { error: function(XMLHttpRequest, textStatus, errorThrown) {
@ -207,10 +207,55 @@ function confirmOutTaskList() {
var completedRequests = 0; var completedRequests = 0;
var totalRequests = selectedDevices.length; var totalRequests = selectedDevices.length;
var deviceList = [];
selectedDevices.forEach(function(device) { selectedDevices.forEach(function(device) {
completedRequests++; completedRequests++;
doOutBydeviceCode(device.deviceCode, device.batchStatus, device.maId,completedRequests,totalRequests); deviceList.push({
id:id,
taskId: taskId,
typeId: typeId,
maId: device.maId,
deviceCode: device.deviceCode,
machineStatus: device.batchStatus,
outPersonId:outPersonId,
preOutNum:preOutNum,
thisOutNum:1
});
// doOutBydeviceCode(device.deviceCode, device.batchStatus, device.maId,completedRequests,totalRequests);
});
doOutBydeviceCodeNew(deviceList,completedRequests);
}
function doOutBydeviceCodeNew(deviceList,completedRequests) {
layer.open({
type: 2,
content: '加载中'
});
$.ajax({
type: "post",
url: bnsUrl + '/backstage/app/out/doOutBydeviceCodeNew',
contentType: "application/json",
data: JSON.stringify(deviceList),
dataType: "json",
success: function(data) {
layer.closeAll('loading');
if(data == "1" || data == 1){
refreshData(completedRequests)
}
else if(data == "-3"){
alert("机具编码重复");
}
else if(data == "2" || data == '2') {
alert("已达到出库数量");
} else {
alert("出库失败");
}
},
error: function(XMLHttpRequest, textStatus, errorThrown) {
alert("未连接到服务器,请检查网络!");
}
}); });
} }
@ -269,7 +314,8 @@ var alOutNumNew = parseInt(alOutNum) + completedRequests;
function refreshData(completedRequests) { function refreshData(completedRequests) {
alert("全部出库成功"); alert("全部出库成功");
alOutNum = parseInt(alOutNum) + completedRequests; alOutNum = parseInt(alOutNum) + completedRequests;
sureSerch() sureSerch();
showAlOutInfo();
} }