Index: ssts-web/src/main/webapp/disinfectsystem/washanddisinfectmanager/washanddisinfectrecord/washAndDisinfectForm.js =================================================================== diff -u -r31977 -r33438 --- ssts-web/src/main/webapp/disinfectsystem/washanddisinfectmanager/washanddisinfectrecord/washAndDisinfectForm.js (.../washAndDisinfectForm.js) (revision 31977) +++ ssts-web/src/main/webapp/disinfectsystem/washanddisinfectmanager/washanddisinfectrecord/washAndDisinfectForm.js (.../washAndDisinfectForm.js) (revision 33438) @@ -9,62 +9,63 @@ var oldPerson = null; //修改时后台传过来的清洗责任人 var oldPersonCode = null; //修改时后台传过来的清洗责任人登录名 var pitchOn = true; //判断是否点击了责任人后扫描条码 true没修改, flase修改过 -var isAddorAlter = true ; //判断是否是修改还是添加 true是添加,flase是修改 +var isAddorAlter = true; //判断是否是修改还是添加 true是添加,flase是修改 var materialDefinitionStore = new Ext.data.Store({ - pageSize: 100, - proxy : new Ext.data.HttpProxy({ - url : WWWROOT + '/disinfectSystem/baseData/materialDefinitionAction!getMaterialDefinitionDataForMaterial.do', - method : 'POST' + pageSize: 100, + proxy: new Ext.data.HttpProxy({ + url: WWWROOT + '/disinfectSystem/baseData/materialDefinitionAction!getMaterialDefinitionDataForMaterial.do', + method: 'POST' }), - reader : new Ext.data.JsonReader({ - totalProperty : 'totalCount', - root : 'data' + reader: new Ext.data.JsonReader({ + totalProperty: 'totalCount', + root: 'data' }, [ - {name : 'id',mapping : 'id'}, - {name : 'spelling',mapping : 'spelling'}, - {name : 'type',mapping : 'type'}, - {name : 'name',mapping : 'name'} + { name: 'id', mapping: 'id' }, + { name: 'spelling', mapping: 'spelling' }, + { name: 'type', mapping: 'type' }, + { name: 'name', mapping: 'name' } ]) }); //清洗界面添加清洗记录时扫描清洗篮筐条码是否收缩(未配置或配置值为false表示不收缩) var enableCollapse = false; -if(sstsConfig && sstsConfig.enableCollapseWhenScanWashBasketBarcode - && sstsConfig.enableCollapseWhenScanWashBasketBarcode == true){ +if (sstsConfig && sstsConfig.enableCollapseWhenScanWashBasketBarcode + && sstsConfig.enableCollapseWhenScanWashBasketBarcode == true) { enableCollapse = true; } var materialCm = new Ext.grid.ColumnModel([ - {header : 'id',dataIndex : 'id',hidden :true}, - {header : "名称",dataIndex : 'name',width : 170,menuDisabled : true}, - {header : "数量",width : 60,menuDisabled : true,dataIndex : 'amount'}, - {id : 'deleteItem',header:'操作',menuDisabled : true, - renderer: function(v,p,record){ + { header: 'id', dataIndex: 'id', hidden: true }, + { header: "名称", dataIndex: 'name', width: 170, menuDisabled: true }, + { header: "数量", width: 60, menuDisabled: true, dataIndex: 'amount' }, + { + id: 'deleteItem', header: '操作', menuDisabled: true, + renderer: function (v, p, record) { var str = ""; return str; }, - dataIndex:'button' -}]); + dataIndex: 'button' + }]); //每次扫描原有的器械包删除原有的器械包节点 -function removeTousseGrid(barcode){ +function removeTousseGrid(barcode) { var root = top.Ext.getCmp('basketTreePanel').root; var node = root.findChild('barcode', barcode); - if(node){ - node.remove(); + if (node) { + node.remove(); } } -function removeWashGridItem(barcode){ +function removeWashGridItem(barcode) { var root = top.Ext.getCmp('basketTreePanel').root; var node = root.findChild('barcode', barcode); - if(node) { + if (node) { node.remove(); - if(node.attributes.type != "fixedBarcode"){ + if (node.attributes.type != "fixedBarcode") { addPendingWashGoodsFromRecord(node); - var desMsg = "删除清洗篮筐,条码: " + node.attributes.barcode + " ,名称 :" + node.attributes.name; - buildLogInfo(desMsg); + var desMsg = "删除清洗篮筐,条码: " + node.attributes.barcode + " ,名称 :" + node.attributes.name; + buildLogInfo(desMsg); } } //重新计算篮筐数量(除了本处删除篮筐后外,另外在新扫描篮筐也应相应修改已扫描篮筐数量) @@ -77,18 +78,18 @@ var objAmount = clickNode.attributes.count; var type = 'BASKET'; var array = new Array(); - - clickNode.eachChild(function(pNode){ - var childObjBarcode = pNode.attributes.barcode; - var childObjName = pNode.attributes.name; - var childObjAmount = pNode.attributes.count; - var childRecyclingDept = pNode.attributes.recyclingDept; - var childRecyclingTime = pNode.attributes.recyclingTime; - var childType = 'TOUSSE'; - var childNode = createPendingWashGoodsNode(childObjBarcode, childObjName, childObjAmount, childType, childRecyclingDept, childRecyclingTime); - array.push(childNode); - }); - + + clickNode.eachChild(function (pNode) { + var childObjBarcode = pNode.attributes.barcode; + var childObjName = pNode.attributes.name; + var childObjAmount = pNode.attributes.count; + var childRecyclingDept = pNode.attributes.recyclingDept; + var childRecyclingTime = pNode.attributes.recyclingTime; + var childType = 'TOUSSE'; + var childNode = createPendingWashGoodsNode(childObjBarcode, childObjName, childObjAmount, childType, childRecyclingDept, childRecyclingTime); + array.push(childNode); + }); + var node = createPendingWashGoodsNode(objBarcode, objName, objAmount, type); if (type == 'BASKET') { node.appendChild(array); @@ -99,32 +100,32 @@ //生成待清洗篮筐节点 function createPendingWashGoodsNode(objBarcode, objName, objAmount, type, childRecyclingDept, childRecyclingTime) { var node; - if(type == 'BASKET'){ + if (type == 'BASKET') { //创建父节点 node = new top.Ext.tree.TreeNode({ - id : Ext.id(), - text : objBarcode, - cls : 'master-task', - uiProvider : top.Ext.tree.ColumnNodeUI, - leaf : false, - expanded : false + id: Ext.id(), + text: objBarcode, + cls: 'master-task', + uiProvider: top.Ext.tree.ColumnNodeUI, + leaf: false, + expanded: false }); - }else{ + } else { //创建子节点 node = new top.Ext.tree.TreeNode({ - id : Ext.id(), - text : objBarcode, - iconCls : 'task', - uiProvider : top.Ext.tree.ColumnNodeUI, - leaf : true, - expanded : false + id: Ext.id(), + text: objBarcode, + iconCls: 'task', + uiProvider: top.Ext.tree.ColumnNodeUI, + leaf: true, + expanded: false }); } //********************** 节点保存的属性值 ****************************// - node.attributes.objBarcode=objBarcode; - node.attributes.objName=objName; - node.attributes.objAmount=objAmount; - node.attributes.type=type; + node.attributes.objBarcode = objBarcode; + node.attributes.objName = objName; + node.attributes.objAmount = objAmount; + node.attributes.type = type; node.attributes.recyclingTime = childRecyclingTime; node.attributes.recyclingDept = childRecyclingDept; return node; @@ -133,7 +134,7 @@ function removeWashGridMaterialItem() { var rows = top.Ext.getCmp('washAndDisinfectMaterialGrid').getSelectionModel().getSelections(); if (rows) { - for (var i = 0; i< rows.length; i++) { + for (var i = 0; i < rows.length; i++) { materialStore.remove(rows[i]); } } @@ -142,328 +143,327 @@ } var materialRecord = Ext.data.Record.create([ - {name : 'id'}, - {name : 'materialId'}, - {name : 'name'}, - {name : 'amount'} + { name: 'id' }, + { name: 'materialId' }, + { name: 'name' }, + { name: 'amount' } ]); var materialStore = new Ext.data.Store({ - proxy : new Ext.data.MemoryProxy([]), - reader : new Ext.data.JsonReader( { - fields : [ - {name : 'id'}, - {name : 'materialId'}, - {name : 'name'}, - {name : 'amount'} + proxy: new Ext.data.MemoryProxy([]), + reader: new Ext.data.JsonReader({ + fields: [ + { name: 'id' }, + { name: 'materialId' }, + { name: 'name' }, + { name: 'amount' } ] }) }); //根据条码加载材料 -function loadMaterial(barcode,callBack,idCardBarcode,isRetrospectTousse) { - if(typeof(barcode) == 'undefined' || barcode == '') - { +function loadMaterial(barcode, callBack, idCardBarcode, isRetrospectTousse) { + if (typeof (barcode) == 'undefined' || barcode == '') { barcode = top.Ext.getCmp('inputText').getValue(); top.Ext.getCmp('inputText').setValue(""); } var root = top.Ext.getCmp('basketTreePanel').root; var node = root.findChild('barcode', barcode); - var nodeIdCardBarcode = root.findChild('barcode',idCardBarcode); - if(!isRetrospectTousse){ - if (node || nodeIdCardBarcode) { - showResult("该篮筐或清洗架已在列表中"); - return; - } + var nodeIdCardBarcode = root.findChild('barcode', idCardBarcode); + if (!isRetrospectTousse) { + if (node || nodeIdCardBarcode) { + showResult("该篮筐或清洗架已在列表中"); + return; + } } var isLoadDefaultCleanMethod = false; - if(!top.Ext.getCmp('disinfectProgram').getValue() && !top.Ext.getCmp('disinfectIdentification').getValue()){ + if (!top.Ext.getCmp('disinfectProgram').getValue() && !top.Ext.getCmp('disinfectIdentification').getValue()) { isLoadDefaultCleanMethod = true; } - - if(barcode!=""){ - Ext.Ajax.request( { - url : WWWROOT + '/disinfectSystem/washAndDisinfect/washAndDisinfectRecordAction!loadContainerContentOfJSON.do', - params : { - barcode : barcode, - isLoadDefaultCleanMethod : isLoadDefaultCleanMethod, - isRetrospectTousse : isRetrospectTousse + + if (barcode != "") { + Ext.Ajax.request({ + url: WWWROOT + '/disinfectSystem/washAndDisinfect/washAndDisinfectRecordAction!loadContainerContentOfJSON.do', + params: { + barcode: barcode, + isLoadDefaultCleanMethod: isLoadDefaultCleanMethod, + isRetrospectTousse: isRetrospectTousse }, - success : function(response, options) { - if(isUndefinedOrNullOrEmpty(response.responseText)){ - return ; + success: function (response, options) { + if (isUndefinedOrNullOrEmpty(response.responseText)) { + return; } -// var result = response.responseText; -// result = result.replace(/\r\n/g, ""); + // var result = response.responseText; + // result = result.replace(/\r\n/g, ""); var basket = Ext.decode(response.responseText); - - if(basket.hasOwnProperty("message")){ + + if (basket.hasOwnProperty("message")) { showResult(basket.message); - return ; - }else if(basket != null){ - -// } -// var results=result.split(","); -// if(result=="notUsed"){ -// showResult("该篮筐没有装载物品,不能进行清洗"); -// }else if(result=="notExistItemsUsed"){ -// showResult("该篮筐或清洗架未存放清洗物品"); -// }else if(result=="packed"){ -// showResult("该篮筐内部分物品已装配并打印标签,不能再次清洗!"); -// }else if(result=="nonFixedDarcode"){ -// showResult(barcode+"不是固定条码,请扫描固定条码!"); -// }else if(results[0]=="retrospect"){ -// showResult(results[1]+"为追溯的包,不能扫描固定条码!"); -// }else if (result != null && result != "null") { - var tousseCounts ; //扫描固定条码时,保存的器械包值 -// var materialCounts = []; + return; + } else if (basket != null) { + + // } + // var results=result.split(","); + // if(result=="notUsed"){ + // showResult("该篮筐没有装载物品,不能进行清洗"); + // }else if(result=="notExistItemsUsed"){ + // showResult("该篮筐或清洗架未存放清洗物品"); + // }else if(result=="packed"){ + // showResult("该篮筐内部分物品已装配并打印标签,不能再次清洗!"); + // }else if(result=="nonFixedDarcode"){ + // showResult(barcode+"不是固定条码,请扫描固定条码!"); + // }else if(results[0]=="retrospect"){ + // showResult(results[1]+"为追溯的包,不能扫描固定条码!"); + // }else if (result != null && result != "null") { + var tousseCounts; //扫描固定条码时,保存的器械包值 + // var materialCounts = []; var timeOfThisFixedBarcode = 1; //固定条码扫描次数 - var repeatedly ; -// var materialArray = new Array(); -// materialArray = result.split("#@"); -// var array = new Array(); - //后台拼接语句 - //" " + ","+ tousseDefinition.getName() + ","+ totalGoodsAmount + ","+ tousseInstance.getBarcode()+ ""; -// array = materialArray[0].split(","); + var repeatedly; + // var materialArray = new Array(); + // materialArray = result.split("#@"); + // var array = new Array(); + //后台拼接语句 + //" " + ","+ tousseDefinition.getName() + ","+ totalGoodsAmount + ","+ tousseInstance.getBarcode()+ ""; + // array = materialArray[0].split(","); var root = top.Ext.getCmp('basketTreePanel').root; -// var node = root.findChild('id', array[0]); - if(!isRetrospectTousse){ + // var node = root.findChild('id', array[0]); + if (!isRetrospectTousse) { if (node) { showResult("该篮筐或清洗架已在列表中"); return; } - }else{ + } else { //获取不追溯的器械包数量 - root.eachChild(function(node){ //遍历已经添加到清洗列表的篮筐 + root.eachChild(function (node) { //遍历已经添加到清洗列表的篮筐 var barcodes = node.attributes.barcode //获取当前遍历篮筐的条码 - if(barcodes==barcode){ //如果当前遍历篮筐与刚才扫的条码相同,则进行处理 - timeOfThisFixedBarcode = parseInt(node.attributes.count)/parseInt(basket.amount)+1; + if (barcodes == barcode) { //如果当前遍历篮筐与刚才扫的条码相同,则进行处理 + timeOfThisFixedBarcode = parseInt(node.attributes.count) / parseInt(basket.amount) + 1; tousseCounts = timeOfThisFixedBarcode * parseInt(basket.amount); repeatedly = true; return false; -// tousseCounts.push({ -// count : count -// }); -// node.eachChild(function(tousseMaterial){ -// var type = tousseMaterial.attributes.type -// var materialCount = tousseMaterial.attributes.count -// var counts = (parseInt(materialCount) / parseInt(node.attributes.count)) * (parseInt(count)); -// materialCounts.push({ -// count : counts -// }); -// }); + // tousseCounts.push({ + // count : count + // }); + // node.eachChild(function(tousseMaterial){ + // var type = tousseMaterial.attributes.type + // var materialCount = tousseMaterial.attributes.count + // var counts = (parseInt(materialCount) / parseInt(node.attributes.count)) * (parseInt(count)); + // materialCounts.push({ + // count : counts + // }); + // }); } }); -// if(node != null){ -// repeatedly = true; -// } + // if(node != null){ + // repeatedly = true; + // } } var personInCharge = top.Ext.getCmp('personInCharge').getValue(); var personInChargeCode = top.Ext.getCmp('personInChargeCode').getValue(); - + personInCharge = !isUndefinedOrNullOrEmpty(basket.personInCharge) ? basket.personInCharge : personInCharge; //(cjr) personInChargeCode = !isUndefinedOrNullOrEmpty(basket.personInChargeCode) ? basket.personInChargeCode : personInChargeCode; - + var position = top.Ext.getCmp('position').getValue(); var showBarcode = basket.barcode; - if( enableIdCardBasketBinding && !isUndefinedOrNullOrEmpty(idCardBarcode) ){ + if (enableIdCardBasketBinding && !isUndefinedOrNullOrEmpty(idCardBarcode)) { showBarcode = idCardBarcode; } - if( isUndefinedOrNullOrEmpty(showBarcode) || showBarcode == 'undefined' ){ + if (isUndefinedOrNullOrEmpty(showBarcode) || showBarcode == 'undefined') { showBarcode = barcode; } var tousseCount = basket.amount; //扫描的是不追溯的器械包可以重复扫描叠加数量 - if(repeatedly){ + if (repeatedly) { removeTousseGrid(barcode); -// for (var i = 0; i < tousseCounts.length; i++) { -// var tousse = tousseCounts[i]; -// tousseCount = tousse.count; -// } + // for (var i = 0; i < tousseCounts.length; i++) { + // var tousse = tousseCounts[i]; + // tousseCount = tousse.count; + // } tousseCount = tousseCounts; } var basketNode = new top.Ext.tree.TreeNode({ -// id : array[0], - classifyBasketId : isRetrospectTousse ? '' : basket.classifyBasketId, - name : basket.name, - showname : basket.name, - count : tousseCount, - barcode : showBarcode, - containerBarcode : barcode, - idCardInstanceBarcode : idCardBarcode, + // id : array[0], + classifyBasketId: isRetrospectTousse ? '' : basket.classifyBasketId, + name: basket.name, + showname: basket.name, + count: tousseCount, + barcode: showBarcode, + containerBarcode: barcode, + idCardInstanceBarcode: idCardBarcode, personInCharge: isRetrospectTousse ? '' : personInCharge, personInChargeCode: isRetrospectTousse ? '' : personInChargeCode, - position : isRetrospectTousse ? '' : position, - type : basket.type, - cls : 'master-task', - iconCls : 'task-folder', - uiProvider : Ext.tree.ColumnNodeUI, - leaf : false, - expanded : !enableCollapse + position: isRetrospectTousse ? '' : position, + type: basket.type, + cls: 'master-task', + iconCls: 'task-folder', + uiProvider: Ext.tree.ColumnNodeUI, + leaf: false, + expanded: !enableCollapse }); - + var classifiedItems = basket.content; -// var judge = [] ; //判断退出循环设的数组 - for ( var i = 0; i < classifiedItems.length; i++) { + // var judge = [] ; //判断退出循环设的数组 + for (var i = 0; i < classifiedItems.length; i++) { var classifiedItem = classifiedItems[i]; -// tempArray = myArray[i].split(","); - if(isLoadDefaultCleanMethod && isUndefinedOrNullOrEmpty(classifiedItem.cleanMethod)){ + // tempArray = myArray[i].split(","); + if (isLoadDefaultCleanMethod && isUndefinedOrNullOrEmpty(classifiedItem.cleanMethod)) { top.Ext.getCmp('disinfectProgram').setValue(classifiedItem.cleanMethod); - WashAndDisinfectRecordTableManager.getCleanParameter(classifiedItem.cleanMethod,function(result){ - if(result != null && result.length > 0){ + WashAndDisinfectRecordTableManager.getCleanParameter(classifiedItem.cleanMethod, function (result) { + if (result != null && result.length > 0) { top.Ext.getCmp('cleanParameter').setValue(result); } }); //设置清洗结束时间 - if(isUndefinedOrNullOrEmpty(classifiedItem.cleanMinutes)){ + if (isUndefinedOrNullOrEmpty(classifiedItem.cleanMinutes)) { setEndDateAddCleanMinutes(parseInt(classifiedItem.cleanMinutes)); } isLoadDefaultCleanMethod = false; } -// var showname = tempArray[0]; -// var type = tempArray[4]; -// var objectId = tempArray[5]; -// var materialCount = tempArray[1]; -// var recyclingTime = tempArray[6]; -// var recyclingDept = tempArray[7]; + // var showname = tempArray[0]; + // var type = tempArray[4]; + // var objectId = tempArray[5]; + // var materialCount = tempArray[1]; + // var recyclingTime = tempArray[6]; + // var recyclingDept = tempArray[7]; //扫描的是不追溯的器械包里面的材料可以重复扫描叠加数量 -// if(repeatedly){ -// for(var int = 0; int < materialCounts.length; int++) { -// var material = materialCounts[int]; -// materialCount = material.count; -// if(judge.contains(materialCount)){ -// continue; -// }else{ -// judge.push(materialCount); -// break; -// } -// } -// } + // if(repeatedly){ + // for(var int = 0; int < materialCounts.length; int++) { + // var material = materialCounts[int]; + // materialCount = material.count; + // if(judge.contains(materialCount)){ + // continue; + // }else{ + // judge.push(materialCount); + // break; + // } + // } + // } var materialNode = new top.Ext.tree.TreeNode({ -// id : '', - name : classifiedItem.name, - showname : classifiedItem.name, - count : classifiedItem.amount*timeOfThisFixedBarcode, - type : classifiedItem.type, - objectId : classifiedItem.objectId, - recyclingTime : classifiedItem.recyclingTime, - recyclingDept : classifiedItem.recyclingDept, - barcode : '', - cls : 'master-task', - iconCls : 'task', - uiProvider : Ext.tree.ColumnNodeUI, - leaf : true, - expanded : !enableCollapse, + // id : '', + name: classifiedItem.name, + showname: classifiedItem.name, + count: classifiedItem.amount * timeOfThisFixedBarcode, + type: classifiedItem.type, + objectId: classifiedItem.objectId, + recyclingTime: classifiedItem.recyclingTime, + recyclingDept: classifiedItem.recyclingDept, + barcode: '', + cls: 'master-task', + iconCls: 'task', + uiProvider: Ext.tree.ColumnNodeUI, + leaf: true, + expanded: !enableCollapse, listeners: { - 'click' : function (node, e) { + 'click': function (node, e) { var type = node.attributes.type; - if( type == '材料'){ - return ; + if (type == '材料') { + return; } var tousseName = node.attributes.name; var objectId = node.attributes.objectId; var params = { - resolution:'1980', - tousseDefinitionID:objectId, - tousseName:encodeURIComponent(tousseName), - number:1 + resolution: '1980', + tousseDefinitionID: objectId, + tousseName: encodeURIComponent(tousseName), + number: 1 } - openModalWindowForExt(WWWROOT+"/disinfectsystem/touchScreen/recycle/tousseImage.jsp",params,'器械包图片',1110,600); + openModalWindowForExt(WWWROOT + "/disinfectsystem/touchScreen/recycle/tousseImage.jsp", params, '器械包图片', 1110, 600); } } }); basketNode.appendChild(materialNode); } var root = top.Ext.getCmp('basketTreePanel').root; - - if(enableCollapse){ + + if (enableCollapse) { //在添加新的记录之前先收缩之前的篮筐记录 top.Ext.getCmp('basketTreePanel').collapseAll(); } root.appendChild(basketNode); - showFrequency(barcode,isRetrospectTousse); + showFrequency(barcode, isRetrospectTousse); //重新计算篮筐数量(除了本处新扫描篮筐外,另外在删除篮筐后也应相应减掉已扫描篮筐数量) resetContainerCount(); //清空判断退出循环的数组 -// judge.splice(0,judge.length); - }else{ + // judge.splice(0,judge.length); + } else { showResult("找不到该篮筐或清洗架"); } }, - failure : function(response, options) { + failure: function (response, options) { var result = Ext.decode(response.responseText); showResult("系统加载失败,请稍候再试"); } }); } } -function cloneBasketMaterial(material){ +function cloneBasketMaterial(material) { var material = new top.Ext.tree.TreeNode({ - id : material.attributes.id, - name : material.attributes.name, - showname : material.attributes.showname, - count : material.attributes.count, - objectId : material.attributes.objectId, - barcode : material.attributes.barcode, - recyclingTime : material.attributes.recyclingTime, - recyclingDept : material.attributes.recyclingDept, - cls : 'master-task', - iconCls : 'task', - uiProvider : Ext.tree.ColumnNodeUI, - leaf : true, - expanded : !enableCollapse, + id: material.attributes.id, + name: material.attributes.name, + showname: material.attributes.showname, + count: material.attributes.count, + objectId: material.attributes.objectId, + barcode: material.attributes.barcode, + recyclingTime: material.attributes.recyclingTime, + recyclingDept: material.attributes.recyclingDept, + cls: 'master-task', + iconCls: 'task', + uiProvider: Ext.tree.ColumnNodeUI, + leaf: true, + expanded: !enableCollapse, listeners: { - 'click' : function (node, e) { + 'click': function (node, e) { var type = node.attributes.type; - if( type == '材料'){ - return ; + if (type == '材料') { + return; } var tousseName = node.attributes.name; var objectId = node.attributes.objectId; var params = { - resolution:'1980', - tousseDefinitionID:objectId, - tousseName:encodeURIComponent(tousseName), - number:1 + resolution: '1980', + tousseDefinitionID: objectId, + tousseName: encodeURIComponent(tousseName), + number: 1 } - openModalWindowForExt(WWWROOT+"/disinfectsystem/touchScreen/recycle/tousseImage.jsp",params,'器械包图片',1110,600); + openModalWindowForExt(WWWROOT + "/disinfectsystem/touchScreen/recycle/tousseImage.jsp", params, '器械包图片', 1110, 600); } } }); return material; } -function cloneBasket(basket){ +function cloneBasket(basket) { var isFixBarcode = basket.attributes.type == 'fixedBarcode' ? true : false; var basketCloned = new top.Ext.tree.TreeNode({ - name : basket.attributes.name, - showname : basket.attributes.showname, - count : basket.attributes.count, - barcode : basket.attributes.barcode, - containerBarcode : basket.containerBarcode, - idCardInstanceBarcode : basket.IDcardInstanceBarcode, - classifyBasketId : isFixBarcode ? '' : basket.attributes.classifyBasketId, + name: basket.attributes.name, + showname: basket.attributes.showname, + count: basket.attributes.count, + barcode: basket.attributes.barcode, + containerBarcode: basket.containerBarcode, + idCardInstanceBarcode: basket.IDcardInstanceBarcode, + classifyBasketId: isFixBarcode ? '' : basket.attributes.classifyBasketId, personInCharge: isFixBarcode ? '' : basket.attributes.personInCharge, personInChargeCode: isFixBarcode ? '' : basket.attributes.personInChargeCode, - position : isFixBarcode ? '' : basket.attributes.position, - type : basket.attributes.type, - cls : 'master-task', - iconCls : 'task-folder', - uiProvider : Ext.tree.ColumnNodeUI, - leaf : false, - expanded : !enableCollapse + position: isFixBarcode ? '' : basket.attributes.position, + type: basket.attributes.type, + cls: 'master-task', + iconCls: 'task-folder', + uiProvider: Ext.tree.ColumnNodeUI, + leaf: false, + expanded: !enableCollapse }); var childNodes = basket.childNodes; var childNodesAppend = []; - if(childNodes != null){ - for(var i=0;i"; - return str; - } - return ''; - } - }, - {header : '责任人',width : 50,dataIndex : 'personInCharge'}, - {header : '位置',width : 80,dataIndex : 'position',hidden : !((sstsConfig.hasOwnProperty('haveRinserPosition')) && sstsConfig.haveRinserPosition)}, - {header : '回收科室',width : 100,dataIndex : 'recyclingDept',hidden : mergeSameDefinitionItemInClassifyBasket}, - {header : '回收时间',width : 120,dataIndex : 'recyclingTime',hidden : mergeSameDefinitionItemInClassifyBasket}], - loader: new Ext.tree.TreeLoader({uiProviders:{'col': Ext.tree.ColumnNodeUI}}), - root: new top.Ext.tree.AsyncTreeNode({ - text : '' - }) - }); + id: 'basketTreePanel', + rootVisible: false, + bodyStyle: 'border:1px solid #afd7af', + autoScroll: true, + containerScroll: true, + height: 380, + title: washBasketTreePanelTitle, + columns: [ + { header: '名称', width: 220, dataIndex: 'name' }, + { header: 'name', width: 0, dataIndex: 'showname', hidden: true }, + { header: '数量', width: 45, dataIndex: 'count' }, + { header: '条形码', width: 75, dataIndex: 'barcode' }, + { + header: '操作', width: 40, dataIndex: 'id', + renderer: function (v, p, record) { + if (record.barcode != '') { + var str = ""; + return str; + } + return ''; + } + }, + { header: '责任人', width: 50, dataIndex: 'personInCharge' }, + { header: '位置', width: 80, dataIndex: 'position', hidden: !((sstsConfig.hasOwnProperty('haveRinserPosition')) && sstsConfig.haveRinserPosition) }, + { header: '回收科室', width: 100, dataIndex: 'recyclingDept', hidden: mergeSameDefinitionItemInClassifyBasket }, + { header: '回收时间', width: 120, dataIndex: 'recyclingTime', hidden: mergeSameDefinitionItemInClassifyBasket }], + loader: new Ext.tree.TreeLoader({ uiProviders: { 'col': Ext.tree.ColumnNodeUI } }), + root: new top.Ext.tree.AsyncTreeNode({ + text: '' + }) + }); /** * 待清洗物品列表 */ pendingWashAndDisinfectColumnTree = new top.Ext.tree.ColumnTree({ - rootVisible : false, - autoScroll : true, - containerScroll : false, - title:'待清洗篮筐', - width:260, - height : 575, - frame : false, - bodyStyle : 'border:1px solid #afd7af', - columns : [{ - header : '条码', - width : 105, - dataIndex : 'objBarcode', - renderer : function(v,p,record){ - if(!enableIdCardBasketBinding){ - return record.objBarcode; - } - var IDcardBarcode = record.IDcardBarcode; - if ( !isUndefinedOrNullOrEmpty(IDcardBarcode) ) { - return IDcardBarcode; - } - return record.objBarcode; - } - },{ - header : '数量', - width : 50, - dataIndex : 'objAmount' - },{ - header : '载入', - width : 50, - dataIndex : 'type', - renderer : function(v,p,record){ - var str = "\"\""; - if (record.type == 'BASKET') { - return str; - } - return ''; - } - } - ,{ - header : '名称', - width : 150, - dataIndex : 'objName' - },{ - header : '回收科室', - width : 100, - dataIndex : 'recyclingDept', - hidden : mergeSameDefinitionItemInClassifyBasket - },{ - header : '回收时间', - width : 120, - dataIndex : 'recyclingTime', - hidden : mergeSameDefinitionItemInClassifyBasket - }], - loader : new top.Ext.tree.TreeLoader({ - url : WWWROOT + '/disinfectSystem/washAndDisinfect/washAndDisinfectRecordAction!getPendingWashAndDisinfectTousseAndBasket.do?', - uiProviders:{ - 'col': top.Ext.tree.ColumnNodeUI - }, - listeners:{ - load:function(treeLoader, node, response){ - Ext.Ajax.request({ - url : WWWROOT + '/system/timeoutAction!getTimeoutSetting.do', - params : {procedure : 'recycleToWash'}, - success : function(response, options) { - var result = Ext.decode(response.responseText); - if(result.success && result.showMessageBox){ - var timeoutCount = 0; - for(var i = 0; i < node.childNodes.length;++i){ - var cNode = node.childNodes[i]; - if(cNode.attributes.isTimeout){ - timeoutCount++; - //cNode.addClass('itemTimeout'); -// cNode.addListener('mouseover',function(){ -// alert('mouseover'); -// }) - } - } - if(timeoutCount > 0){ - showResult('有'+timeoutCount+'个超时未清洗的篮筐,请及时处理红色标注的篮筐'); - } - } - } - }); - } - } - }), - root: new top.Ext.tree.AsyncTreeNode({ - text:'待清洗物品列表' - }) - }); -// pendingWashAndDisinfectColumnTree.loader.load(pendingWashAndDisinfectColumnTree.root,function(){}); - + rootVisible: false, + autoScroll: true, + containerScroll: false, + title: '待清洗篮筐', + width: 260, + height: 575, + frame: false, + bodyStyle: 'border:1px solid #afd7af', + columns: [{ + header: '条码', + width: 105, + dataIndex: 'objBarcode', + renderer: function (v, p, record) { + if (!enableIdCardBasketBinding) { + return record.objBarcode; + } + var IDcardBarcode = record.IDcardBarcode; + if (!isUndefinedOrNullOrEmpty(IDcardBarcode)) { + return IDcardBarcode; + } + return record.objBarcode; + } + }, { + header: '数量', + width: 50, + dataIndex: 'objAmount' + }, { + header: '载入', + width: 50, + dataIndex: 'type', + renderer: function (v, p, record) { + var str = "\"\""; + if (record.type == 'BASKET') { + return str; + } + return ''; + } + } + , { + header: '名称', + width: 150, + dataIndex: 'objName' + }, { + header: '回收科室', + width: 100, + dataIndex: 'recyclingDept', + hidden: mergeSameDefinitionItemInClassifyBasket + }, { + header: '回收时间', + width: 120, + dataIndex: 'recyclingTime', + hidden: mergeSameDefinitionItemInClassifyBasket + }], + loader: new top.Ext.tree.TreeLoader({ + url: WWWROOT + '/disinfectSystem/washAndDisinfect/washAndDisinfectRecordAction!getPendingWashAndDisinfectTousseAndBasket.do?', + uiProviders: { + 'col': top.Ext.tree.ColumnNodeUI + }, + listeners: { + load: function (treeLoader, node, response) { + Ext.Ajax.request({ + url: WWWROOT + '/system/timeoutAction!getTimeoutSetting.do', + params: { procedure: 'recycleToWash' }, + success: function (response, options) { + var result = Ext.decode(response.responseText); + if (result.success && result.showMessageBox) { + var timeoutCount = 0; + for (var i = 0; i < node.childNodes.length; ++i) { + var cNode = node.childNodes[i]; + if (cNode.attributes.isTimeout) { + timeoutCount++; + //cNode.addClass('itemTimeout'); + // cNode.addListener('mouseover',function(){ + // alert('mouseover'); + // }) + } + } + if (timeoutCount > 0) { + showResult('有' + timeoutCount + '个超时未清洗的篮筐,请及时处理红色标注的篮筐'); + } + } + } + }); + } + } + }), + root: new top.Ext.tree.AsyncTreeNode({ + text: '待清洗物品列表' + }) + }); + // pendingWashAndDisinfectColumnTree.loader.load(pendingWashAndDisinfectColumnTree.root,function(){}); + formObj = new top.Ext.FormPanel({ - id : 'washForm', - frame : true, - border : 0, - labelSeparator : ':', - bodyStyle : 'padding:5px 5px 0px 5px', - labelAlign:'right', - autoWidth : true, - autoScroll : true, - items : [{ - layout : 'column', - items : [{ - columnWidth : 0.73, - layout : 'column', - items : [{ - xtype : "fieldset", - title : '基础数据', - layout:'column', - width:710, - height:(!!window.ActiveXObject || "ActiveXObject" in window || window.navigator.userAgent.indexOf("MSIE") >= 1)?185:210, - columnWidth : 1, -// autoHeight : true, - labelWidth : 95, - items : [{ - layout : 'column', - items : [{ - xtype : 'hidden', - name : 'classifyBasketIds', - id : 'classifyBasketIds' - },{ - xtype : 'hidden', - name : 'classifyBasketInfo', - id : 'classifyBasketInfo' - },{ - xtype : 'hidden', - name : 'materialData', - id : 'materialData' - },{ - xtype : 'hidden', - name : 'id', - id : 'id' - },{ - xtype : 'hidden', - name : 'conCurrent', - id : 'conCurrent' - },{ - xtype : 'hidden', - name : 'orgWashStartTime', - id : 'orgWashStartTime' - },{ - xtype : 'hidden', - name : 'orgWashEndTime', - id : 'orgWashEndTime' - },{ - id:'washLoadResult', - xtype:'hidden', - value:"0" - },{ - id : 'serialNum', - columnWidth : 0.5, - layout : 'form', - hidden:true, - items : [{ - xtype : 'textfield', - fieldLabel : "流水号", - name : "serialNumber", - readOnly : true, - id : "serialNumber", - anchor : '99%', - cls:'fieldReadOnlyNoRemove' + id: 'washForm', + frame: true, + border: 0, + labelSeparator: ':', + bodyStyle: 'padding:5px 5px 0px 5px', + labelAlign: 'right', + autoWidth: true, + autoScroll: true, + items: [{ + layout: 'column', + items: [{ + columnWidth: 0.73, + layout: 'column', + items: [{ + xtype: "fieldset", + title: '基础数据', + layout: 'column', + width: 710, + height: (!!window.ActiveXObject || "ActiveXObject" in window || window.navigator.userAgent.indexOf("MSIE") >= 1) ? 185 : 210, + columnWidth: 1, + // autoHeight : true, + labelWidth: 95, + items: [{ + layout: 'column', + items: [{ + xtype: 'hidden', + name: 'classifyBasketIds', + id: 'classifyBasketIds' + }, { + xtype: 'hidden', + name: 'classifyBasketInfo', + id: 'classifyBasketInfo' + }, { + xtype: 'hidden', + name: 'materialData', + id: 'materialData' + }, { + xtype: 'hidden', + name: 'id', + id: 'id' + }, { + xtype: 'hidden', + name: 'conCurrent', + id: 'conCurrent' + }, { + xtype: 'hidden', + name: 'orgWashStartTime', + id: 'orgWashStartTime' + }, { + xtype: 'hidden', + name: 'orgWashEndTime', + id: 'orgWashEndTime' + }, { + id: 'washLoadResult', + xtype: 'hidden', + value: "0" + }, { + id: 'serialNum', + columnWidth: 0.5, + layout: 'form', + hidden: true, + items: [{ + xtype: 'textfield', + fieldLabel: "流水号", + name: "serialNumber", + readOnly: true, + id: "serialNumber", + anchor: '99%', + cls: 'fieldReadOnlyNoRemove' }] - },{ - columnWidth : 0.5, - layout : 'form', - items : [{ - xtype : 'textfield', - fieldLabel : "操作员", - name : "operator", - readOnly : true, - id : "operator", - anchor : '99%', - cls:'fieldReadOnlyNoRemove' + }, { + columnWidth: 0.5, + layout: 'form', + items: [{ + xtype: 'textfield', + fieldLabel: "操作员", + name: "operator", + readOnly: true, + id: "operator", + anchor: '99%', + cls: 'fieldReadOnlyNoRemove' }] }, { - columnWidth : 0.5, - layout : 'form', - items : [{ - xtype : 'textfield', - fieldLabel : "责任人", - name : "personInCharge", - readOnly : true, - id : "personInCharge", - anchor : '99%', - cls:'fieldReadOnlyNoRemove', - listeners : { - focus: function(){ - //获取焦点 - pitchOn = false; //修改时点击责任人获取焦点才能修改清洗责任人 - } + columnWidth: 0.5, + layout: 'form', + items: [{ + xtype: 'textfield', + fieldLabel: "责任人", + name: "personInCharge", + readOnly: true, + id: "personInCharge", + anchor: '99%', + cls: 'fieldReadOnlyNoRemove', + listeners: { + focus: function () { + //获取焦点 + pitchOn = false; //修改时点击责任人获取焦点才能修改清洗责任人 + } } }] - },{ - xtype : 'hidden', - name : 'personInChargeCode', - id : 'personInChargeCode' }, { - columnWidth : 0.5, - layout : 'form', - hidden : !((sstsConfig.hasOwnProperty('haveRinserPosition')) && sstsConfig.haveRinserPosition), - items : [{ - xtype : 'textfield', - fieldLabel : "位置", - name : "position", - readOnly : true, - id : "position", - anchor : '99%', - cls:'fieldReadOnlyNoRemove' + xtype: 'hidden', + name: 'personInChargeCode', + id: 'personInChargeCode' + }, { + columnWidth: 0.5, + layout: 'form', + hidden: !((sstsConfig.hasOwnProperty('haveRinserPosition')) && sstsConfig.haveRinserPosition), + items: [{ + xtype: 'textfield', + fieldLabel: "位置", + name: "position", + readOnly: true, + id: "position", + anchor: '99%', + cls: 'fieldReadOnlyNoRemove' }] - },{ - columnWidth : .5, - layout : 'form', - hidden : true, - items : [{ - xtype : 'combo', - fieldLabel : '清洗方式', - valueField : 'typeName', - displayField : 'typeName', - id : 'washingMode', - name : 'washingMode', - mode : 'local', - triggerAction : 'all', - forceSelection : true, - editable : false, - store : washingModeStore, - anchor : '99%', - listeners : { - select : function(combo,record,index ){ - if(combo.getValue()==washMachine){ + }, { + columnWidth: .5, + layout: 'form', + hidden: true, + items: [{ + xtype: 'combo', + fieldLabel: '清洗方式', + valueField: 'typeName', + displayField: 'typeName', + id: 'washingMode', + name: 'washingMode', + mode: 'local', + triggerAction: 'all', + forceSelection: true, + editable: false, + store: washingModeStore, + anchor: '99%', + listeners: { + select: function (combo, record, index) { + if (combo.getValue() == washMachine) { setFieldsHide(false); - }else{ + } else { setFieldsHide(true); } } } }] - },{ - id : "inputTextField", - columnWidth : .5, - layout : 'form', - items : [{ - xtype : 'textfield', - fieldLabel : "扫描条码", - allowBlank : true, - blankText : '请输入!', - name : "inputText", - id : "inputText", - anchor : '99%', - listeners : { - specialkey : function(field, ee) { + }, { + id: "inputTextField", + columnWidth: .5, + layout: 'form', + items: [{ + xtype: 'textfield', + fieldLabel: "扫描条码", + allowBlank: true, + blankText: '请输入!', + name: "inputText", + id: "inputText", + anchor: '99%', + listeners: { + specialkey: function (field, ee) { if (ee.getKey() == Ext.EventObject.ENTER) { var barcode = top.Ext.getCmp('inputText').getValue(); barcode = barcode.Trim(); - if(barcode!=null && barcode != ""){ - BarcodeTableManager.getBarcodeTypeByBarcode(barcode,function(jsonStr){ + if (barcode != null && barcode != "") { + BarcodeTableManager.getBarcodeTypeByBarcode(barcode, function (jsonStr) { var result = Ext.util.JSON.decode(jsonStr); var isRetrospectTousse = false; //是否是追溯的器械包 //逻辑反了,应该理解为:是否是不追溯的器械包。false代表要追溯,true代表不追溯 - if(result !=null && result !=""){ - if(result.returnType == 'container'){ - if(result.isCurUserDepart != null && result.isCurUserDepart == true){ - addPendingWashAndDisinfectBasketToRecord(barcode,result.idCardBarcode); - }else{ + if (result != null && result != "") { + if (result.returnType == 'container') { + if (result.isCurUserDepart != null && result.isCurUserDepart == true) { + addPendingWashAndDisinfectBasketToRecord(barcode, result.idCardBarcode); + } else { showResult('请扫描本科室的篮筐!'); } - }else if(result.returnType == 'rinser'){ + } else if (result.returnType == 'rinser') { loadWashMachineByBarcode(barcode); - }else if(result.returnType == 'cleanmethod'){ + } else if (result.returnType == 'cleanmethod') { loadWashProgramByBarcode(barcode); - }else if(result.returnType == 'user'){ + } else if (result.returnType == 'user') { loadUserByBarcode(barcode); - }else if(result.returnType == 'position'){ + } else if (result.returnType == 'position') { loadPositionByBarcode(barcode); - }else if(result.returnType == 'tousseInstance'){ //扫描的是标识牌或者是固定条码 - if(result.isIdcardInstance){ + } else if (result.returnType == 'tousseInstance') { //扫描的是标识牌或者是固定条码 + if (result.isIdcardInstance) { var containerBarcode = result.bindingContianer - if( !isUndefinedOrNullOrEmpty(containerBarcode) ){ + if (!isUndefinedOrNullOrEmpty(containerBarcode)) { // 标识牌带出篮筐条码 - addPendingWashAndDisinfectBasketToRecord(containerBarcode,barcode,isRetrospectTousse); - }else{ + addPendingWashAndDisinfectBasketToRecord(containerBarcode, barcode, isRetrospectTousse); + } else { showResult("找不到该条码所对应的信息!"); } - }else{ + } else { //判断config是否启用清洗不追溯的器械包 - if(sstsConfig.endbleScanTousseFixationBarcode){ + if (sstsConfig.endbleScanTousseFixationBarcode) { // 不追溯的器械包 - isRetrospectTousse = true ; - addPendingWashAndDisinfectBasketToRecord(barcode,null,isRetrospectTousse); - }else{ + isRetrospectTousse = true; + addPendingWashAndDisinfectBasketToRecord(barcode, null, isRetrospectTousse); + } else { showResult("找不到该条码所对应的信息!"); } } - }else{ + } else { showResult(result.message); } - }else{ + } else { showResult('找不到该条码所对应的信息!'); } top.Ext.getCmp('inputText').setValue(''); }); - }else{ + } else { showResult('请扫描条码!'); } - - + + } - + } } }] - },{ - id : 'disinfectIdentificationField', - columnWidth : .5, - layout : 'form', - items : [{ - xtype : 'combo', - fieldLabel : '清洗机名称', - valueField : 'rinserName', - displayField : 'rinserName', - id : 'disinfectIdentification', - name : 'disinfectIdentification', - mode : 'remote', - triggerAction : 'all', - forceSelection : true, - editable : false, - allowBlank : false, - store : rinserStore, - listeners : { - select : function(thiz,record,index){ + }, { + id: 'disinfectIdentificationField', + columnWidth: .5, + layout: 'form', + items: [{ + xtype: 'combo', + fieldLabel: '清洗机名称', + valueField: 'rinserName', + displayField: 'rinserName', + id: 'disinfectIdentification', + name: 'disinfectIdentification', + mode: 'remote', + triggerAction: 'all', + forceSelection: true, + editable: false, + allowBlank: false, + store: rinserStore, + listeners: { + select: function (thiz, record, index) { /*var index = thiz.value.indexOf('手工'); if(index==-1){ index = thiz.value.indexOf('人工'); @@ -1062,408 +1063,405 @@ //默认结束时间为20分钟 setEndDateAddCleanMinutes(20); }else{*/ - top.Ext.getCmp('conCurrent').setValue(record.data.conCurrent); - setFieldsHide(false); - washMachineReloadData(washingMachineStore,record.data.cleanMethodDataList); - DWREngine.setAsync(false); - var value = top.Ext.getCmp('disinfectIdentification').getValue(); - WashAndDisinfectRecordTableManager.getNextCycleCounter(value,function(result){ - if(result == 0) - { - top.Ext.getCmp('cycleCounter').setValue(1); - }else - { - top.Ext.getCmp('cycleCounter').setValue(result); - } - }); - // 判断要不要显示循环次数输入框 - WashAndDisinfectRecordTableManager.isDefineDeviceInterface(value,function(result){ - if( result == false) - { - top.Ext.getCmp('cycleCounterId').hide(); - }else{ - top.Ext.getCmp('cycleCounterId').show(); - } - }); - // 获取默认清洗程序信息,包括清洗程序的时间,清洗程序参数等 - WashAndDisinfectRecordTableManager.getDefaultWashMethodMsg(value,function(responseText){ - var result = top.Ext.decode(responseText); - if(result.success){ - // 清洗程序名称 - top.Ext.getCmp('disinfectProgram').setValue(result.disinfectProgram); - // 清洗时间,单位为分钟 - setEndDateAddCleanMinutes(result.cleanMinutes); - // 清洗参数 - top.Ext.getCmp('cleanParameter').setValue(result.cleanParameter); - } - }); - DWREngine.setAsync(true); -// } + top.Ext.getCmp('conCurrent').setValue(record.data.conCurrent); + setFieldsHide(false); + washMachineReloadData(washingMachineStore, record.data.cleanMethodDataList); + DWREngine.setAsync(false); + var value = top.Ext.getCmp('disinfectIdentification').getValue(); + WashAndDisinfectRecordTableManager.getNextCycleCounter(value, function (result) { + if (result == 0) { + top.Ext.getCmp('cycleCounter').setValue(1); + } else { + top.Ext.getCmp('cycleCounter').setValue(result); + } + }); + // 判断要不要显示循环次数输入框 + WashAndDisinfectRecordTableManager.isDefineDeviceInterface(value, function (result) { + if (result == false) { + top.Ext.getCmp('cycleCounterId').hide(); + } else { + top.Ext.getCmp('cycleCounterId').show(); + } + }); + // 获取默认清洗程序信息,包括清洗程序的时间,清洗程序参数等 + WashAndDisinfectRecordTableManager.getDefaultWashMethodMsg(value, function (responseText) { + var result = top.Ext.decode(responseText); + if (result.success) { + // 清洗程序名称 + top.Ext.getCmp('disinfectProgram').setValue(result.disinfectProgram); + // 清洗时间,单位为分钟 + setEndDateAddCleanMinutes(result.cleanMinutes); + // 清洗参数 + top.Ext.getCmp('cleanParameter').setValue(result.cleanParameter); + } + }); + DWREngine.setAsync(true); + // } } }, - anchor : '99%' + anchor: '99%' }] - }, -// { -// id : 'programInputTextField', -// columnWidth : .5, -// layout : 'form', -// items : [{ -// xtype : 'textfield', -// fieldLabel : "清洗程序条码", -// allowBlank : true, -// blankText : '请输入!', -// name : "programInputText", -// id : "programInputText", -// anchor : '99%', -// listeners : { -// specialkey : function(field, ee) { -// if (ee.getKey() == Ext.EventObject.ENTER) { -// var barcode = top.Ext.getCmp('programInputText').getValue(); -// var setComBoVal = ''; -// var cleanMinutes = 0; -// if(barcode!=''){ -// var count = washingMachineStore.getCount(); -// for(var i=0;i 0){ -// top.Ext.getCmp('cleanParameter').setValue(result); -// } -// }); -// } -// } -// } - // -// } -// }] -// }, + }, + // { + // id : 'programInputTextField', + // columnWidth : .5, + // layout : 'form', + // items : [{ + // xtype : 'textfield', + // fieldLabel : "清洗程序条码", + // allowBlank : true, + // blankText : '请输入!', + // name : "programInputText", + // id : "programInputText", + // anchor : '99%', + // listeners : { + // specialkey : function(field, ee) { + // if (ee.getKey() == Ext.EventObject.ENTER) { + // var barcode = top.Ext.getCmp('programInputText').getValue(); + // var setComBoVal = ''; + // var cleanMinutes = 0; + // if(barcode!=''){ + // var count = washingMachineStore.getCount(); + // for(var i=0;i 0){ + // top.Ext.getCmp('cleanParameter').setValue(result); + // } + // }); + // } + // } + // } + // + // } + // }] + // }, { - columnWidth : .5, - layout : 'form', - items : [{ - xtype : 'datefieldWithMin', - fieldLabel : '开始时间', - id : 'startDateStr', - name : 'startDateStr', - editable:false, - altFormats:'Y-m-d|Y-n-j|y-n-j|y-m-j|y-m-d|y-n-d|Y-n-d|Y-m-j|Ymd|Ynj|ynj|ymj|ymd|ynd|Ynd|Ymj|Y/m/d|Y/n/j|y/n/j|y/m/j|y/m/d|y/n/d|Y/n/d|Y/m/j', - format:'Y-m-d H:i:s', - allowBlank : false, - anchor : '99%', - listeners:{ - change:function(thiz,newValue,oldValue){ - var newStr = Ext.util.Format.date(newValue, 'Y-m-d H:i'); + columnWidth: .5, + layout: 'form', + items: [{ + xtype: 'datefieldWithMin', + fieldLabel: '开始时间', + id: 'startDateStr', + name: 'startDateStr', + editable: false, + altFormats: 'Y-m-d|Y-n-j|y-n-j|y-m-j|y-m-d|y-n-d|Y-n-d|Y-m-j|Ymd|Ynj|ynj|ymj|ymd|ynd|Ynd|Ymj|Y/m/d|Y/n/j|y/n/j|y/m/j|y/m/d|y/n/d|Y/n/d|Y/m/j', + format: 'Y-m-d H:i:s', + allowBlank: false, + anchor: '99%', + listeners: { + change: function (thiz, newValue, oldValue) { + var newStr = Ext.util.Format.date(newValue, 'Y-m-d H:i'); var oldStr = Ext.util.Format.date(oldValue, 'Y-m-d H:i'); buildLogInfo("PC修改清洗时间,将开始时间" + oldStr + "改为" + newStr); }, - select:function(){ + select: function () { clearInterval(endDateTimerHandle); } } }] - } ,{ - id : 'disinfectProgramField', - columnWidth : .5, - layout : 'form', - items : [{ - width : 150, - xtype : 'combo', - fieldLabel : '清洗程序', - valueField : 'barcode', - displayField : 'cleanMethod', - id : 'disinfectProgram', - name : 'disinfectProgram', - mode : 'local', - triggerAction : 'all', - forceSelection : true, - editable : false, - allowBlank : false, - store : washingMachineStore, - listeners : { - select : function (thiz,record,index){ + }, { + id: 'disinfectProgramField', + columnWidth: .5, + layout: 'form', + items: [{ + width: 150, + xtype: 'combo', + fieldLabel: '清洗程序', + valueField: 'barcode', + displayField: 'cleanMethod', + id: 'disinfectProgram', + name: 'disinfectProgram', + mode: 'local', + triggerAction: 'all', + forceSelection: true, + editable: false, + allowBlank: false, + store: washingMachineStore, + listeners: { + select: function (thiz, record, index) { setEndDateAddCleanMinutes(record.data.cleanMinutes); //加载清洗参数 var value = top.Ext.getCmp('disinfectProgram').getRawValue(); - WashAndDisinfectRecordTableManager.getCleanParameter(value,function(result){ - if(result != null && result.length > 0){ + WashAndDisinfectRecordTableManager.getCleanParameter(value, function (result) { + if (result != null && result.length > 0) { top.Ext.getCmp('cleanParameter').setValue(result); } }); - + } }, - anchor : '99%' + anchor: '99%' }] }, { - columnWidth : .5, - layout : 'form', - items : [{ - xtype : 'datefieldWithMin', - fieldLabel : '结束时间', - id : 'endDateStr', - name : 'endDateStr', - editable:false, - altFormats:'Y-m-d|Y-n-j|y-n-j|y-m-j|y-m-d|y-n-d|Y-n-d|Y-m-j|Ymd|Ynj|ynj|ymj|ymd|ynd|Ynd|Ymj|Y/m/d|Y/n/j|y/n/j|y/m/j|y/m/d|y/n/d|Y/n/d|Y/m/j', - format:'Y-m-d H:i:s', - allowBlank : true, - anchor : '99%', - listeners:{ - change:function(thiz,newValue,oldValue){ - var newStr = Ext.util.Format.date(newValue, 'Y-m-d H:i'); + columnWidth: .5, + layout: 'form', + items: [{ + xtype: 'datefieldWithMin', + fieldLabel: '结束时间', + id: 'endDateStr', + name: 'endDateStr', + editable: false, + altFormats: 'Y-m-d|Y-n-j|y-n-j|y-m-j|y-m-d|y-n-d|Y-n-d|Y-m-j|Ymd|Ynj|ynj|ymj|ymd|ynd|Ynd|Ymj|Y/m/d|Y/n/j|y/n/j|y/m/j|y/m/d|y/n/d|Y/n/d|Y/m/j', + format: 'Y-m-d H:i:s', + allowBlank: true, + anchor: '99%', + listeners: { + change: function (thiz, newValue, oldValue) { + var newStr = Ext.util.Format.date(newValue, 'Y-m-d H:i'); var oldStr = Ext.util.Format.date(oldValue, 'Y-m-d H:i'); buildLogInfo("PC修改清洗时间,将开始时间" + oldStr + "改为" + newStr); } } }] - },{ - id : "cycleCounterId", - columnWidth : .33, - layout : 'form', - cls:'edit-5char-labelwidth', - items : [{ - xtype : 'numberfield', - fieldLabel : "循环次数", - name : "cycleCounter", - id : "cycleCounter", - allowBlank : false, - readOnly : false, - anchor : '100%', - maxValue:1000000, - allowDecimals : false, - allowNegative : false, - cls:'edit-5char-labelwidth' + }, { + id: "cycleCounterId", + columnWidth: .33, + layout: 'form', + cls: 'edit-5char-labelwidth', + items: [{ + xtype: 'numberfield', + fieldLabel: "循环次数", + name: "cycleCounter", + id: "cycleCounter", + allowBlank: false, + readOnly: false, + anchor: '100%', + maxValue: 1000000, + allowDecimals: false, + allowNegative: false, + cls: 'edit-5char-labelwidth' }] - },{ - columnWidth : 1, - layout : 'form', - items : [{ - xtype : 'textarea', - fieldLabel : "清洗程序参数", - name : "cleanParameter", - id : "cleanParameter", - readOnly:true, - anchor : '99%' + }, { + columnWidth: 1, + layout: 'form', + items: [{ + xtype: 'textarea', + fieldLabel: "清洗程序参数", + name: "cleanParameter", + id: "cleanParameter", + readOnly: true, + anchor: '99%' }] }] }] - },{ - columnWidth : .58, - layout : 'fit', - items : basketTreePanel - },{ - columnWidth : .42, - layout : 'fit', - items : new top.Ext.grid.EditorGridPanel({ - id : 'washAndDisinfectMaterialGrid', - title : '清洗器械', - bodyStyle : 'border:1px solid #afd7af', - store : materialStore, - cm : materialCm, - width : 160, - height : 380, - autoExpandColumn : 'deleteItem', - frame : false, - selModel : new top.Ext.grid.RowSelectionModel({ - singleSelect : false - }), - tbar : [{ - text : '器械材料:' - },{ - xtype : 'combo', - id : 'materialName', - name : 'materialName', - queryParam : 'spell', - minChars : 0, - valueField : 'id', - displayField : 'name', - store : materialDefinitionStore, - pageSize : 100, - listWidth : 300, - forceSelection : true, - lazyInit : false, - triggerAction : 'all', - hideTrigger : true, - typeAhead : false, - allowBlank : true, - width : 100, - listeners : { - select : function(combo, record, index) { -// combo.setValue(record.data.name); - }, - specialkey : function(field, ee) { - if (ee.getKey() == Ext.EventObject.ENTER) { - top.Ext.getCmp('materialAmount').focus(); - } - } + }, { + columnWidth: .58, + layout: 'fit', + items: basketTreePanel + }, { + columnWidth: .42, + layout: 'fit', + items: new top.Ext.grid.EditorGridPanel({ + id: 'washAndDisinfectMaterialGrid', + title: '清洗器械', + bodyStyle: 'border:1px solid #afd7af', + store: materialStore, + cm: materialCm, + width: 160, + height: 380, + autoExpandColumn: 'deleteItem', + frame: false, + selModel: new top.Ext.grid.RowSelectionModel({ + singleSelect: false + }), + tbar: [{ + text: '器械材料:' + }, { + xtype: 'combo', + id: 'materialName', + name: 'materialName', + queryParam: 'spell', + minChars: 0, + valueField: 'id', + displayField: 'name', + store: materialDefinitionStore, + pageSize: 100, + listWidth: 300, + forceSelection: true, + lazyInit: false, + triggerAction: 'all', + hideTrigger: true, + typeAhead: false, + allowBlank: true, + width: 100, + listeners: { + select: function (combo, record, index) { + // combo.setValue(record.data.name); + }, + specialkey: function (field, ee) { + if (ee.getKey() == Ext.EventObject.ENTER) { + top.Ext.getCmp('materialAmount').focus(); + } + } - } - },{ - text : '数量:' - },{ - xtype : 'numberfield', - maxLength : '16', - id : 'materialAmount', - name : 'materialAmount', - width : 50, - style : 'text-align: left', - allowDecimals : false, - allowNegative : false, - listeners : { - specialkey : function(field, e) { - if (e.getKey() == Ext.EventObject.ENTER) { - addMaterial(); - } - } - } - },{ - id : 'addMaterialId', - iconCls : 'btn_ext_add', - handler : function() { - addMaterial(); - } - }] - }) + } + }, { + text: '数量:' + }, { + xtype: 'numberfield', + maxLength: '16', + id: 'materialAmount', + name: 'materialAmount', + width: 50, + style: 'text-align: left', + allowDecimals: false, + allowNegative: false, + listeners: { + specialkey: function (field, e) { + if (e.getKey() == Ext.EventObject.ENTER) { + addMaterial(); + } + } + } + }, { + id: 'addMaterialId', + iconCls: 'btn_ext_add', + handler: function () { + addMaterial(); + } + }] + }) + }] + }, { + columnWidth: 0.27, + layout: 'column', + items: [{ + columnWidth: 1, + layout: 'fit', + items: [{ + layout: 'form', + columnWidth: 1, + items: [pendingWashAndDisinfectColumnTree] }] - },{ - columnWidth : 0.27, - layout : 'column', - items : [{ - columnWidth : 1, - layout : 'fit', - items : [{ - layout : 'form', - columnWidth : 1, - items : [pendingWashAndDisinfectColumnTree] - }] }] }] }], - buttons : [{ - id : 'saveBtn', - text : '保存', - hidden:(isWashAgain ? true : false), - handler : function(){ + buttons: [{ + id: 'saveBtn', + text: '保存', + hidden: (isWashAgain ? true : false), + handler: function () { var root = top.Ext.getCmp('basketTreePanel').getRootNode(); var that = this; - if(materialStore.getCount() == 0 && root.childNodes.length == 0){ - top.Ext.MessageBox.confirm("请确认", "没有添加清洗的物品,继续清洗吗?",function (button, text) { + if (materialStore.getCount() == 0 && root.childNodes.length == 0) { + top.Ext.MessageBox.confirm("请确认", "没有添加清洗的物品,继续清洗吗?", function (button, text) { if ("yes" == button) { that.disable(); var success = save(); - if(!success){ + if (!success) { that.enable(); } } else { return false; } }); - }else { + } else { that.disable(); var success = save(); - if(!success){ + if (!success) { that.enable(); } } } - },{ - id:'washAgainBtn', - text : '重新清洗', - hidden:(isWashAgain ? false : true), - handler : function(){ + }, { + id: 'washAgainBtn', + text: '重新清洗', + hidden: (isWashAgain ? false : true), + handler: function () { var root = top.Ext.getCmp('basketTreePanel').getRootNode(); var that = this; - if(materialStore.getCount() == 0 && root.childNodes.length == 0){ - top.Ext.MessageBox.confirm("请确认", "没有添加清洗的物品,继续清洗吗?",function (button, text) { + if (materialStore.getCount() == 0 && root.childNodes.length == 0) { + top.Ext.MessageBox.confirm("请确认", "没有添加清洗的物品,继续清洗吗?", function (button, text) { if ("yes" == button) { that.disable(); top.Ext.getCmp("id").setValue(""); var success = save(); - if(!success){ + if (!success) { that.enable(); } } else { return false; } }); - }else { + } else { that.disable(); top.Ext.getCmp("id").setValue(""); var success = save(); - if(!success){ + if (!success) { that.enable(); } } } }, { - text : '取消', - id : 'saveAndNewBtn', - handler : cancel + text: '取消', + id: 'saveAndNewBtn', + handler: cancel }] }); washAndDisinfectRecordWin = new top.Ext.Window({ - id : 'washAndDisinfectRecordWin', - layout : 'fit', - title : '清洗消毒记录', - modal : true, - border:false, - width : 1000, - height : top.screen.height > 800 ? 660 : 500, + id: 'washAndDisinfectRecordWin', + layout: 'fit', + title: '清洗消毒记录', + modal: true, + border: false, + width: 1000, + height: top.screen.height > 800 ? 660 : 500, // height : 660, - plain : true, - items : [ formObj ] + plain: true, + items: [formObj] }); washAndDisinfectRecordWin.show(); - washAndDisinfectRecordWin.on('close', function() { //关闭窗口就清除定时器 + washAndDisinfectRecordWin.on('close', function () { //关闭窗口就清除定时器 clearInterval(startDateTimerHandle); clearInterval(endDateTimerHandle); }); top.Ext.getCmp('washLoadResult').setValue("0"); formObj.form.load({ - url : WWWROOT + '/disinfectSystem/washAndDisinfect/washAndDisinfectRecordAction!loadWashAndDisinfectRecord.do', - method : 'GET', - waitMsg : '正在加载数据,请稍候', - success : function(form, action) { + url: WWWROOT + '/disinfectSystem/washAndDisinfect/washAndDisinfectRecordAction!loadWashAndDisinfectRecord.do', + method: 'GET', + waitMsg: '正在加载数据,请稍候', + success: function (form, action) { //流水号初始化 - if(id == 0){ + if (id == 0) { startDateTimerHandle = synchronizationSetDateField(top.Ext, 'yyyy/MM/dd HH:mm:ss', 'startDateStr', null, 1000); //(设置开始时间,取服务器时间,并且每秒刷新一下。cjr) top.Ext.getCmp('inputText').focus(true); // 默认不显示循环次数输入框 top.Ext.getCmp('cycleCounterId').hide(); - }else{ + } else { top.Ext.getCmp("serialNum").show(); /*if(top.Ext.getCmp("washingMode").getValue()!=washMachine){ setFieldsHide(true); }*/ - if(action.result.data.endDateStr && !isWashAgain){ - var endTimeStr = new Date(action.result.data.endDateStr.replace(/-/g,'/')).getTime(); + if (action.result.data.endDateStr && !isWashAgain) { + var endTimeStr = new Date(action.result.data.endDateStr.replace(/-/g, '/')).getTime(); var nowTimeStr = new Date().getTime(); - if(endTimeStr < nowTimeStr){ + if (endTimeStr < nowTimeStr) { top.Ext.getCmp('disinfectIdentification').disable(); top.Ext.getCmp('startDateStr').disable(); top.Ext.getCmp('disinfectProgram').disable(); @@ -1482,89 +1480,86 @@ top.Ext.getCmp('orgWashEndTime').setValue(top.Ext.getCmp('endDateStr').getRawValue()); //当前清洗机名称 var rinserName = action.result.data.disinfectIdentification; - if(rinserName == "人工清洗"){ + if (rinserName == "人工清洗") { setFieldsHide(true); } // 判断要不要显示循环次数输入框 - WashAndDisinfectRecordTableManager.isDefineDeviceInterface(rinserName,function(result){ - if( result == false) - { + WashAndDisinfectRecordTableManager.isDefineDeviceInterface(rinserName, function (result) { + if (result == false) { top.Ext.getCmp('cycleCounterId').hide(); } }); - for(var i=0;i 0){ + WashAndDisinfectRecordTableManager.getCleanParameter(value, function (result) { + if (result != null && result.length > 0) { top.Ext.getCmp('cleanParameter').setValue(result); } }); top.Ext.getCmp('washLoadResult').setValue("1"); }, - failure : function(form, action) { + failure: function (form, action) { top.Ext.getCmp('washLoadResult').setValue("-1"); showResult("加载失败,请联系管理员!"); }, - params : { - id : id + params: { + id: id } }); - - if(id != 0){ - isAddorAlter = false ; //修改时为flase; - pitchOn = true; + + if (id != 0) { + isAddorAlter = false; //修改时为flase; + pitchOn = true; var oldPerson = null; //清空后台传过来的清洗责任人 var oldPersonCode = null; //清空后台传过来的清洗责任人登录名 loadDisinfectedMaterial(id); - }else{ - pitchOn = true; - isAddorAlter = true ; + } else { + pitchOn = true; + isAddorAlter = true; var oldPerson = null; //清空后台传过来的清洗责任人 var oldPersonCode = null; //清空后台传过来的清洗责任人登录名 washingMachineStore.load(); } } -function addPendingWashAndDisinfectBasketToRecord(barcode,idCardBarcode,isRetrospectTousse){ - if(sstsConfig.hasOwnProperty('wrRecordScanPosition') && sstsConfig.wrRecordScanPosition){ - if((sstsConfig.hasOwnProperty('haveRinserPosition')) && sstsConfig.haveRinserPosition){ +function addPendingWashAndDisinfectBasketToRecord(barcode, idCardBarcode, isRetrospectTousse) { + if (sstsConfig.hasOwnProperty('wrRecordScanPosition') && sstsConfig.wrRecordScanPosition) { + if ((sstsConfig.hasOwnProperty('haveRinserPosition')) && sstsConfig.haveRinserPosition) { var position = top.Ext.getCmp('position').getValue(); - if(position == null || position == ''){ + if (position == null || position == '') { showResult("请先扫描位置"); return; } } } - loadMaterial(barcode,removePendingWashAndDisinfectGoods(barcode,idCardBarcode),idCardBarcode,isRetrospectTousse); + loadMaterial(barcode, removePendingWashAndDisinfectGoods(barcode, idCardBarcode), idCardBarcode, isRetrospectTousse); var type = "篮筐"; - if(isRetrospectTousse ){ + if (isRetrospectTousse) { //日志保存清洗的是不追溯的器械包 type = "器械包"; } @@ -1573,83 +1568,83 @@ } // callback //移除右边表格的数据(今天待审核的数据列表),barcode可能为单个器械包条码,也可能为两个条码中间用分号隔开 -function removePendingWashAndDisinfectGoods(barcode,idCardBarcode) { - pendingWashAndDisinfectColumnTree.getRootNode().eachChild(function(pNode){ +function removePendingWashAndDisinfectGoods(barcode, idCardBarcode) { + pendingWashAndDisinfectColumnTree.getRootNode().eachChild(function (pNode) { //移除某一个节点后,再遍历其他节点得到的是undefined if (pNode != null && pNode.attributes && pNode.attributes.objBarcode) { - if(barcode.indexOf(";") != -1){ - try{ + if (barcode.indexOf(";") != -1) { + try { var objBarcodeInt = parseInt(pNode.attributes.objBarcode); var barcodeArray = barcode.split(";"); - if(parseInt(barcodeArray[0]) <= objBarcodeInt && parseInt(barcodeArray[1]) >= objBarcodeInt){ + if (parseInt(barcodeArray[0]) <= objBarcodeInt && parseInt(barcodeArray[1]) >= objBarcodeInt) { pNode.remove(); } - }catch(e){ - + } catch (e) { + } - }else{ - if(pNode.attributes.objBarcode == barcode || pNode.attributes.objBarcode == idCardBarcode){ + } else { + if (pNode.attributes.objBarcode == barcode || pNode.attributes.objBarcode == idCardBarcode) { pNode.remove(); } } } }); } -function setEndDateAddCleanMinutes(cleanMinutes){ +function setEndDateAddCleanMinutes(cleanMinutes) { //设置结束时间cleanMinutes var startDateObj = top.Ext.getCmp('startDateStr'); - if(typeof(cleanMinutes)=='number'){ + if (typeof (cleanMinutes) == 'number') { var endDateObj = top.Ext.getCmp('endDateStr'); - if(cleanMinutes<1){ + if (cleanMinutes < 1) { endDateObj.setValue(); return; } var endDate = startDateObj.getValue(); - if(endDate==''){ + if (endDate == '') { endDate = new Date(); startDateObj.setValue(endDate); } - endDate.setMinutes(endDate.getMinutes()+cleanMinutes); + endDate.setMinutes(endDate.getMinutes() + cleanMinutes); endDateObj.setValue(endDate);//设置结束时间的当前开始时间为开始时间加上清洗时间 clearInterval(endDateTimerHandle); endDateTimerHandle = synchronizationSetDateField(top.Ext, 'yyyy/MM/dd HH:mm:ss', 'endDateStr', endDateObj.getValue(), 1000); //(让结束时间每秒刷新一下) } } -function washMachineReloadData(store,data){ - if(typeof(data)=='undefined')data='[]'; +function washMachineReloadData(store, data) { + if (typeof (data) == 'undefined') data = '[]'; var barcode = top.Ext.getCmp('disinfectProgram').getValue(); - if(barcode!=''){ - if(data.indexOf('"'+barcode+'"')==-1){ + if (barcode != '') { + if (data.indexOf('"' + barcode + '"') == -1) { top.Ext.getCmp('disinfectProgram').clearValue(); } } - store.loadData(Ext.util.JSON.decode(data),false); + store.loadData(Ext.util.JSON.decode(data), false); } -function setFieldsHide(hidden){ - if(true==hidden){ +function setFieldsHide(hidden) { + if (true == hidden) { top.Ext.getCmp("disinfectProgram").disable(); -// top.Ext.getCmp("programInputText").disable(); - }else{ + // top.Ext.getCmp("programInputText").disable(); + } else { top.Ext.getCmp("disinfectProgram").enable(); -// top.Ext.getCmp("programInputText").enable(); + // top.Ext.getCmp("programInputText").enable(); } } -function setHiddenFieldsAllowBlank(allowBlank){ +function setHiddenFieldsAllowBlank(allowBlank) { top.Ext.getCmp("disinfectIdentification").allowBlank = allowBlank; top.Ext.getCmp("disinfectProgram").allowBlank = allowBlank; } -function isAnyBasketPersonInChargeBlank(){ +function isAnyBasketPersonInChargeBlank() { var root = top.Ext.getCmp('basketTreePanel').getRootNode(); var r = false; - root.eachChild(function (node){ + root.eachChild(function (node) { var personInCharge = node.attributes.personInCharge; var personInChargeCode = node.attributes.personInChargeCode; - if(!node.isLeaf()){ - if(isUndefinedOrNullOrEmpty(personInCharge) || isUndefinedOrNullOrEmpty(personInChargeCode)){ + if (!node.isLeaf()) { + if (isUndefinedOrNullOrEmpty(personInCharge) || isUndefinedOrNullOrEmpty(personInChargeCode)) { r = true; return false; } @@ -1663,19 +1658,19 @@ setHiddenFieldsAllowBlank(false); return false; } - + //日期比较验证 - if(top.Ext.getCmp('endDateStr').getValue() !== ''){ - if(top.Ext.getCmp('endDateStr').getValue()-top.Ext.getCmp('startDateStr').getValue() < 0){ + if (top.Ext.getCmp('endDateStr').getValue() !== '') { + if (top.Ext.getCmp('endDateStr').getValue() - top.Ext.getCmp('startDateStr').getValue() < 0) { showResult('开始日期不能大于结束日期!'); setHiddenFieldsAllowBlank(false); return false; } } - + // 校验责任人 - if(!personInChargeAllowBlank){ - if(isAnyBasketPersonInChargeBlank()){ + if (!personInChargeAllowBlank) { + if (isAnyBasketPersonInChargeBlank()) { showResult('责任人不能为空!'); setHiddenFieldsAllowBlank(false); return false; @@ -1687,19 +1682,19 @@ var rinserName = top.Ext.getCmp('disinfectIdentification').getValue(); var cbInfo = top.Ext.getCmp('classifyBasketInfo').getValue(); // 添加的记录,判断清洗顺序是否正确 -// if( isUndefinedOrNullOrEmpty(id) || id == 0){ -// DWREngine.setAsync(false); -// var isWashOrderRight = true; -// WashAndDisinfectRecordTableManager.isWashOrderRight(rinserName,cbInfo,function(result){ -// isWashOrderRight = result; -// }); -// if(isWashOrderRight == false){ -// showResult("篮筐需要手工清洗再进行机洗!"); -// return false; -// } -// DWREngine.setAsync(true); -// } - + // if( isUndefinedOrNullOrEmpty(id) || id == 0){ + // DWREngine.setAsync(false); + // var isWashOrderRight = true; + // WashAndDisinfectRecordTableManager.isWashOrderRight(rinserName,cbInfo,function(result){ + // isWashOrderRight = result; + // }); + // if(isWashOrderRight == false){ + // showResult("篮筐需要手工清洗再进行机洗!"); + // return false; + // } + // DWREngine.setAsync(true); + // } + // 验证循环计数器是否已经存在,一个清洗机的一个循环次数应是唯一的。 { var id = top.Ext.getCmp('id').getValue(); @@ -1709,129 +1704,129 @@ var cycleCounter = top.Ext.getCmp('cycleCounter').getValue(); // 判断是否定义接口 var haveDeviceInterface = true; - WashAndDisinfectRecordTableManager.isDefineDeviceInterface(rinserName,function(result){ + WashAndDisinfectRecordTableManager.isDefineDeviceInterface(rinserName, function (result) { haveDeviceInterface = result; }); // 没有接口不需要校验循环次数 - if(haveDeviceInterface){ - WashAndDisinfectRecordTableManager.isRinserCycleCounterExist(id,rinserName,cycleCounter, - function(result) { - sign = result; - }); + if (haveDeviceInterface) { + WashAndDisinfectRecordTableManager.isRinserCycleCounterExist(id, rinserName, cycleCounter, + function (result) { + sign = result; + }); DWREngine.setAsync(true); if (sign) { showResult("清洗机的循环次数已存在,保存失败!"); return false; } - }else{ + } else { top.Ext.getCmp('cycleCounter').setValue(0); } } - + // 如果当前时间比清洗结束时间晚,说明已经清洗完成,不能修改清洗记录 - if(id != null && id != '' && id > 0){ + if (id != null && id != '' && id > 0) { var curTimeLater = false; var washEndTime = top.Ext.getCmp('endDateStr').getRawValue(); DWREngine.setAsync(false); - WashAndDisinfectRecordTableManager.isCurTimeLaterThanWashEndtime(id,washEndTime, - function(result) { - curTimeLater = result; - }); + WashAndDisinfectRecordTableManager.isCurTimeLaterThanWashEndtime(id, washEndTime, + function (result) { + curTimeLater = result; + }); DWREngine.setAsync(true); - if(true == curTimeLater){ + if (true == curTimeLater) { showResult("已清洗完成,不能修改记录!"); return false; } } - + // 判断装配时间是否比清洗时间晚 DWREngine.setAsync(false); var washEndtimeLaterThanPacktime = false; var endT = top.Ext.getCmp('endDateStr').getRawValue(); - WashAndDisinfectRecordTableManager.isWashEndtimeLaterThanPacktime(id,endT, - function(result) { - washEndtimeLaterThanPacktime = result; - }); + WashAndDisinfectRecordTableManager.isWashEndtimeLaterThanPacktime(id, endT, + function (result) { + washEndtimeLaterThanPacktime = result; + }); DWREngine.setAsync(true); - if( true == washEndtimeLaterThanPacktime ){ + if (true == washEndtimeLaterThanPacktime) { // 装配时间比清洗时间晚提示 - top.Ext.MessageBox.confirm("请确认","存在包的清洗时间比装配时间晚,确认修改?", - function(button, text) { - if ("no" == button){ - return false; - }else{ - doSubmit(); - } - }); - }else{ + top.Ext.MessageBox.confirm("请确认", "存在包的清洗时间比装配时间晚,确认修改?", + function (button, text) { + if ("no" == button) { + return false; + } else { + doSubmit(); + } + }); + } else { doSubmit(); } -// var conCurrent = top.Ext.getCmp("conCurrent").getValue(); -// top.Ext.getCmp("disinfectProgram").setValue(top.Ext.getCmp("disinfectProgram").getRawValue()); -// formObj.form.submit({ -// url : WWWROOT + '/disinfectSystem/washAndDisinfect/washAndDisinfectRecordAction!saveWashAndDisinfectRecord.do', -// params : {conCurrent :conCurrent}, -// method : 'POST', -// waitMsg : '正在保存数据,请稍候', -// waitTitle : '提交表单', -// success : function(form, action) { -// var validate = Ext.decode(action.result.success); -// if(validate){ -// showResult(action.result.message); -// grid.dwrReload(); -// washAndDisinfectRecordWin.close(); -// }else{ -// showResult(action.result.message); -// top.Ext.getCmp("saveBtn").enable(); -// } -// }, -// failure : function(form, action) { -// showResult(action.result.message); -// top.Ext.getCmp("saveBtn").enable(); -// } -// }); + // var conCurrent = top.Ext.getCmp("conCurrent").getValue(); + // top.Ext.getCmp("disinfectProgram").setValue(top.Ext.getCmp("disinfectProgram").getRawValue()); + // formObj.form.submit({ + // url : WWWROOT + '/disinfectSystem/washAndDisinfect/washAndDisinfectRecordAction!saveWashAndDisinfectRecord.do', + // params : {conCurrent :conCurrent}, + // method : 'POST', + // waitMsg : '正在保存数据,请稍候', + // waitTitle : '提交表单', + // success : function(form, action) { + // var validate = Ext.decode(action.result.success); + // if(validate){ + // showResult(action.result.message); + // grid.dwrReload(); + // washAndDisinfectRecordWin.close(); + // }else{ + // showResult(action.result.message); + // top.Ext.getCmp("saveBtn").enable(); + // } + // }, + // failure : function(form, action) { + // showResult(action.result.message); + // top.Ext.getCmp("saveBtn").enable(); + // } + // }); } -function doSubmit(){ +function doSubmit() { var conCurrent = top.Ext.getCmp("conCurrent").getValue(); var orgWashStartTime = top.Ext.getCmp('orgWashStartTime').getValue(); var orgWashEndTime = top.Ext.getCmp('orgWashEndTime').getValue(); - if(isAddorAlter){ //新添加纪录取责任人框内数据 + if (isAddorAlter) { //新添加纪录取责任人框内数据 var washPersonInCharge = top.Ext.getCmp('personInCharge').getValue(); //取界面最后显示的责任人为清洗责任人 var washPersonInChargeCode = top.Ext.getCmp('personInChargeCode').getValue(); - }else if(pitchOn){ //修改时是否点击责任人修改过 true没修改 false修改过 + } else if (pitchOn) { //修改时是否点击责任人修改过 true没修改 false修改过 var washPersonInCharge = oldPerson; //取加载旧责任人为清洗责任人 var washPersonInChargeCode = oldPersonCode; - }else{ + } else { var washPersonInCharge = top.Ext.getCmp('personInCharge').getValue(); //取界面最后显示的责任人为清洗责任人 var washPersonInChargeCode = top.Ext.getCmp('personInChargeCode').getValue(); } - - + + Ext.getCmp('washSaveSubmitResult').setValue("0"); top.Ext.getCmp("disinfectProgram").setValue(top.Ext.getCmp("disinfectProgram").getRawValue()); formObj.form.submit({ - url : WWWROOT + '/disinfectSystem/washAndDisinfect/washAndDisinfectRecordAction!saveWashAndDisinfectRecord.do', - params : {conCurrent :conCurrent, orgWashStartTime : orgWashStartTime, orgWashEndTime : orgWashEndTime, washPersonInCharge : washPersonInCharge, washPersonInChargeCode : washPersonInChargeCode}, - method : 'POST', - waitMsg : '正在保存数据,请稍候', - waitTitle : '提交表单', - success : function(form, action) { + url: WWWROOT + '/disinfectSystem/washAndDisinfect/washAndDisinfectRecordAction!saveWashAndDisinfectRecord.do', + params: { conCurrent: conCurrent, orgWashStartTime: orgWashStartTime, orgWashEndTime: orgWashEndTime, washPersonInCharge: washPersonInCharge, washPersonInChargeCode: washPersonInChargeCode }, + method: 'POST', + waitMsg: '正在保存数据,请稍候', + waitTitle: '提交表单', + success: function (form, action) { var validate = Ext.decode(action.result.success); - if(validate){ + if (validate) { Ext.getCmp('washSaveSubmitResult').setValue("1"); showResult(action.result.message); grid.dwrReload(); washAndDisinfectRecordWin.close(); - }else{ + } else { showResult(action.result.message); Ext.getCmp('washSaveSubmitResult').setValue("-1"); top.Ext.getCmp("saveBtn").enable(); } oldPerson = null; //成功保存清空旧的责任人 oldPersonCode = null; }, - failure : function(form, action) { + failure: function (form, action) { showResult(action.result.message); Ext.getCmp('washSaveSubmitResult').setValue("-1"); top.Ext.getCmp("saveBtn").enable(); @@ -1846,75 +1841,75 @@ var classifyBasketInfo = []; var washMaterials = []; var root = top.Ext.getCmp('basketTreePanel').root; - root.eachChild(function(node){ - if(node.attributes.type != "fixedBarcode"){ //不是固定条码扫出来的 + root.eachChild(function (node) { + if (node.attributes.type != "fixedBarcode") { //不是固定条码扫出来的 classifyBasketInfo.push({ classifyBasketID: node.attributes.classifyBasketId, personInCharge: node.attributes.personInCharge, personInChargeCode: node.attributes.personInChargeCode, position: node.attributes.position }); - }else{ - node.eachChild(function(tousseMaterial){//如果是器械包固定条码就保存里面的材料 + } else { + node.eachChild(function (tousseMaterial) {//如果是器械包固定条码就保存里面的材料 washMaterials.push({ - id : -1, //用-1来标识是从固定条码扫来的材料 + id: -1, //用-1来标识是从固定条码扫来的材料 name: tousseMaterial.attributes.name, materialId: tousseMaterial.attributes.objectId, amount: tousseMaterial.attributes.count - }); + }); }); - } + } }); top.Ext.getCmp('classifyBasketInfo').setValue(JSON.stringify(classifyBasketInfo)); - var materialData = null; + var materialData = null; for (var i = 0; i < materialStore.getCount(); i++) { var record = materialStore.getAt(i); washMaterials.push({ - id : record.get('id'), - materialId : record.get('materialId'), - name : record.get('name'), - amount : record.get('amount') + id: record.get('id'), + materialId: record.get('materialId'), + name: record.get('name'), + amount: record.get('amount') }); } top.Ext.getCmp('materialData').setValue(JSON.stringify(washMaterials)); - + } //根据条码获取清洗机 -function loadWashMachineByBarcode(barcode){ +function loadWashMachineByBarcode(barcode) { var setComBoVal = ''; - if(barcode!=''){ + if (barcode != '') { var count = rinserStore.getCount(); - for(var i=0;i 0){ + WashAndDisinfectRecordTableManager.getCleanParameter(value, function (result) { + if (result != null && result.length > 0) { top.Ext.getCmp('cleanParameter').setValue(result); } }); } top.Ext.getCmp('inputText').setValue(''); } // 根据条码获取用户 -function loadUserByBarcode(barcode){ +function loadUserByBarcode(barcode) { top.Ext.getCmp('inputText').setValue(''); var setComBoVal = ''; var cleanMinutes = 0; - if(isUndefinedOrNullOrEmpty(barcode)){ + if (isUndefinedOrNullOrEmpty(barcode)) { showResult('条码不能为空!'); } - UserTableManager.getUserByBarcode(barcode,function(responseText){ - if(!isUndefinedOrNullOrEmpty(responseText)){ - var result = top.Ext.decode(responseText); - if(!result.success){ - showResult("不允许登记非本科室人员,请扫描本科室人员条码!"); - return; - } - top.Ext.getCmp('personInCharge').setValue(result.fullName); - top.Ext.getCmp('personInChargeCode').setValue(result.name); - - var selNode = top.Ext.getCmp('basketTreePanel').getSelectionModel().getSelectedNode(); - var root = top.Ext.getCmp('basketTreePanel').getRootNode(); - if(selNode != null && !selNode.isLeaf()){ - selNode.attributes.personInCharge = result.fullName; - selNode.attributes.personInChargeCode = result.name; - - var newBasket = cloneBasket(selNode); - var curIndex = root.indexOf(selNode); - var nextNode = selNode.nextSibling; - root.removeChild(selNode); - if(nextNode != null){ - root.insertBefore(newBasket,nextNode); - }else{ - root.appendChild(newBasket); - } - }else{ - root.eachChild(function(child) { - var personInCharge = child.attributes.personInCharge; - if( child.attributes.personInCharge == null || child.attributes.personInCharge == ''){ - child.attributes.personInCharge = result.fullName; - child.attributes.personInChargeCode = result.name; - var newBasket = cloneBasket(child); - var curIndex = root.indexOf(child); - var nextNode = child.nextSibling; - root.removeChild(child); - if(nextNode != null){ - root.insertBefore(newBasket,nextNode); - }else{ - root.appendChild(newBasket); - } - } - }); - } - }else{ - showResult('找不到该条码所对应的人员信息'); - } - }); + UserTableManager.getUserByBarcode(barcode, function (responseText) { + if (!isUndefinedOrNullOrEmpty(responseText)) { + var result = top.Ext.decode(responseText); + if (!result.success) { + showResult("不允许登记非本科室人员,请扫描本科室人员条码!"); + return; + } + top.Ext.getCmp('personInCharge').setValue(result.fullName); + top.Ext.getCmp('personInChargeCode').setValue(result.name); + + var selNode = top.Ext.getCmp('basketTreePanel').getSelectionModel().getSelectedNode(); + var root = top.Ext.getCmp('basketTreePanel').getRootNode(); + if (selNode != null && !selNode.isLeaf()) { + selNode.attributes.personInCharge = result.fullName; + selNode.attributes.personInChargeCode = result.name; + + var newBasket = cloneBasket(selNode); + var curIndex = root.indexOf(selNode); + var nextNode = selNode.nextSibling; + root.removeChild(selNode); + if (nextNode != null) { + root.insertBefore(newBasket, nextNode); + } else { + root.appendChild(newBasket); + } + } else { + root.eachChild(function (child) { + var personInCharge = child.attributes.personInCharge; + if (child.attributes.personInCharge == null || child.attributes.personInCharge == '') { + child.attributes.personInCharge = result.fullName; + child.attributes.personInChargeCode = result.name; + var newBasket = cloneBasket(child); + var curIndex = root.indexOf(child); + var nextNode = child.nextSibling; + root.removeChild(child); + if (nextNode != null) { + root.insertBefore(newBasket, nextNode); + } else { + root.appendChild(newBasket); + } + } + }); + } + } else { + showResult('找不到该条码所对应的人员信息'); + } + }); } //根据条码获取位置名称 -function loadPositionByBarcode(barcode){ - if(isUndefinedOrNullOrEmpty(barcode)){ +function loadPositionByBarcode(barcode) { + if (isUndefinedOrNullOrEmpty(barcode)) { showResult('条码不能为空!'); - return ; + return; } - PositionTableManager.getPositionNameByBarcode(barcode,true,function(responseText){ - if(!isUndefinedOrNullOrEmpty(responseText)){ - var result = top.Ext.decode(responseText); - if(!result.success){ - showResult(result.message); - return; - } - top.Ext.getCmp('position').setValue(result.name); - var selNode = top.Ext.getCmp('basketTreePanel').getSelectionModel().getSelectedNode(); - var root = top.Ext.getCmp('basketTreePanel').getRootNode(); - if(selNode != null && !selNode.isLeaf()){ - selNode.attributes.position = result.name; - - var newBasket = cloneBasket(selNode); - var curIndex = root.indexOf(selNode); - var nextNode = selNode.nextSibling; - root.removeChild(selNode); - if(nextNode != null){ - root.insertBefore(newBasket,nextNode); - }else{ - root.appendChild(newBasket); - } - }else{ - root.eachChild(function(child) { - var position = child.attributes.position; - if( child.attributes.position == null || child.attributes.position == ''){ - child.attributes.position = result.name; - var newBasket = cloneBasket(child); - var curIndex = root.indexOf(child); - var nextNode = child.nextSibling; - root.removeChild(child); - if(nextNode != null){ - root.insertBefore(newBasket,nextNode); - }else{ - root.appendChild(newBasket); - } - } - }); - } - }else{ + PositionTableManager.getPositionNameByBarcode(barcode, true, function (responseText) { + if (!isUndefinedOrNullOrEmpty(responseText)) { + var result = top.Ext.decode(responseText); + if (!result.success) { + showResult(result.message); + return; + } + top.Ext.getCmp('position').setValue(result.name); + var selNode = top.Ext.getCmp('basketTreePanel').getSelectionModel().getSelectedNode(); + var root = top.Ext.getCmp('basketTreePanel').getRootNode(); + if (selNode != null && !selNode.isLeaf()) { + selNode.attributes.position = result.name; + + var newBasket = cloneBasket(selNode); + var curIndex = root.indexOf(selNode); + var nextNode = selNode.nextSibling; + root.removeChild(selNode); + if (nextNode != null) { + root.insertBefore(newBasket, nextNode); + } else { + root.appendChild(newBasket); + } + } else { + root.eachChild(function (child) { + var position = child.attributes.position; + if (child.attributes.position == null || child.attributes.position == '') { + child.attributes.position = result.name; + var newBasket = cloneBasket(child); + var curIndex = root.indexOf(child); + var nextNode = child.nextSibling; + root.removeChild(child); + if (nextNode != null) { + root.insertBefore(newBasket, nextNode); + } else { + root.appendChild(newBasket); + } + } + }); + } + } else { showResult('找不到该条码所对应的位置信息'); } }); @@ -2077,11 +2072,11 @@ * @author SYF * @Since 2015-12-10 */ -function resetContainerCount(){ +function resetContainerCount() { var basketLength = top.Ext.getCmp('basketTreePanel').root.childNodes.length; - if(basketLength > 0){ + if (basketLength > 0) { top.Ext.getCmp('basketTreePanel').setTitle(washBasketTreePanelTitle + ":" + basketLength); - }else{ + } else { top.Ext.getCmp('basketTreePanel').setTitle(washBasketTreePanelTitle); } } @@ -2092,6 +2087,6 @@ * @author SYF * @Since 2015-12-10 */ -function resetWashMaterialCount(){ - +function resetWashMaterialCount() { + } \ No newline at end of file