Index: ssts-web/src/main/webapp/disinfectsystem/touchScreen/recycle/recycleForTouchScreen.js =================================================================== diff -u -r28346 -r28390 --- ssts-web/src/main/webapp/disinfectsystem/touchScreen/recycle/recycleForTouchScreen.js (.../recycleForTouchScreen.js) (revision 28346) +++ ssts-web/src/main/webapp/disinfectsystem/touchScreen/recycle/recycleForTouchScreen.js (.../recycleForTouchScreen.js) (revision 28390) @@ -4,14 +4,13 @@ var departBindingBasketBarcodes = []; var materialsMapForSave = {}; var newAmount = 0; +var isDelete = false; /** * 不回收的器械包的集合。这个是由绑定带出来的器械包,并且不回收,在回收这里本来是不做处理的。现在要能修改原来的申请数量,相关的还有装配任务 */ var unrecycleTousseItemArray = new Array(); //添加或删除器械包 function addOrDelTousse(item){ - var basketBarcode = item.basketBarcode; - var basketId = item.basketId; var classifiedItemId = item.classifiedItemId; var tousseName = item.tousseName; var amount = item.amount; @@ -22,9 +21,23 @@ var basketGroupBarcodes = item.basketGroupBarcodes; var lastTousseInstanceId = item.lastTousseInstanceId; var tousseInstanceBarcode = item.tousseInstanceBarcode; + var washClassifyType = item.washClassifyType; var length = tousseArray.length; var sigle = true; var deleteIndex = []; + var basketId = ''; + var basketBarcode = ''; + if(washClassifyType !== ''){ + $("#basketsUl li").each(function(){ + var hideStr = $(this).find('input').val(); + var json = JSON.parse(hideStr); + if(json.washClassifyType == washClassifyType){ + basketId = json.classifyBasketId; + basketBarcode = json.barcode; + } + }); + } + for(var i = 0;i < length ; i++){ var t_basketBarcode = tousseArray[i].basketBarcode; var t_tousseName = tousseArray[i].tousseName; @@ -37,13 +50,14 @@ var t_lastTousseInstanceId = tousseArray[i].lastTousseInstanceId; var t_tousseInstanceBarcode = tousseArray[i].tousseInstanceBarcode; var t_itemType = tousseArray[i].itemType; - if(t_basketBarcode == basketBarcode && itemType == t_itemType && t_tousseName == tousseName && t_tousseDefinitionID == item.tousseDefinitionID && t_idCardBarcode == idCardBarcode && t_tousseInstanceBarcode == tousseInstanceBarcode){ + if(t_basketBarcode == item.basketBarcode && itemType == t_itemType && t_tousseName == tousseName && t_tousseDefinitionID == item.tousseDefinitionID && t_idCardBarcode == idCardBarcode && t_tousseInstanceBarcode == tousseInstanceBarcode){ if(itemType == '材料' && (tousseNameForMaterial != t_tousseNameForMaterial || basketGroupBarcodes != t_basketGroupBarcodes)){ continue; } tousseArray[i].amount = t_amount+amount; tousseArray[i].tousseAmountForMaterial = t_amountForMaterial + tousseAmountForMaterial; - tousseArray[i].basketSequence = item.basketSequence; + tousseArray[i].basketSequence = item.basketSequence; + tousseArray[i].washClassifyType = washClassifyType; if(tousseArray[i].amount === 0){ //如果数量为0,入筐后又移除了 deleteIndex.push(i); @@ -55,30 +69,32 @@ tousseArray.splice(deleteIndex[i],1); } if(sigle){ - if(basketBarcode && item.tousseDefinitionID && amount && tousseName && itemType){ + if(item.basketBarcode && item.tousseDefinitionID && amount && tousseName && itemType){ + basketBarcode = (basketBarcode == '')?item.basketBarcode:basketBarcode; + basketId = (basketId == '')?item.basketId:basketId; //需要保证基本信息是有效的 var newTousse = { - basketBarcode: basketBarcode, - basketId: basketId, - classifiedItemId: item.classifiedItemId || '', - tousseDefinitionID: item.tousseDefinitionID, - tousseInstanceBarcode:tousseInstanceBarcode, - tousseName: tousseName, - amount: amount, - tousseAmountForMaterial: tousseAmountForMaterial, - itemType: itemType, - tousseNameForMaterial: tousseNameForMaterial, - idCardBarcode: idCardBarcode, - basketGroupBarcodes: basketGroupBarcodes, - basketSequence: item.basketSequence, - lastTousseInstanceId:lastTousseInstanceId + basketBarcode: basketBarcode, + basketId: basketId, + classifiedItemId: item.classifiedItemId || '', + tousseDefinitionID: item.tousseDefinitionID, + tousseInstanceBarcode:tousseInstanceBarcode, + tousseName: tousseName, + amount: amount, + tousseAmountForMaterial: tousseAmountForMaterial, + itemType: itemType, + tousseNameForMaterial: tousseNameForMaterial, + idCardBarcode: idCardBarcode, + basketGroupBarcodes: basketGroupBarcodes, + basketSequence: item.basketSequence, + lastTousseInstanceId:lastTousseInstanceId, + washClassifyType:washClassifyType }; tousseArray.push(newTousse); } } } - var ab; var lock = false; //锁定键盘 @@ -483,7 +499,6 @@ } }, error:function(result){ - console.log(result) } }); }else { @@ -729,6 +744,7 @@ $("#basketsUl li").each(function(){ refreshBasketTotalNum($(this)); }); + isDelete = false; } /** * 入框时重新计算该篮筐的数量 @@ -775,7 +791,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); } } @@ -997,32 +1013,33 @@ var isExist = false; var lastTousseInstanceId = basketItem.lastTousseInstanceId; var tousseInstanceBarcode = basketItem.tousseInstanceBarcode; + var washClassifyType = basketItem.washClassifyType; var basketElement = $('dl[class="sed clearfix"]:eq(0)'); var basketHidenValue = $("#basketsUl li:first").find('input').val(); if(type == '材料'){ $("#basketsUl li").each(function(){ var hideStr = $(this).find('input').val(); var json = JSON.parse(hideStr); - if(json.barcode == basketBarcode){ + if(json.barcode == basketBarcode || basketGroupBarcodes.indexOf(json.barcode) >= 0){ basketElement = $(this).find("dl"); basketHidenValue = hideStr; + $(this).find('dl').children().each(function(){ if($(this).attr('type') == 'hidden'){ var hideStr = $(this).val(); - var json = JSON.parse(hideStr); - if(json.materialName == materialName && json.tousseDefinitionID == tousseDefinitionID && - json.idCardBarcode == idCardBarcode && json.basketGroupBarcodes == basketGroupBarcodes && json.tousseInstanceBarcode == tousseInstanceBarcode){ - isExist = true; - json.amount = (json.amount + amount); - json.tousseAmount = (json.tousseAmount + tousseAmount); - $(this).val(JSON.stringify(json)); - $(this).next().next().next().text(json.amount); + var jsonChild = JSON.parse(hideStr); + if(jsonChild.materialName == materialName && jsonChild.tousseDefinitionID == tousseDefinitionID && + jsonChild.idCardBarcode == idCardBarcode && jsonChild.basketGroupBarcodes == basketGroupBarcodes && (jsonChild.tousseInstanceBarcode || '') == tousseInstanceBarcode){ + isExist = true; + jsonChild.amount = (jsonChild.amount + amount); + jsonChild.tousseAmount = (jsonChild.tousseAmount + tousseAmount); + $(this).val(JSON.stringify(jsonChild)); + $(this).next().next().next().text(jsonChild.amount); return false; } } }); - return false; - } + } }); }else{ $("#basketsUl li").each(function(){ @@ -1072,9 +1089,21 @@ element += '
' + amount + '
'; element += '
删除
'; - var json = getBasketItemJSON(ci_id,type,orgUnitName,tousseName,materialName,amount,tousseAmount,idCardBarcode,tousseDefinitionID,basketGroupBarcodes,putBasketMaxAmount,tousseType,lastTousseInstanceId,tousseInstanceBarcode); - basketElement.prepend($(element)); - basketElement.find("input:first").val(json); + var json = getBasketItemJSON(ci_id,type,orgUnitName,tousseName,materialName,amount,tousseAmount,idCardBarcode,tousseDefinitionID,basketGroupBarcodes,putBasketMaxAmount,tousseType,lastTousseInstanceId,tousseInstanceBarcode,washClassifyType); + if(type == '材料'){ + $("#basketsUl li").each(function(){ + var hideStr = $(this).find('input').val(); + var jsonParent = JSON.parse(hideStr); + if(jsonParent.washClassifyType == washClassifyType){ + basketElement = $(this).find("dl"); + basketElement.prepend($(element)); + basketElement.find("input:first").val(json); + } + }); + }else { + basketElement.prepend($(element)); + basketElement.find("input:first").val(json); + } } var basketJson = JSON.parse(basketHidenValue); @@ -1088,21 +1117,22 @@ tousseNameForMaterial = tousseName; } var tousse = { - basketBarcode: basketBarcode, - basketId: basketId, - classifiedItemId: ci_id, - tousseName: goodsName, - amount: amount, - tousseAmountForMaterial: tousseAmount, - itemType: type, - tousseNameForMaterial: tousseNameForMaterial, - idCardBarcode: idCardBarcode, - tousseDefinitionID: tousseDefinitionID, - tousseInstanceBarcode:tousseInstanceBarcode, - basketGroupBarcodes: basketGroupBarcodes, - basketSequence:basketJson.sequence, - lastTousseInstanceId:lastTousseInstanceId - } + basketBarcode: basketBarcode, + basketId: basketId, + classifiedItemId: ci_id, + tousseName: goodsName, + amount: amount, + tousseAmountForMaterial: tousseAmount, + itemType: type, + tousseNameForMaterial: tousseNameForMaterial, + idCardBarcode: idCardBarcode, + tousseDefinitionID: tousseDefinitionID, + tousseInstanceBarcode:tousseInstanceBarcode, + basketGroupBarcodes: basketGroupBarcodes, + basketSequence:basketJson.sequence, + lastTousseInstanceId:lastTousseInstanceId, + washClassifyType:washClassifyType + } addOrDelTousse(tousse); } @@ -1173,7 +1203,7 @@ imageButton = ''; } - basketElement += '' + (sequence&&sequence>0?(sequence+'.' + basketName):basketName) + '      ' + imageButton +''; + basketElement += '' + (sequence&&sequence>0?(sequence+'.' + basketName):basketName) + '' + imageButton +''; basketElement += '' + 0 + ''; basketElement += '
'; basketElement += ''; @@ -1372,7 +1402,7 @@ var barcode = barcodeTemp; $.ajax({ type:'get', - url:encodeURI(WWWROOT + '/disinfectSystem/recyclingRecordAction!getBarcodeInfo.do?time='+new Date()+'&barcode='+barcode+''), + url:encodeURI(WWWROOT + '/disinfectSystem/recyclingRecordAction!getBarcodeInfo.do?time='+new Date().getTime()+'&barcode='+barcode+''), data:'recyclingRecordId=' + encodeURI($('#id').val()) + '&formType=' + encodeURI($('#appType').val()), dataType:'json', success:function(msg){ @@ -1563,7 +1593,7 @@ } } }else{ //扫描标识牌实例条码 - barcode = msg.idCardInstance.barcode; + barcode = msg.idCardInstance.barcode; if($('#depart').attr('value') == ''){ $('#depart').val(msg.tousseInstance.locationForDisplay) $('#departCode').val(msg.tousseInstance.location) @@ -1609,7 +1639,7 @@ var loadedAmount = tousseIntoBasketFunction("",td.id,td.name,1,td.isCleanedEntirely,orgUnitName,barcode,"",td.tousseType); - if(loadedAmount > 0){ + if(loadedAmount >= 0){ var tousseIsExist = false; $('#tousseItemTable').children().first().children().each(function(i,element){ if($('#tousseName'+i).val() == td.name && $('#deleted'+i).val() == '0'){ @@ -2344,7 +2374,7 @@ } function getBasketItemJSON(ci_id,type,orgUnitName,tousseName,materialName,amount,tousseAmount,idCardBarcode, - tousseDefinitionID,basketGroupBarcodes,putBasketMaxAmount,tousseType,lastTousseInstanceId,tousseInstanceBarcode){ + tousseDefinitionID,basketGroupBarcodes,putBasketMaxAmount,tousseType,lastTousseInstanceId,tousseInstanceBarcode,washClassifyType){ var json = {}; json.classifiedItemId = ci_id; json.type = type; @@ -2361,6 +2391,7 @@ json.basketGroupBarcodes = basketGroupBarcodes; json.lastTousseInstanceId = lastTousseInstanceId; json.tousseInstanceBarcode = tousseInstanceBarcode; + json.washClassifyType = washClassifyType || ''; return JSON.stringify(json); } @@ -2461,51 +2492,125 @@ RecyclingRecordTableManager.getTousseIntoBasketAmount(materials,tousseDefinitionID,recycleAmount,idCardBarcode,JSON.stringify(params),JSON.stringify(getTousseIntoBasketInfo()),recyclingApplicationId,function(result){ var jsonObj = JSON.parse(result); if(!jsonObj.success){ - alertDiv(jsonObj.message); + alertDiv(jsonObj.message); + return; }else{ var data = jsonObj.data; var packAmount = data.packAmount; var invoiceAmount = data.invoiceAmount; - var recycleAmountNew = parseInt($('#recycleAmount'+row).val()); - var loadedAmountNew = parseInt($('#loadedAmount'+row).val()); + var recycleAmountNew = parseInt($('#recycleAmount'+row).val() || 0); + var loadedAmountNew = parseInt($('#loadedAmount'+row).val() || 0); var maxCount = Math.max.call(null,packAmount,invoiceAmount); var putBasketMaxAmount = data.putBasketMaxAmount || 0; - + var basketsObj = JSON.parse($("#basketsUl li").eq(0).find('input').val()); if(!sstsConfig.allowDecreaseRecyclingAmountGreatUnPackingAmount){ if(recycleAmountNew < maxCount){ alertDiv(tousseName+"已装配"+packAmount+"个,已发货"+invoiceAmount+"个,修改后回收的数量为"+recycleAmountNew+",不能小于已装配或者已发货的数量!"); return 0; } + }else { + if(recycleAmountNew < maxCount){ + if(!isDelete){ + dialogConfirm(tousseName+"已装配"+packAmount+"个,已发货"+invoiceAmount+"个,修改后回收的数量为"+recycleAmountNew+",要修改会导致待装配任务被删除,您确认要修改吗?",function(){ + isDelete = true; + tousseIntoBasketFunction(tousseInstanceId,tousseDefinitionID,tousseName,recycleAmount,isCleanedEntirely,orgUnitName,idCardBarcode,tousseInstanceBarcode,tousseType,row); + refreshAllBasketTotalNum() + },function(){ + isDelete = false; + }); + return; + } + } } + if(recycleAmount < 0){ var loadedAmount = parseInt($('#loadedAmount'+row).val()); - var sum = 0; - var recycleCount1 = 0; - var len = 0; - $("#basketsUl li").each(function(){ - var basketsObj = JSON.parse($(this).find('input').val()); - if(isCleanedEntirely == '否'){ - $(this).find('dl').children().each(function(i,element){ + var loadedAmountSum = 0; + var tousseLenght = 0; + var amountSum = 0; + if(isCleanedEntirely == '否'){ + var tousseAmount = 0; + $('dl[class="sed clearfix"]').each(function(){ + var basketEle = $(this).prev().prev().prev().prev().prev().val(); + var basketJSON = JSON.parse(basketEle); + $(this).children().each(function(){ if($(this).attr('type') == 'hidden'){ - sum = parseInt(loadedAmount+recycleAmount); - var delButton = $(this).next().next().next().next().find('a'); - deleteMaterialItem(delButton,basketsObj.barcode,basketsObj.classifyBasketId); + var hideValue = $(this).val(); + if(!isUndefinedOrNullOrEmpty(hideValue)){ + var obj = JSON.parse(hideValue); + if(obj.tousseName == tousseName){ + var amount = obj.amount/obj.tousseAmount; + var delButton = $(this).next().next().next().next().find('a'); + obj.tousseAmount = obj.tousseAmount + recycleAmount; + obj.amount = obj.tousseAmount*amount; + tousseAmount = obj.tousseAmount; + $(this).val(JSON.stringify(obj)); + $(this).next().next().next().html(obj.amount); + var hideElement = $(delButton).parent().prev().prev().prev().prev(); + var item = JSON.parse(hideElement.val()); + var tousse = { + basketBarcode: basketJSON.barcode, + basketId: basketJSON.classifyBasketId, + classifiedItemId:'', + tousseName: item.materialName, + tousseDefinitionID: item.tousseDefinitionID, + amount: parseInt(recycleAmount*amount), + tousseAmountForMaterial: parseInt(recycleAmount), + itemType: item.type, + tousseNameForMaterial: item.tousseName, + idCardBarcode: item.idCardBarcode, + basketGroupBarcodes:item.basketGroupBarcodes, + lastTousseInstanceId:item.lastTousseInstanceId, + tousseInstanceBarcode:item.tousseInstanceBarcode + } + addOrDelTousse(tousse); + } + } } }); - 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){ - len ++; + }); + + loadedAmountSum = tousseAmount; + }else { + $("#basketsUl li").eq(0).find('dl').children().each(function(i,element){ + if($(this).attr('type') == 'hidden'){ + var hideStr = $(this).val(); + var json = JSON.parse(hideStr); + if(json.tousseName == tousseName){ + tousseLenght++; + loadedAmountSum = parseInt(loadedAmount+recycleAmount); + amountSum = amountSum + json.amount; + } + } + }) + + if(recycleAmount + amountSum < 0){ + alertDiv('【'+tousseName+'】减少的数量不能大于【'+basketsObj.basketName+'】现有的数量'+amountSum); + return; + } + + var recycleCount1 = 0; + $("#basketsUl li").eq(0).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){ + var count = parseInt($(this).next().next().next().text()); + var recycleCount = count+recycleAmount; + if(tousseLenght == 1){ + $(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); + } + }else { 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; @@ -2521,65 +2626,41 @@ } } } - }); - - 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){ + $("#basketsUl li").eq(0).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(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; + if(json.tousseName == tousseName){ + if(json.classifiedItemId !== ''){ + var count = parseInt($(this).next().next().next().text()); + var recycleCount = count+recycleCount1; + if(recycleCount > 0){ $(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); - } + deleteBasketItem(delButton,count); + return; + }else { + json.amount = 0-count; + $(this).val(JSON.stringify(json)); + deleteBasketItem(delButton,0); } } } - }); - } + } + }); } - }); + } + + $('#loadedAmount'+row).val(loadedAmountSum); - $('#loadedAmount'+row).val(sum); - - if(sum == 0){ + if(loadedAmountSum == 0){ $('#loadedAmount'+row).css('background','#fff'); }else { $('#loadedAmount'+row).css('background','rgb(183, 217, 165)'); @@ -2588,74 +2669,92 @@ refreshSplitBasketView(); return; }else if(recycleAmount > 0){ - if(recycleAmountNew > putBasketMaxAmount && loadedAmountNew == putBasketMaxAmount && putBasketMaxAmount !== 0){ - alertDiv("【"+tousseName+"】的清洗装载数量上限为"+putBasketMaxAmount+",本次入筐数量为"+recycleAmount+",当前篮筐容量不够,请用其它篮筐装载。"); - return 0; + var loadedAmount = data.amount; + if(row !== undefined){ + if(recycleAmountNew > putBasketMaxAmount && loadedAmountNew == putBasketMaxAmount && putBasketMaxAmount !== 0){ + alertDiv("【"+tousseName+"】的清洗装载数量上限为"+putBasketMaxAmount+",本次入筐数量为"+recycleAmount+",当前篮筐容量不够,请用其它篮筐装载。"); + return 0; + } + $('#loadedAmount'+row).val(recycleAmountNew); + if(recycleAmountNew > putBasketMaxAmount && loadedAmountNew < putBasketMaxAmount){ + $('#loadedAmount'+row).val(putBasketMaxAmount); + loadedAmount = putBasketMaxAmount-loadedAmountNew; + } + }else { + var key = -1; + $('#tousseItemTable').children().first().children().each(function(i,element){ + var showTousseName = $('#showTousseName'+i).val(); + if(showTousseName == tousseName){ + key = i; + } + }); + if(key >= 0){ + var recycleAmountKye = parseInt($('#recycleAmount'+key).val(),10); + var loadedAmountKey = parseInt($('#loadedAmount'+key).val(),10); + if(loadedAmountKey != 0){ + $('#recycleAmount'+key).val(recycleAmountKye+loadedAmount); + $('#loadedAmount'+key).val(loadedAmountKey+loadedAmount); + }else { + $('#loadedAmount'+key).val(loadedAmount); + } + } } - - loadedAmount = data.amount; - $('#loadedAmount'+row).val(recycleAmountNew); - - if(recycleAmountNew > putBasketMaxAmount && loadedAmountNew < putBasketMaxAmount){ - $('#loadedAmount'+row).val(putBasketMaxAmount); - loadedAmount = putBasketMaxAmount-loadedAmountNew; - } - }else { - return 0; } + if(isCleanedEntirely == "否"){ var materials = data.materials; if(materials == null){ alertDiv("异常数据,请联系管理员!"); return; - } + } for(var i = 0;i < materials.length;i++){ var item = materials[i]; var basketItem = { - ci_id: "", - type: '材料', - orgUnitName: orgUnitName, - tousseName: tousseName, - tousseDefinitionID: tousseDefinitionID, - lastTousseInstanceId:tousseInstanceId, //包实例id - tousseInstanceBarcode:tousseInstanceBarcode, - tousseType:tousseType, - materialName: item.materialName, - showName: item.materialName, - amount: item.materialAmount, - tousseAmount: loadedAmount, - basketBarcode: item.basketBarcode, - idCardBarcode: idCardBarcode, - basketGroupBarcodes:item.basketGroupBarcodes, - putBasketMaxAmount : item.putBasketMaxAmount - }; + ci_id: "", + type: '材料', + orgUnitName: orgUnitName, + tousseName: tousseName, + tousseDefinitionID: tousseDefinitionID, + lastTousseInstanceId:tousseInstanceId, //包实例id + tousseInstanceBarcode:tousseInstanceBarcode, + tousseType:tousseType, + materialName: item.materialName, + showName: item.materialName, + amount: item.materialAmount, + tousseAmount: loadedAmount, + basketBarcode: item.barcode, + idCardBarcode: idCardBarcode, + basketGroupBarcodes:item.basketGroupBarcodes, + putBasketMaxAmount : item.putBasketMaxAmount, + washClassifyType:item.washClassifyType + }; addBasketItemElement(basketItem); } }else{ var basketItem = { - ci_id: "", - type: '器械包', - orgUnitName: orgUnitName, - tousseName: tousseName, - tousseDefinitionID: tousseDefinitionID, - lastTousseInstanceId:tousseInstanceId, //包实例id, - tousseInstanceBarcode:tousseInstanceBarcode,//包实例条码,为了显示 - tousseType:tousseType, - materialName: "", - showName: tousseName, - amount: loadedAmount, - tousseAmount: loadedAmount, - basketBarcode: data.basketBarcode, - idCardBarcode: idCardBarcode, - basketGroupBarcodes: data.basketBarcode, - putBasketMaxAmount : data.putBasketMaxAmount - }; + ci_id: "", + type: '器械包', + orgUnitName: orgUnitName, + tousseName: tousseName, + tousseDefinitionID: tousseDefinitionID, + lastTousseInstanceId:tousseInstanceId, //包实例id, + tousseInstanceBarcode:tousseInstanceBarcode,//包实例条码,为了显示 + tousseType:tousseType, + materialName: "", + showName: tousseName, + amount: loadedAmount, + tousseAmount: loadedAmount, + basketBarcode: data.basketBarcode, + idCardBarcode: idCardBarcode, + basketGroupBarcodes: data.basketBarcode, + putBasketMaxAmount : data.putBasketMaxAmount + }; addBasketItemElement(basketItem); - refreshAllBasketTotalNum() - } - } - }); - DWREngine.setAsync(true); + } + refreshAllBasketTotalNum() + } + }); + DWREngine.setAsync(true); return loadedAmount; } @@ -2737,8 +2836,8 @@ if(amount == 0){ alertDiv('没有可以放入篮筐的器械包。'); }else{ - var loadedAmount = tousseIntoBasketFunction("",tousseDefinitionID,tousseName,amount,isCleanedEntirely,orgUnitName,"","",tousseType,row); - newAmount = 0; + var loadedAmount = tousseIntoBasketFunction("",tousseDefinitionID,tousseName,amount,isCleanedEntirely,orgUnitName,"","",tousseType,row); + newAmount = 0; if(loadedAmount > 0){ $('#loadedAmount'+row).val(parseInt(loadedAmount,10)+parseInt($('#loadedAmount'+row).val(),10)); //丢失报损器械 @@ -3061,7 +3160,7 @@ function setTousseRemark(row){ $.ajax({ type:'get', - url:encodeURI(WWWROOT + '/disinfectSystem/core/httpOptionAction!getHttpOptionsById.do?time='+new Date()), + url:encodeURI(WWWROOT + '/disinfectSystem/core/httpOptionAction!getHttpOptionsById.do?time='+new Date().getTime()), data:'optionId=recycleItem_remark', dataType:'json', success:function(result){ @@ -3618,6 +3717,7 @@ } } }); + //部分入筐提示 if(isPartIntheBasket){ if(sstsConfig.enablePartRecycle == true){ @@ -4547,7 +4647,7 @@ $("#operator").css("background","white"); } } -//选择科室 +//选择沟通人 function selectCommunicationUser(currentElementId){ //只有历史回收记录才能修改沟通确认人 // if('history' != params_recordType){ @@ -5502,20 +5602,22 @@ } } } - } + } + if(record.classifyBaskets != null){ for(var i = 0 ; i< record.classifyBaskets.length ; i++){ - var basket = record.classifyBaskets[i]; - - createBasketUiElement(basket.containerBarcode,basket.id,record.classifyBaskets[i].containerName,basket.washClassifyType,basket.sequence) + var basket = record.classifyBaskets[i]; + var washClassifyType = basket.washClassifyType; + + createBasketUiElement(basket.containerBarcode,basket.id,record.classifyBaskets[i].containerName,washClassifyType,basket.sequence) - for(var j = 0 ; j < record.classifyBaskets[i].classfiedItems.length ; j++){ - var ci = record.classifyBaskets[i].classfiedItems[j]; - var containerBarcode = record.classifyBaskets[i].containerBarcode; + for(var j = 0 ; j < basket.classfiedItems.length ; j++){ + var ci = record.classifyBaskets[i].classfiedItems[j]; + var containerBarcode = record.classifyBaskets[i].containerBarcode; if(record.id != ci.recyclingRecordId){ continue; - } - var tousseType = ci.tousseDefinition?ci.tousseDefinition.tousseType:''; + } + var tousseType = ci.tousseDefinition?ci.tousseDefinition.tousseType:''; if(ci.itemType == '材料'){ var materialName = ci.materialDefinition.name; var putBasketMaxAmount = ci.materialDefinition.intoBasketMaxAmount; @@ -5544,9 +5646,8 @@ element += '
删除
'; $('dl[class="sed clearfix"]:eq(0)').prepend(element); - var json = getBasketItemJSON(ci.id,'材料',ci.orgUnitName,tousseNameForMaterial,materialName,ci.amount,ci.tousseAmountForMaterial,ci.idCardBarcode,ci.tousseDefinitionID,ci.basketGroupBarcodes,putBasketMaxAmount,tousseType,ci.lastTousseInstanceId,ci.tousseInstanceBarcode); + var json = getBasketItemJSON(ci.id,'材料',ci.orgUnitName,tousseNameForMaterial,materialName,ci.amount,ci.tousseAmountForMaterial,ci.idCardBarcode,ci.tousseDefinitionID,ci.basketGroupBarcodes,putBasketMaxAmount,tousseType,ci.lastTousseInstanceId,ci.tousseInstanceBarcode,washClassifyType); $('dl[class="sed clearfix"]:eq(0)').find("input:first").val(json); - $('td[axis="materialName"]').each(function(){ if($(this).text() == materialName){ $(this).parent().remove(); @@ -5570,7 +5671,7 @@ element += '
删除
'; $('dl[class="sed clearfix"]:eq(0)').prepend(element); - var json = getBasketItemJSON(ci.id,"器械包",ci.orgUnitName,ci.tousseDefinition.name,"",ci.amount,ci.tousseAmountForMaterial,ci.idCardBarcode,ci.tousseDefinitionID,ci.basketGroupBarcodes,putBasketMaxAmount,tousseType,ci.lastTousseInstanceId,ci.tousseInstanceBarcode); + var json = getBasketItemJSON(ci.id,"器械包",ci.orgUnitName,ci.tousseDefinition.name,"",ci.amount,ci.tousseAmountForMaterial,ci.idCardBarcode,ci.tousseDefinitionID,ci.basketGroupBarcodes,putBasketMaxAmount,tousseType,ci.lastTousseInstanceId,ci.tousseInstanceBarcode,washClassifyType); $('dl[class="sed clearfix"]:eq(0)').find("input:first").val(json); } }