Index: ssts-web/src/main/webapp/disinfectsystem/sterilizationmanager/sterilizationrecord/sterilizationRecordForm.js =================================================================== diff -u -r29968 -r29979 --- ssts-web/src/main/webapp/disinfectsystem/sterilizationmanager/sterilizationrecord/sterilizationRecordForm.js (.../sterilizationRecordForm.js) (revision 29968) +++ ssts-web/src/main/webapp/disinfectsystem/sterilizationmanager/sterilizationrecord/sterilizationRecordForm.js (.../sterilizationRecordForm.js) (revision 29979) @@ -16,9 +16,9 @@ //右边今天审核的待灭菌物品的ColumnTree var pendingSterilizationColumnTree; //右边卸载物品统计列表 -var sterileUnLoadScanTousseColumnTree; -//上个灭菌程序名 -var oldSterilizationType = ""; +var sterileUnLoadScanTousseColumnTree +var nowScanAmount = 0; +var oldSterilizationType = "";//上个灭菌程序名 //是否需要扫描灭菌员 var scanUser = sstsConfig.hasOwnProperty('sterilizationScanUser') && sstsConfig.sterilizationScanUser; //是否将“已扫描数量”设置为大号字体 @@ -35,15 +35,12 @@ var listDisplayOfItemsToBeSterilized = sstsConfig.hasOwnProperty('listDisplayOfItemsToBeSterilized') ? sstsConfig.listDisplayOfItemsToBeSterilized : 1; //灭菌炉名称 var sterilizerNameTemp = ''; -//缓存灭菌列表固定条码的数量 -var leftFixedBarcodeMap = new newMap(); -//缓存待灭菌列表固定条码的数量 -var rightFixedBarcodeMap = new newMap(); -//缓存固定条码的扫描数量 +//全局包实例条码 +var myBarcodes = []; +var leftFixedBarcodeMap = new newMap();//灭菌列表 +var rightFixedBarcodeMap = new newMap();//待灭菌列表 var scanAmountMap = new newMap(); -//缓存固定条码的对象 var tousseInstanMap = new newMap(); -//缓存灭菌列表中已灭菌的固定条码的数量 var leftFixedBarcodeMapBySterilization = new newMap(); var SHELF = "灭菌架"; @@ -78,7 +75,11 @@ currentScanMode = sstsConfig.sterilePageScanMode; } -//灭菌程序 +var sterilizerJsonStore = new Ext.data.SimpleStore({ + fields: ['sterilizerName'], + url: WWWROOT + '/disinfectSystem/baseData/sterilizerAction!getAllSterilizer.do' +}); + var sterilizationTypeStore = new Ext.data.SimpleStore({ fields: ['id', 'sterilizationType'], url: WWWROOT + '/disinfectSystem/baseData/sterilizerAction!getSterilizerType.do', @@ -105,7 +106,7 @@ } }); -//远程方法请求后台查询灭菌目的 +//远程方法请求后台查询灭菌目录 var sterilizationPurposeJsonStore = new Ext.data.Store({ proxy: new Ext.data.HttpProxy({ url: WWWROOT + '/disinfectSystem/sterilization/sterilizationRecordAction!getSterilizationPurposeList.do', @@ -120,20 +121,45 @@ }) }); -//获取灭菌物品 +//合并数组并去重 +function mergeArray(arr){ + var map = {},dest = []; + for(var i = 0; i < arr.length; i++){ + var ai = arr[i]; + if(!map[ai.fixedBarcodes]){ + dest.push(ai); + map[ai.fixedBarcodes] = ai; + }else { + for(var j = 0; j < dest.length; j++){ + var dj = dest[j]; + if(dj.fixedBarcodes == ai.fixedBarcodes){ + var amount = parseInt(ai.amount); + dj.amount += amount; + if(dj.amount > 2000){ + dj.amount = 2000; + } + } + } + } + } + return dest; +} +/** + * 获取灭菌物品 + */ function getItemTreeData() { var rootNode = sterilizationColumnTree.getRootNode(); var pTousseStr = ""; var myBarcodes = []; - leftFixedBarcodeMap.forEach(function (item, i) { + leftFixedBarcodeMap.forEach(function(item,i){ var amount = item; - if (leftFixedBarcodeMapBySterilization.get(i)) { + if(leftFixedBarcodeMapBySterilization.get(i)){ amount = amount - leftFixedBarcodeMapBySterilization.get(i); } - if (amount !== 0) { + if(amount !== 0){ myBarcodes.push({ - fixedBarcodes: i, - amount: amount + fixedBarcodes:i, + amount:amount }) } }); @@ -142,15 +168,16 @@ var isFixed = false; var pTousseName = pNode.attributes.barcode; for (var i = 0; i < myBarcodes.length; i++) { - if (myBarcodes[i].fixedBarcodes == pTousseName) { + if(myBarcodes[i].fixedBarcodes == pTousseName){ + //pTousseStr += myBarcodes[i].fixedBarcodes+',,固定条码,,'+myBarcodes[i].amount; isFixed = true; break; } } - if (leftFixedBarcodeMapBySterilization.has(pTousseName)) { + if(leftFixedBarcodeMapBySterilization.has(pTousseName)){ isFixed = true; } - if (!isFixed) { + if(!isFixed){ if (!pNode.isLeaf()) {//父节点 pNode.eachChild(function (cNode) { var cAttr = cNode.attributes; @@ -173,12 +200,13 @@ } }); for (var i = 0; i < myBarcodes.length; i++) { - pTousseStr += "##" + myBarcodes[i].fixedBarcodes + ',,固定条码,,' + myBarcodes[i].amount; + pTousseStr += "##" + myBarcodes[i].fixedBarcodes+',,固定条码,,'+myBarcodes[i].amount; } return pTousseStr; } - -//获取位置信息 +/** + * 获取位置信息 + */ function getBarcodePositionData() { var rootNode = sterilizationColumnTree.getRootNode(); var pBarcodePositionStr = ""; @@ -195,8 +223,9 @@ }); return pBarcodePositionStr; } - -//获取最后的位置名称 +/** + * 获取最后的位置名称 + */ function getLastPosition() { var rootNode = sterilizationColumnTree.getRootNode(); var positionStr = ""; @@ -209,57 +238,38 @@ }); return positionStr; } - -//灭菌物品统计 var tousseItemCountRecord = new Ext.data.Record.create([{ name: 'tousseName' }, { name: 'count', type: 'int' }]); -//中断记录列表 -var InterruptRecordItem = Ext.data.Record.create([ - { name: 'id' }, - { name: 'interruptUser' }, - { name: 'interruptDate' }, - { name: 'interruptFinishDate' }, - { name: 'interruptOptType' }, - { name: 'quatifyMonitoryId' } -]); - -//监测结果store var monitorResutlStore = new Ext.data.SimpleStore({ fields: ['value'], data: [['无'], ['合格'], ['不合格']] }); /** * 创建节点的方法 - * @param {是否父节点(灭菌筐节点或者没有入灭菌筐的器械包节点为true)} isParentNode - * @param {条码(篮筐或器械包)} barcode - * @param {名称(篮筐或器械包)} name - * @param {器械包类型(注意区别于真正的类型)} typeForSterilizationStatistics - * @param {科室} depart - * @param {值为即“篮筐”或“器械包”} type - * @param {位置} position - * @param {数量} amount - * @param {审核时间} reviewTime - * @param {库存数量} stockAmount - * @param {灭菌方式} sterilingMode - * @param {固定条码扫描数量} scanAmount - * @param {是否追溯物品} isTraceable - * @param {是否加急} isUrgentTousse - * @param {加急级别} urgentLevel - * @param {是否植入物} includeImplant + * @param isParentNode 是否父节点(灭菌筐节点或者没有入灭菌筐的器械包节点为true) + * @param barcode 条码(篮筐或器械包) + * @param name 名称(篮筐或器械包) + * @param typeForSterilizationStatistics 器械包类型(注意区别于真正的类型) + * @param depart 科室 + * @param type 值为即“篮筐”或“器械包” + * @param position 位置 + * @param amount 数量(便于以后扫描固定条码支持修改数量的功能,目前值为均为1) + * @param reviewTime 审核时间 + * @param sterilingMode 灭菌方式 */ -function createNode(params) { +function createNode(isParentNode, barcode, name, typeForSterilizationStatistics, depart, type, position, amount, reviewTime, stockAmount, sterilingMode,scanAmount,isTraceable) { var node; - if (params.isParentNode == true) { + if (isParentNode == true) { //创建父节点(灭菌筐节点或者没有入灭菌筐的器械包节点) node = new top.Ext.tree.TreeNode({ id: Ext.id(), - iconCls: params.type == '篮筐' ? 'task-folder' : 'task', + iconCls: type == '篮筐' ? 'task-folder' : 'task', uiProvider: top.Ext.tree.ColumnNodeUI, leaf: false, expanded: true @@ -275,36 +285,101 @@ }); } - node.attributes.isParentNode = params.isParentNode; - node.attributes.barcode = params.barcode; - node.attributes.name = params.name; - node.attributes.typeForSterilizationStatistics = params.typeForSterilizationStatistics || ''; - node.attributes.depart = params.depart; - node.attributes.type = params.type; - node.attributes.position = params.position || ''; - node.attributes.amount = params.amount; - node.attributes.reviewTime = params.reviewTime; - node.attributes.sterilingMode = params.sterilingMode; - node.attributes.stockAmount = params.stockAmount || 0; - node.attributes.scanAmount = params.scanAmount || 0; - if (params.isTraceable !== null) { - node.attributes.isTraceable = params.isTraceable; + node.attributes.isParentNode = isParentNode; + node.attributes.barcode = barcode; + node.attributes.name = name; + node.attributes.typeForSterilizationStatistics = typeForSterilizationStatistics; + node.attributes.depart = depart; + node.attributes.type = type; + node.attributes.position = position; + node.attributes.amount = amount; + node.attributes.reviewTime = reviewTime; + node.attributes.sterilingMode = sterilingMode; + node.attributes.stockAmount = stockAmount; + node.attributes.scanAmount = scanAmount; + node.attributes.isTraceable = isTraceable; + return node; +} +//加急--创建节点 +function createNodeForUrgent(isParentNode, barcode, name, typeForSterilizationStatistics, depart, type, position, amount, reviewTime, stockAmount, sterilingMode, isUrgentTousse, urgentLevel, includeImplant) { + var node; + if (isParentNode == true) { + //创建父节点(灭菌筐节点或者没有入灭菌筐的器械包节点) + node = new top.Ext.tree.TreeNode({ + id: Ext.id(), + iconCls: type == '篮筐' ? 'task-folder' : 'task', + uiProvider: top.Ext.tree.ColumnNodeUI, + leaf: false, + expanded: true + }); + } else { + //创建子节点(进入灭菌筐器械包节点) + node = new top.Ext.tree.TreeNode({ + id: Ext.id(), + iconCls: 'task', + uiProvider: top.Ext.tree.ColumnNodeUI, + leaf: true, + expanded: true + }); } - if (params.isUrgentTousse && params.isUrgentTousse !== null) { - node.attributes.isUrgentTousse = params.isUrgentTousse; - } - if (params.urgentLevel && params.urgentLevel !== null) { - node.attributes.urgentLevel = params.urgentLevel; - } - if (params.includeImplant && params.includeImplant !== null) { - node.attributes.includeImplant = params.includeImplant; - } + + node.attributes.isParentNode = isParentNode; + node.attributes.barcode = barcode; + node.attributes.name = name; + node.attributes.typeForSterilizationStatistics = typeForSterilizationStatistics; + node.attributes.depart = depart; + node.attributes.type = type; + node.attributes.position = position; + node.attributes.amount = amount; + node.attributes.reviewTime = reviewTime; + node.attributes.sterilingMode = sterilingMode; + node.attributes.stockAmount = stockAmount; + node.attributes.isUrgentTousse = isUrgentTousse; + node.attributes.urgentLevel = urgentLevel; + node.attributes.includeImplant = includeImplant; return node; } -//统计篮筐和器械包数量,并且更新统计信息列表 +function createNodeForPendingStarilizationGoods(isParentNode, barcode, name, type, depart, reviewTime, amount, sterilingMode,isTraceable,scanAmount,typeForSterilizationStatistics) { + var node; + if (isParentNode == true) { + //创建父节点(灭菌筐节点或者没有入灭菌筐的器械包节点) + node = new top.Ext.tree.TreeNode({ + id: Ext.id(), + iconCls: type == '篮筐' ? 'task-folder' : 'task', + uiProvider: top.Ext.tree.ColumnNodeUI, + leaf: false, + expanded: true + }); + } else { + //创建子节点(进入灭菌筐器械包节点) + node = new top.Ext.tree.TreeNode({ + id: Ext.id(), + iconCls: 'task', + uiProvider: top.Ext.tree.ColumnNodeUI, + leaf: true, + expanded: true + }); + } + node.attributes.objBarcode = barcode; + node.attributes.objName = name; + node.attributes.type = type; + node.attributes.depart = depart; + node.attributes.reviewTime = reviewTime; + node.attributes.objAmount = amount; + node.attributes.sterilingMode = sterilingMode; + node.attributes.isTraceable = isTraceable; + node.attributes.scanAmount = scanAmount; + node.attributes.typeForSterilizationStatistics = typeForSterilizationStatistics; + return node +} + +/** + * 统计篮筐和器械包数量,并且更新统计信息列表 + */ function statisticsTousseAndBasket() { var rootNode = sterilizationColumnTree.getRootNode(); //灭菌物品columnTree的根节点 + var basketAmount = 0; //篮筐数量 var tousseNameOfAmount = {}; //器械包名称和数量 var statisticsAmount = { '篮筐': 0, '器械包': 0, '敷料包': 0, '外来器械包': 0, '代理灭菌包': 0, '灭菌物品总数量': 0, '植入物': 0 }; rootNode.eachChild(function (pNode) { @@ -344,9 +419,6 @@ /** * 合计器械包和灭菌筐个数 - * @param {当前节点} pNode - * @param {器械包名称和数量} tousseNameOfAmount - * @param {默认数量} statisticsAmount */ function sumTousseAndBasket(pNode, tousseNameOfAmount, statisticsAmount) { var tousseName = pNode.attributes.name; @@ -366,10 +438,9 @@ //给已扫描数量(大号字体)赋值 top.Ext.getCmp('nowScanAmountId').setValue(statisticsAmount['灭菌物品总数量']) } - /** * 扫描灭菌架条码 - * @param {条码} barcode + * @param barcode 架条码条码 */ function loadSterilizationShelf(barcode) { if (barcode != null && barcode.length > 0) { @@ -389,15 +460,7 @@ } } -/** - * 启用灭菌炉生物监测间隔时间提醒验证 - * @param {参数} params - * sterilizerName:灭菌炉的名称 - * isSave:是否保存的时候调用 - * biologicalMonitoring:生物监测包 - * button:触发方法的按钮 - * saveType:不同类型触发不同的事件 - */ +//启用灭菌炉生物监测间隔时间提醒验证 function sterilizerBioMonitoringIntervalReminder(params) { Ext.Ajax.request({ url: WWWROOT + '/disinfectSystem/sterilization/sterilizationRecordAction!sterilizerBioMonitoringIntervalReminder.do', @@ -426,8 +489,6 @@ /** * 扫描灭菌炉 - * @param {条码} barcode - * @param {灭菌ID} recordId */ function getSterilization(barcode, recordId) { if (barcode != null && barcode.length > 0) { @@ -487,8 +548,6 @@ /** * 扫描灭菌程序 - * @param {条码} barcode - * @param {灭菌炉的名称} sterilizerName */ function loadSterilizationType(barcode, sterilizerName) { DWREngine.setAsync(false); @@ -546,11 +605,9 @@ }); DWREngine.setAsync(true); } - /** * 扫描灭菌员条码 - * @param {灭菌条码} sterilizerName - * @param {灭菌程序} sterilizationType + * @param barcode 灭菌条码 */ function isHaveDoneNoticeSterilisation(sterilizerName, sterilizationType) { Ext.Ajax.request({ @@ -602,17 +659,14 @@ }, failure: function (response, options) { + // sterilizationColumnTree.getEl().unmask(); + var result = Ext.decode(response.responseText); top.Ext.getCmp('sterilizationType').setValue(oldSterilizationType); showResult("验证当天是否做过需要提示的灭菌程序失败"); } }); } - -/** - * 扫描用户 - * @param {用户条码} barcode - */ function loadSterilizationUser(barcode) { if (barcode != null && barcode.length > 0) { SterilizationRecordTableManager.getSterilizationUserByBarcode(barcode, function (response) { @@ -626,11 +680,7 @@ ); } } - -/** - * 根据条码获取位置名称 - * @param {条码} barcode - */ +//根据条码获取位置名称 function loadPositionByBarcode(barcode) { if (isUndefinedOrNullOrEmpty(barcode)) { showResult('条码不能为空!', null, sstsConfig.messagePauseTimeOnSterilizationRecordPage); @@ -667,11 +717,6 @@ } }); } - -/** - * 修改位置后重新更新节点 - * @param {节点} node - */ function cloneBasketOrTousse(node) { var barcode = node.attributes.barcode; var name = node.attributes.name; @@ -684,40 +729,10 @@ // 没入篮筐的器械包或者篮筐 if (node.attributes.isParentNode) { if (type == '器械包') { - var params = { - isParentNode: true, - barcode: barcode, - name: name, - typeForSterilizationStatistics: typeForSterilizationStatistics, - depart: depart, - type: type, - position: position, - amount: amount, - reviewTime: reviewTime, - stockAmount: 0, - sterilingMode: null, - scanAmount: 0, - isTraceable: null - } - var cloneNode = createNode(params); + var cloneNode = createNode(true, barcode, name, typeForSterilizationStatistics, depart, type, position, amount, reviewTime, 0, null); return cloneNode; } else { - var params = { - isParentNode: true, - barcode: barcode, - name: name, - typeForSterilizationStatistics: typeForSterilizationStatistics, - depart: depart, - type: type, - position: position, - amount: amount, - reviewTime: reviewTime, - stockAmount: 0, - sterilingMode: null, - scanAmount: 0, - isTraceable: null - } - var cloneNode = createNode(params); + var cloneNode = createNode(true, barcode, name, typeForSterilizationStatistics, depart, type, position, amount, reviewTime, 0, null); var childNodes = node.attributes.children; if (childNodes != null) { for (var i = 0; i < childNodes.length; i++) { @@ -728,22 +743,7 @@ var cAmount = childNodes[i].amount; var cType = childNodes[i].type; var cReviewTime = childNodes[i].reviewTime; - var params = { - isParentNode: false, - barcode: cBarcode, - name: cName, - typeForSterilizationStatistics: cTypeForSterilizationStatistics, - depart: cDepart, - type: cType, - position: '', - amount: cAmount, - reviewTime: cReviewTime, - stockAmount: 0, - sterilingMode: null, - scanAmount: 0, - isTraceable: null - } - cloneNode.appendChild(createNode(params)); + cloneNode.appendChild(createNode(false, cBarcode, cName, cTypeForSterilizationStatistics, cDepart, cType, '', cAmount, cReviewTime, 0, null)); } return cloneNode; } @@ -757,52 +757,21 @@ var cType = childNodes2[i].attributes.type; var cAmount = childNodes2[i].amount; var cReviewTime = childNodes2[i].reviewTime; - var params = { - isParentNode: false, - barcode: cBarcode, - name: cName, - typeForSterilizationStatistics: cTypeForSterilizationStatistics, - depart: cDepart, - type: cType, - position: '', - amount: cAmount, - reviewTime: cReviewTime, - stockAmount: 0, - sterilingMode: null, - scanAmount: 0, - isTraceable: null - } - cloneNode.appendChild(createNode(params)); + cloneNode.appendChild(createNode(false, cBarcode, cName, cTypeForSterilizationStatistics, cDepart, cType, '', cAmount, cReviewTime, 0, null)); } return cloneNode; } return cloneNode; } } else { //篮筐里面的器械包 - var params = { - isParentNode: false, - barcode: barcode, - name: name, - typeForSterilizationStatistics: typeForSterilizationStatistics, - depart: depart, - type: type, - position: '', - amount: amount, - reviewTime: reviewTime, - stockAmount: 0, - sterilingMode: null, - scanAmount: 0, - isTraceable: null - } - var cloneNode = createNode(params); + var cloneNode = createNode(false, barcode, name, typeForSterilizationStatistics, depart, type, '', amount, reviewTime, 0, null); return cloneNode; } } - /** * 判断灭菌程序是否能添加器械包(没选灭菌程序也不能灭菌) - * @param {灭菌程序的名称} sterilizationName + * @param sterilizationName */ function sterilizationCanAddTousse(sterilizationName) { if (isUndefinedOrNullOrEmpty(sterilizationName)) { @@ -821,11 +790,10 @@ } /** - * 固定条码的载入扫描 - * @param {固定条码} fixedBarcode - * @param {是否载入全部数量} isLoadAll + * 针对固定条码多次扫描,累加数量 + * @param fixedBarcode */ -function scanFixedBarcode(fixedBarcode, isLoadAll) { +function scanFixedBarcode(fixedBarcode,isLoadAll) { var rootNode = sterilizationColumnTree.getRootNode(); var leftFixedLenght = parseInt(getLeftFixedBarcodeAmount(fixedBarcode) || 0); var rightFixedLenght = parseInt(getRigthFixedBarcodeAmount(fixedBarcode) || 0); @@ -840,51 +808,51 @@ if (pNode.attributes.barcode == fixedBarcode && i < 1) { leftHasBarcode = true; i++; - if (rightFixedLenght > scanAmount && scanAmount !== 0) { - finalAmount = isLoadAll ? rightFixedLenght : scanAmount; - } else { - rightFixedLenght = rightFixedLenght > 0 ? rightFixedLenght : 0; + if(rightFixedLenght > scanAmount && scanAmount !== 0){ + finalAmount = isLoadAll?rightFixedLenght:scanAmount; + }else { + rightFixedLenght = rightFixedLenght>0?rightFixedLenght:0; finalAmount = rightFixedLenght; } - if (leftFixedLenght + finalAmount >= 2000) { - if (leftFixedLenght == 2000) { - showResult('已超过' + pNode.attributes.name + '的最大待灭菌物品总数2000!'); + if(leftFixedLenght+finalAmount >= 2000){ + if(leftFixedLenght == 2000){ + showResult('已超过'+pNode.attributes.name+'的最大待灭菌物品总数2000!'); isLast = true; return - } else if (leftFixedLenght > 2000) { + }else if(leftFixedLenght > 2000){ finalAmount = 2000 - pNode.attributes.amount; - showResult('已超过' + pNode.attributes.name + '的最大待灭菌物品总数2000!'); + showResult('已超过'+pNode.attributes.name+'的最大待灭菌物品总数2000!'); - leftFixedBarcodeMap.set(fixedBarcode, 2000); - rightFixedBarcodeMap.set(fixedBarcode, 0); + leftFixedBarcodeMap.set(fixedBarcode,2000); + rightFixedBarcodeMap.set(fixedBarcode,0); return - } else { - finalAmount -= (leftFixedLenght + finalAmount) - 2000; + }else { + finalAmount -= (leftFixedLenght+finalAmount)-2000; } } - if (rightFixedLenght == 0) { - showResult('已超过' + pNode.attributes.name + '的最大待灭菌物品总数' + leftFixedLenght + '!'); + if(rightFixedLenght == 0){ + showResult('已超过'+pNode.attributes.name+'的最大待灭菌物品总数'+leftFixedLenght+'!'); } - var newAmount = rightFixedLenght - finalAmount; - leftFixedLenght = leftFixedLenght + parseInt(finalAmount); - leftFixedBarcodeMap.set(fixedBarcode, leftFixedLenght); - rightFixedBarcodeMap.set(fixedBarcode, newAmount); + var newAmount = rightFixedLenght-finalAmount; + leftFixedLenght = leftFixedLenght+parseInt(finalAmount); + leftFixedBarcodeMap.set(fixedBarcode,leftFixedLenght); + rightFixedBarcodeMap.set(fixedBarcode,newAmount); } } }); - if (!leftHasBarcode) { + if(!leftHasBarcode){ var tousseInstan = tousseInstanMap.get(fixedBarcode); - if (tousseInstan) { + if(tousseInstan){ var scanAmount = parseInt(tousseInstan.scanAmount) || 0; var objAmount = parseInt(tousseInstan.objAmount) || 0; - if (!scanAmountMap.has(fixedBarcode)) { - scanAmountMap.set(fixedBarcode, scanAmount) + if(!scanAmountMap.has(fixedBarcode)){ + scanAmountMap.set(fixedBarcode,scanAmount) } var tousseName = tousseInstan.objName; //器械包名称 - var amount = (scanAmount > objAmount || scanAmount == 0) ? objAmount : scanAmount; //每次扫描数量 - amount = isLoadAll ? objAmount : amount; - leftFixedBarcodeMap.set(fixedBarcode, amount) - rightFixedBarcodeMap.set(fixedBarcode, objAmount - amount); + var amount = (scanAmount>objAmount || scanAmount == 0)?objAmount:scanAmount; //每次扫描数量 + amount = isLoadAll?objAmount:amount; + leftFixedBarcodeMap.set(fixedBarcode,amount) + rightFixedBarcodeMap.set(fixedBarcode,objAmount-amount); var sterilingTypeTemp = top.Ext.getCmp('sterilizationType').getValue(); var diffTousseNames = ""; var typeForSterilizationStatistics = tousseInstan.typeForSterilizationStatistics; //器械包类型(用于分类统计) @@ -900,22 +868,7 @@ //添加到灭菌物品视图列表的第一行 var rootNode = sterilizationColumnTree.getRootNode(); var position = top.Ext.getCmp('position').getValue(); - var params = { - isParentNode: true, - barcode: tousseBarcode, - name: tousseName, - typeForSterilizationStatistics: typeForSterilizationStatistics, - depart: '', - type: '器械包', - position: position, - amount: amount, - reviewTime: reviewTime, - stockAmount: 0, - sterilingMode: sterilingMode, - scanAmount: scanAmount, - isTraceable: isTraceable - } - var parentNode = createNode(params); + var parentNode = createNode(true, tousseBarcode, tousseName, typeForSterilizationStatistics, "", '器械包', position, amount, reviewTime, 0, sterilingMode,scanAmount,isTraceable); var firstChildNode = rootNode.item(0); if (firstChildNode == null || firstChildNode == undefined) {//第一行数据为空 rootNode.appendChild(parentNode); @@ -925,23 +878,25 @@ updateRigthFixedBarcodeAmount(tousseBarcode, amount)//修改右边节点的数量 var speakBasket = new SpeakBasket(); speakBasket.addGoods('', tousseName, 1); - + if (diffTousseNames != '') { showResultWithoutSpeak("器械包" + diffTousseNames + "的灭菌程序和所选的灭菌程序不同!", null, sstsConfig.messagePauseTimeOnSterilizationRecordPage); } } - } else { - if (!isLast) { + }else { + if(!isLast){ updateRigthFixedBarcodeAmount(fixedBarcode, finalAmount)//修改右边的数量 updateLeftFixedBarcodeAmount(fixedBarcode, finalAmount)//修改左边的数量 statisticsTousseAndBasket();//统计总数量 } } } + /** - * 根据节点获取灭菌列表固定条码的数量 - * @param {固定条码} fixedBarcode + * 根据固定条码,获取左边对应的数量 + * @param fixedBarcode + */ function getLeftFixedBarcodeAmount(fixedBarcode) { var rootNode = sterilizationColumnTree.getRootNode(); @@ -950,7 +905,7 @@ var returnAmount = 0; rootNode.eachChild(function (pNode) { if (pNode != null && pNode.attributes && pNode.attributes.barcode) { - if (pNode.attributes.barcode == fixedBarcode && i < 1) { + if (pNode.attributes.barcode == fixedBarcode && i < 1) {//找到左边对应的条码 i++ var amount = parseInt(pNode.attributes.amount) returnAmount = amount; @@ -961,12 +916,12 @@ } /** - * 根据节点获取已审核列表固定条码的数量 - * @param {固定条码} fixedBarcode + * 根据固定条码,获取右边的数量 + * @param fixedBarcode */ function getRigthFixedBarcodeAmount(fixedBarcode) { var i = 0; - var result = 0; + var result = -1; //循环右边的节点 pendingSterilizationColumnTree.getRootNode().eachChild(function (pNode) { //移除某一个节点后,再遍历其他节点得到的是undefined @@ -982,16 +937,16 @@ /** * 扫描器械包、灭菌篮筐、虚拟篮筐的条码(注意:如果config的配置是强制要扫描位置的,则需要先扫描位置) - * @param {条码} barcodeStr - * @param {灭菌记录id} sterilizationRecordId - * @param {*} tousseInstan + * @param barcodeStr 器械包、灭菌篮筐、虚拟篮筐(还有可能是器械包或者虚拟篮筐的条码段) + * @param sterilizationRecordId 灭菌记录id */ -function loadTousseInstanceCheckPosition(barcodeStr, sterilizationRecordId) { +function loadTousseInstanceCheckPosition(barcodeStr, sterilizationRecordId,tousseInstan) { if (sstsConfig.hasOwnProperty('stRecordScanPosition') && sstsConfig.stRecordScanPosition) { if ((sstsConfig.hasOwnProperty('haveSterilizerPosition')) && sstsConfig.haveSterilizerPosition) { var position = top.Ext.getCmp('position').getValue(); if (position == null || position == '') { showResult("请先扫描位置", null, sstsConfig.messagePauseTimeOnSterilizationRecordPage); + return; } } @@ -1006,16 +961,15 @@ } /** - * 更新已审核列表中的节点 - * @param {固定条码} fixedBarcode - * @param {每次扫描数量} scanAmount - * @param {更新类型:0减少;1增加} updateType + * 载入修改右边的数量 + * @param fixedBarcode 固定条码 + * @param scanAmount 每次扫描数量 */ -function updateRigthFixedBarcodeAmount(fixedBarcode, scanAmount, updateType) { +function updateRigthFixedBarcodeAmount(fixedBarcode, scanAmount,updateType) { var rootNode = pendingSterilizationColumnTree.getRootNode(); var i = 0; var isTrue = false; - //循环右边的节点 + //循环右边的节点 rootNode.eachChild(function (pNode) { if (pNode != null && pNode.attributes && pNode.attributes.objBarcode) { if (pNode.attributes.objBarcode == fixedBarcode && i < 1) { @@ -1030,38 +984,25 @@ var isTraceable = pNode.attributes.isTraceable || ''; var typeForSterilizationStatistics = pNode.attributes.typeForSterilizationStatistics || ''; var amount; - if (updateType == 0) { + if(updateType == 'reduce'){ amount = amountRight + parseInt(scanAmount); - } else { + }else { amount = amountRight - parseInt(scanAmount); } if (amount > 0) { - var params = { - isParentNode: true, - barcode: fixedBarcode, - name: name, - depart: depart, - type: type, - amount: amount, - reviewTime: reviewTime, - typeForSterilizationStatistics: typeForSterilizationStatistics, - sterilingMode: sterilingMode, - scanAmount: scanAmount, - isTraceable: isTraceable - } - var myNode = createNode(params) - setTimeout(function () { + var myNode = createNodeForPendingStarilizationGoods(true, fixedBarcode, name, type, depart, reviewTime, amount, sterilingMode,isTraceable,scanAmount,typeForSterilizationStatistics) + setTimeout(function(){ rootNode.replaceChild(myNode, pNode); }, 10); - } else { - setTimeout(function () { + }else { + setTimeout(function(){ pNode.remove(); }, 10); } } } }); - if (!isTrue && updateType == 0) { + if(!isTrue && updateType == 'reduce'){ var rootNode = sterilizationColumnTree.getRootNode(); var j = 0 //循环左边的节点 @@ -1074,33 +1015,15 @@ var sterilingMode = pNode.attributes.sterilingMode; var isTraceable = pNode.attributes.isTraceable; var typeForSterilizationStatistics = pNode.attributes.typeForSterilizationStatistics; - var params = { - isParentNode: true, - barcode: barcode, - name: name, - type: 'TOUSSE', - depart: '', - reviewTime: '', - amount: scanAmount, - sterilingMode: sterilingMode, - isTraceable: isTraceable, - scanAmount: scanAmount, - typeForSterilizationStatistics: typeForSterilizationStatistics - } - var myNode = createNode(params) + var myNode = createNodeForPendingStarilizationGoods(true, barcode, name, "TOUSSE", "", "", scanAmount, sterilingMode,isTraceable,scanAmount,typeForSterilizationStatistics) pendingSterilizationColumnTree.getRootNode().appendChild(myNode); - rightFixedBarcodeMap.set(fixedBarcode, scanAmount) + rightFixedBarcodeMap.set(fixedBarcode,scanAmount) } } }); } } -/** - * 更新灭菌列表的节点 - * @param {固定条码} fixedBarcode - * @param {扫描数量} scanAmount - */ function updateLeftFixedBarcodeAmount(fixedBarcode, scanAmount) { var rootNode = sterilizationColumnTree.getRootNode(); var i = 0; @@ -1118,22 +1041,7 @@ var name = pNode.attributes.name; var sterilingMode = pNode.attributes.sterilingMode || ''; var isTraceable = pNode.attributes.isTraceable; - var params = { - isParentNode: true, - barcode: barcode, - name: name, - typeForSterilizationStatistics: typeForSterilizationStatistics, - depart: department, - type: '器械包', - position: position, - amount: amount, - reviewTime: reviewTime, - stockAmount: 0, - sterilingMode: sterilingMode, - scanAmount: scanAmount, - isTraceable: isTraceable - } - var parentNode = createNode(params); + var parentNode = createNode(true, barcode, name, typeForSterilizationStatistics, department, '器械包', position, amount, reviewTime, 0, sterilingMode,scanAmount,isTraceable); pNode.remove();//删除修改后的节点数据 rootNode.appendChild(parentNode);//追加修改前的数据 } @@ -1142,6 +1050,64 @@ } /** + * 针对固定条码修改数量后,动态去修改右边对应节点的数量 + * @param fixedBarcode 固定条码 + * @param editAmount 修改的数量 + * @param type 1:增加,2:减少 + */ +function editAmountComplete(fixedBarcode, editCompleteAmount, editType) { + editCompleteAmount = parseInt(editCompleteAmount) + var i = 0; + var rigthAmount = getRigthFixedBarcodeAmount(fixedBarcode)//获取右边的数量 + pendingSterilizationColumnTree.getRootNode().eachChild(function (pNode) { + if (pNode != null && pNode.attributes && pNode.attributes.objBarcode) { + if (pNode.attributes.objBarcode == fixedBarcode) { + i++ + var name = pNode.attributes.objName; + var type = pNode.attributes.type; + var depart = pNode.attributes.depart; + var reviewTime = pNode.attributes.reviewTime; + var amountRight = parseInt(pNode.attributes.objAmount);//右边的数量 + var rootNode = sterilizationColumnTree.getRootNode(); + var sterilingMode = pNode.attributes.sterilingMode; + pNode.remove();//移除对应右边的节点 + var resultAmount = 0; + if (editType == 1) {//如果是增加了数量,则对应右边要减少 + resultAmount = amountRight - editCompleteAmount + } else if (editType == 2) {//如果是减少了数量,则对应右边要增加 + resultAmount = amountRight + editCompleteAmount + } + } + } + }); + if (i == 0 && editType == 2) {//没有在右边匹配到对应的条码 + var rootNode = sterilizationColumnTree.getRootNode(); + var j = 0 + //循环左边的节点 + rootNode.eachChild(function (pNode) { + if (pNode != null && pNode.attributes && pNode.attributes.barcode) { + if (pNode.attributes.barcode == fixedBarcode && j < 1) {//找到左边对应的条码 + i++ + var isParentNode = pNode.attributes.isParentNode; + var type = pNode.attributes.type; + var department = pNode.attributes.depart; + var position = pNode.attributes.position; + var amount = parseInt(pNode.attributes.amount) + var reviewTime = pNode.attributes.reviewTime; + var stockAmount = pNode.attributes.stockAmount; + var barcode = pNode.attributes.barcode; + var name = pNode.attributes.name; + var sterilingMode = pNode.attributes.sterilingMode; + var rootNode = sterilizationColumnTree.getRootNode(); + var myNode = createNodeForPendingStarilizationGoods(true, barcode, name, "TOUSSE", "", "", editCompleteAmount, sterilingMode) + pendingSterilizationColumnTree.getRootNode().appendChild(myNode); + } + } + }); + } +} + +/** * 获取灭菌物品列表里的包的灭菌方式 * 如果列表的包数量为0,则返回[],否则返回相应的灭菌方式,有多少种都加入到数组中返回 * 忽略所有不追溯的包,不遍历不追溯的包的灭菌方式 @@ -1154,6 +1120,7 @@ var sterilingModeObject = {}; //根节点 var rootNode = sterilizationColumnTree.getRootNode(); + var alreadyPushAmount = 0; rootNode.eachChild(function (pNode) { var pType = pNode.attributes.type; if (pType == '篮筐') { @@ -1195,15 +1162,15 @@ /** * 加载条码对应的器械包 - * @param {条码} barcodeStr (器械包、灭菌篮筐、虚拟篮筐) - * @param {灭菌记录id} sterilizationRecordId + * @param barcodeStr 器械包、灭菌篮筐、虚拟篮筐(还有可能是器械包或者虚拟篮筐的条码段) + * @param sterilizationRecordId 灭菌记录id */ -function loadTousseInstance(barcodeStr, sterilizationRecordId) { +function loadTousseInstance(barcodeStr, sterilizationRecordId, isFiexdBarcode) { if (barcodeStr == '' || barcodeStr.length <= 0) { showResult("请输入条码!", null, sstsConfig.messagePauseTimeOnSterilizationRecordPage); return; } - if (checkRepeat(barcodeStr)) {//已有,并且不是固定条码 + if (checkRepeat(barcodeStr) && !isFiexdBarcode) {//已有,并且不是固定条码 showResult("输入的条码已存在!", null, sstsConfig.messagePauseTimeOnSterilizationRecordPage); return; } @@ -1215,6 +1182,10 @@ } var position = top.Ext.getCmp('position').getValue(); sterilizationRecordWin.getEl().mask("正在加载中.请稍等...", "x-mask-loading"); + if(isFiexdBarcode){ + loadAllTousseInstanceInfoByFixedBarcode(barcodeStr, sterilizationRecordId,isFiexdBarcode); + return + } Ext.Ajax.request({ url: WWWROOT + '/disinfectSystem/sterilization/sterilizationRecordAction!loadTousseInstanceInfo.do', params: { @@ -1223,7 +1194,8 @@ loadTousseNamesInBasket: true, //是否要加载篮筐里的器械包名称 sterilizationRecordId: sterilizationRecordId, //灭菌记录id checkProxyDisinfection: 'yes', //是否需要检查代理灭菌是否已录入代理灭菌单 - saveBarcode: getAlreadyScanBarcodes() //此次扫描之前已经扫描的条码集合,通过节点获取 + saveBarcode: getAlreadyScanBarcodes(), //此次扫描之前已经扫描的条码集合,通过节点获取 + myBarcodes: JSON.stringify(myBarcodes) //此次扫描之前已经扫描的条码集合,通过数组获取 }, success: function (response, options) { var result = response.responseText; @@ -1289,23 +1261,7 @@ //添加到灭菌物品视图列表的第一行 var rootNode = sterilizationColumnTree.getRootNode(); - var params = { - isParentNode: true, - barcode: barcodeStr, - name: tousseName, - typeForSterilizationStatistics: typeForSterilizationStatistics, - depart: department, - type: '器械包', - position: position, - amount: 1, - reviewTime: reviewTime, - stockAmount: 0, - sterilingMode: sterilingMode, - isUrgentTousse: isUrgentTousse, - urgentLevel: urgentLevel, - includeImplant: newIncludeImplant - } - var parentNode = createNode(params); + var parentNode = createNodeForUrgent(true, barcodeStr, tousseName, typeForSterilizationStatistics, department, '器械包', position, 1, reviewTime, 0, sterilingMode, isUrgentTousse, urgentLevel, newIncludeImplant); var firstChildNode = rootNode.item(0); if (firstChildNode == null || firstChildNode == undefined) { rootNode.appendChild(parentNode); @@ -1389,23 +1345,8 @@ } else { newIncludeImplant = includeImplant; } - var params = { - isParentNode: true, - barcode: barcodeStr, - name: containerName, - typeForSterilizationStatistics: '', - depart: '', - type: '篮筐', - position: position, - amount: amount == 0 ? 1 : amount, - reviewTime: '', - stockAmount: 0, - sterilingMode: '', - isUrgentTousse: isUrgentTousse, - urgentLevel: urgentLevel, - includeImplant: newIncludeImplant - } - var parentNode = createNode(params); + + var parentNode = createNodeForUrgent(true, barcodeStr, containerName, '', '', '篮筐', position, amount == 0 ? 1 : amount, '', 0, '', isUrgentTousse, urgentLevel, newIncludeImplant); var firstChildNode = rootNode.item(0); if (firstChildNode == null || firstChildNode == undefined) { rootNode.appendChild(parentNode); @@ -1439,23 +1380,8 @@ if (sterilingTypeTemp != sterilingType) { showResultWithoutSpeak("灭菌筐[" + containerName + "]里面的器械包[" + tousseName + "]的灭菌程序和所选的灭菌程序不同!", null, sstsConfig.messagePauseTimeOnSterilizationRecordPage); } - var params = { - isParentNode: false, - barcode: tousseBarcode, - name: tousseName, - typeForSterilizationStatistics: typeForSterilizationStatistics, - depart: department, - type: '器械包', - position: '', - amount: amount, - reviewTime: reviewTime, - stockAmount: 0, - sterilingMode: sterilingMode, - isUrgentTousse: isUrgentTousse, - urgentLevel: urgentLevel, - includeImplant: newIncludeImplant - } - var childNode = createNode(params); + + var childNode = createNodeForUrgent(false, tousseBarcode, tousseName, typeForSterilizationStatistics, department, '器械包', '', amount, reviewTime, 0, sterilingMode, isUrgentTousse, urgentLevel, newIncludeImplant); parentNode.appendChild(childNode); speakBasket.addGoods(containerName, tousseName, 1); } @@ -1468,6 +1394,9 @@ }); removePendingSterilizationGoods(barcodeStr) sterilizationRecordWin.getEl().unmask(); + } else if (success == 2) { //不追溯器械包(不追溯的包暂不校验灭菌方式是否不一致) + sterilizationRecordWin.getEl().mask("正在加载中.请稍等...", "x-mask-loading"); + loadAllTousseInstanceInfoByFixedBarcode(barcodeStr, sterilizationRecordId); } else if (success == 3) { //首尾器械包,since2015-10-27 var tousseInstanceArr = resultData.tousseInstanceArr; var length = tousseInstanceArr.length; @@ -1530,22 +1459,7 @@ }); if (!exists) { //此包没有扫描过并且没有入审核篮筐 //添加到灭菌物品视图列表的第一行 - var params = { - isParentNode: true, - barcode: tousseBarcode, - name: tousseName, - typeForSterilizationStatistics: typeForSterilizationStatistics, - depart: department, - type: '器械包', - position: position, - amount: 1, - reviewTime: reviewTime, - stockAmount: 0, - sterilingMode: sterilingMode, - scanAmount: 0, - isTraceable: null - } - var parentNode = createNode(params); + var parentNode = createNode(true, tousseBarcode, tousseName, typeForSterilizationStatistics, department, '器械包', position, 1, reviewTime, sterilingMode); var firstChildNode = rootNode.item(0); if (firstChildNode == null || firstChildNode == undefined) { rootNode.appendChild(parentNode); @@ -1624,44 +1538,15 @@ if (!exists) { //添加到灭菌物品视图列表的第一行 - var params = { - isParentNode: true, - barcode: virtualBasketSeqNum, - name: '虚拟篮筐', - typeForSterilizationStatistics: '', - depart: '', - type: '篮筐', - position: position, - amount: 1, - reviewTime: '', - stockAmount: 0, - sterilingMode: null, - scanAmount: 0, - isTraceable: null - } - currentParentNode = createNode(params); + currentParentNode = createNode(true, virtualBasketSeqNum, "虚拟篮筐", '', '', '篮筐', position, 1, ''); var firstChildNode = rootNode.item(0); if (firstChildNode == null || firstChildNode == undefined) { rootNode.appendChild(currentParentNode); } else { rootNode.insertBefore(currentParentNode, firstChildNode); } - var params1 = { - isParentNode: false, - barcode: tousseBarcode, - name: tousseName, - typeForSterilizationStatistics: typeForSterilizationStatistics, - depart: department, - type: '器械包', - position: '', - amount: 1, - reviewTime: reviewTime, - stockAmount: 0, - sterilingMode: sterilingMode, - scanAmount: 0, - isTraceable: null - } - var childNode = createNode(params1); + + var childNode = createNode(false, tousseBarcode, tousseName, typeForSterilizationStatistics, department, '器械包', '', 1, reviewTime, sterilingMode); currentParentNode.appendChild(childNode); speakBasket.addGoods('', tousseName, 1); alreadyAdd++; @@ -1677,22 +1562,7 @@ }); } if (!existsCNode) { - var params2 = { - isParentNode: false, - barcode: tousseBarcode, - name: tousseName, - typeForSterilizationStatistics: typeForSterilizationStatistics, - depart: department, - type: '器械包', - position: '', - amount: 1, - reviewTime: reviewTime, - stockAmount: 0, - sterilingMode: null, - scanAmount: 0, - isTraceable: null - } - var childNode = createNode(params2); + var childNode = createNode(false, tousseBarcode, tousseName, typeForSterilizationStatistics, department, '器械包', '', 1, reviewTime); currentParentNode.appendChild(childNode); speakBasket.addGoods('', tousseName, 1); alreadyAdd++; @@ -1735,8 +1605,10 @@ } /** - * 一键入炉(不包含固定条码) - * @param {条码数组} datas + * 点击一键入炉按钮,请求后台后的处理(把物品加载到灭菌物品列表) + * 器械包节点 = {type:"器械包",barcode:"器械包条码",name:"器械包名称",typeForSterilizationStatistics:"器械包类型(注意区别于真正的类型)",sterilingType:"灭菌程序",depart:"科室",reviewTime:"审核时间"} + * 篮筐节点 = {type:"篮筐",barcode:"篮筐条码",name:"篮筐名称",dataList:[{barcode:"器械包条码",name:"器械包名称",typeForSterilizationStatistics:"器械包类型(注意区别于真正的类型)",sterilingType:"灭菌程序",depart:"科室",reviewTime:"审核时间"}...]} + * datas格式:[器械包节点/篮筐节点,...] */ function loadContainerAndTousseToGrid(datas) { var position = top.Ext.getCmp('position').getValue(); @@ -1755,22 +1627,7 @@ var newObj = {}; if ('器械包' == data.type) { if (newBarcodeArray.indexOf(data.barcode) == -1) { - var params = { - isParentNode: true, - barcode: data.barcode, - name: data.name, - typeForSterilizationStatistics: data.typeForSterilizationStatistics, - depart: data.depart, - type: '器械包', - position: position, - amount: data.amount, - reviewTime: data.reviewTime, - stockAmount: 0, - sterilingMode: data.sterilingMode, - scanAmount: 0, - isTraceable: null - } - parentNode = createNode(params); + parentNode = createNode(true, data.barcode, data.name, data.typeForSterilizationStatistics, data.depart, '器械包', position, data.amount, data.reviewTime, 0, data.sterilingMode); } else { exit = true; newObj = data; @@ -1783,41 +1640,11 @@ for (var j = 0; j < length; j++) { amount = amount + parseInt(tousseInstanceArr[j].amount); } - var params = { - isParentNode: true, - barcode: data.barcode, - name: data.name, - typeForSterilizationStatistics: '', - depart: data.depart, - type: '篮筐', - position: position, - amount: data.amount, - reviewTime: '', - stockAmount: 0, - sterilingMode: null, - scanAmount: 0, - isTraceable: null - } - parentNode = createNode(params); + parentNode = createNode(true, data.barcode, data.name, '', data.depart, '篮筐', position, amount, '', 0, null); if (tousseInstanceArr && tousseInstanceArr.length > 0) { for (var k = 0; k < tousseInstanceArr.length; k++) { var ti = tousseInstanceArr[k]; - var params1 = { - isParentNode: false, - barcode: ti.barcode, - name: ti.name, - typeForSterilizationStatistics: ti.typeForSterilizationStatistics, - depart: ti.depart, - type: '器械包', - position: position, - amount: ti.amount, - reviewTime: ti.reviewTime, - stockAmount: 0, - sterilingMode: data.sterilingMode, - scanAmount: 0, - isTraceable: null - } - var childNode = createNode(params1); + var childNode = createNode(false, ti.barcode, ti.name, ti.typeForSterilizationStatistics, ti.depart, '器械包', position, ti.amount, ti.reviewTime, 0, data.sterilingMode); parentNode.appendChild(childNode); } } @@ -1834,25 +1661,10 @@ rootNode.eachChild(function (pNode) { if (pNode.attributes.barcode == newObj.barcode) { var amount = parseInt(pNode.attributes.amount) + parseInt(newObj.amount); - if (amount > 2000) { + if(amount > 2000){ amount = 2000; } - var params1 = { - isParentNode: true, - barcode: newObj.barcode, - name: newObj.name, - typeForSterilizationStatistics: newObj.typeForSterilizationStatistics, - depart: newObj.depart, - type: '器械包', - position: position, - amount: amount, - reviewTime: newObj.reviewTime, - stockAmount: 0, - sterilingMode: newObj.sterilingMode, - scanAmount: 0, - isTraceable: null - } - var newNode = createNode(params1); + var newNode = createNode(true, newObj.barcode, newObj.name, newObj.typeForSterilizationStatistics, newObj.depart, '器械包', position, amount, newObj.reviewTime, 0, newObj.sterilingMode); rootNode.replaceChild(newNode, pNode); return true; } @@ -1864,8 +1676,9 @@ } /** - * 判断条码是否存在 - * @param {条码} barcodeStr + * 条码重复性判断,如果是单个条码,则按原有逻辑处理,否则为不重复,需要在结果中判断 + * @param barcodeStr 可以是单个器械包/篮筐条码,也可以是首尾器械包/篮筐条码,用分号分隔 + * @returns {Boolean} */ function checkRepeat(barcodeStr) { var barcodeArray = barcodeStr.split(";"); @@ -1884,12 +1697,10 @@ return isExistTousse; } -//点击删除图标 function setIsClickDel(v) { isClickDel = (v == 1 ? true : false); } -//删除灭菌条码 function deleteGiveBackColumnTreeItem(clickNode) { addPendingStarilizationGoodsFromRecord(clickNode); var desMsg = "删除灭菌条码:" + clickNode.attributes.barcode + " ,名称:" + clickNode.attributes.name; @@ -1900,10 +1711,10 @@ } /** - * 点击载入按钮 - * @param {条码} barcode - * @param {类型} type - * @param {名称} name + * 待灭菌物品点击按钮添加至灭菌物品栏 + * @param barcode + * @param type + * @param name */ function addPendingSterilizationGoodsToRecord(barcode, type, name) { var desMsg = "载入条码:" + barcode + " ,名称:" + name; @@ -1918,8 +1729,8 @@ /** * 写日志 - * @param {操作类型} type - * @param {日志描述} description + * @param type + * @param description */ function buildSterilizationLogInfo(type, description) { Ext.Ajax.request({ @@ -1932,7 +1743,7 @@ /** * 移除右边表格的数据(今天待审核的数据列表),barcode可能为单个器械包条码,也可能为首尾两个条码中间用分号隔开(最好别用首尾条码) - * @param {条码} barcode + * @param barcode */ function removePendingSterilizationGoods(barcode) { pendingSterilizationColumnTree.getRootNode().eachChild(function (pNode) { @@ -1957,9 +1768,91 @@ }); } +function removePendingSterilizationGoods2(barcode) { + var barcodeArray = barcode.split(";"); + var child = pendingSterilizationColumnTree.getRootNode().childNodes; + var removeAllArr = []; + for (var i = 0; i < child.length; i++) { + for (var j = 0; j < barcodeArray.length; j++) { + if (child[i].attributes.objBarcode == barcodeArray[j]) { + removeAllArr.push(child[i]);//统一放进去一起删除,防止删除了节点以后,循环的时候会报错 + continue; + } + } + } + + for (var k = 0; k < removeAllArr.length; k++) { + pendingSterilizationColumnTree.getRootNode().removeChild(removeAllArr[k]); + } +} + /** + * 扫描固定条码和修改数量后,修改右边表格对应的数量 + * @param barcode 条码 + * @param finalAmount 剩余可用数量 + */ +function updateAmountToFixedBarcodes(barcode, finalAmount) { + var i = 0; + finalAmount = parseInt(finalAmount); + //循环右边的节点 + pendingSterilizationColumnTree.getRootNode().eachChild(function (pNode) { + //移除某一个节点后,再遍历其他节点得到的是undefined + if (pNode != null && pNode.attributes && pNode.attributes.objBarcode) { + if (pNode.attributes.objBarcode == barcode && i < 1) { + i++ + var name = pNode.attributes.objName; + var type = pNode.attributes.type; + var depart = pNode.attributes.depart; + var reviewTime = pNode.attributes.reviewTime; + var sterilingMode = pNode.attributes.sterilingMode; + var amount = parseInt(pNode.attributes.objAmount);//右边的数量 + var rootNode = sterilizationColumnTree.getRootNode(); + var isTraceable = pNode.attributes.isTraceable; + var scanAmount = pNode.attributes.scanAmount; + var typeForSterilizationStatistics = pNode.attributes.typeForSterilizationStatistics; + pNode.remove();//移除对应右边的节点 + var myNode = createNodeForPendingStarilizationGoods(true, barcode, name, type, depart, reviewTime, finalAmount, sterilingMode,isTraceable,scanAmount,typeForSterilizationStatistics) + pendingSterilizationColumnTree.getRootNode().appendChild(myNode); + } + } + }); +} + +/** + * 删除固定条码以后,直接在右边设置库存的最大值 + * @param barcode 条码 + * @param parentNode 左边的节点 + * @param objAmount 左边的数量 + */ +function setAmountToFixedBarcodes(barcode, objAmount) { + var i = 0; + pendingSterilizationColumnTree.getRootNode().eachChild(function (pNode) { + //移除某一个节点后,再遍历其他节点得到的是undefined + if (pNode != null && pNode.attributes && pNode.attributes.objBarcode) { + if (pNode.attributes.objBarcode == barcode && i < 1) { + i++ + var name = pNode.attributes.objName; + var type = pNode.attributes.type; + var depart = pNode.attributes.depart; + var reviewTime = pNode.attributes.reviewTime; + var sterilingMode = pNode.attributes.sterilingMode; + var amount = pNode.attributes.objAmount;//右边的数量 + var rootNode = sterilizationColumnTree.getRootNode(); + var isTraceable = pNode.attributes.isTraceable; + var scanAmount = pNode.attributes.scanAmount; + var typeForSterilizationStatistics = pNode.attributes.typeForSterilizationStatistics; + //var finalAmount = parseInt(amount)+parseInt(objAmount) + pNode.remove();//移除对应右边的节点 + var myNode = createNodeForPendingStarilizationGoods(true, barcode, name, type, depart, reviewTime, parseInt(objAmount), sterilingMode,isTraceable,scanAmount,typeForSterilizationStatistics) + pendingSterilizationColumnTree.getRootNode().appendChild(myNode); + } + } + }); +} + +/** * 将器械包移除篮筐(只能移除篮筐里面的器械包,这里只是方便用户,不需要特意回到“灭菌装载”界面操作) - * @param {将要被从灭菌篮筐移除的器械包条码} barcode + * @param barcode 将要被从灭菌篮筐移除的器械包条码 */ function removeGridItem(barcode) { top.Ext.Msg.confirm("删除确认", "是否要将此器械包移除篮筐", function (btn) { @@ -2002,7 +1895,10 @@ }); } -//删除灭菌物品栏,物品回退至待灭菌物品列表 +/** + * 删除灭菌物品栏,物品回退至待灭菌物品列表 + * @param clickNode + */ function addPendingStarilizationGoodsFromRecord(clickNode) { var objBarcode = clickNode.attributes.barcode; var objName = clickNode.attributes.name; @@ -2084,7 +1980,7 @@ * @param sterilingMode 灭菌方式 * @returns */ -function createPendingSterilizationGoodsNode(objBarcode, objName, objAmount, type, depart, reviewTime, sterilingMode, isTraceable, scanAmount, typeForSterilizationStatistics) { +function createPendingSterilizationGoodsNode(objBarcode, objName, objAmount, type, depart, reviewTime, sterilingMode,isTraceable,scanAmount,typeForSterilizationStatistics) { var node; if (type == 'BASKET') { //创建父节点 @@ -2164,7 +2060,88 @@ return node; } -//删除固定条码 +var InterruptRecordItem = Ext.data.Record.create([ + { name: 'id' }, + { name: 'interruptUser' }, + { name: 'interruptDate' }, + { name: 'interruptFinishDate' }, + { name: 'interruptOptType' }, + { name: 'quatifyMonitoryId' } +]); + + +/** + * 只针对固定条码 增加数量 + * @param fixedBarcode 固定条码 + * @param addAmount 修改后数量 - 修改前的数量 = 新增的数量 + */ +function addTousseInsAmount(fixedBarcode, addAmount, thiz, newValue, oldValue) { + var editNode = thiz.editNode; + var attr = editNode.attributes; + var name = attr.name; + var barcode = attr.barcode; + var newAmount = parseInt(newValue) + var oldAmount = parseInt(oldValue) + var reg = new RegExp("^[0-9]*$"); + var stockAmount = parseInt(editNode.attributes.stockAmount); + //修改失败后调用 + var updateFail = function roleBack(amount) { + //克隆修改前的数据 + var isParentNode = editNode.attributes.isParentNode; + var typeForSterilizationStatistics = editNode.attributes.typeForSterilizationStatistics; + var department = editNode.attributes.depart; + var position = editNode.attributes.position; + var amount = amount || oldValue; + var reviewTime = editNode.attributes.reviewTime; + var stockAmount = editNode.attributes.stockAmount; + var sterilingMode = editNode.attributes.sterilingMode; + var rootNode = sterilizationColumnTree.getRootNode(); + var parentNode = createNode(true, barcode, name, typeForSterilizationStatistics, department, '器械包', position, amount, reviewTime, stockAmount, sterilingMode); + var firstChildNode = rootNode.item(0); + editNode.remove();//删除修改后的节点数据 + rootNode.appendChild(parentNode);//追加修改前的数据 + sterilizationRecordWin.getEl().unmask();//关闭进度条 + } + Ext.Ajax.request({ + url: WWWROOT + '/disinfectSystem/sterilization/sterilizationRecordAction!fixedBarcodeBarcodeAdd.do', + params: { + fixedBarcode: fixedBarcode, + addAmount: addAmount, + myBarcodes: JSON.stringify(myBarcodes)//将数组已json格式传入后台 + }, + waitMsg: '正在处理,请稍候...', + success: function (response, options) { + var result = Ext.decode(response.responseText); + if (result.success) { + var newBarcode = result.message.split(",") + myBarcodes = myBarcodes.concat(newBarcode);//将返回的条码添加到全局中 + editAmountComplete(fixedBarcode, addAmount, 1); + top.Ext.getCmp('saveBtn').enable(); + updateFail(newValue); + } else { + showResult(result.message, null, sstsConfig.messagePauseTimeOnSterilizationRecordPage); + sterilizationRecordWin.getEl().unmask(); + updateFail(); + top.Ext.getCmp('saveBtn').enable(); + formObj.getEl().unmask(); + statisticsTousseAndBasket(); + } + sterilizationRecordWin.getEl().unmask(); + top.Ext.getCmp('saveBtn').enable(); + statisticsTousseAndBasket(); + }, + failure: function (response, options) { + showResult("系统发生异常,请勿提交数据", null, sstsConfig.messagePauseTimeOnSterilizationRecordPage); + + sterilizationRecordWin.getEl().unmask(); + formObj.getEl().unmask(); + } + }); +} + +/** + * 只针对固定条码:删除固定条码 + */ function clickDeleteIcon(clickNode) { var objName = clickNode.attributes.name; var reviewTime = clickNode.attributes.reviewTime; @@ -2181,51 +2158,184 @@ if (pNode.attributes.objBarcode == fixedBarcode) { var amountRight = parseInt(pNode.attributes.objAmount);//右边的数量 removePendingSterilizationGoods(fixedBarcode)//删除右边的数据 - node = createPendingSterilizationGoodsNode(fixedBarcode, objName, amount + amountRight, 'TOUSSE', '', '', sterilingMode, isTraceable, scanAmount, typeForSterilizationStatistics) + node = createPendingSterilizationGoodsNode(fixedBarcode, objName, amount + amountRight, 'TOUSSE', '', '', sterilingMode,isTraceable,scanAmount,typeForSterilizationStatistics) } } }); if (!pendingSterilizationColumnTree.getRootNode().childNode) { pendingSterilizationColumnTree.getRootNode().childNode = []; } if (node == '') { - node = createPendingSterilizationGoodsNode(fixedBarcode, objName, amount, 'TOUSSE', '', reviewTime, sterilingMode, isTraceable, scanAmount, typeForSterilizationStatistics); + node = createPendingSterilizationGoodsNode(fixedBarcode, objName, amount, 'TOUSSE', '', reviewTime, sterilingMode,isTraceable,scanAmount,typeForSterilizationStatistics); pendingSterilizationColumnTree.getRootNode().appendChild(node); } else { pendingSterilizationColumnTree.getRootNode().appendChild(node); } clickNode.remove();//将当前节点移除 sterilizationRecordWin.getEl().unmask(); - if (leftFixedBarcodeMap.get(fixedBarcode)) { - leftFixedBarcodeMap.set(fixedBarcode, 0); + if(leftFixedBarcodeMap.get(fixedBarcode)){ + leftFixedBarcodeMap.set(fixedBarcode,0); } statisticsTousseAndBasket(); } /** + * 固定条码删除数量 + * @param delAmount + * @param fixedBarcode + */ +function delTousseInsAmount(delAmount, fixedBarcode) { + top.Ext.getCmp('saveBtn').disable();//删除可能比较慢,先禁用保存按钮 + Ext.Ajax.request({ + url: WWWROOT + '/disinfectSystem/sterilization/sterilizationRecordAction!fixedBarcodeBarcodeSubtraction.do', + params: { + fixedBarcode: fixedBarcode,//固定条码 + myBarcodes: JSON.stringify(myBarcodes),//将全局数组以json格式传入后台 + delAmount: delAmount//减少的数量 + }, + waitMsg: '正在处理,请稍候...', + success: function (response, options) { + var result = Ext.decode(response.responseText); + if (result.success) { + if (typeof (result.message) == "undefined" || result.message == "") { + myBarcodes = []; + } else { + myBarcodes = result.message.split(",") + editAmountComplete(fixedBarcode, delAmount, 2) + } + top.Ext.getCmp('saveBtn').enable(); + } else { + showResult("减少数量失败,请勿提交数据", null, sstsConfig.messagePauseTimeOnSterilizationRecordPage); + + } + sterilizationRecordWin.getEl().unmask(); + top.Ext.getCmp('saveBtn').enable();//成功删除全部后,启用保存按钮 + statisticsTousseAndBasket(); + }, + failure: function (response, options) { + showResult("后台运行异常,请稍候再试...", null, sstsConfig.messagePauseTimeOnSterilizationRecordPage); + + formObj.getEl().unmask(); + } + }); +} + +Array.prototype.removeByValue = function (val) { + for (var i = 0; i < this.length; i++) { + if (this[i] == val) { + this.splice(i, 1); + break; + } + } +} + +//获取固定条码的所有实例条码 +function loadAllTousseInstanceInfoByFixedBarcode(barcode,sterilizationRecordId,isFiexdBarcode){ + Ext.Ajax.request({ + url: WWWROOT + '/disinfectSystem/sterilization/sterilizationRecordAction!loadAllTousseInstanceInfoByFixedBarcode.do', + params: { + barcode: barcode, + sterilizationRecordId:sterilizationRecordId + }, + waitMsg: '正在处理,请稍候...', + success: function (response, options) { + var result = Ext.decode(response.responseText); + if (result.success) { + var tousseInstanceArr = result.tousseInstanceArr || []; + var length = tousseInstanceArr.length; + var speakBasket = new SpeakBasket(); + if(result.success == -1){ + showResult(result.failureCause, null, sstsConfig.messagePauseTimeOnSterilizationRecordPage); + sterilizationRecordWin.getEl().unmask(); + return; + } + if (length < 1) { + showResult('未找到符合条件的器械包!', null, sstsConfig.messagePauseTimeOnSterilizationRecordPage); + sterilizationRecordWin.getEl().unmask(); + return; + } + var scanAmount = result.scanAmount || 0; + if(!scanAmountMap.has(barcode)){ + scanAmountMap.set(barcode,scanAmount) + } + var tousseInstan = result.fixedBarcodeInfo; + var tousseName = tousseInstan.tousseName; //器械包名称 + var amount = (parseInt(scanAmount)>parseInt(length))?parseInt(length):parseInt(scanAmount); //每次扫描数量 + leftFixedBarcodeMap.set(barcode,amount) + rightFixedBarcodeMap.set(barcode,length-amount); + var sterilingTypeTemp = top.Ext.getCmp('sterilizationType').getValue(); + var diffTousseNames = ""; + var typeForSterilizationStatistics = tousseInstan.typeForSterilizationStatistics; //器械包类型(用于分类统计) + var tousseBarcode = tousseInstan.tousseBarcode; //器械包条码 + var sterilingType = tousseInstan.SterilingType; //灭菌程序 + var reviewTime = tousseInstan.reviewTime; //审核时间 + var stockAmount = parseInt(tousseInstan.stockAmount);//库存数量 + var sterilingMode = tousseInstan.sterilingMode;//灭菌方式 + //多个灭菌程序和所选的灭菌程序不同的器械包提示一起提示。同名包只出现一次 + if (sterilingTypeTemp != sterilingType && diffTousseNames.indexOf(tousseName) == -1) { + diffTousseNames += '[' + tousseName + ']'; + } + //添加到灭菌物品视图列表的第一行 + var rootNode = sterilizationColumnTree.getRootNode(); + var position = top.Ext.getCmp('position').getValue(); + if(!isFiexdBarcode){ + var parentNode = createNode(true, tousseBarcode, tousseName, typeForSterilizationStatistics, "", '器械包', position, amount, reviewTime, stockAmount, sterilingMode); + var firstChildNode = rootNode.item(0); + if (firstChildNode == null || firstChildNode == undefined) {//第一行数据为空 + rootNode.appendChild(parentNode); + } else { + rootNode.insertBefore(parentNode, firstChildNode); + } + }else { + updateLeftFixedBarcodeAmount(tousseBarcode, amount)//修改右边节点的数量 + } + updateRigthFixedBarcodeAmount(tousseBarcode, amount)//修改右边节点的数量 + speakBasket.addGoods('', tousseName, 1); + + if (diffTousseNames != '') { + showResultWithoutSpeak("器械包" + diffTousseNames + "的灭菌程序和所选的灭菌程序不同!", null, sstsConfig.messagePauseTimeOnSterilizationRecordPage); + } + }else { + if(result.failureCause){ + showResult(result.failureCause, null, sstsConfig.messagePauseTimeOnSterilizationRecordPage); + } + } + sterilizationColumnTree.getEl().unmask(); + sterilizationRecordWin.getEl().unmask(); + statisticsTousseAndBasket();//统计总数量 + }, + failure: function (response, options) { + showResult("后台运行异常,请稍候再试...", null, sstsConfig.messagePauseTimeOnSterilizationRecordPage); + + formObj.getEl().unmask(); + } + }); +} + +/** * 修改leftFixedBarcodeMap和rightFixedBarcodeMap * @param {固定条码} fixedBarcode * @param {最新的数量} newAmount * @param {修改后的数量} oldAmount * @param {增加或减少的类型} type */ -function updateLeftAndRightMap(thiz, newAmount, oldAmount, type) { +function updateLeftAndRightMap(thiz,newAmount,oldAmount,type){ var editNode = thiz.editNode; var barcode = editNode.attributes.barcode; var amount; - if (type == 1) { - leftFixedBarcodeMap.set(barcode, newAmount); - amount = parseInt(newAmount - oldAmount); - if (rightFixedBarcodeMap.get(barcode)) { + if(type == 'add'){ + leftFixedBarcodeMap.set(barcode,newAmount); + amount = parseInt(newAmount-oldAmount); + if(rightFixedBarcodeMap.get(barcode)){ var amount1 = rightFixedBarcodeMap.get(barcode); - rightFixedBarcodeMap.set(barcode, amount1 - amount); + rightFixedBarcodeMap.set(barcode,amount1-amount); } - } else { - leftFixedBarcodeMap.set(barcode, newAmount); - amount = parseInt(oldAmount - newAmount); - if (rightFixedBarcodeMap.get(barcode)) { + }else { + leftFixedBarcodeMap.set(barcode,newAmount); + amount = parseInt(oldAmount-newAmount); + if(rightFixedBarcodeMap.get(barcode)){ var amount1 = rightFixedBarcodeMap.get(barcode); - rightFixedBarcodeMap.set(barcode, amount1 + amount); + rightFixedBarcodeMap.set(barcode,amount1+amount); } } var name = editNode.attributes.name; @@ -2238,25 +2348,10 @@ var isTraceable = editNode.attributes.isTraceable; var scanAmount = editNode.attributes.scanAmount; var rootNode = sterilizationColumnTree.getRootNode(); - var params = { - isParentNode: true, - barcode: barcode, - name: name, - typeForSterilizationStatistics: typeForSterilizationStatistics, - depart: department, - type: '器械包', - position: position, - amount: newAmount, - reviewTime: reviewTime, - stockAmount: stockAmount, - sterilingMode: sterilingMode, - scanAmount: scanAmount, - isTraceable: isTraceable - } - var parentNode = createNode(params); + var parentNode = createNode(true, barcode, name, typeForSterilizationStatistics, department, '器械包', position, newAmount, reviewTime, stockAmount, sterilingMode,scanAmount,isTraceable); editNode.remove();//删除修改后的节点数据 rootNode.appendChild(parentNode);//追加修改前的数据 - updateRigthFixedBarcodeAmount(barcode, amount, type)//修改右边的数量 + updateRigthFixedBarcodeAmount(barcode, amount,type)//修改右边的数量 sterilizationRecordWin.getEl().unmask();//关闭进度条 } @@ -2268,6 +2363,9 @@ * @param includeImplant 是否植入物 */ function addAndEditSterilizationRecord(id, currentStatus, reSterilization, includeImplant) { + //将存放条码的数组初始化 + myBarcodes = []; + myFixedBarcodes = []; delTousseJson = []; tousseItemCountJsonStore = new Ext.data.Store({ autoLoad: false, @@ -2382,29 +2480,29 @@ }, load: function (_this, node, response) { statisticsTousseAndBasket(); - if (response.responseText == '') { + if(response.responseText == ''){ sterilizationColumnTree.getEl().unmask(); return; } var result = Ext.decode(response.responseText); - if (result && result.length > 0) { - for (var i = 0; i < result.length; i++) { - if (result[i].unTraceable == '是') { - if (!tousseInstanMap.has(result[i].barcode)) { + if(result && result.length > 0){ + for(var i=0;i0?getRigthFixedBarcodeAmount(barcode):0; var fixedBarcode = attr.barcode; if (newAmount > oldAmount) {//如果是增加数量 - if (!rightFixedBarcodeMap.get(fixedBarcode) || rightFixedBarcodeMap.get(fixedBarcode) == 0) { + if(!rightFixedBarcodeMap.get(fixedBarcode) || rightFixedBarcodeMap.get(fixedBarcode) == 0){ var sumAmount = leftFixedBarcodeMap.get(fixedBarcode); - showResult('已超过' + attr.name + '的最大待灭菌物品总数' + sumAmount + '!'); + showResult('已超过'+attr.name+'的最大待灭菌物品总数'+sumAmount+'!'); sterilizationRecordWin.getEl().unmask(); return false; } var amount = parseInt(newAmount) - parseInt(oldAmount); var leftAmount = parseInt(getLeftFixedBarcodeAmount(barcode)); if (amount > rigthAmount || (amount + leftAmount > 2000)) { - var sumAmount = (leftAmount + rigthAmount) > 2000 ? 2000 : (leftAmount + rigthAmount); + var sumAmount = (leftAmount+rigthAmount)>2000?2000:(leftAmount+rigthAmount); sterilizationRecordWin.getEl().unmask(); - showResult('已超过' + attr.name + '的最大待灭菌物品总数' + sumAmount + '!'); + showResult('已超过'+attr.name+'的最大待灭菌物品总数'+sumAmount+'!'); return false; } - updateLeftAndRightMap(thiz, newAmount, oldAmount, 1); + updateLeftAndRightMap(thiz,newAmount,oldAmount,'add'); } else if (newAmount < oldAmount) { - updateLeftAndRightMap(thiz, newAmount, oldAmount, 0); + updateLeftAndRightMap(thiz,newAmount,oldAmount,'reduce'); } statisticsTousseAndBasket(); @@ -2633,20 +2731,20 @@ Ext.each(rootNode.childNodes, function (cNode) { if (cNode != null && cNode.attributes && cNode.attributes.objBarcode) { var objBarcode = cNode.attributes.objBarcode; - if (cNode.attributes["isTraceable"] == '否') { + if(cNode.attributes["isTraceable"] == '否'){ fixedBarcodeArr.push(objBarcode); - } else { + }else { waitSterilingBarcodeArray.push(objBarcode); } } }); - if (waitSterilingBarcodeArray.length == 0) { + if(waitSterilingBarcodeArray.length == 0){ for (var i = 0; i < fixedBarcodeArr.length; i++) { - scanFixedBarcode(fixedBarcodeArr[i], true); + scanFixedBarcode(fixedBarcodeArr[i],true); } } statisticsTousseAndBasket();//统计总数量 - if (waitSterilingBarcodeArray.length > 0) { + if(waitSterilingBarcodeArray.length > 0){ Ext.Ajax.timeout = 90000; pendingSterilizationColumnTree.getEl().mask("正在加载中.请稍等...", "x-mask-loading"); Ext.Ajax.request({ @@ -2664,7 +2762,7 @@ if (result.success) { //判断是否含有植入物 var includeImplant = result.includeImplant; - + if (includeImplant == '是') { showResult('篮筐内物品含有植入物,请做生物监测', null, sstsConfig.messagePauseTimeOnSterilizationRecordPage); } @@ -2675,7 +2773,7 @@ removePendingSterilizationGoods(waitSterilingBarcodeArray[i]); } for (var i = 0; i < fixedBarcodeArr.length; i++) { - scanFixedBarcode(fixedBarcodeArr[i], true); + scanFixedBarcode(fixedBarcodeArr[i],true); } pendingSterilizationColumnTree.getEl().unmask(); statisticsTousseAndBasket();//统计总数量 @@ -2691,7 +2789,7 @@ }, failure: function (response, options) { showResult("后台运行异常,请稍候再试...", null, sstsConfig.messagePauseTimeOnSterilizationRecordPage); - + formObj.getEl().unmask(); } }); @@ -2722,21 +2820,21 @@ top.Ext.getCmp("btnBatchAddTousse").enable(); } var result = Ext.decode(response.responseText); - for (var i = 0; i < result.length; i++) { - if (result[i].isTraceable == '否') { - rightFixedBarcodeMap.set(result[i].objBarcode, result[i].objAmount); + for(var i=0;i