Index: ssts-web/src/main/webapp/disinfectsystem/touchScreen/recycle/recycleForTouchScreen.js =================================================================== diff -u -r28339 -r28344 --- ssts-web/src/main/webapp/disinfectsystem/touchScreen/recycle/recycleForTouchScreen.js (.../recycleForTouchScreen.js) (revision 28339) +++ ssts-web/src/main/webapp/disinfectsystem/touchScreen/recycle/recycleForTouchScreen.js (.../recycleForTouchScreen.js) (revision 28344) @@ -665,23 +665,22 @@ var barcodeElement = $(deleteButton).parent().prev().prev(); var amountElement = $(deleteButton).parent().prev(); var delElement = $(deleteButton).parent(); - var item = JSON.parse(hideElement.val()); var tousse = { - basketBarcode: containerBarcode, - basketId: basketId, - classifiedItemId: '', - tousseName: item.materialName, - tousseDefinitionID: item.tousseDefinitionID, - amount: -parseInt(item.amount), - tousseAmountForMaterial: -parseInt(item.tousseAmount), - itemType: item.type, - tousseNameForMaterial: item.tousseName, - idCardBarcode: item.idCardBarcode, - basketGroupBarcodes:item.basketGroupBarcodes, - lastTousseInstanceId:item.lastTousseInstanceId, - tousseInstanceBarcode:item.tousseInstanceBarcode - } + basketBarcode: containerBarcode, + basketId: basketId, + classifiedItemId:'', + tousseName: item.materialName, + tousseDefinitionID: item.tousseDefinitionID, + amount: -parseInt(item.amount), + tousseAmountForMaterial: -parseInt(item.tousseAmount), + itemType: item.type, + tousseNameForMaterial: item.tousseName, + idCardBarcode: item.idCardBarcode, + basketGroupBarcodes:item.basketGroupBarcodes, + lastTousseInstanceId:item.lastTousseInstanceId, + tousseInstanceBarcode:item.tousseInstanceBarcode + } addOrDelTousse(tousse); refreshSequence(delElement.parent().parent(),0); @@ -776,7 +775,7 @@ obj.basketGroupBarcodes == basketGroupBarcodes && obj.idCardBarcode == idCardBarcode && obj.tousseInstanceBarcode == tousseInstanceBarcode){ - var delButton = $(this).next().next().next().next().find('a'); + var delButton = $(this).next().next().next().next().find('a'); deleteMaterialItem(delButton,basketJSON.barcode,basketJSON.classifyBasketId); } } @@ -802,7 +801,7 @@ classifiedItemId: item.classifiedItemId || '', tousseName: name, tousseDefinitionID: item.tousseDefinitionID, - amount: parseInt(amount), + amount: -Math.abs(parseInt(amount)), tousseAmountForMaterial: -parseInt(tousseAmountForMaterial), itemType: type, tousseNameForMaterial: tousseNameForMaterial, @@ -2471,7 +2470,7 @@ var loadedAmountNew = parseInt($('#loadedAmount'+row).val()); var maxCount = Math.max.call(null,packAmount,invoiceAmount); var putBasketMaxAmount = data.putBasketMaxAmount || 0; - + if(!sstsConfig.allowDecreaseRecyclingAmountGreatUnPackingAmount){ if(recycleAmountNew < maxCount){ alertDiv(tousseName+"已装配"+packAmount+"个,已发货"+invoiceAmount+"个,修改后回收的数量为"+recycleAmountNew+",不能小于已装配或者已发货的数量!"); @@ -2485,84 +2484,97 @@ var recycleCount1 = 0; var len = 0; $("#basketsUl li").each(function(){ - $(this).find('dl').children().each(function(i,element){ - if($(this).attr('type') == 'hidden'){ - var hideStr = $(this).val(); - var json = JSON.parse(hideStr); - var delButton = $(this).next().next().next().next().find('a'); - sum = parseInt(loadedAmount+recycleAmount); - - if(json.tousseName == tousseName){ - len ++; - if(json.classifiedItemId == ''){ - var count = parseInt($(this).next().next().next().text()); - var recycleCount = count+recycleAmount; - - if(recycleCount > 0){ - $(this).next().next().next().html(recycleCount); - json.amount = recycleCount; - $(this).val(JSON.stringify(json)); - deleteBasketItem(delButton,count); - return; - }else { - json.amount = 0-count; - $(this).val(JSON.stringify(json)); - deleteBasketItem(delButton,0); - recycleCount1 = recycleCount; - } - } + var basketsObj = JSON.parse($(this).find('input').val()); + if(isCleanedEntirely == '否'){ + $(this).find('dl').children().each(function(i,element){ + if($(this).attr('type') == 'hidden'){ + sum = parseInt(loadedAmount+recycleAmount); + var delButton = $(this).next().next().next().next().find('a'); + deleteMaterialItem(delButton,basketsObj.barcode,basketsObj.classifyBasketId); } - } - }); - if(len == 1){ + }); + putTousseInTheBasket(row,recycleAmountNew); + }else { $(this).find('dl').children().each(function(i,element){ if($(this).attr('type') == 'hidden'){ var hideStr = $(this).val(); var json = JSON.parse(hideStr); var delButton = $(this).next().next().next().next().find('a'); - + sum = parseInt(loadedAmount+recycleAmount); if(json.tousseName == tousseName){ - if(json.classifiedItemId !== ''){ + len ++; + if(json.classifiedItemId == ''){ var count = parseInt($(this).next().next().next().text()); var recycleCount = count+recycleAmount; - $(this).next().next().next().html(recycleCount); - json.amount = recycleCount; - $(this).val(JSON.stringify(json)); + if(recycleCount > 0){ + $(this).next().next().next().html(recycleCount); + json.amount = recycleCount; + $(this).val(JSON.stringify(json)); deleteBasketItem(delButton,count); return; }else { + json.amount = 0-count; + $(this).val(JSON.stringify(json)); deleteBasketItem(delButton,0); + recycleCount1 = recycleCount; } } } } }); - } - if(recycleCount1 < 0){ - $(this).find('dl').children().each(function(i,element){ - if($(this).attr('type') == 'hidden'){ - var hideStr = $(this).val(); - var json = JSON.parse(hideStr); - var delButton = $(this).next().next().next().next().find('a'); - var recycleAmount2 = (recycleCount1 == 0)?recycleAmount:recycleCount1; - if(json.tousseName == tousseName){ - if(json.classifiedItemId !== '') { - var count = parseInt($(this).next().next().next().text()); - var recycleCount = count+recycleAmount2; - $(this).next().next().next().html(recycleCount); - json.amount = recycleCount; - $(this).val(JSON.stringify(json)); - if(recycleCount >= 0){ - deleteBasketItem(delButton,count); - return; - }else { - deleteBasketItem(delButton,0); + + if(len == 1){ + $(this).find('dl').children().each(function(i,element){ + if($(this).attr('type') == 'hidden'){ + var hideStr = $(this).val(); + var json = JSON.parse(hideStr); + var delButton = $(this).next().next().next().next().find('a'); + + if(json.tousseName == tousseName){ + if(json.classifiedItemId !== ''){ + var count = parseInt($(this).next().next().next().text()); + var recycleCount = count+recycleAmount; + $(this).next().next().next().html(recycleCount); + json.amount = recycleCount; + $(this).val(JSON.stringify(json)); + if(recycleCount > 0){ + deleteBasketItem(delButton,count); + return; + }else { + deleteBasketItem(delButton,0); + } } } } - } - }); + }); + } + + if(recycleCount1 < 0){ + $(this).find('dl').children().each(function(i,element){ + if($(this).attr('type') == 'hidden'){ + var hideStr = $(this).val(); + var json = JSON.parse(hideStr); + var delButton = $(this).next().next().next().next().find('a'); + var recycleAmount2 = (recycleCount1 == 0)?recycleAmount:recycleCount1; + if(json.tousseName == tousseName){ + if(json.classifiedItemId !== '') { + var count = parseInt($(this).next().next().next().text()); + var recycleCount = count+recycleAmount2; + $(this).next().next().next().html(recycleCount); + json.amount = recycleCount; + $(this).val(JSON.stringify(json)); + if(recycleCount >= 0){ + deleteBasketItem(delButton,count); + return; + }else { + deleteBasketItem(delButton,0); + } + } + } + } + }); + } } }); @@ -2618,7 +2630,7 @@ idCardBarcode: idCardBarcode, basketGroupBarcodes:item.basketGroupBarcodes, putBasketMaxAmount : item.putBasketMaxAmount - }; + }; addBasketItemElement(basketItem); } }else{ @@ -2649,7 +2661,7 @@ } //将器械包放入篮筐中 -function putTousseInTheBasket(row){ +function putTousseInTheBasket(row,recycleAmountNew){ var inputSuccess = false; newAmount = 0; if($('#basketsUl').children().length > 0){ @@ -2665,7 +2677,7 @@ alertDiv("回收数量不能超过申请数量"); return false; } - var amount = recycleAmount - parseInt($('#loadedAmount'+row).val(),10); + var amount = recycleAmountNew || recycleAmount - parseInt($('#loadedAmount'+row).val(),10); newAmount = amount; //回收数量扣减入筐操作 如果已经入筐就不能入筐,只能是手动从篮筐里面删除,因为程序不晓得从哪个篮筐里面扣减 var msg = ""; @@ -2683,7 +2695,7 @@ return false; } - var isIDCard = $('#isThereIdentificationCard'+row).val(); + var isIDCard = $('#isThereIdentificationCard'+row).val(); if(isIDCard == '是'){ var showMsg = null; var recyclingErrorJsonArrayStr = $('#recyclingError'+row).val(); @@ -3600,7 +3612,7 @@ if(recyclingAmount > 0){ //有回收,那加入回收物品清单 recyclingTousses.push({tousseName:tousseName,recyclingAmount:recyclingAmount}); - } + } if(recyclingAmount > loadedAmount){ isPartIntheBasket = true; return false;