Index: ssts-web/src/main/webapp/disinfectsystem/touchScreen/recycle/recycleForTouchScreen.js =================================================================== diff -u -r25777 -r25778 --- ssts-web/src/main/webapp/disinfectsystem/touchScreen/recycle/recycleForTouchScreen.js (.../recycleForTouchScreen.js) (revision 25777) +++ ssts-web/src/main/webapp/disinfectsystem/touchScreen/recycle/recycleForTouchScreen.js (.../recycleForTouchScreen.js) (revision 25778) @@ -1,7 +1,7 @@ var tousseArray = new Array(); var deleteTousseItemArray = new Array(); -// 科室绑定的篮筐数量 -var departBindingBasketAmount = 0; +// 科室绑定的篮筐的条码数组 +var departBindingBasketBarcodes = []; /** * 不回收的器械包的集合。这个是由绑定带出来的器械包,并且不回收,在回收这里本来是不做处理的。现在要能修改原来的申请数量,相关的还有装配任务 */ @@ -1082,43 +1082,54 @@ function showSelectTousseDiscardCauseWin(){ return openModalWindow(WWWROOT+"/disinfectsystem/recyclingApplication/selectTousseDiscardCause.jsp?time="+new Date(), "选择回收员", "760", "400"); } -var arrayGood = [];//保存清洗完成或者清洗中状态篮筐条码信息 -function loadgin(msg,containerStatus,d){ - $("#dialogConfirm").dialog({ - resizable: false, - height:325, - width:600, - modal: true, - open: function() { - $("#confirmMsg").text("【"+msg.basket.containerName + "】当前状态为【" + containerStatus + "】,还有物品未装配,是否继续使用该篮筐?"); - }, - close: function() { - $("#confirmMsg").text(""); - }, - buttons: { - "是": function() { - addBasketElement(msg.basket); - $( this ).dialog( "close" ); - loaddialogConfirm(d+1); - arrayGood = []; +function loadDialogConfirm(msg){ + + $("#dialogConfirm").dialog({ + resizable: false, + height:325, + width:600, + modal: true, + open: function() { + $("#confirmMsg").text("【"+msg.basket.containerName + "】当前状态为【" + msg.basket.containerStatus + "】,还有物品未装配,是否继续使用该篮筐?"); }, - "否": function() { - $( this ).dialog( "close" ); - loaddialogConfirm(d+1); - arrayGood = []; + close: function() { + $("#confirmMsg").text(""); + }, + buttons: { + "是": function() { + addBasketElement(msg.basket); + $( this ).dialog( "close" ); + + loadNextBindingBasket(); + + }, + "否": function() { + $( this ).dialog( "close" ); + + loadNextBindingBasket(); + + } } - } - }); + }); } -function loaddialogConfirm(d){ - var loadginGoodLength = arrayGood.length; - if(d <= (loadginGoodLength-1)){ - var containerStatus = arrayGood[d].containerStatus; - loadgin(arrayGood[d].msg,containerStatus,d); - } +/** + * 加载下一个绑定的清洗篮筐。 + * 加载前,从绑定篮筐的数组中删除已经做了扫描处理的篮筐条码 + * + */ +function loadNextBindingBasket(){ + if (departBindingBasketBarcodes.length > 0){ + // 删除数组的第1个元素,即已经做了扫描处理的篮筐条码 + departBindingBasketBarcodes.splice(0, 1); + } + + if (departBindingBasketBarcodes.length > 0){ + loadBarcodeDevice(departBindingBasketBarcodes[0]); + } } + /** * 根据扫描的条码加载对应的对象. * @param barcodeTemp @@ -1189,13 +1200,13 @@ alertDiv("已有回收单不可更改科室"); } }else if(msg.basket != null){ - //不装配的篮筐不能回收扫描 + // 没有完成装配的篮筐要确认是否用于回收 var containerStatus = msg.basket.containerStatus; if(containerStatus == "清洗完成" || containerStatus == "清洗中"){ - arrayGood.push({msg:msg,containerStatus:containerStatus}); - loaddialogConfirm(0); + loadDialogConfirm(msg); }else{ addBasketElement(msg.basket); + loadNextBindingBasket(); } }else if(msg.tousseInstance != null){ if(!checkSelectDepartBeforeAddTousse()){ @@ -1383,7 +1394,6 @@ }else{ alertDiv('没有找到该条码所对应的信息。'); } - // loadgin(msg,containerStatus) $("#codeScan").val(""); barcodeGloble = ""; }, @@ -3733,10 +3743,15 @@ if(result != ''){ $('#scanContainerBarcodeTipUl').hide(); $("#basketsUl").empty(); - departBindingBasketAmount = result.length; + for (var i =0 ;i < result.length; i++){ - loadBarcodeDevice(result[i].barcode); + departBindingBasketBarcodes.push(result[i].barcode); } + + if (departBindingBasketBarcodes.length > 0){ + loadBarcodeDevice(departBindingBasketBarcodes[0]); + } + }else{ $("#basketsUl").empty(); $('#scanContainerBarcodeTipUl').show(); @@ -3792,7 +3807,6 @@ } }); } - arrayGood = []; if(isTousseItemTableEmpty()){ processFun(); }else{