Index: ssts-web/src/main/webapp/disinfectsystem/touchScreen/recycle/recycleForTouchScreen.js =================================================================== diff -u -r16647 -r16721 --- ssts-web/src/main/webapp/disinfectsystem/touchScreen/recycle/recycleForTouchScreen.js (.../recycleForTouchScreen.js) (revision 16647) +++ ssts-web/src/main/webapp/disinfectsystem/touchScreen/recycle/recycleForTouchScreen.js (.../recycleForTouchScreen.js) (revision 16721) @@ -1754,7 +1754,7 @@ } if(!isAllTousseInTheBasket){ - alertDiv('还有部分器械包未装入篮筐,不能保存。'); + alertDiv('部分器械包回收数量大于装载数量,不能保存。'); return false; } @@ -1790,61 +1790,101 @@ function submitFunction(confirmation,saveAndNew){ if(submitCheck()){ - alertDiv("保存中,请稍候......", true); - - var jsonStr = getJsonParams(confirmation); - var id = document.getElementById('id').value; - var app_id = document.getElementById('recyclingApplicationId').value; - var departCode = document.getElementById('departCode').value; - var recyclingUser = document.getElementById('recyclingUser').value; - var operator = document.getElementById('operator').value; - var depart = document.getElementById('depart').value; - var recyclingTime = document.getElementById('recyclingTime').value; - var recyclingUserDefault = true; - if(sstsConfig.hasOwnProperty('recyclingUserDefault') && !sstsConfig.recyclingUserDefault){ - recyclingUserDefault = false; - } - $.ajax({ - url : WWWROOT + "/disinfectSystem/recyclingRecordAction!saveRecyclingRecord.do", - type : "POST", - timeout : 300000, - dataType :'json', - data : { - jsonParam : "" + jsonStr + "", - id : id, - recyclingApplicationId : app_id, - departCode : departCode, - recyclingUser : recyclingUser, - operator : operator, - depart : depart, - recyclingTime : recyclingTime, - recyclingUserDefault : recyclingUserDefault - }, - success : function(result) { - if(result.success){ - alertDiv(result.message, true); - setTimeout("closeDiv()",1200); - - if(saveAndNew){ - location.href = "recycleForTouchScreen.jsp?resolution=" + resolution + "&rememberRecycleUser=" + rememberRecycleUser; - }else{ - location.href = "awaitForRecycleList.jsp?resolution=" + resolution; - } - }else{ - alertDiv(result.message); - } - }, - error: function(x, t, m) { - if(t == "timeout") { - alert("提交超时,请重试"); - } else { - alert(t); + var isPartIntheBasket = false; + $('#tousseItemTable').children().first().children().each(function(index,element){ + if($('#deleted'+index).val() == '0'){ + var recyclingAmount = parseInt($('#recycleAmount'+index).val(),10); + var loadedAmount = parseInt($('#loadedAmount'+index).val(),10); + if(recyclingAmount > loadedAmount){ + isPartIntheBasket = true; + return false; } } - }); + }); + //部分入筐提示 + if(isPartIntheBasket){ + $("#dialogConfirm").dialog({ + resizable: false, + height:310, + width:600, + modal: true, + open: function() { + $("#confirmMsg").text("还有部分器械包未装入篮筐,是否继续保存?"); + }, + close: function() { + $("#confirmMsg").text(""); + }, + buttons: { + "是": function() { + submitFormFunction(confirmation,saveAndNew); + $( this ).dialog( "close" ); + }, + "否": function() { + $( this ).dialog( "close" ); + } + } + }); + }else{ + submitFormFunction(confirmation,saveAndNew); + } } } +function submitFormFunction(confirmation,saveAndNew){ + + alertDiv("保存中,请稍候......", true); + var jsonStr = getJsonParams(confirmation); + var id = document.getElementById('id').value; + var app_id = document.getElementById('recyclingApplicationId').value; + var departCode = document.getElementById('departCode').value; + var recyclingUser = document.getElementById('recyclingUser').value; + var operator = document.getElementById('operator').value; + var depart = document.getElementById('depart').value; + var recyclingTime = document.getElementById('recyclingTime').value; + var recyclingUserDefault = true; + if(sstsConfig.hasOwnProperty('recyclingUserDefault') && !sstsConfig.recyclingUserDefault){ + recyclingUserDefault = false; + } + $.ajax({ + url : WWWROOT + "/disinfectSystem/recyclingRecordAction!saveRecyclingRecord.do", + type : "POST", + timeout : 300000, + dataType :'json', + data : { + jsonParam : "" + jsonStr + "", + id : id, + recyclingApplicationId : app_id, + departCode : departCode, + recyclingUser : recyclingUser, + operator : operator, + depart : depart, + recyclingTime : recyclingTime, + recyclingUserDefault : recyclingUserDefault + }, + success : function(result) { + if(result.success){ + alertDiv(result.message, true); + setTimeout("closeDiv()",1200); + + if(saveAndNew){ + location.href = "recycleForTouchScreen.jsp?resolution=" + resolution + "&rememberRecycleUser=" + rememberRecycleUser; + }else{ + location.href = "awaitForRecycleList.jsp?resolution=" + resolution; + } + }else{ + alertDiv(result.message); + } + }, + error: function(x, t, m) { + if(t == "timeout") { + alert("提交超时,请重试"); + } else { + alert(t); + } + } + }); +} + function doSaveAction(){ submitFunction(false,false); }