Index: ssts-web/src/main/webapp/ext-4.2.3/resources/ext-theme-green/green-theme-sandbox-all-fontSize12.css =================================================================== diff -u -r14608 -r27866 --- ssts-web/src/main/webapp/ext-4.2.3/resources/ext-theme-green/green-theme-sandbox-all-fontSize12.css (.../green-theme-sandbox-all-fontSize12.css) (revision 14608) +++ ssts-web/src/main/webapp/ext-4.2.3/resources/ext-theme-green/green-theme-sandbox-all-fontSize12.css (.../green-theme-sandbox-all-fontSize12.css) (revision 27866) @@ -12803,4 +12803,9 @@ .x4-tab-noicon .x4-tab-icon { display: none +} + +#foreignToussForm .x4-panel-body-default{ + background:none; + border-width: 0px; } \ No newline at end of file Index: ssts-web/src/main/webapp/disinfectsystem/foreigntousseapplication/foreignTousseInfoForm.js =================================================================== diff -u -r27864 -r27866 --- ssts-web/src/main/webapp/disinfectsystem/foreigntousseapplication/foreignTousseInfoForm.js (.../foreignTousseInfoForm.js) (revision 27864) +++ ssts-web/src/main/webapp/disinfectsystem/foreigntousseapplication/foreignTousseInfoForm.js (.../foreignTousseInfoForm.js) (revision 27866) @@ -1,2089 +1,2821 @@ -var foreignTousseStore; -var foreignTousseForm; -var foreignTousseApplyWindow; -var applyDepartJsonStore; -var handleDepartmentStore; -var settleDepartJsonStore; -var supplierType = '外来器械租用商'; -//供应商联系人数据源 -var supplierContacJsonStore; -//归还联系人数据源 -var returnContactJsonStore; -var currentWashClassifyType = null; -var tmpWashClassifyTypeNum = 0; -var batches; -var supplierName; //用于查询供应商关联的联系人 -var phoneNumber; //选择器械包或供应商连带出联系人电话 -var contactName; //选择器械包或供应商连带出联系人电话 -var oldSupplierName = null; //不是新建记录旧的供应商名称 -var currentRecord; -//外来器械申请单id -var foreignTousseApplicationId; -var orgUnitCodeOperationRoom= null; -var saveOrgUnitCode = null; -var urgentLevelId; -var urgentLevelVal; -//外来器械材料种类颜色管理 -var washClassifyTypeColor = sstsConfig.washClassifyTypeColorManager || { - '平面类' : 'yellow-row', - '轴节类' : 'white-row', - '材料' : 'lightGreen-row', - '剪刀' : 'skyBlue-row', - 'default' : 'darkcyan-row' -} -//防止用户配置了配置文件,却忘记配置default的颜色 -washClassifyTypeColor['default'] = washClassifyTypeColor['default'] ? washClassifyTypeColor['default'] : 'darkcyan-row'; - -//大小属性的下拉选项 -var packageSizeArray = [[PACKAGE_SIZE_HUGE],[PACKAGE_SIZE_BIG],[PACKAGE_SIZE_CENTER],[PACKAGE_SIZE_SMALL]]; -if(sstsConfig.pageSizeArrayConfig && sstsConfig.pageSizeArrayConfig.length > 0){ - packageSizeArray = sstsConfig.pageSizeArrayConfig; -} -//默认的大小选项 -var defaultPackageSize = PACKAGE_SIZE_BIG; -if(sstsConfig.defaultPackageSize){ - defaultPackageSize = sstsConfig.defaultPackageSize; -} -//打印份数的默认值 -var defaultforeignToussePrintAmount = sstsConfig.foreignToussePrintAmount ? sstsConfig.foreignToussePrintAmount : 1; -//拆包份数的默认值 -var defaultSplitNumber = 1; - -top.Ext4.define('foreignTousseTreeGrid',{ - extend: 'top.Ext4.tree.Panel', - xtype: 'tree-grid', - useArrows: true, - rootVisible: false, - multiSelect: false, - columnLines: true, - animate:true, - rowLines: true, - cls: 'no-leaf-icons', - viewConfig : { - toggleOnDblClick: false, - markDirty:false, - getRowClass: function(record) { - var washClassifyType = record.get('washClassifyType'); - var depth = record.getDepth();//获取节点的深度 - if (depth == 2 && sstsConfig.washClassifyTypeUseColorDiscriminate){ - var washClassifyTypeClass = washClassifyTypeColor[washClassifyType]; - return top.Ext4.isEmpty(washClassifyTypeClass) ? washClassifyTypeColor['default'] : washClassifyTypeClass; - } - } - }, - initComponent: function() { - this.cellEditing = new top.Ext4.grid.plugin.CellEditing({ - clicksToEdit: 2, - listeners: { - beforeedit: function(editor, context, eOpts){ - var record = context.record; - currentRecord = record; - var isLeaf = record.get('leaf'); - var colIdx = context.colIdx; - if(sstsConfig.foreignTousseAddWeight){ - if(!isLeaf && (colIdx == 4 || colIdx == 5 || colIdx == 8 || colIdx == 9)){//根节点不能编辑 - return false; - }else if(isLeaf && (colIdx == 1 || colIdx == 7 || colIdx == 10|| colIdx == 11 || colIdx == 12 || colIdx == 3)){ - return false; - } - }else if(sstsConfig.onlySelectExistedForeignTousse){//外来器械申请单器械包材料名称父节点不允许编辑 - if(!isLeaf && (colIdx == 2 || colIdx == 3 || colIdx == 4 || colIdx == 7 || colIdx == 8)){ - return false; - }else if(isLeaf && (colIdx == 1 || colIdx == 5 || colIdx == 9 || colIdx == 10 || colIdx == 11)){ - return false; - } - }else{ - /* if(!isLeaf && (colIdx == 3 || colIdx == 4 || colIdx == 6 || colIdx == 7)){//父节点不能编辑 - return false; - }else if(isLeaf && (colIdx == 1 || colIdx == 5 || colIdx == 8|| colIdx == 9 || colIdx == 10)){//子节点不能编辑 - return false; - } */ - - - if(!isLeaf && (colIdx == 3 || colIdx == 4 || colIdx == 7 || colIdx == 8)){//父节点不能编辑 - return false; - }else if(isLeaf && (colIdx == 1 || colIdx == 5 || colIdx == 6 || colIdx == 9|| colIdx == 10 || colIdx == 11)){//子节点不能编辑 - return false; - } - } - }, - edit:function(editor, context, eOpts){ //如果是“工具”则把是否植入物的默认值设置成“否” - var record = context.record; - var dataIndex = context.column.dataIndex; - var isLeaf = record.get('leaf'); - if (dataIndex == 'tousseName' && isLeaf) { - var tousseName = record.get('tousseName').trim(); - if (!tousseName) { - record.set('includeImplant', ''); - } else if (tousseName == '工具') { - record.set('includeImplant', '否'); - } - } - } - } - }); - Ext4.apply(this, { - plugins: [this.cellEditing] - }); - this.superclass.initComponent.call(this); - } -}); - -Ext4.define('foreignTousseItemModel',{ - extend : 'Ext4.data.Model', - idProperty: 'nodeId', - fields: [ - {name : 'id'}, - {name : 'tousseDefinitionId'}, - {name : 'oldTousseName'}, - {name : 'tousseName'}, - {name : 'weight'}, - {name : 'supplierName'}, - {name : 'oldSupplierName'}, - {name : 'amount'}, - {name : 'includeImplant'}, - {name : 'price'}, - {name : 'urgentLevel'}, - {name : 'urgentLevelId'}, - {name : 'type'}, - {name : 'usedAmountOfIncludeImplant'}, - {name : 'implantAmountOfUseRecord'}, - {name : 'packageSize'}, - {name : 'foreignToussePrintAmount'}, - {name : 'splitNumber'}, - {name : 'minDismantleAmount'}, - {name : 'washClassifyType'} -]}); - -function showPatientInfo(patientInfo){ - top.Ext4.getCmp('patient').setValue(patientInfo.patientName); - top.Ext4.getCmp('patientAge').setValue(patientInfo.patientAge); - if(patientInfo.clinicNumber){ - top.Ext4.getCmp('clinicNumber').setValue(patientInfo.clinicNumber); - } - if(patientInfo.hospitalNumber){ - top.Ext4.getCmp('hospitalNumber').setValue(patientInfo.hospitalNumber); - } - if(patientInfo.patientSex == '男'){ - top.Ext4.getCmp('patientSex').setValue('男'); - }else if(patientInfo.patientSex == '女'){ - top.Ext4.getCmp('patientSex').setValue('女'); - }else{ - top.Ext4.getCmp('patientSex').setValue(''); - } - top.Ext4.getCmp('patientArea').setValue(patientInfo.patientArea); - top.Ext4.getCmp('roomNumber').setValue(patientInfo.roomNumber); - top.Ext4.getCmp('bedNumber').setValue(patientInfo.bedNumber); - top.Ext4.getCmp('doctor').setValue(patientInfo.doctorName); - top.Ext4.getCmp('surgery').setValue(patientInfo.operation); - //手术时间需要特殊处理,需要将年和月之间的-符替换成/ - if(patientInfo.operationTime){ - try{ - top.Ext4.getCmp('operationTime').setValue(new Date(patientInfo.operationTime.replace("-","/"))); - }catch(e){ - - } - } - top.Ext4.getCmp('operationRoom').setValue(patientInfo.opRoomId); - top.Ext4.getCmp('ascriptionDepartment').setValue(patientInfo.ascriptionDepartment); - top.Ext4.getCmp('remark').setValue(patientInfo.remark); -} - -function getSupplierName(){ - var nodes = foreignTousseStore.getRootNode().childNodes; - if(nodes.length > 0){ - return nodes[0].get("supplierName"); - } -} -function getPrintGoodsInfo(){ - var nodes = foreignTousseStore.getRootNode().childNodes; - var result = ""; - for(var i = 0;i < nodes.length ; i++){ - var n = nodes[i]; - var materialNodes = n.childNodes; - - var tousseStr = n.get("tousseName") + "#&" + n.get("amount"); - var materialStr = ""; - for (var j=0; j < materialNodes.length; j++){ - var materialNode = materialNodes[j]; - if(materialStr.length > 0){ - materialStr += "#@"; - } - materialStr += ("    " + materialNode.get("tousseName") + "#&" + materialNode.get("amount")); - } - tousseStr += "#@" + materialStr; - result = tousseStr; - } - return result; -} - -function buildTousses(){ - var tousses = []; - var nodes = foreignTousseStore.getRootNode().childNodes; - var result = ""; - for(var i = 0;i < nodes.length ; i++){ - var n = nodes[i]; - var materials = []; - var tools = []; - var implants = []; - var tousse = { - 'tousseName':n.get("tousseName"), - 'supplierName':n.get("supplierName"), - 'amount':n.get("amount"), - 'type':n.get("type"), - 'price':n.get("price"), - 'includeImplant':n.get("includeImplant"), - 'tools':tools, - 'implants':implants, - 'materials':materials, - 'splitNumber':n.get('splitNumber'), - 'weight':n.get('weight'), - 'foreignToussePrintAmount':n.get('foreignToussePrintAmount') - }; - - var materialNodes = n.childNodes; - for (var j=0; j < materialNodes.length; j++){ - var material = { - 'tousseName':materialNodes[j].get("tousseName"), - 'supplierName':materialNodes[j].get("supplierName"), - 'amount':materialNodes[j].get("amount"), - 'minDismantleAmount': materialNodes[j].get("minDismantleAmount"), - 'type':materialNodes[j].get("type"), - 'price':materialNodes[j].get("price"), - 'includeImplant':materialNodes[j].get("includeImplant") - }; - if(material.includeImplant == '是'){ - implants.push(material); - }else{ - tools.push(material); - } - materials.push(material); - } - - tousse.includeImplantAmount = 0; - tousse.toolsAmount = 0; - tousse.materialsAmount = 0; - for(var k = 0;k < materials.length;++k){ - tousse.materialsAmount += parseInt(materials[k].amount); - if(materials[k].includeImplant == '是'){ - tousse.includeImplantAmount += parseInt(materials[k].amount); - }else{ - tousse.toolsAmount += parseInt(materials[k].amount); - } - } - tousses.push(tousse); - } - return tousses; -} -function refreshMaterialAmountInfo(){ - var toolsAmount = 0; - var includeImplantAmount = 0; - var nodes = foreignTousseStore.getRootNode().childNodes; - for(var i = 0;i < nodes.length ; i++){ - var n = nodes[i]; - var materialNodes = n.childNodes; - for (var j=0; j < materialNodes.length; j++){ - var includeImplant = materialNodes[j].get("includeImplant"); - var amount = materialNodes[j].get("amount"); - if(includeImplant == '是'){ - includeImplantAmount += parseInt(amount); - }else{ - toolsAmount += parseInt(amount); - } - } - } - var text = '工具:'+toolsAmount+'件,植入物:'+includeImplantAmount+'件,共' + (toolsAmount+includeImplantAmount) + '件'; - var amountElement = top.Ext4.getCmp('materialAmountInfo'); - if(amountElement != null){ - amountElement.setText(text); - } -} - -/** - * 从store中根据科室名称,查找对应的科室编码. - * @param store - * @param deptName - * @returns {String} - */ -function getStoreDepartCoding(store,deptName){ - var deptCoding = ""; - for(var i = 0;i < store.data.length;i++){ - var record = store.getAt(i); - if(record.get('name') == deptName){ - deptCoding = record.get('id'); - break; - } - } - return deptCoding; -} - -function printForeignTousseApplication_local(printType){ - var title = ""; - DWREngine.setAsync(false); - SupplyRoomConfigTableManager.getStartTimeObject(function(config){ - if(config != null){ - title = config.unitName; - } - }); - DWREngine.setAsync(true); - var applicationId = top.Ext4.getCmp('id').getValue(); - var applicant = top.Ext4.getCmp('applicant').getValue(); - var applicationTime = top.Ext4.getCmp('applicationTime').getValue(); - var depart = top.Ext4.getCmp('depart').getValue(); - var remark = top.Ext4.getCmp('remark').getValue(); - var roomNumber = top.Ext4.getCmp('roomNumber').getValue(); - var bedNumber = top.Ext4.getCmp('bedNumber').getValue(); - var patient = top.Ext4.getCmp('patient').getValue(); - var patientAge = top.Ext4.getCmp('patientAge').getValue(); - var patientSex = top.Ext4.getCmp('patientSex').getValue(); - var hospitalNumber = top.Ext4.getCmp('hospitalNumber').getValue(); - var clinicNumber = top.Ext4.getCmp('clinicNumber').getValue(); - var patientArea = top.Ext4.getCmp('patientArea').getValue(); - var doctor = top.Ext4.getCmp('doctor').getValue(); - var surgery = top.Ext4.getCmp('surgery').getValue(); +var foreignTousseStore; +var foreignTousseForm; +var foreignTousseApplyWindow; +var applyDepartJsonStore; +var handleDepartmentStore; +var settleDepartJsonStore; +var supplierType = '外来器械租用商'; +//供应商联系人数据源 +var supplierContacJsonStore; +//归还联系人数据源 +var returnContactJsonStore; +var currentWashClassifyType = null; +var tmpWashClassifyTypeNum = 0; +var batches; +var supplierName; //用于查询供应商关联的联系人 +var phoneNumber; //选择器械包或供应商连带出联系人电话 +var contactName; //选择器械包或供应商连带出联系人电话 +var oldSupplierName = null; //不是新建记录旧的供应商名称 +var currentRecord; +//外来器械申请单id +var foreignTousseApplicationId; +var orgUnitCodeOperationRoom= null; +var saveOrgUnitCode = null; +var urgentLevelId; +var urgentLevelVal; +//外来器械材料种类颜色管理 +var washClassifyTypeColor = sstsConfig.washClassifyTypeColorManager || { + '平面类' : 'yellow-row', + '轴节类' : 'white-row', + '材料' : 'lightGreen-row', + '剪刀' : 'skyBlue-row', + 'default' : 'darkcyan-row' +} +//防止用户配置了配置文件,却忘记配置default的颜色 +washClassifyTypeColor['default'] = washClassifyTypeColor['default'] ? washClassifyTypeColor['default'] : 'darkcyan-row'; + +//大小属性的下拉选项 +var packageSizeArray = [[PACKAGE_SIZE_HUGE],[PACKAGE_SIZE_BIG],[PACKAGE_SIZE_CENTER],[PACKAGE_SIZE_SMALL]]; +if(sstsConfig.pageSizeArrayConfig && sstsConfig.pageSizeArrayConfig.length > 0){ + packageSizeArray = sstsConfig.pageSizeArrayConfig; +} +//默认的大小选项 +var defaultPackageSize = PACKAGE_SIZE_BIG; +if(sstsConfig.defaultPackageSize){ + defaultPackageSize = sstsConfig.defaultPackageSize; +} +//打印份数的默认值 +var defaultforeignToussePrintAmount = sstsConfig.foreignToussePrintAmount ? sstsConfig.foreignToussePrintAmount : 1; +//拆包份数的默认值 +var defaultSplitNumber = 1; + +top.Ext4.define('foreignTousseTreeGrid',{ + extend: 'top.Ext4.tree.Panel', + xtype: 'tree-grid', + useArrows: true, + rootVisible: false, + multiSelect: false, + columnLines: true, + animate:true, + rowLines: true, + cls: 'no-leaf-icons', + viewConfig : { + toggleOnDblClick: false, + markDirty:false, + getRowClass: function(record) { + var washClassifyType = record.get('washClassifyType'); + var depth = record.getDepth();//获取节点的深度 + if (depth == 2 && sstsConfig.washClassifyTypeUseColorDiscriminate){ + var washClassifyTypeClass = washClassifyTypeColor[washClassifyType]; + return top.Ext4.isEmpty(washClassifyTypeClass) ? washClassifyTypeColor['default'] : washClassifyTypeClass; + } + } + }, + initComponent: function() { + this.cellEditing = new top.Ext4.grid.plugin.CellEditing({ + clicksToEdit: 2, + listeners: { + beforeedit: function(editor, context, eOpts){ + var record = context.record; + currentRecord = record; + var isLeaf = record.get('leaf'); + var colIdx = context.colIdx; + if(sstsConfig.foreignTousseAddWeight){ + if(!isLeaf && (colIdx == 4 || colIdx == 5 || colIdx == 8 || colIdx == 9)){//根节点不能编辑 + return false; + }else if(isLeaf && (colIdx == 1 || colIdx == 7 || colIdx == 10|| colIdx == 11 || colIdx == 12 || colIdx == 3)){ + return false; + } + }else if(sstsConfig.onlySelectExistedForeignTousse){//外来器械申请单器械包材料名称父节点不允许编辑 + if(!isLeaf && (colIdx == 2 || colIdx == 3 || colIdx == 4 || colIdx == 7 || colIdx == 8)){ + return false; + }else if(isLeaf && (colIdx == 1 || colIdx == 5 || colIdx == 9 || colIdx == 10 || colIdx == 11)){ + return false; + } + }else{ + /* if(!isLeaf && (colIdx == 3 || colIdx == 4 || colIdx == 6 || colIdx == 7)){//父节点不能编辑 + return false; + }else if(isLeaf && (colIdx == 1 || colIdx == 5 || colIdx == 8|| colIdx == 9 || colIdx == 10)){//子节点不能编辑 + return false; + } */ + + + if(!isLeaf && (colIdx == 3 || colIdx == 4 || colIdx == 7 || colIdx == 8)){//父节点不能编辑 + return false; + }else if(isLeaf && (colIdx == 1 || colIdx == 5 || colIdx == 6 || colIdx == 9|| colIdx == 10 || colIdx == 11)){//子节点不能编辑 + return false; + } + } + }, + edit:function(editor, context, eOpts){ //如果是“工具”则把是否植入物的默认值设置成“否” + var record = context.record; + var dataIndex = context.column.dataIndex; + var isLeaf = record.get('leaf'); + if (dataIndex == 'tousseName' && isLeaf) { + var tousseName = record.get('tousseName').trim(); + if (!tousseName) { + record.set('includeImplant', ''); + } else if (tousseName == '工具') { + record.set('includeImplant', '否'); + } + } + } + } + }); + Ext4.apply(this, { + plugins: [this.cellEditing] + }); + this.superclass.initComponent.call(this); + } +}); + +Ext4.define('foreignTousseItemModel',{ + extend : 'Ext4.data.Model', + idProperty: 'nodeId', + fields: [ + {name : 'id'}, + {name : 'tousseDefinitionId'}, + {name : 'oldTousseName'}, + {name : 'tousseName'}, + {name : 'weight'}, + {name : 'supplierName'}, + {name : 'oldSupplierName'}, + {name : 'amount'}, + {name : 'includeImplant'}, + {name : 'price'}, + {name : 'urgentLevel'}, + {name : 'urgentLevelId'}, + {name : 'type'}, + {name : 'usedAmountOfIncludeImplant'}, + {name : 'implantAmountOfUseRecord'}, + {name : 'packageSize'}, + {name : 'foreignToussePrintAmount'}, + {name : 'splitNumber'}, + {name : 'minDismantleAmount'}, + {name : 'washClassifyType'} +]}); + +function showPatientInfo(patientInfo){ + top.Ext4.getCmp('patient').setValue(patientInfo.patientName); + top.Ext4.getCmp('patientAge').setValue(patientInfo.patientAge); + if(patientInfo.clinicNumber){ + top.Ext4.getCmp('clinicNumber').setValue(patientInfo.clinicNumber); + } + if(patientInfo.hospitalNumber){ + top.Ext4.getCmp('hospitalNumber').setValue(patientInfo.hospitalNumber); + } + if(patientInfo.patientSex == '男'){ + top.Ext4.getCmp('patientSex').setValue('男'); + }else if(patientInfo.patientSex == '女'){ + top.Ext4.getCmp('patientSex').setValue('女'); + }else{ + top.Ext4.getCmp('patientSex').setValue(''); + } + top.Ext4.getCmp('patientArea').setValue(patientInfo.patientArea); + top.Ext4.getCmp('roomNumber').setValue(patientInfo.roomNumber); + top.Ext4.getCmp('bedNumber').setValue(patientInfo.bedNumber); + top.Ext4.getCmp('doctor').setValue(patientInfo.doctorName); + top.Ext4.getCmp('surgery').setValue(patientInfo.operation); + //手术时间需要特殊处理,需要将年和月之间的-符替换成/ + if(patientInfo.operationTime){ + try{ + top.Ext4.getCmp('operationTime').setValue(new Date(patientInfo.operationTime.replace("-","/"))); + }catch(e){ + + } + } + top.Ext4.getCmp('operationRoom').setValue(patientInfo.opRoomId); + top.Ext4.getCmp('ascriptionDepartment').setValue(patientInfo.ascriptionDepartment); + top.Ext4.getCmp('remark').setValue(patientInfo.remark); +} + +function getSupplierName(){ + var nodes = foreignTousseStore.getRootNode().childNodes; + if(nodes.length > 0){ + return nodes[0].get("supplierName"); + } +} +function getPrintGoodsInfo(){ + var nodes = foreignTousseStore.getRootNode().childNodes; + var result = ""; + for(var i = 0;i < nodes.length ; i++){ + var n = nodes[i]; + var materialNodes = n.childNodes; + + var tousseStr = n.get("tousseName") + "#&" + n.get("amount"); + var materialStr = ""; + for (var j=0; j < materialNodes.length; j++){ + var materialNode = materialNodes[j]; + if(materialStr.length > 0){ + materialStr += "#@"; + } + materialStr += ("    " + materialNode.get("tousseName") + "#&" + materialNode.get("amount")); + } + tousseStr += "#@" + materialStr; + result = tousseStr; + } + return result; +} + +function buildTousses(){ + var tousses = []; + var nodes = foreignTousseStore.getRootNode().childNodes; + var result = ""; + for(var i = 0;i < nodes.length ; i++){ + var n = nodes[i]; + var materials = []; + var tools = []; + var implants = []; + var tousse = { + 'tousseName':n.get("tousseName"), + 'supplierName':n.get("supplierName"), + 'amount':n.get("amount"), + 'type':n.get("type"), + 'price':n.get("price"), + 'includeImplant':n.get("includeImplant"), + 'tools':tools, + 'implants':implants, + 'materials':materials, + 'splitNumber':n.get('splitNumber'), + 'weight':n.get('weight'), + 'foreignToussePrintAmount':n.get('foreignToussePrintAmount') + }; + + var materialNodes = n.childNodes; + for (var j=0; j < materialNodes.length; j++){ + var material = { + 'tousseName':materialNodes[j].get("tousseName"), + 'supplierName':materialNodes[j].get("supplierName"), + 'amount':materialNodes[j].get("amount"), + 'minDismantleAmount': materialNodes[j].get("minDismantleAmount"), + 'type':materialNodes[j].get("type"), + 'price':materialNodes[j].get("price"), + 'includeImplant':materialNodes[j].get("includeImplant") + }; + if(material.includeImplant == '是'){ + implants.push(material); + }else{ + tools.push(material); + } + materials.push(material); + } + + tousse.includeImplantAmount = 0; + tousse.toolsAmount = 0; + tousse.materialsAmount = 0; + for(var k = 0;k < materials.length;++k){ + tousse.materialsAmount += parseInt(materials[k].amount); + if(materials[k].includeImplant == '是'){ + tousse.includeImplantAmount += parseInt(materials[k].amount); + }else{ + tousse.toolsAmount += parseInt(materials[k].amount); + } + } + tousses.push(tousse); + } + return tousses; +} +function refreshMaterialAmountInfo(){ + var toolsAmount = 0; + var includeImplantAmount = 0; + var nodes = foreignTousseStore.getRootNode().childNodes; + for(var i = 0;i < nodes.length ; i++){ + var n = nodes[i]; + var materialNodes = n.childNodes; + for (var j=0; j < materialNodes.length; j++){ + var includeImplant = materialNodes[j].get("includeImplant"); + var amount = materialNodes[j].get("amount"); + if(includeImplant == '是'){ + includeImplantAmount += parseInt(amount); + }else{ + toolsAmount += parseInt(amount); + } + } + } + var text = '工具:'+toolsAmount+'件,植入物:'+includeImplantAmount+'件,共' + (toolsAmount+includeImplantAmount) + '件'; + var amountElement = top.Ext4.getCmp('materialAmountInfo'); + if(amountElement != null){ + amountElement.setText(text); + } +} + +/** + * 从store中根据科室名称,查找对应的科室编码. + * @param store + * @param deptName + * @returns {String} + */ +function getStoreDepartCoding(store,deptName){ + var deptCoding = ""; + for(var i = 0;i < store.data.length;i++){ + var record = store.getAt(i); + if(record.get('name') == deptName){ + deptCoding = record.get('id'); + break; + } + } + return deptCoding; +} + +function printForeignTousseApplication_local(printType){ + var title = ""; + DWREngine.setAsync(false); + SupplyRoomConfigTableManager.getStartTimeObject(function(config){ + if(config != null){ + title = config.unitName; + } + }); + DWREngine.setAsync(true); + var applicationId = top.Ext4.getCmp('id').getValue(); + var applicant = top.Ext4.getCmp('applicant').getValue(); + var applicationTime = top.Ext4.getCmp('applicationTime').getValue(); + var depart = top.Ext4.getCmp('depart').getValue(); + var remark = top.Ext4.getCmp('remark').getValue(); + var roomNumber = top.Ext4.getCmp('roomNumber').getValue(); + var bedNumber = top.Ext4.getCmp('bedNumber').getValue(); + var patient = top.Ext4.getCmp('patient').getValue(); + var patientAge = top.Ext4.getCmp('patientAge').getValue(); + var patientSex = top.Ext4.getCmp('patientSex').getValue(); + var hospitalNumber = top.Ext4.getCmp('hospitalNumber').getValue(); + var clinicNumber = top.Ext4.getCmp('clinicNumber').getValue(); + var patientArea = top.Ext4.getCmp('patientArea').getValue(); + var doctor = top.Ext4.getCmp('doctor').getValue(); + var surgery = top.Ext4.getCmp('surgery').getValue(); var recyclingTime = top.Ext4.getCmp('recyclingTime').getValue(); - //simon-edit - var operationTimeStr=top.Ext4.getCmp('operationTime').getValue(); - var operationTime; - if(operationTimeStr==null){ - operationTime=''; - }else{ - operationTime = new Date(operationTimeStr).Format("yyyy-MM-dd hh:mm"); - } - - var supplierContactName = top.Ext4.getCmp('supplierContactName').getValue(); - var supplierPhoneNumber = top.Ext4.getCmp('supplierPhoneNumber').getValue(); - - var supplierName = getSupplierName(); - var goodsDetail = getPrintGoodsInfo(); - if(goodsDetail == null || goodsDetail.length <= 0){ - showResult("请填写申请的物品!"); - return; - } - var tousses = buildTousses(); - - formTypeOfPrinted = "foreignTousseAppliation"; - var config = printConfig.foreignTousseAppliation; - var printParams = getPrintJsonParams("print", applicationId , config); - printParams.printScope.rowsPerPage = printConfig.foreignTousseAppliation.rowsPerPage; - RecyclingApplicationTableManager.findPrintRecyclingGoods(JSON.stringify(printParams) , function(result){ - var obj = JSON.parse(result); - if (obj.success){ - var summary = obj.data[0]; - summary.pageIndex = 0; - summary.title = title; - summary.applicant = applicant; - summary.applicationTime = applicationTime; - summary.depart = depart; - summary.remark = remark; - summary.roomNumber = roomNumber; - summary.bedNumber = bedNumber; - summary.patient = patient; - summary.patientAge = patientAge; - summary.patientSex = patientSex; - summary.hospitalNumber = hospitalNumber; - summary.clinicNumber = clinicNumber; - summary.patientArea = patientArea; - summary.surgery = surgery; - summary.operationTime = operationTime; - summary.doctor = doctor; - summary.supplierName = supplierName; - //供应商联系人 - summary.supplierContactName = supplierContactName; - //供应商联系电话 - summary.supplierPhoneNumber = supplierPhoneNumber; - summary.goodsDetail = goodsDetail; - summary.tousses = tousses; - //第一次回收时间 - summary.recyclingTime = recyclingTime; + var sterilizationMethod = top.Ext4.getCmp('sterilizationMethod').getValue(); + var sterilizationTime = top.Ext4.getCmp('sterilizationTime').getValue(); + var sterilizationTemp = top.Ext4.getCmp('sterilizationTemp').getValue(); + var dryTime = top.Ext4.getCmp('dryTime').getValue(); + var explain = top.Ext4.getCmp('explain').getValue(); + + //simon-edit + var operationTimeStr=top.Ext4.getCmp('operationTime').getValue(); + var operationTime; + if(operationTimeStr==null){ + operationTime=''; + }else{ + operationTime = new Date(operationTimeStr).Format("yyyy-MM-dd hh:mm"); + } + + var supplierContactName = top.Ext4.getCmp('supplierContactName').getValue(); + var supplierPhoneNumber = top.Ext4.getCmp('supplierPhoneNumber').getValue(); + + var supplierName = getSupplierName(); + var goodsDetail = getPrintGoodsInfo(); + if(goodsDetail == null || goodsDetail.length <= 0){ + showResult("请填写申请的物品!"); + return; + } + var tousses = buildTousses(); + + formTypeOfPrinted = "foreignTousseAppliation"; + + var config = printConfig.foreignTousseAppliation; + var printParams = getPrintJsonParams("print", applicationId , config); + printParams.printScope.rowsPerPage = printConfig.foreignTousseAppliation.rowsPerPage; + RecyclingApplicationTableManager.findPrintRecyclingGoods(JSON.stringify(printParams) , function(result){ + var obj = JSON.parse(result); + if (obj.success){ + var summary = obj.data[0]; + summary.pageIndex = 0; + summary.title = title; + summary.applicant = applicant; + summary.applicationTime = applicationTime; + summary.depart = depart; + summary.remark = remark; + summary.roomNumber = roomNumber; + summary.bedNumber = bedNumber; + summary.patient = patient; + summary.patientAge = patientAge; + summary.patientSex = patientSex; + summary.hospitalNumber = hospitalNumber; + summary.clinicNumber = clinicNumber; + summary.patientArea = patientArea; + summary.surgery = surgery; + summary.operationTime = operationTime; + summary.doctor = doctor; + summary.supplierName = supplierName; + //供应商联系人 + summary.supplierContactName = supplierContactName; + //供应商联系电话 + summary.supplierPhoneNumber = supplierPhoneNumber; + summary.goodsDetail = goodsDetail; + summary.tousses = tousses; + //第一次回收时间 + summary.recyclingTime = recyclingTime; summary.printType = printType; - var myObj = printConfig[formTypeOfPrinted]; - if(isUndefinedOrNullOrEmpty(myObj)){ - var msg = '未找到('+formTypeOfPrinted+')的打印配置'; - alert(msg); - return; - } - // 自定义打印 - if (!isUndefinedOrNullOrEmpty(myObj.customPrint)) { - myObj.customPrint(summary); - //自定义外来器械申请单打印 - if("foreignTousseAppliation" == formTypeOfPrinted){ - var isSupplyRoomUser = validateIsSupplyRoomUser(); - if (isSupplyRoomUser && printType == 0){ - RecyclingApplicationTableManager.updatePrintStatus(applicationId,function(result){ - //更新完打印状态之后,及时刷新页面 - grid.dwrReload(); - }); - } - } - return; - } - doPrintForeignTousseApplication(printType, summary); - - var isSupplyRoomUser = validateIsSupplyRoomUser(); - - if (isSupplyRoomUser && printType == 0){ - RecyclingApplicationTableManager.updatePrintStatus(applicationId,function(result){ - //更新完打印状态之后,及时刷新页面 - grid.dwrReload(); - }); - } - }else{ - showResult(obj.message); - } - }); -} - -/** - * 获取申请的“外来器械包”的信息. - * return 验证合法返回true,并且把获取申请的“外来器械包”的信息设置到隐藏域foreignTousseInfo,否则返回false - */ -function getForeignTousseInfo(){ - var foreignTousseInfo = []; - var nodes = foreignTousseStore.getRootNode().childNodes; - var msg = ""; - if(nodes.length == 0){ - showResult("必须添加器械包!"); - return false; - } - //遍历每一个外来器械包(一张单或能有多个外来器械包,通常只有一个) - for (var i = 0; i < nodes.length; i++){ - var n = nodes[i]; - if(n.get("supplierName") == null || n.get("supplierName") == ""){ - msg = "外来器械供应商不能为空!"; - break; - } - var foreignTousseName = n.get("tousseName").trim(); - if(!foreignTousseName){ - msg = "外来器械名称不能为空!"; - break; - } - if(n.get("amount") <= 0){ - msg = "外来器械数量必须大于0!"; - break; - } - if(sstsConfig.foreignTousseAddWeight){ - if(n.get("weight") == "" || n.get("weight") == undefined ){ - msg = "请填写外来器械包的重量!"; - break; - } - } - - var materialNodes = n.childNodes; - - var materials = []; - var materialNameJson = {}; - var repeatMaterialName;//重复的材料名称 - var materialAmountPass = false; - //遍历外来器械包下的每一个材料(如果材料名称有重复,则进行提示不予提交) - for (var j=0; j < materialNodes.length; j++){ - var materialNode = materialNodes[j]; - var materialName = materialNode.get("tousseName").trim(); - if(!materialName){ - msg = "外来器械材料必须填写名称!"; - break; - } - if(materialNameJson[materialName]){ - msg = "【"+ foreignTousseName +"】的材料【"+ materialName +"】重复,请删除重复的材料!"; - repeatMaterialName = materialName; - break; - } - if(!materialNode.get("includeImplant")){ - msg = "外来器械材料必须填写是否植入物!"; - break; - } - if(materialNode.get("amount") > 0){ - materialAmountPass = true; - } - materials.push({ - materialInstanceId : materialNode.get("id"), - materialName : materialName, - amount : materialNode.get("amount"), - includeImplant : materialNode.get('includeImplant'), - usedAmountOfIncludeImplant : materialNode.get('usedAmountOfIncludeImplant'), - minDismantleAmount : materialNode.get('minDismantleAmount') - }); - materialNameJson[materialName] = materialName; - } - if(!materialAmountPass && msg == ""){ - msg = "外来器械材料数量不能都为0!"; - break; - } - - foreignTousseInfo.push({ - tousseItemId : n.get("id"), - tousseDefinitionId : n.get("tousseDefinitionId"), - oldTousseName : n.get("oldTousseName"), - tousseName : n.get("tousseName"), - weight : n.get("weight"), - oldSupplierName : n.get("oldSupplierName"), - supplierName : n.get("supplierName"), - amount : n.get("amount"), - price : n.get("price"), - urgentLevel:n.get("urgentLevel"), - urgentLevelId:n.get("urgentLevelId"), - packageSize : n.get("packageSize"), - foreignToussePrintAmount : n.get("foreignToussePrintAmount"), - splitNumber : n.get("splitNumber"), - materials : materials - }); - } - if(msg == ""){ - top.Ext4.getCmp('foreignTousseInfo').setValue(JSON.stringify(foreignTousseInfo)); - return true; - }else{ - showResult(msg); - return false; - } -} - -//联系人config -var supplierContacConfig = Ext.data.Record.create([ - {name : 'id'}, - {name : 'name'}, - {name : 'phoneNumber'} -]); - -function setBatchNumbers(batches,fireSelect) { - for(var i = 0;i 0){ - var nodeChildCount = 0; - for (var i = 0; i < clickNode.childNodes.length; i++) { - if (clickNode.childNodes[i].data.id == 0 || clickNode.childNodes[i].data.id == "0") { - nodeChildCount++; - } - } - var limitNum = parseInt(sstsConfig.numberOfNewMaterialsForForeignTousse); - if (nodeChildCount >= limitNum) { - showResult("材料最多只能增加"+limitNum+"个", null , sstsConfig.messagePauseTimeOnPackingPage); - return; - } - }else if(sstsConfig.numberOfNewMaterialsForForeignTousse == 0){ - showResult("不允许增加新的材料", null , sstsConfig.messagePauseTimeOnPackingPage); - return; - } - - if(clickNode != null){ - clickNode.appendChild(materialItem); - } -} - -function submintForeignTousseForm(actionType, needPrint){ - /** - * 修复IE6下快速粘贴申请科室,科室编码未赋值问题 - */ - var depart = top.Ext4.ComponentQuery.query("#foreignToussForm #depart")[0].getValue(); - var settleAccountsDepart = top.Ext4.ComponentQuery.query("#foreignToussForm #settleAccountsDepart")[0].getValue(); - var deptCoding = top.Ext4.getCmp('departCoding').getValue(); - var deptCoding2 = top.Ext4.getCmp('settleAccountsDepartCoding').getValue(); - - //从store用用名字再次寻找deptCoding,比较页面上的deptCoding和从store找出来的deptCoding一样不,如果不一样, 有可能用户是复制粘贴科室名称上去, - //而没有从下拉选项中选择(由于做了分页,如果用户粘贴了一个不在当前页面的科室名,下拉选项是不会有值的,所以不用担心从store里找不到该科室的coding) - var storeDeptCoding = getStoreDepartCoding(applyDepartJsonStore,depart); - if (!Ext.isEmpty(storeDeptCoding) && deptCoding != storeDeptCoding){ - //如果不一样,则将deptCoding改成storeDeptCoding - deptCoding = storeDeptCoding; - } - var storeDeptCoding2 = getStoreDepartCoding(settleDepartJsonStore,settleAccountsDepart); - if (!Ext.isEmpty(storeDeptCoding) && deptCoding2 != storeDeptCoding2){ - //如果不一样,则将deptCoding改成storeDeptCoding2 - deptCoding2 = storeDeptCoding2; - } - - if(deptCoding == ""){ - showResult("申请科室编码不能为空!"); - return false; - } - - if(deptCoding2 == ""){ - showResult("结算科室编码不能为空!"); - return false; - } - top.Ext4.getCmp('departCoding').setValue(deptCoding); - top.Ext4.getCmp('settleAccountsDepartCoding').setValue(deptCoding2); - - //新增时判断相关的必填的字段是否有填写 - if(actionType == ACTION_TYPE_ADD && sstsConfig.notAllowBlankFieldsOnForeignTousseInfoPage - && sstsConfig.notAllowBlankFieldsOnForeignTousseInfoPage.length > 0){ - for(var i = 0;i < sstsConfig.notAllowBlankFieldsOnForeignTousseInfoPage.length;i++){ - var notAllowBlankFiled = sstsConfig.notAllowBlankFieldsOnForeignTousseInfoPage[i]; - var fieldCompoent = top.Ext4.getCmp(notAllowBlankFiled); - if(!fieldCompoent){ - showResult("未找到id为"+ notAllowBlankFiled +"的表单元素"); - return false; - } - if(!fieldCompoent.getValue()){ - if(fieldCompoent.fieldLabel){ - showResult(fieldCompoent.fieldLabel + "的值不能空"); - }else{ - showResult("id为"+ notAllowBlankFiled +"的表单元素的值不能空"); - } - return false; - } - } - } - //判断已改成上面的配置项 - /*if(sstsConfig.doctorOfForeignTousseApplicationNotBlank && top.Ext4.getCmp('doctor').getValue() == ''){ - showResult("医生不能为空!"); - top.Ext4.getCmp('doctor').focus(); - return false; - }*/ - - //当外来器械未归还时能否申请 - var canApplyForForeignTousseNotReturn = getObjValueFromJs('sstsConfig.canApplyForForeignTousseNotReturn',true); - if(!canApplyForForeignTousseNotReturn){ - var tousseNode = foreignTousseStore.getRootNode().childNodes[0]; - var tousseName = tousseNode.get("tousseName"); - var supplierName = tousseNode.get("supplierName"); - var id = top.Ext4.getCmp('id').getValue(); - Ext4.Ajax.request({ - url : WWWROOT + '/disinfectSystem/foreigntousseapplication/foreignTousseApplicationAction!isHaveNotReturnApplication.do', - params : {id : id,departCoding : deptCoding, tousseName : tousseName, supplierName : supplierName}, - async : false, - success : function(response, options) { - var result = Ext4.JSON.decode(response.responseText); - if(!result.success){ - showResult(result.message); - return false; - }else{ - submitForm(actionType, needPrint); - } - }, - failure : function(response, opts) { - showResult(response.responseText); - } - }); - }else{ - submitForm(actionType, needPrint); - } -} - -/** - * 提交“外来器械包申请单”. - * @param actionType 提交的类型 - * @param needPrint 提交成功后是否需要打印 - */ -function submitForm(actionType, needPrint){ - foreignTousseForm.form.submit({ - url : WWWROOT + '/disinfectSystem/foreigntousseapplication/foreignTousseApplicationAction!saveForeignTousseApplication.do', - method : 'POST', - waitMsg : '正在保存数据,请稍候', - waitTitle : '提交表单', - params : {actionType : actionType}, - success : function(form, action) { - if (needPrint) { - top.Ext4.getCmp('id').setValue(action.result.id); - top.Ext4.getCmp('applicationTime').setValue(action.result.applicationTime); - printForeignTousseApplication_local(0); - } - showResult(action.result.message); - grid.dwrReload(); - foreignTousseApplyWindow.close(); - }, - failure : function(form, action) { - showResult(action.result.message); - } - }); -} - -//是否执行清零操作 -var isCleanAmount = false; -/** - * 打开“外来器械包”的所有的材料清洗分类类型. - */ -function openWashClassifyTypeWindow() { - var foreignTousseNodes = foreignTousseStore.getRootNode().childNodes; - if (foreignTousseNodes.length > 0) { - //定义“清洗分类类型”每一行的数据模型 - Ext4.define('washClassifyTypeModel', { - extend : 'Ext4.data.Model', - fields: [ - {name : 'washClassifyType'}, - {name : 'amount'}, - {name : 'clean'} - ] - }); - - //“清洗分类类型”grid的store - var washClassifyTypeGridStore = Ext4.create('top.Ext4.data.Store', { - model: washClassifyTypeModel, - proxy: { - type: 'memory' - } - }); - - //把数据加到washClassifyTypeGridStore中 - var washClassifyTypeAndAmount = statisticsWashClassifyType(foreignTousseNodes); - for(var key in washClassifyTypeAndAmount){ - if (washClassifyTypeAndAmount.hasOwnProperty(key)) { //过滤掉非“washClassifyTypeAndAmount”本对象的属性比较严谨一些 - var washClassifyTypeItem = Ext4.create('washClassifyTypeModel', { - washClassifyType: key, - amount: washClassifyTypeAndAmount[key] - }); - washClassifyTypeGridStore.add(washClassifyTypeItem); - } - } - - var washClassifyTypeGrid = Ext4.create('top.Ext4.grid.Panel', { - height: 200, - width: 400, - autoScroll : true, - store: washClassifyTypeGridStore, - columns: [{ - text: '清洗分类类型', dataIndex: 'washClassifyType',sortable:false - },{ - text: '数量', dataIndex: 'amount',sortable:false - },{ - text: '清零', dataIndex: 'clean',sortable:false,renderer:function(v, p, record){ - return ""; - } - }], - listeners: { - cellclick: function(_this, td, cellIndex, record, tr, rowIndex, e, eOpts) { - //如果是点击清零图标,就清零 - if (isCleanAmount) { - setCleanAmount(false); - record.set('amount', 0); - } - } - } - }); - - //清洗分类类型的窗口 - var washClassifyTypeWindow = Ext4.create('top.Ext4.window.Window', { - title : '清洗分类类型统计', - resizable :false, - modal : true, - border : false, - plain : true, - layout : 'fit', - buttonAlign : 'center', - buttons: [{ - text: '确认', - handler: function() { - var zeroArray = []; - washClassifyTypeGridStore.each(function(item) { - if (item.get('amount') == 0) { - zeroArray.push(item.get('washClassifyType')); - } - }); + summary.sterilizationMethod = sterilizationMethod; + summary.sterilizationTime = sterilizationTime; + summary.sterilizationTemp = sterilizationTemp; + summary.dryTime = dryTime; + summary.explain = explain; + + var myObj = printConfig[formTypeOfPrinted]; + if(isUndefinedOrNullOrEmpty(myObj)){ + var msg = '未找到('+formTypeOfPrinted+')的打印配置'; + alert(msg); + return; + } + // 自定义打印 + if (!isUndefinedOrNullOrEmpty(myObj.customPrint)) { + myObj.customPrint(summary); + //自定义外来器械申请单打印 + if("foreignTousseAppliation" == formTypeOfPrinted){ + var isSupplyRoomUser = validateIsSupplyRoomUser(); + if (isSupplyRoomUser && printType == 0){ + RecyclingApplicationTableManager.updatePrintStatus(applicationId,function(result){ + //更新完打印状态之后,及时刷新页面 + grid.dwrReload(); + }); + } + } + return; + } + doPrintForeignTousseApplication(printType, summary); + + var isSupplyRoomUser = validateIsSupplyRoomUser(); + + if (isSupplyRoomUser && printType == 0){ + RecyclingApplicationTableManager.updatePrintStatus(applicationId,function(result){ + //更新完打印状态之后,及时刷新页面 + grid.dwrReload(); + }); + } + }else{ + showResult(obj.message); + } + }); +} + +/** + * 获取申请的“外来器械包”的信息. + * return 验证合法返回true,并且把获取申请的“外来器械包”的信息设置到隐藏域foreignTousseInfo,否则返回false + */ +function getForeignTousseInfo(){ + var foreignTousseInfo = []; + var nodes = foreignTousseStore.getRootNode().childNodes; + var msg = ""; + if(nodes.length == 0){ + showResult("必须添加器械包!"); + return false; + } + //遍历每一个外来器械包(一张单或能有多个外来器械包,通常只有一个) + for (var i = 0; i < nodes.length; i++){ + var n = nodes[i]; + if(n.get("supplierName") == null || n.get("supplierName") == ""){ + msg = "外来器械供应商不能为空!"; + break; + } + var foreignTousseName = n.get("tousseName").trim(); + if(!foreignTousseName){ + msg = "外来器械名称不能为空!"; + break; + } + if(n.get("amount") <= 0){ + msg = "外来器械数量必须大于0!"; + break; + } + if(sstsConfig.foreignTousseAddWeight){ + if(n.get("weight") == "" || n.get("weight") == undefined ){ + msg = "请填写外来器械包的重量!"; + break; + } + } + + var materialNodes = n.childNodes; + + var materials = []; + var materialNameJson = {}; + var repeatMaterialName;//重复的材料名称 + var materialAmountPass = false; + //遍历外来器械包下的每一个材料(如果材料名称有重复,则进行提示不予提交) + for (var j=0; j < materialNodes.length; j++){ + var materialNode = materialNodes[j]; + var materialName = materialNode.get("tousseName").trim(); + if(!materialName){ + msg = "外来器械材料必须填写名称!"; + break; + } + + if(materialNameJson[materialName]){ + msg = "【"+ foreignTousseName +"】的材料【"+ materialName +"】重复,请删除重复的材料!"; + repeatMaterialName = materialName; + break; + } + if(!materialNode.get("includeImplant")){ + msg = "外来器械材料必须填写是否植入物!"; + break; + } + if(materialNode.get("amount") > 0){ + materialAmountPass = true; + } + materials.push({ + materialInstanceId : materialNode.get("id"), + materialName : materialName, + amount : materialNode.get("amount"), + includeImplant : materialNode.get('includeImplant'), + usedAmountOfIncludeImplant : materialNode.get('usedAmountOfIncludeImplant'), + minDismantleAmount : materialNode.get('minDismantleAmount') + }); + materialNameJson[materialName] = materialName; + } + if(!materialAmountPass && msg == ""){ + msg = "外来器械材料数量不能都为0!"; + break; + } + + foreignTousseInfo.push({ + tousseItemId : n.get("id"), + tousseDefinitionId : n.get("tousseDefinitionId"), + oldTousseName : n.get("oldTousseName"), + tousseName : n.get("tousseName"), + weight : n.get("weight"), + oldSupplierName : n.get("oldSupplierName"), + supplierName : n.get("supplierName"), + amount : n.get("amount"), + price : n.get("price"), + urgentLevel:n.get("urgentLevel"), + urgentLevelId:n.get("urgentLevelId"), + packageSize : n.get("packageSize"), + foreignToussePrintAmount : n.get("foreignToussePrintAmount"), + splitNumber : n.get("splitNumber"), + materials : materials + }); + } + if(msg == ""){ + top.Ext4.getCmp('foreignTousseInfo').setValue(JSON.stringify(foreignTousseInfo)); + return true; + }else{ + showResult(msg); + return false; + } +} + +//联系人config +var supplierContacConfig = Ext.data.Record.create([ + {name : 'id'}, + {name : 'name'}, + {name : 'phoneNumber'} +]); + +function setBatchNumbers(batches,fireSelect) { + for(var i = 0;i 0){ + var nodeChildCount = 0; + for (var i = 0; i < clickNode.childNodes.length; i++) { + if (clickNode.childNodes[i].data.id == 0 || clickNode.childNodes[i].data.id == "0") { + nodeChildCount++; + } + } + var limitNum = parseInt(sstsConfig.numberOfNewMaterialsForForeignTousse); + if (nodeChildCount >= limitNum) { + showResult("材料最多只能增加"+limitNum+"个", null , sstsConfig.messagePauseTimeOnPackingPage); + return; + } + }else if(sstsConfig.numberOfNewMaterialsForForeignTousse == 0){ + showResult("不允许增加新的材料", null , sstsConfig.messagePauseTimeOnPackingPage); + return; + } + + if(clickNode != null){ + clickNode.appendChild(materialItem); + } +} + +function submintForeignTousseForm(actionType, needPrint){ + /** + * 修复IE6下快速粘贴申请科室,科室编码未赋值问题 + */ + var depart = top.Ext4.ComponentQuery.query("#foreignToussForm #depart")[0].getValue(); + var settleAccountsDepart = top.Ext4.ComponentQuery.query("#foreignToussForm #settleAccountsDepart")[0].getValue(); + var deptCoding = top.Ext4.getCmp('departCoding').getValue(); + var deptCoding2 = top.Ext4.getCmp('settleAccountsDepartCoding').getValue(); + + //从store用用名字再次寻找deptCoding,比较页面上的deptCoding和从store找出来的deptCoding一样不,如果不一样, 有可能用户是复制粘贴科室名称上去, + //而没有从下拉选项中选择(由于做了分页,如果用户粘贴了一个不在当前页面的科室名,下拉选项是不会有值的,所以不用担心从store里找不到该科室的coding) + var storeDeptCoding = getStoreDepartCoding(applyDepartJsonStore,depart); + if (!Ext.isEmpty(storeDeptCoding) && deptCoding != storeDeptCoding){ + //如果不一样,则将deptCoding改成storeDeptCoding + deptCoding = storeDeptCoding; + } + var storeDeptCoding2 = getStoreDepartCoding(settleDepartJsonStore,settleAccountsDepart); + if (!Ext.isEmpty(storeDeptCoding) && deptCoding2 != storeDeptCoding2){ + //如果不一样,则将deptCoding改成storeDeptCoding2 + deptCoding2 = storeDeptCoding2; + } + + if(deptCoding == ""){ + showResult("申请科室编码不能为空!"); + return false; + } + + if(deptCoding2 == ""){ + showResult("结算科室编码不能为空!"); + return false; + } + top.Ext4.getCmp('departCoding').setValue(deptCoding); + top.Ext4.getCmp('settleAccountsDepartCoding').setValue(deptCoding2); + + //新增时判断相关的必填的字段是否有填写 + if(actionType == ACTION_TYPE_ADD && sstsConfig.notAllowBlankFieldsOnForeignTousseInfoPage + && sstsConfig.notAllowBlankFieldsOnForeignTousseInfoPage.length > 0){ + for(var i = 0;i < sstsConfig.notAllowBlankFieldsOnForeignTousseInfoPage.length;i++){ + var notAllowBlankFiled = sstsConfig.notAllowBlankFieldsOnForeignTousseInfoPage[i]; + var fieldCompoent = top.Ext4.getCmp(notAllowBlankFiled); + if(!fieldCompoent){ + showResult("未找到id为"+ notAllowBlankFiled +"的表单元素"); + return false; + } + if(!fieldCompoent.getValue()){ + if(fieldCompoent.fieldLabel){ + showResult(fieldCompoent.fieldLabel + "的值不能空"); + }else{ + showResult("id为"+ notAllowBlankFiled +"的表单元素的值不能空"); + } + return false; + } + } + } + //判断已改成上面的配置项 + /*if(sstsConfig.doctorOfForeignTousseApplicationNotBlank && top.Ext4.getCmp('doctor').getValue() == ''){ + showResult("医生不能为空!"); + top.Ext4.getCmp('doctor').focus(); + return false; + }*/ + + //当外来器械未归还时能否申请 + var canApplyForForeignTousseNotReturn = getObjValueFromJs('sstsConfig.canApplyForForeignTousseNotReturn',true); + if(!canApplyForForeignTousseNotReturn){ + var tousseNode = foreignTousseStore.getRootNode().childNodes[0]; + var tousseName = tousseNode.get("tousseName"); + var supplierName = tousseNode.get("supplierName"); + var id = top.Ext4.getCmp('id').getValue(); + Ext4.Ajax.request({ + url : WWWROOT + '/disinfectSystem/foreigntousseapplication/foreignTousseApplicationAction!isHaveNotReturnApplication.do', + params : {id : id,departCoding : deptCoding, tousseName : tousseName, supplierName : supplierName}, + async : false, + success : function(response, options) { + var result = Ext4.JSON.decode(response.responseText); + if(!result.success){ + showResult(result.message); + return false; + }else{ + submitForm(actionType, needPrint); + } + }, + failure : function(response, opts) { + showResult(response.responseText); + } + }); + }else{ + submitForm(actionType, needPrint); + } +} + +/** + * 提交“外来器械包申请单”. + * @param actionType 提交的类型 + * @param needPrint 提交成功后是否需要打印 + */ +function submitForm(actionType, needPrint){ + foreignTousseForm.form.submit({ + url : WWWROOT + '/disinfectSystem/foreigntousseapplication/foreignTousseApplicationAction!saveForeignTousseApplication.do', + method : 'POST', + waitMsg : '正在保存数据,请稍候', + waitTitle : '提交表单', + params : {actionType : actionType}, + success : function(form, action) { + if (needPrint) { + top.Ext4.getCmp('id').setValue(action.result.id); + top.Ext4.getCmp('applicationTime').setValue(action.result.applicationTime); + printForeignTousseApplication_local(0); + } + showResult(action.result.message); + grid.dwrReload(); + foreignTousseApplyWindow.close(); + }, + failure : function(form, action) { + showResult(action.result.message); + } + }); +} + +//是否执行清零操作 +var isCleanAmount = false; +/** + * 打开“外来器械包”的所有的材料清洗分类类型. + */ +function openWashClassifyTypeWindow() { + var foreignTousseNodes = foreignTousseStore.getRootNode().childNodes; + if (foreignTousseNodes.length > 0) { + //定义“清洗分类类型”每一行的数据模型 + Ext4.define('washClassifyTypeModel', { + extend : 'Ext4.data.Model', + fields: [ + {name : 'washClassifyType'}, + {name : 'amount'}, + {name : 'clean'} + ] + }); + + //“清洗分类类型”grid的store + var washClassifyTypeGridStore = Ext4.create('top.Ext4.data.Store', { + model: washClassifyTypeModel, + proxy: { + type: 'memory' + } + }); + + //把数据加到washClassifyTypeGridStore中 + var washClassifyTypeAndAmount = statisticsWashClassifyType(foreignTousseNodes); + for(var key in washClassifyTypeAndAmount){ + if (washClassifyTypeAndAmount.hasOwnProperty(key)) { //过滤掉非“washClassifyTypeAndAmount”本对象的属性比较严谨一些 + var washClassifyTypeItem = Ext4.create('washClassifyTypeModel', { + washClassifyType: key, + amount: washClassifyTypeAndAmount[key] + }); + washClassifyTypeGridStore.add(washClassifyTypeItem); + } + } + + var washClassifyTypeGrid = Ext4.create('top.Ext4.grid.Panel', { + height: 200, + width: 400, + autoScroll : true, + store: washClassifyTypeGridStore, + columns: [{ + text: '清洗分类类型', dataIndex: 'washClassifyType',sortable:false + },{ + text: '数量', dataIndex: 'amount',sortable:false + },{ + text: '清零', dataIndex: 'clean',sortable:false,renderer:function(v, p, record){ + return ""; + } + }], + listeners: { + cellclick: function(_this, td, cellIndex, record, tr, rowIndex, e, eOpts) { + //如果是点击清零图标,就清零 + if (isCleanAmount) { + setCleanAmount(false); + record.set('amount', 0); + } + } + } + }); + + //清洗分类类型的窗口 + var washClassifyTypeWindow = Ext4.create('top.Ext4.window.Window', { + title : '清洗分类类型统计', + resizable :false, + modal : true, + border : false, + plain : true, + layout : 'fit', + buttonAlign : 'center', + buttons: [{ + text: '确认', + handler: function() { + var zeroArray = []; + washClassifyTypeGridStore.each(function(item) { + if (item.get('amount') == 0) { + zeroArray.push(item.get('washClassifyType')); + } + }); + + if (zeroArray.length > 0) { + var temp = ';' + zeroArray.join(';') + ';'; + for (var i = 0; i < foreignTousseNodes.length; i++) { + var materialNodes = foreignTousseNodes[i].childNodes; + for (var j = 0; j < materialNodes.length; j++) { + var materialNode = materialNodes[j]; + var washClassifyType = materialNode.get('washClassifyType'); + if (temp.indexOf(';' + washClassifyType + ';') != -1) { + materialNode.set('amount', 0); + } + } + } + } + washClassifyTypeWindow.close(); + } + },{ + text: '取消', + handler: function() { + washClassifyTypeWindow.close(); + } + }], + items : washClassifyTypeGrid + }); + washClassifyTypeWindow.show(); + } +} + +/** + * 统计某个“外来器械包”的所有清洗分类类型. + * @param materialNodes 外来器械包的材料节点信息 + */ +function statisticsWashClassifyType(foreignTousseNodes) { + var washClassifyTypeAndAmount = {}; + + for (var i = 0; i < foreignTousseNodes.length; i++) { + var materialNodes = foreignTousseNodes[i].childNodes; + for (var j = 0; j < materialNodes.length; j++) { + var materialNode = materialNodes[j]; + var washClassifyType = materialNode.get('washClassifyType'); + if (washClassifyTypeAndAmount.hasOwnProperty(washClassifyType)) { + washClassifyTypeAndAmount[washClassifyType] += (materialNode.get('amount') ? parseInt(materialNode.get('amount')) : 0); + } else { + washClassifyTypeAndAmount[washClassifyType] = (materialNode.get('amount') ? parseInt(materialNode.get('amount')) : 0); + } + } + } + return washClassifyTypeAndAmount; +} + +/** + * 清除数量. + * @param cleanAmount 是否需要执行清零操作 + */ +function setCleanAmount(cleanAmount) { + isCleanAmount = cleanAmount; +} + +/** + * 校验外来器械包申请单并且“提交”/“提交并打印”. + * @param id 单记录id + * @param needPrint 是否需要打印 + * @param ismodify 是否是点击修改按钮 fasle是,true不是 + */ +function checkAndsubmintForeignTousseForm(id,needPrint,ismodify) { + if (!foreignTousseForm.getForm().isValid()) { + showResult('请正确填写表单各值'); + return false; + } + if(foreignTousseStore.getRootNode().childNodes.length == 0){ + showResult('申请的物品不能为空!'); + return false; + } + var success = getForeignTousseInfo(); + if(success){ + var foreignTousseInfoValue = top.Ext4.getCmp('foreignTousseInfo').getValue(); + if(foreignTousseInfoValue){ + var foreignTousseInfoArray = JSON.parse(foreignTousseInfoValue); + if(foreignTousseInfoArray && foreignTousseInfoArray.length > 0){ + for(var i = 0;i < foreignTousseInfoArray.length;i++){ + var foreignTousseInfoObject = foreignTousseInfoArray[i]; + if(goodsNameImageFile[foreignTousseInfoObject.oldTousseName] + && goodsNameImageFile[foreignTousseInfoObject.oldTousseName].length > 0){ + foreignTousseInfoObject.imageFileIds = goodsNameImageFile[foreignTousseInfoObject.oldTousseName].join(","); + } + if(goodsNameVideoFile[foreignTousseInfoObject.oldTousseName] + && goodsNameVideoFile[foreignTousseInfoObject.oldTousseName].length > 0){ + foreignTousseInfoObject.videoFileIds = goodsNameVideoFile[foreignTousseInfoObject.oldTousseName].join(","); + } + } + top.Ext4.getCmp('foreignTousseInfo').setValue(JSON.stringify(foreignTousseInfoArray)); + } + } + + if(id != "" && !ismodify){//不是新添加的单,并且是点击修改按钮 + submintForeignTousseForm(ACTION_TYPE_UPDATE, needPrint); + }else{ + submintForeignTousseForm(ACTION_TYPE_ADD, needPrint); + } + + } +} + +/** + * 拍照 + * @param tousseName 包定义名称 + * @param tousseDefinitionId 包定义id + */ +/* function takePhone(tousseName,tousseDefinitionId){ + if(Ext4.chromeVersion < 62){ + showResult("请使用62以上版本的chrome浏览器!" , null , sstsConfig.messagePauseTimeOnPackingPage); + return ; + } + // 弹出窗口 + var pageUrl = WWWROOT + '/disinfectsystem/test/video.jsp?goodsName='+ tousseName +'&imageType='+imageTypeCameraApplication; + //如果为打开申请单修改,则可以追加拍照图片 + if(foreignTousseApplicationId){ + pageUrl += '&objectId='+tousseDefinitionId; + } + var style="menubar=no,location=no,directories=no,toolbar=no,statusbar=no,resizable=no,"+getCenterWindowPos(1920,1080)+",scrollbars=no"; + var popwin=window.open(pageUrl,'图片采集',style); + if(popwin != null ){ + popwin.focus(); + } +} */ + +/** + * 拍照 + * @param tousseName 包定义名称 + * @param tousseDefinitionId 包定义id + * @param isLook 是查看还是拍摄 + */ +function takeImgAndVideo(tousseName,tousseDefinitionId,isLook){ + if(Ext4.chromeVersion < 62){ + showResult("请使用62以上版本的chrome浏览器!" , null , sstsConfig.messagePauseTimeOnPackingPage); + return ; + } + + var imageIds = document.getElementById("imageIds").value; + var videoIds = document.getElementById("videoIds").value; + + if(imageIds == ""){ + imageIds = null; + } + + if(videoIds == ""){ + videoIds = null; + } + if(tousseDefinitionId == "null"){ + tousseDefinitionId = ""; + } + + var urls = WWWROOT + '/disinfectsystem/test/videoAndImg.jsp?goodsName='+ tousseName +'&imageType='+imageTypeCameraApplication+'&videoType='+videoType+'&objectId='+tousseDefinitionId+'&videoIds='+videoIds+'&imageIds='+imageIds+'&isLook='+isLook; + var videoImgWin = openFullSizeWindowWithName(urls,true,'图片视频拍摄'); + if(videoImgWin != null ){ + videoImgWin.focus(); + } + +} +/* function takeImgAndVideo(tousseName,tousseDefinitionId,isLook){ + if(Ext4.chromeVersion < 62){ + showResult("请使用62以上版本的chrome浏览器!" , null , sstsConfig.messagePauseTimeOnPackingPage); + return ; + } + var imageIds = document.getElementById("imageIds").value; + var videoIds = document.getElementById("videoIds").value; + if(imageIds == ""){ + imageIds = null; + } + + if(videoIds == ""){ + videoIds = null; + } + if(tousseDefinitionId == "null"){ + tousseDefinitionId = ""; + } + + var urls = WWWROOT + '/disinfectsystem/test/videoAndImg.jsp?goodsName='+ tousseName +'&imageType='+imageTypeCameraApplication+'&videoType='+videoType+'&objectId='+tousseDefinitionId+'&videoIds='+videoIds+'&imageIds='+imageIds+'&isLook='+isLook; + takeImgAndVideoWin = new top.Ext4.window.Window({ + id : 'playVideoWin', + layout : 'fit', + title : tousseName+'的图片/视频', + width :1020,//document.body.clientWidth + height:600,//document.body.clientHeight + modal : true, + border : false, + html:"", + plain : true + }); + + takeImgAndVideoWin.show(); +} */ + +//记录每个包名对应的图片id +//var goodsNameImageFile = {}; +var goodsNameImageFile = {}; +var goodsNameVideoFile = {}; +//接收新上传的imageFile的id +/* function returnImageFileId(goodsName , imageFileId){ + + if(goodsNameImageFile[goodsName]){ + var imageFileArray = goodsNameImageFile[goodsName]; + imageFileArray.push(imageFileId); + goodsNameImageFile[goodsName] = imageFileArray; + }else{ + var imageFileArray = []; + imageFileArray.push(imageFileId); + goodsNameImageFile[goodsName] = imageFileArray; + } +} */ + +/** + * 打开外来器械包申请单的窗口. + * @param id 外来器械包申请单 + * @param formType 操作类型 + * @param ismodify 是点击修改按钮还是点击姓名列的文字链接打开弹窗的,false是点击修改按钮 + */ +function openForeignTousseForm(id, formType,ismodify){ + if(ismodify == undefined){ + ismodify = true; + } + foreignTousseApplicationId = id; + currentWashClassifyType = null; + + //外来器械申请时是否显示原始包定义(如果为true显示原始,否则显示最近一次申请的) + var isShowForeignTousseAncestorDefinitionForApply = getObjValueFromJs('sstsConfig.isShowForeignTousseAncestorDefinitionForApply',false); + + var urgentLevelStore = new Ext4.data.Store({ + proxy : { + type : 'ajax', + url : WWWROOT + '/disinfectSystem/baseData/urgentLevelAction!getUrgentsForSelect.do', + reader : { + type : 'json', + root : 'data' + } + }, + fields : [ + {name : 'id',mapping : 'id'}, + {name : 'urgentLevel',mapping : 'urgentLevel'}, + {name : 'urgentDefaultValue',mapping : 'urgentDefaultValue'} + ] + }); + urgentLevelStore.load(); + + //外来器械包的store + var foreignTousseJsonStore = new Ext4.data.Store({ + proxy : { + type : 'ajax', + url : WWWROOT + '/disinfectSystem/baseData/tousseDefinitionAction!getForeignTousseDefinitionNames.do', + reader : { + type : 'json', + root : 'data' + }, + extraParams : { + isShowForeignTousseAncestorDefinitionForApply : isShowForeignTousseAncestorDefinitionForApply + } + }, + fields : [{name : 'id',mapping : 'id'}, + {name : 'spelling',mapping : 'spelling'}, + {name : 'name',mapping : 'name'}, + {name : 'displayName',mapping : 'displayName'}, + {name : 'amount',mapping : 'amount'}, + {name : 'suppler',mapping : 'suppler'}, + {name : 'includeImplant',mapping : 'includeImplant'}, + {name : 'packageSize',mapping : 'packageSize'}, + {name : 'foreignToussePrintAmount',mapping : 'foreignToussePrintAmount'}, + {name : 'splitNumber',mapping : 'splitNumber'}, + {name : 'materials',mapping : 'materials'}, + {name : 'contactName',mapping : 'contactName'}, + {name : 'phoneNumber',mapping : 'phoneNumber'}, + {name : 'sterilizationMethod',mapping : 'sterilizationMethod'}, + {name : 'sterilizationTemp',mapping : 'sterilizationTemp'}, + {name : 'sterilizationTime',mapping : 'sterilizationTime'}, + {name : 'dryTime',mapping : 'dryTime'}, + {name : 'explain',mapping : 'explain'} + ], + listeners : { + beforeload: function(store, operation, eOpts){ + var suppler1Comp = top.Ext4.getCmp("suppler1"); + if(suppler1Comp != null){ + store.proxy.extraParams.supplierName = suppler1Comp.getValue(); + } + } + } + }); + + //手术间的store + var operationRoomJsonStore = new Ext4.data.Store({ + proxy : { + type : 'ajax', + url : WWWROOT + '/disinfectSystem/baseData/operationRoomAction!getOperationRoomByOrgUnitCode.do', + reader : { + type : 'json', + root : 'data' + } + }, + fields :[ + {name : 'id',mapping : 'id'}, + {name : 'operationRoomName',mapping : 'operationRoomName'}, + {name : 'orgUnitCoding',mapping : 'orgUnitCoding'} + ], + listeners : { + beforeload: function(store, operation, eOpts){ + store.proxy.extraParams.orgUnitCode = orgUnitCodeOperationRoom; + } + } + }); + + /** + * 常用医生的store + */ + var commonlyUsedDoctorJsonStore = new Ext4.data.Store({ + pageSize:200, + proxy : { + type : 'ajax', + url : WWWROOT + '/disinfectSystem/baseData/commonlyUsedDoctorAction!getDoctorBykeyWord.do', + reader : { + type : 'json', + root : 'data' + } + }, + fields : [{name : 'id',mapping : 'id'}, + {name : 'doctor',mapping : 'doctor'} + ] + }); + + //供应商联系人Store + supplierContacJsonStore = new Ext4.data.Store({ + proxy : { + type : 'ajax', + url : WWWROOT + '/disinfectSystem/baseData/supplierAction!getsupplierContacData.do', + reader : { + type : 'json', + root : 'data' + } + }, + fields : [ + {name : 'id',mapping : 'id'}, + {name : 'name',mapping : 'name'}, + {name : 'phoneNumber',mapping : 'phoneNumber'} + ], + listeners : { + beforeload: function(store, operation, eOpts){ + var suppler1Comp = top.Ext4.getCmp("suppler1"); + var supplierName = suppler1Comp.getValue(); + if(supplierName != "" && supplierName != null ){ + store.proxy.extraParams.supplierName = supplierName; + }else{ + //供应商选择框没值就看是否有添加过器械信息,用器械信息里面的供应商名称 + store.proxy.extraParams.supplierName = oldSupplierName; + } + }, + load: function(store, records, eOpts){ + if (records && records.length > 0) { + var record = records[0]; + top.Ext4.getCmp("supplierContactName").setValue(record.get('name')); + top.Ext4.getCmp("supplierPhoneNumber").setValue(record.get('phoneNumber')); + } else { + //因为要支持可输入,所以load后不进行清除,修改依据为ZSSXLRMYY-171 + //top.Ext4.getCmp("supplierContactName").setValue(''); + //top.Ext4.getCmp("supplierPhoneNumber").setValue(''); + } + } + } + }); + + //归还联系人Store + returnContactJsonStore = new Ext4.data.Store({ + proxy : { + type : 'ajax', + url : WWWROOT + '/disinfectSystem/baseData/supplierAction!getsupplierContacData.do', + reader : { + type : 'json', + root : 'data' + } + }, + fields : [ + {name : 'id',mapping : 'id'}, + {name : 'name',mapping : 'name'}, + {name : 'phoneNumber',mapping : 'phoneNumber'} + ], + listeners : { + beforeload: function(store, operation, eOpts){ + var suppler1Comp = top.Ext4.getCmp("suppler1"); + var supplierName = suppler1Comp.getValue(); + if(supplierName != "" && supplierName != null ){ + store.proxy.extraParams.supplierName = supplierName; + }else{ + //供应商选择框没值就看是否有添加过器械信息,用器械信息里面的供应商名称 + store.proxy.extraParams.supplierName = oldSupplierName; + } + } + } + }); + + + //供应室的store + var foldersCompanyJsonStore = new Ext4.data.Store({ + pageSize : 12, + proxy : { + type : 'ajax', + url : WWWROOT + '/disinfectSystem/baseData/supplierAction!getSupplierData.do', + extraParams : {supplierType : supplierType}, + reader : { + type : 'json', + totalProperty:'totalCount', + root : 'data' + } + }, + fields : [ + {name : 'id',mapping : 'id'}, + {name : 'name',mapping : 'name'}, + {name : 'contactName',mapping : 'contactName'}, + {name : 'phoneNumber',mapping : 'phoneNumber'} + ] + }); + + var forigntousseTbar = [ + { + text: "器械包名称:" + },{ + xtype : 'combo', + id : 'foreignTousseName1', + name : 'foreignTousseName1', + queryParam : 'spell', + minChars : 0, + valueField : 'id', + displayField : 'name', + width : 220, + listConfig: {width : 220}, + matchFieldWidth: false, + store : foreignTousseJsonStore, + lazyInit : true, + triggerAction : 'all', + hideTrigger : false, + typeAhead : false, + allowBlank : true, + queryDelay: sstsConfig.onlySelectExistedForeignTousse ? 1300: 0, + forceSelection: sstsConfig.onlySelectExistedForeignTousse ? true: false, + listeners : { + select:function(combo, records, index){ + var suppler1Comp = top.Ext4.getCmp("suppler1"); + suppler1Comp.forceSelection = false; + suppler1Comp.setValue(records[0].get("suppler")); + suppler1Comp.forceSelection = true; + supplierContacJsonStore.load(); + returnContactJsonStore.load(); - if (zeroArray.length > 0) { - var temp = ';' + zeroArray.join(';') + ';'; - for (var i = 0; i < foreignTousseNodes.length; i++) { - var materialNodes = foreignTousseNodes[i].childNodes; - for (var j = 0; j < materialNodes.length; j++) { - var materialNode = materialNodes[j]; - var washClassifyType = materialNode.get('washClassifyType'); - if (temp.indexOf(';' + washClassifyType + ';') != -1) { - materialNode.set('amount', 0); - } - } + //给配置项expandFieldsOfForeignTousseApplicationForm新增字段赋值 + if(sstsConfig.expandFieldsOfForeignTousseApplicationForm && sstsConfig.expandFieldsOfForeignTousseApplicationForm.length > 0){ + var sterilizationMethodVal = top.Ext4.getCmp("sterilizationMethod").getValue(); + var sterilizationTempVal = top.Ext4.getCmp("sterilizationTemp").getValue(); + var sterilizationTimeVal = top.Ext4.getCmp("sterilizationTime").getValue(); + var dryTimeVal = top.Ext4.getCmp("dryTime").getValue(); + var explainVal = top.Ext4.getCmp("explain").getValue(); + if(sterilizationMethodVal == "" && sterilizationTempVal == null && sterilizationTimeVal == null && dryTimeVal == null && explainVal == ""){ + top.Ext4.getCmp("sterilizationMethod").setValue(records[0].get("sterilizationMethod")); + top.Ext4.getCmp("sterilizationTemp").setValue(records[0].get("sterilizationTemp")); + top.Ext4.getCmp("sterilizationTime").setValue(records[0].get("sterilizationTime")); + top.Ext4.getCmp("dryTime").setValue(records[0].get("dryTime")); + top.Ext4.getCmp("explain").setValue(records[0].get("explain")); } - } - washClassifyTypeWindow.close(); - } - },{ - text: '取消', - handler: function() { - washClassifyTypeWindow.close(); - } - }], - items : washClassifyTypeGrid - }); - washClassifyTypeWindow.show(); - } -} - -/** - * 统计某个“外来器械包”的所有清洗分类类型. - * @param materialNodes 外来器械包的材料节点信息 - */ -function statisticsWashClassifyType(foreignTousseNodes) { - var washClassifyTypeAndAmount = {}; - - for (var i = 0; i < foreignTousseNodes.length; i++) { - var materialNodes = foreignTousseNodes[i].childNodes; - for (var j = 0; j < materialNodes.length; j++) { - var materialNode = materialNodes[j]; - var washClassifyType = materialNode.get('washClassifyType'); - if (washClassifyTypeAndAmount.hasOwnProperty(washClassifyType)) { - washClassifyTypeAndAmount[washClassifyType] += (materialNode.get('amount') ? parseInt(materialNode.get('amount')) : 0); - } else { - washClassifyTypeAndAmount[washClassifyType] = (materialNode.get('amount') ? parseInt(materialNode.get('amount')) : 0); - } - } - } - return washClassifyTypeAndAmount; -} - -/** - * 清除数量. - * @param cleanAmount 是否需要执行清零操作 - */ -function setCleanAmount(cleanAmount) { - isCleanAmount = cleanAmount; -} - -/** - * 校验外来器械包申请单并且“提交”/“提交并打印”. - * @param id 单记录id - * @param needPrint 是否需要打印 - * @param ismodify 是否是点击修改按钮 fasle是,true不是 - */ -function checkAndsubmintForeignTousseForm(id,needPrint,ismodify) { - if (!foreignTousseForm.getForm().isValid()) { - showResult('请正确填写表单各值'); - return false; - } - if(foreignTousseStore.getRootNode().childNodes.length == 0){ - showResult('申请的物品不能为空!'); - return false; - } - var success = getForeignTousseInfo(); - if(success){ - var foreignTousseInfoValue = top.Ext4.getCmp('foreignTousseInfo').getValue(); - if(foreignTousseInfoValue){ - var foreignTousseInfoArray = JSON.parse(foreignTousseInfoValue); - if(foreignTousseInfoArray && foreignTousseInfoArray.length > 0){ - for(var i = 0;i < foreignTousseInfoArray.length;i++){ - var foreignTousseInfoObject = foreignTousseInfoArray[i]; - if(goodsNameImageFile[foreignTousseInfoObject.oldTousseName] - && goodsNameImageFile[foreignTousseInfoObject.oldTousseName].length > 0){ - foreignTousseInfoObject.imageFileIds = goodsNameImageFile[foreignTousseInfoObject.oldTousseName].join(","); - } - if(goodsNameVideoFile[foreignTousseInfoObject.oldTousseName] - && goodsNameVideoFile[foreignTousseInfoObject.oldTousseName].length > 0){ - foreignTousseInfoObject.videoFileIds = goodsNameVideoFile[foreignTousseInfoObject.oldTousseName].join(","); - } - } - top.Ext4.getCmp('foreignTousseInfo').setValue(JSON.stringify(foreignTousseInfoArray)); - } - } - - if(id != "" && !ismodify){//不是新添加的单,并且是点击修改按钮 - submintForeignTousseForm(ACTION_TYPE_UPDATE, needPrint); + } + } + } + },{ + text: "供应商:" + },{ + xtype : 'combo', + id : 'suppler1', + name : 'suppler1', + queryParam : 'supplierName', + minChars : 0, + valueField : 'name', + displayField : 'name', + width : 200, + listConfig: {width : 270}, + matchFieldWidth: false, + store : foldersCompanyJsonStore, + pageSize : 12, + queryDelay: 1300, //滞后1300ms发起请求 +// forceSelection : true, + lazyInit : true, + triggerAction : 'all', + hideTrigger : false, + typeAhead : false, + allowBlank : true, + listeners : { + select: function(combo, records, eOpts){ + var foreignTousseName1Comp = top.Ext4.getCmp("foreignTousseName1"); + foreignTousseName1Comp.setValue(''); + foreignTousseJsonStore.reload(); + supplierContacJsonStore.load(); + returnContactJsonStore.load(); + } + } + },{ + text: "加急级别:", + hidden: !sstsConfig.enableUrgentFunction + },{ + xtype : 'combo', + width : 60, + id : 'urgentLevel1', + name : 'urgentLevel1', + store : urgentLevelStore, + valueField : 'id', + displayField : 'urgentLevel', + hidden: !sstsConfig.enableUrgentFunction, + minChars : 0, + forceSelection : true, + lazyInit : true, + editable:true, + triggerAction : 'all', + typeAhead : false + },{ + xtype:'button', + id : 'addTousseBt', + text: "添加", + iconCls : 'btn_ext_add', + handler : function() { + currentWashClassifyType = null; + + var foreignTousseName = top.Ext4.getCmp('foreignTousseName1').getRawValue(); + var tousseDefinitionId = top.Ext4.getCmp('foreignTousseName1').getValue(); + if(isNaN(tousseDefinitionId)){ + tousseDefinitionId = ""; + } + var suppler = top.Ext4.getCmp('suppler1').getValue(); + if(sstsConfig.enableUrgentFunction){ + var urgentLevel = top.Ext4.getCmp('urgentLevel1').getRawValue(); + var urgentLevelId = top.Ext4.getCmp('urgentLevel1').getValue(); + } + + //保存添加器械信息时带的供应商名称 + oldSupplierName =suppler; + if(Ext4.isEmpty(foreignTousseName)){ + showResult("请选择器械包!"); + top.Ext4.getCmp('foreignTousseName1').focus(); + return false; + }else if(Ext4.isEmpty(suppler)){ + showResult("请选择供应商!"); + top.Ext4.getCmp('suppler1').focus(); + return false; + } + + //是否允许申请多套外来器械包 + if(!sstsConfig.allowApplyMultipleForeignTousse && foreignTousseStore.getRootNode().childNodes.length > 0){ + showResult("只能申请一个外来器械包!"); + return false; + } + + //1、获取外来器械包的部分属性 + var record = foreignTousseJsonStore.findRecord("id", tousseDefinitionId); + var materials = []; + var packageSize = ''; + var foreignToussePrintAmount = 0; + var splitNumber = 0; + if(record){ + packageSize = record.get('packageSize'); + foreignToussePrintAmount = record.get('foreignToussePrintAmount'); + splitNumber = record.get('splitNumber'); + } + + //2、获取外来器械包的材料信息 + Ext4.Ajax.request({ + url : WWWROOT + '/disinfectSystem/baseData/tousseDefinitionAction!loadForeignTousseIncludeMaterials.do', + params : {id : tousseDefinitionId}, + async : false, + success : function(response, options) { + var result = Ext4.JSON.decode(response.responseText); + if(result.success){ + var materialsJson = result.data; + for(var i = 0;i < materialsJson.length;i++){ + materials.push({ + id : materialsJson[i].id, //材料实例的id + tousseName : materialsJson[i].materialName, + includeImplant : materialsJson[i].includeImplant, + amount : materialsJson[i].amount, + usedAmountOfIncludeImplant : 0, + implantAmountOfUseRecord : 0, + minDismantleAmount : materialsJson[i].minDismantleAmount, + washClassifyType:materialsJson[i].washClassifyType, + type : 'material', + leaf : true + }); + } + + } + }, + failure : function(response, opts) { + showResult(response.responseText); + } + }); + + var tousseItem = Ext4.create('foreignTousseItemModel',{ + id : 0, + tousseDefinitionId : tousseDefinitionId, + oldTousseName: foreignTousseName, + tousseName: foreignTousseName, + weight:"", + oldSupplierName : suppler, + supplierName : suppler, + packageSize : (packageSize ? packageSize : defaultPackageSize), + foreignToussePrintAmount : (foreignToussePrintAmount ? foreignToussePrintAmount : defaultforeignToussePrintAmount), + splitNumber : (splitNumber ? splitNumber : defaultSplitNumber), + amount : 1, + includeImplant : '', + price : foreignToussePriceOfSysParams, + urgentLevel:urgentLevel, + urgentLevelId:urgentLevelId, + type : 'tousse', + usedAmountOfIncludeImplant : 0, + implantAmountOfUseRecord : 0, + minDismantleAmount : 0, + leaf : false, + expanded : true, + children : materials + }); + var rootNode = foreignTousseStore.getRootNode(); + rootNode.appendChild(tousseItem); + top.Ext4.getCmp('foreignTousseName1').setValue(''); + } + },{ + text: "", + id : 'materialAmountInfo' + } + ]; + + var bbars = []; + //是否隐藏植入物使用数量列 + var includeImplantUsedAmountHidden = false; + var confirmRecycle = false; + if(formType == 'apply'){ + includeImplantUsedAmountHidden = true; + + //是否禁用“确认归还”按钮 + var disableReturn = true; + //是否禁用“提前归还”按钮 + var disableEarlyReturn = true; + if(id && !SSTS_ForeignTousseApplication_Return){ + DWREngine.setAsync(false); + ForeignTousseApplicationTableManager.isForeignTousseCanReturn(id,function(result){ + var json = JSON.parse(result); + disableReturn = json.disableReturn; + disableEarlyReturn = json.disableEarlyReturn; + }); + DWREngine.setAsync(true); + } + + bbars = [{ + text : '打印预览', + hidden : (id == "" ? true : false), + handler : function() { + printForeignTousseApplication_local(1); + } + },{ + text : '打印', + hidden : (id == "" ? true : false), + handler : function() { + printForeignTousseApplication_local(0); + } + },{ + text : '提交', + id : 'commitBtn', + //hidden:(id != ""), + hidden:(id != "" && ismodify),//点击姓名列的文字链接和点击工具栏的修改按钮,隐藏提交按钮 + handler : function() { + if(document.getElementById("imageIdsAndGoodsName")){ + goodsNameImageFile = document.getElementById("imageIdsAndGoodsName").value; + if(goodsNameImageFile != ""){ + goodsNameImageFile = JSON.parse(goodsNameImageFile); + } + } + + if(document.getElementById("videoIdsAndGoodsName").value){ + goodsNameVideoFile = document.getElementById("videoIdsAndGoodsName").value; + if(goodsNameVideoFile != ""){ + goodsNameVideoFile = JSON.parse(goodsNameVideoFile); + } + } + checkAndsubmintForeignTousseForm(id,false,ismodify); + } + },{ + text : '提交并打印', + id : 'commitPrintBtn', + hidden:(id != "" && ismodify),//点击姓名列的文字链接和点击工具栏的修改按钮,隐藏提交按钮 + //hidden:(id != ""), + handler : function() { + checkAndsubmintForeignTousseForm(id,true,ismodify); + } + },{ + text : '确认归还', + id : 'returnBtn', + disabled : disableReturn, + handler : function(){ + var tmpWindow = new top.Ext4.window.Window({ + title : '请确认', + modal : true, + border : true, + html : '
  确认归还' + entityName + '信息?  

', + buttonAlign : 'center', + buttons:[{ + text:'是', + handler : function() { + tmpWindow.close(); + if(!foreignTousseForm.getForm().isValid()){ + showResult('请正确填写表单各值'); + return false; + } + var success = getForeignTousseInfo(); + if(success){ + submintForeignTousseForm(actionType_confirmReturn, false); + } + } + },{ + text:'否', + handler : function() { + tmpWindow.close(); + } + }] + }); + tmpWindow.show(); + } + },{ + text : '提前归还', + disabled:disableEarlyReturn, + handler : function(){ + //由于Ext4.MessageBox.confirm兼容性问题,在全部申请单列表中点【是】按钮事件无反应,故而改用window显示 + var tmpWindow = new top.Ext4.window.Window({ + title : '请确认', + modal : true, + border : true, + html : '
  提前归还会终止申请单,并删除装配任务,是否要提前归还?  

', + buttonAlign : 'center', + buttons:[{ + text:'是', + handler : function() { + tmpWindow.close(); + if(!foreignTousseForm.getForm().isValid()){ + showResult('请正确填写表单各值'); + return false; + } + var success = getForeignTousseInfo(); + if(success){ + submintForeignTousseForm(actionType_confirmReturn, false); + } + } + },{ + text:'否', + handler : function() { + tmpWindow.close(); + } + }] + }); + + tmpWindow.show(); + } + },{ + text : '查看清洗分类类型', + hidden:((id || !sstsConfig.washClassifyTypeFastClearing) ? true : false), + handler : function() { + openWashClassifyTypeWindow(); + } + },{ + text : '取消', + handler : function() { + foreignTousseApplyWindow.close(); + } + }] + }else if(formType == 'recycle'){ + + }else if(formType == 'interfere'){ + bbars = [{ + text : '保存', + handler : function() { + if (!foreignTousseForm.getForm().isValid()) { + showResult('请正确填写表单各值'); + return false; + } + if(foreignTousseStore.getRootNode().length == 0){ + showResult('申请的物品不能为空!'); + return false; + } + var success = getForeignTousseInfo(); + if(success){ + submintForeignTousseForm(ACTION_TYPE_INTERFERE, false); + } + } + },{ + text : '取消', + handler : function() { + foreignTousseApplyWindow.close(); + } + }] + } + + //foreignTousseTreeGrid的列 + var foreignTousseColumns = [{ + dataIndex : 'tousseDefinitionId', + hidden : true + },{ + header: '供应商', + width : includeImplantUsedAmountHidden ? 200 : 170, + sortable: true, + xtype : 'treecolumn', + dataIndex: 'supplierName', + editor: { + xtype : 'combo', + valueField : 'name', + displayField : 'name', + store : foldersCompanyJsonStore, + pageSize : 12, + listConfig: {width : 270}, + queryParam : 'supplierName', + minChars : 0, + matchFieldWidth: false, + forceSelection : true, + lazyInit : true, + triggerAction : 'all', + hideTrigger : false, + typeAhead : false, + allowBlank: false, + listeners : { + focus : function(value) { + var supplierName = top.Ext4.getCmp('suppler1').getValue(); + oldSupplierName = supplierName; + } + } + } + },{ + header: '器械包/材料名称', + width : includeImplantUsedAmountHidden ? 200 : 170, + align:'center', + sortable: true, + dataIndex: 'tousseName', + editor: { + xtype: 'textfield', + allowDecimals :false, + minValue: 0, + listeners : { + 'focus':function(){ + this.selectText(); + } + } + } + },{ + header: '是否植入物', + width : 75, + align:'center', + sortable: true, + dataIndex: 'includeImplant', + editor: { + xtype : 'combo', + id : 'isIncludeImplant', + name : 'isIncludeImplant', + width : 130, + valueField : 'yesOrNo', + displayField : 'yesOrNo', + store : new top.Ext4.data.SimpleStore({ + fields : [ 'yesOrNo' ], + data : [['是'],['否']] + }), + allowBlank: true, + forceSelection : true + } + },{ + header: '数量', + width : 40, + align:'center', + sortable: true, + dataIndex : 'amount', + editor: { + xtype: 'numberfield', + allowBlank: true, + allowDecimals :false, + minValue: 0, + listeners : { + 'focus':function(){ + this.selectText(); + } + } + } + },{ + header: '单价', + width : 40, + align:'center', + sortable: true, + dataIndex: 'price', + editor: { + xtype: 'numberfield', + allowBlank: true, + allowDecimals :true, + decimalPrecision: 2, + minValue: 0, + listeners : { + 'focus':function(){ + this.selectText(); + } + } + } + },{ + header: '加急级别', + width : 60, + align:'center', + sortable: true, + dataIndex: 'urgentLevel', + hidden:!sstsConfig.enableUrgentFunction, + editor: { + xtype : 'combo', + id : 'urgentLevel', + name : 'urgentLevel', + valueField : 'urgentLevel', + displayField : 'urgentLevel', + store : urgentLevelStore, + allowBlank: true, + forceSelection : true, + listeners : { + select: function(v,r,p) { + currentRecord.set("urgentLevel",r[0].data.urgentLevel); + currentRecord.set("urgentLevelId",r[0].data.id); + }, + blur:function(thiz){ + if(thiz.getValue() == null){ + currentRecord.set('urgentLevelId',null); + } + } + } + } + },{ + header:'植入物使用数量', + width:100, + align:'center', + dataIndex:'usedAmountOfIncludeImplant', + hidden : includeImplantUsedAmountHidden, + editor: { + xtype: 'numberfield', + allowBlank: true, + allowDecimals :false, + minValue: 0, + listeners : { + 'focus':function(){ + this.selectText(); + } + } + } + },{ + header: '可拆卸数量', + width : 75, + align:'center', + sortable: true, + dataIndex: 'minDismantleAmount', + editor: { + xtype: 'numberfield', + allowBlank: true, + allowDecimals :false, + minValue: 0, + listeners : { + 'focus':function(){ + this.selectText(); + } + } + } + },{ + header: '打印份数', + width : 75, + align:'center', + sortable: true, + hidden: !sstsConfig.enableForeignToussePrintAmount, + dataIndex: 'foreignToussePrintAmount', + editor: { + xtype: 'numberfield', + allowBlank: true, + allowDecimals :false, + minValue: 0, + listeners : { + 'focus':function(){ + this.selectText(); + } + } + } + },{ + header: '拆包份数', + width : 75, + align:'center', + sortable: true, + hidden: !sstsConfig.enableForeignTousseSplitNumberProperty, + dataIndex: 'splitNumber', + editor: { + xtype: 'numberfield', + allowBlank: true, + allowDecimals :false, + minValue: 0, + listeners : { + 'focus':function(){ + this.selectText(); + } + } + } + },{ + header: '大小', + width : 60, + align:'center', + sortable: true, + dataIndex: 'packageSize', + editor: { + xtype : 'combo', + id : 'packageSize', + name : 'packageSize', + valueField : 'value', + displayField : 'value', + editable:false, + store : new top.Ext4.data.SimpleStore({ + fields : [ 'value' ], + data : packageSizeArray + }), + allowBlank: true, + forceSelection : true + } + },{ + dataIndex : 'oldTousseName', + hidden : true + },{ + dataIndex : 'oldSupplierName', + hidden : true + },{ + dataIndex : 'urgentLevelId', + hidden : true + }, { + header: '图片', + width : 80, + align:'center', + sortable: true, + dataIndex: 'type', + renderer: function(v,p,record,rowIndex, columnIndex, store){ + var isLeaf = record.get('leaf'); + var tousseName = record.get('tousseName'); + var tousseDefinitionId = record.get('tousseDefinitionId'); + if(!isLeaf){ + var currentPage = 1; + var materialId = ""; + var imgName = IMAGE_TYPE_TOUSSE; + var iframeHeight = window.screen.height; + var url = WWWROOT+'/disinfectsystem/touchScreen/recycle/tousseImage.jsp?resolution=1980&clientHeight='+iframeHeight+'&parentPageName=application&tousseDefinitionID='+tousseDefinitionId+'&materialId='+materialId+'&tousseName='+encodeURIComponent(tousseName)+'&imgName='+encodeURIComponent(imgName)+'&number='+currentPage; + + //var btnHtml = ""; + var btnHtml = ""; + if(sstsConfig.showCameraPhoto){ + /* if(id){ + //只有再次打开该单修改时,才能查看图片 + btnHtml += " "; + } */ + //btnHtml += " "; + if(id == ""){ + tousseDefinitionId = null; + } + btnHtml += " "; + } + return btnHtml; + } + } + }]; + //增加重量字段 + if(sstsConfig.foreignTousseAddWeight){ + foreignTousseColumns.splice(3, 0, { + header: '重量(公斤)', + width : 70, + align:'center', + sortable: true, + dataIndex: 'weight', + editor: { + xtype: 'numberfield', + allowBlank: false, + allowNegative: false, // 不允许负数 + allowDecimals: true, // 允许小数点 + minValue: 0, + listeners : { + 'focus':function(){ + this.selectText(); + } + } + } + }); + } + //foreignTousseTreeGrid的store + foreignTousseStore = new Ext4.data.TreeStore({ + model: foreignTousseItemModel, + proxy: { + type: 'ajax', + url: WWWROOT + '/disinfectSystem/foreigntousseapplication/foreignTousseApplicationAction!loadForeignTousseItems.do' + }, + listeners : { + beforeload : function(store, operation) { + var params = {//参数 + applicationId : id, + confirmRecycle : confirmRecycle + }; + Ext4.apply(store.proxy.extraParams, params); + }, + datachanged: function(store,eOpts){ + refreshMaterialAmountInfo(); + }, + update: function( store, record, operation, eOpts ){ + refreshMaterialAmountInfo(); + } + }, + folderSort: true + }); + + + + settleDepartJsonStore = new Ext4.data.JsonStore({ + autoLoad: true, + proxy : { + type : 'ajax', + url : WWWROOT + '/disinfectSystem/baseData/supplyRoomConfigAction!getSettleAccountsDepartJson.do?showDisableOrgUnit=false', + reader : { + type : 'json', + root : 'data' + } + }, + fields : [ + {name : 'id',mapping : 'id'}, + {name : 'name',mapping : 'name'} + ] + }); + + //申请科室的store + applyDepartJsonStore = new Ext4.data.Store({ + //limit参数,每页显示条数,默认为25 + pageSize: isIE6OrIE7 ? 15 : 50, + proxy : { + type : 'ajax', + url : WWWROOT + '/disinfectSystem/baseData/supplyRoomConfigAction!getApplicationDepartJson.do?showDisableOrgUnit=false', + reader : { + type : 'json', + totalProperty : 'totalCount', + root : 'data' + } + }, + fields : [ + {name : 'id',mapping : 'id'}, + {name : 'name',mapping : 'name'} + ] + }); + + //simon-add:处理科室数据源,加载时设置默认处理科室 + handleDepartmentStore = new Ext4.data.JsonStore({ + autoLoad: true, + proxy : { + type : 'ajax', + url : WWWROOT + '/disinfectSystem/baseData/supplyRoomConfigAction!getfTHandleDepartAndTaskGroupJsonArray.do', + reader : { + type : 'json', + root : 'data' + } + }, + fields : [ + {name : 'handleDepartCoding',mapping : 'departCode'}, + {name : 'handleDepart',mapping : 'departName'}, + {name : 'taskGroup',mapping : 'taskGroup'} + ], + listeners:{ + load:function(records){ + //simon-add:items为外来器械配置的处理科室,高级视图中"科室供应室配置"中“外来器械参数设置” + var handleDeparts=records.data.items; + var HDLength=handleDeparts.length; + var handleDepartStore = new Ext4.data.JsonStore({ + autoLoad: true, + proxy : { + type : 'ajax', + url : WWWROOT + '/systemmanage/getCssdsByApplyDepartAndType.do', + reader : { + type : 'json', + root : 'data' + } + }, + fields : [ + {name : 'defaultHandleDepart',mapping : 'defaultHandleDepart'}, + {name : 'cssdOrgUnitCode',mapping : 'cssdOrgUnitCode'}, + {name : 'name',mapping : 'cssdOrgUnitName'} + ], + listeners:{ + beforeload : function(store, operation, eOpts){ + //每次加载之前传“申请科室编码”和“物品类型”两个参数 + store.proxy.extraParams.applyDepartCode = top.Ext4.getCmp('departCoding').getValue(); + store.proxy.extraParams.tousseType = "器械包"; + }, + load:function(records){ + //simon-add:defualtHandleDeparts为可服务此申请科室的供应室,高级视图中"供应室服务临床科室配置" + var defualtHandleDeparts=records.data.items; + var DHDLength=defualtHandleDeparts.length; + /* + * 首先判断外来器械配置的处理科室handleDeparts数量 + * 1.为0则不选择,为1则选择此科室 + * 大于1,继续判断handleDeparts与服务此申请科室的供应室defualtHandleDeparts的交集情况 + * 1.交集为0,不设置默认处理科室 + * 2.为1,则设置此科室 + * 3.大于1,再判断其中有没有“是否默认处理科室”参数为“是”的科室。 + * 4.(有多个科室同时参数设置“是”的情况?)有“是”,则选择此科室,没有是,则不设置默认处理科室 + */ + + + //外来器械配置的处理科室handleDeparts数量为1则选择此科室 + if(HDLength==1){ + var handleDepart=handleDeparts[0].data.handleDepart; + var handleDepartCoding=handleDeparts[0].data.handleDepartCoding; + top.Ext4.getCmp("handleDepart").setValue(handleDepart); + top.Ext4.getCmp("handleDepartCoding").setValue(handleDepartCoding); + }else if(HDLength>1){ + //handleDeparts与服务此申请科室的供应室defualtHandleDeparts的交集 + var sameArray=new Array(); + //“是否默认处理科室”参数为“是”的科室在sameArray中的index + var indexArray=new Array(); + for(var h=0;h1){ + /*交集大于1,再判断其中有没有“是否默认处理科室”参数为“是”的科室,如果参数为“是”的科室数量为1则设置为此科室 + * 其他情况,不设置。 + */ + if(indexArray.length==1){ + var index=indexArray[0]; + var handleDepart=sameArray[index].handleDepart; + var handleDepartCoding=sameArray[index].handleDepartCoding; + top.Ext4.getCmp("handleDepart").setValue(handleDepart); + top.Ext4.getCmp("handleDepartCoding").setValue(handleDepartCoding); + } + } + } + } + } + }); + + } + } + + }); + + //处理方式的store + var processTypeJsonStore = new Ext4.data.Store({ + fields : [ 'typeName' ], + proxy : { + type : 'ajax', + url : WWWROOT + '/disinfectSystem/foreigntousseapplication/foreignTousseApplicationAction!getProcessType.do', + reader : { + type : 'array' + } + } + }); + var heightVal = 26; + +/* foreignTousseForm = new top.Ext4.form.Panel({ + id : 'foreignToussForm', + frame : true, + border : 0, + labelSeparator : ':', + bodyPadding : '5 5 0', + autoScroll : true, + buttonAlign : 'center', + buttons : bbars, + fieldDefaults : { + labelAlign : 'right' + }, + layout : { + type : 'vbox' + }, + items : [ + { + xtype : 'fieldset', + title : '基础信息', + collapsible : false, + height : 360, + width : top.screen.width > 1280 ? 930 : 920,//900 + defaultType : 'textfield', + layout : { + type : 'vbox' + }, + items : [ + { + xtype : 'container', + width : '100%', + layout : 'hbox', + flex : 1, + items : [ + {xtype : 'hidden',name : 'id',id : 'id'}, + {xtype : 'hidden',fieldLabel : '科室编号 ',name : 'departCoding',id : 'departCoding'}, + {xtype : 'hidden',fieldLabel : '结算科室编号',name : 'settleAccountsDepartCoding',id : 'settleAccountsDepartCoding'}, + //simon-add + {xtype : 'hidden',fieldLabel : '处理科室编号',name : 'handleDepartCoding',id : 'handleDepartCoding'}, + {xtype : 'hidden',name : 'foreignTousseInfo',id : 'foreignTousseInfo'}, + {xtype : 'hidden',name : 'barcodeStr',id : 'barcodeStr'}, + {xtype : 'hidden',name : 'recyclingTime',id : 'recyclingTime'}, + { + xtype : 'textfield', + width : '33.3%', + fieldLabel : '申请人', + maxLength : '50', + id : 'applicant', + name : 'applicant', + allowBlank : false, + flex : 1, + readOnly : true, + value : $Id('userName').value, + readOnly : true, + fieldCls : 'fieldReadOnlyNoRemoveAndTop' + },{ + xtype : 'textfield', + width : '33.3%', + fieldLabel : '申请时间', + id : 'applicationTime', + name : 'applicationTime', + editable:false, + flex : 1, + format : 'Y-m-d H:i', + fieldCls : 'fieldReadOnlyNoRemoveAndTop' + },{ + xtype : 'textfield', + width : '33.3%', + fieldLabel : '流水号', + id : 'serialNumber', + name : 'serialNumber', + allowBlank : true, + readOnly:true, + flex : 1, + fieldCls : 'fieldReadOnlyNoRemoveAndTop' + } + ] + },{ + xtype : 'container', + width : '100%', + layout : 'hbox', + flex : 1, + items : [{ + xtype : 'combo', + width : '33.3%', + fieldLabel : '申请科室', + id : 'depart', + name : 'depart', + queryParam : 'spell', + minChars : 0, + valueField : 'name', + displayField : 'name', + store : applyDepartJsonStore, + pageSize : 100, + matchFieldWidth: false, + listConfig: {width: 300}, + queryDelay: 1300, //滞后1300ms发起请求 + forceSelection : true, + lazyInit : true, + triggerAction : 'all', + hideTrigger : true, + typeAhead : false, + allowBlank : false, + flex : 1, + listeners:{ + select:function(combo, record, index){ + var setObj = { + 'departCoding' : 'id', + 'settleAccountsDepart' : 'name', + 'settleAccountsDepartCoding' : 'id' + } + + if(saveOrgUnitCode != null && saveOrgUnitCode != record[0].get('id')){ + top.Ext4.getCmp('operationRoom').setValue(""); + saveOrgUnitCode = null; + } + + orgUnitCodeOperationRoom = record[0].get('id'); + operationRoomJsonStore.proxy.extraParams.orgUnitCode = orgUnitCodeOperationRoom; + operationRoomJsonStore.load(); + resetComboData({val: record[0].get('name'), property : 'name'}, settleDepartJsonStore, setObj); + //simon-update:根据"申请科室"值,查询对应设置的"结算科室" + DWREngine.setAsync(false); + Ext4.Ajax.request({ + url : WWWROOT + '/disinfectSystem/baseData/supplyRoomConfigAction!getSupplyRoomConfigByCoding.do', + params : {'orgUnitCode':record[0].get('id'),'type':3}, + timeout : 600000, + success : function(response, options) { + var result= Ext4.JSON.decode(response.responseText); + //simon-add:如果申请科室配置的默认结算科室不为空,那么设置此值为页面结算科室默认值 + if(!isUndefinedOrNullOrEmpty(result.settleAccountsDepart)&&!isUndefinedOrNullOrEmpty(result.settleAccountsDepartCoding)){ + top.Ext4.getCmp('settleAccountsDepart').setValue(result.settleAccountsDepart); + top.Ext4.getCmp('settleAccountsDepartCoding').setValue(result.settleAccountsDepartCoding); + } + }, + failure : function(response, opts) { + showResult(response.responseText); + } + }); + DWREngine.setAsync(true); + }, + focus : function(thiz){ + thiz.selectText(); + }, + change : function(combo, record, index){ + var departVal = top.Ext4.getCmp("depart").getValue(); + if(departVal == "" || departVal == null || departVal == undefined){ + orgUnitCodeOperationRoom = ""; + operationRoomJsonStore.proxy.extraParams.orgUnitCode = orgUnitCodeOperationRoom; + operationRoomJsonStore.load(); + } + } + } + },{ + xtype : 'combo', + fieldLabel : '结算科室', + id : 'settleAccountsDepart', + name : 'settleAccountsDepart', + queryParam : 'spell', + minChars : 0, + valueField : 'name', + displayField : 'name', + store : settleDepartJsonStore, + forceSelection : true, + lazyInit : true, + triggerAction : 'all', + width : '33.3%', + queryDelay: 1300, //滞后1300ms发起请求 + hideTrigger : true, + typeAhead : false, + allowBlank : false, + flex : 1, + listeners:{ + select:function(combo, record, index){ + resetComboData({val : record[0].get('name'),property : 'name'}, settleDepartJsonStore, {'settleAccountsDepartCoding' : 'id'}); + }, + focus : function(thiz){ + thiz.selectText(); + } + } + }] + },{ + xtype : 'container', + width : '100%', + layout : 'hbox', + flex : 1, + items : [ + //simon-add + { + xtype : 'combo', + fieldLabel : '处理科室', + id : 'handleDepart', + name : 'handleDepart', + minChars : 0, + valueField : 'handleDepart', + displayField : 'handleDepart', + store : handleDepartmentStore, + forceSelection : false, + lazyInit : true, + width : '33.3%', + triggerAction : 'all', + hideTrigger : false, + typeAhead : false, + allowBlank : false, + flex : 1, + listeners:{ + select:function(combo, records, index){ + var record = transformRecords(records); + var handleDepart=record.data.handleDepart; + var handleDepartCoding=record.data.handleDepartCoding; + top.Ext4.getCmp("handleDepart").setValue(handleDepart); + top.Ext4.getCmp("handleDepartCoding").setValue(handleDepartCoding); + }, + focus : function(thiz){ + thiz.selectText(); + } + } + }, + { + xtype : 'combo', + fieldLabel : '处理方式', + id : 'processType', + name : 'processType', + valueField : 'typeName', + displayField : 'typeName', + store : processTypeJsonStore, + allowBlank: true, + forceSelection : true, + triggerAction : 'all', + flex : 1 + } + ] + },{ + xtype : 'container', + width : '100%', + layout : 'hbox', + flex : 1, + items : [ + { + xtype : 'textfield', + fieldLabel : '住院号', + maxLength : '50', + id : 'hospitalNumber', + name : 'hospitalNumber', + width : '33.3%', + allowBlank : true, + enableKeyEvents : true, + listeners : { + specialkey : function(field, ee) { + if (ee.getKey() == Ext4.EventObject.ENTER) { + var jsonStr = "{\"patientNum\":\"" + field.value + + "\",\"numType\":\"hospitalNum\",\"sourcePage\":\"0\"}"; + loadPatientInfoByValAndType(jsonStr); + } + } + }, + flex : 1 + },{ + xtype : 'textfield', + fieldLabel : '诊疗号', + maxLength : '100', + id : 'clinicNumber', + name : 'clinicNumber', + width : '33.3%', + allowBlank : true, + enableKeyEvents : true, + listeners : { + specialkey : function(field, ee) { + if (ee.getKey() == Ext4.EventObject.ENTER) { + var jsonStr = "{\"patientNum\":\"" + field.value + + "\",\"numType\":\"treatmentNum\",\"sourcePage\":\"0\"}"; + loadPatientInfoByValAndType(jsonStr); + } + } + }, + flex : 1 + }, { + xtype : 'textfield', + fieldLabel : '病人姓名', + maxLength : '50', + id : 'patient', + name : 'patient', + width : '33.3%', + allowBlank : true, + flex : 1 + } + ] + },{ + xtype : 'container', + width : '100%', + layout : 'hbox', + hidden : sstsConfig.hidePatientArea, + flex : 1, + items : [{ + xtype : 'textfield', + fieldLabel : '病区', + maxLength : '50', + id : 'patientArea', + name : 'patientArea', + width : '33.3%', + allowBlank : true, + flex : 1 + },{ + xtype : 'textfield', + fieldLabel : '病室', + maxLength : '50', + id : 'roomNumber', + name : 'roomNumber', + width : '33.3%', + allowBlank : true, + hidden : sstsConfig.hideRoomNumber, + flex : 1 + }, { + xtype : 'textfield', + fieldLabel : '床位', + maxLength : '50', + id : 'bedNumber', + name : 'bedNumber', + width : '33.3%', + allowBlank : true, + hidden : sstsConfig.hideRoomNumber, + flex : 1 + } + ] + },{ + xtype : 'container', + width : '100%', + layout : 'hbox', + flex : 1, + items : [ + { + xtype : 'textfield', + fieldLabel : '年龄', +// maxLength : '3', + id : 'patientAge', + name : 'patientAge', + width : '33.3%', +// allowDecimals : false, + allowNegative : false, + flex : 1 + }, { + xtype : 'combo', + fieldLabel : '性别', + valueField : 'typeName', + displayField : 'typeName', + id : 'patientSex', + name : 'patientSex', + width : '33.3%', + mode : 'local', + triggerAction : 'all', + forceSelection : true, + editable : false, + store : new top.Ext4.data.SimpleStore( { + fields : [ 'typeName' ], + data : [['男'],['女']] + }), + flex : 1 + },{ + xtype : 'textfield', + fieldLabel : '病人所属科室', + maxLength : '16', + id : 'ascriptionDepartment', + name : 'ascriptionDepartment', + width : '33.3%', + allowBlank : true, + flex : 1 + } + ] + },{ + xtype : 'container', + width : '100%', + layout : 'hbox', + flex : 1, + items : [ + { + xtype : 'textfield', + fieldLabel : '手术名称', + id : 'surgery', + name : 'surgery', + width : '33.3%', + allowBlank : true, + flex : 1 + }, { + xtype : 'datefield', + fieldLabel : '手术时间', + id : 'operationTime', + name : 'operationTime', + width : '33.3%', + selectOnFocus :true, + format : 'Y-m-d H:i', + allowBlank : true, + flex : 1 + },{ + fieldLabel : '医生', + xtype : 'combo', + id : 'doctor', + name : 'doctor', + width : '33.3%', + flex : 1, + queryParam : 'spell', + minChars : 0, + //valueField : 'doctorName', + displayField : 'doctor', + pageSize : 0, + listConfig: {width: 300}, + forceSelection : true, + lazyInit : true, + triggerAction : 'all', + hideTrigger : false, + typeAhead : false, + allowBlank : true, + forceSelection:false, + store : commonlyUsedDoctorJsonStore + + } + ] + },{ + xtype : 'container', + width : '100%', + layout : 'hbox', + flex : 1, + items : [ + { + xtype : 'combo', + fieldLabel : '手术间', + id : 'operationRoom', + name : 'operationRoom', + width : '33.3%', + flex : .33, + maxLength:10, + maxLengthText :'长度超过限制,不能保存!', + // queryParam : 'spell', + minChars : 0, + valueField : 'operationRoomName', + displayField : 'operationRoomName', + listConfig: {width : 193}, + matchFieldWidth: false, + store : sstsConfig.onlySelectExistedOperationRoom ? operationRoomJsonStore : "", + lazyInit : true, + triggerAction : 'all', + hideTrigger : sstsConfig.onlySelectExistedOperationRoom ? false: true,//隐藏向下箭头 + typeAhead : false, + allowBlank : true, + editable: sstsConfig.onlySelectExistedOperationRoom ? false : true, + forceSelection : sstsConfig.onlySelectExistedOperationRoom ? true: false, + listeners :{ + select:function(combo, record, index ){ + saveOrgUnitCode = record[0].get("orgUnitCoding"); + } + } + },{ + xtype : 'combo', + fieldLabel : '供应商联系人', + id : 'supplierContactName', + name : 'supplierContactName', + width : '33.3%', + valueField : 'name', + displayField : 'name', + flex : 1, + queryParam : 'contactName', + minChars : 0, + flex : .33, + listConfig: {width: 300}, + forceSelection : false, + lazyInit : true, + triggerAction : 'all', + typeAhead : false, + allowBlank : true, +// emptyText : '', + hideTrigger : false, + store : supplierContacJsonStore, + listeners :{ + focus : function(value) { + supplierName = top.Ext4.getCmp('suppler1').getValue(); + //获取供应商信息 + if(!supplierName && oldSupplierName == null){ + showResult('请先选择供应商!'); + return false; + } + }, + select:function(combo, record, index ){ + if(record[0] != null){ + var phoneNumber = record[0].data.phoneNumber; + top.Ext4.getCmp('supplierPhoneNumber').setRawValue(phoneNumber); + }else{ + var phoneNumber = record.data.phoneNumber; + top.Ext4.getCmp('supplierPhoneNumber').setRawValue(phoneNumber); + } + } + } + },{ + xtype : 'textfield', + fieldLabel : '联系电话', + id : 'supplierPhoneNumber', + name : 'supplierPhoneNumber', + width : '33.3%', +// readOnly: true, + allowBlank : true, + flex : .33 + } + ] + },{ + xtype : 'container', + width : '66%', + layout : 'hbox', + id : 'returnContactContainer', + hidden : true, + flex : 1, + items : [ + { + xtype : 'combo', + fieldLabel : '归还联系人', + id : 'returnContactName', + name : 'returnContactName', + width : '33.5%', + valueField : 'name', + displayField : 'name', + flex : 1, + queryParam : 'contactName', + minChars : 0, + flex : .34, + listConfig: {width: 300}, + forceSelection : false, + lazyInit : true, + triggerAction : 'all', + typeAhead : false, + allowBlank : true, + hideTrigger : false, + store : returnContactJsonStore, + listeners :{ + select:function(combo, record, index ){ + if(record[0] != null){ + var phoneNumber = record[0].data.phoneNumber; + top.Ext4.getCmp('returnContactPhoneNumber').setRawValue(phoneNumber); + }else{ + var phoneNumber = record.data.phoneNumber; + top.Ext4.getCmp('returnContactPhoneNumber').setRawValue(phoneNumber); + } + } + } + },{ + xtype : 'textfield', + fieldLabel : '归还联系人电话', + id : 'returnContactPhoneNumber', + name : 'returnContactPhoneNumber', + width : '34%', + allowBlank : true, + flex : .34 + } + ] + },{ + xtype : 'container', + width : '100%', + layout : 'hbox', + flex : 1, + items : [ + { + xtype : 'textfield', + fieldLabel : "灭菌方法", + allowBlank : true, + name : "sterilizationMethod", + id : "sterilizationMethod", + //readOnly : true, + width : '33.3%', + flex : 1 + },{ + xtype : 'numberfield', + fieldLabel : "灭菌温度(°C)", + allowBlank : true, + hideTrigger:true, + name : 'sterilizationTemp', + id : 'sterilizationTemp', + width : '33.3%', + flex : 1 + } + ] + },{ + xtype : 'container', + width : '33.3%', + layout : 'hbox', + flex : 1, + items : [ + { + xtype : 'numberfield', + fieldLabel : "干燥时间(分钟)", + allowBlank : true, + hideTrigger:true, + name : 'dryTime', + id : 'dryTime', + flex : 1 + } + ] + },{ + xtype : 'container', + width : '100%', + layout : 'hbox', + flex : 1, + id:"explainWrapper", + defaults:{margins:'-6 0 0 0'}, + items : [{ + xtype : 'textarea', + fieldLabel : "清洗消毒的特别要求和说明", + allowBlank : true, + name : "explain", + id : "explain", + flex : .67 + }] + },{ + xtype : 'container', + width : '100%', + layout : 'hbox', + flex : 1, + defaults:{margins:'3 0 0 0'}, + items : [{ + xtype : 'textfield', + fieldLabel : '备注', + id : 'remark', + name : 'remark', + flex : .67 + }] + } + ] + } , + { + flex : 1, + xtype : 'container', + layout : 'hbox', + items:[ + top.Ext4.create('foreignTousseTreeGrid', { + id : 'foreignTousseTreeGridForm', + columns : foreignTousseColumns, + flex : 1, + border : true, + tbar : forigntousseTbar, + store : foreignTousseStore, + width : 930, + height: 348, + forceFit: true, + listeners : { + 'itemcontextmenu' : function(menutree, record, items, index, e) { + e.preventDefault(); + e.stopEvent(); + + var menuArray = []; + + var leaf = record.get("leaf"); + + if(leaf){ + menuArray.push({ + text : "删除", + iconCls :'btn_ext_pause', + handler : function() { + var parentNode = record.parentNode; + var ids = record.get("id"); + if(sstsConfig.disableModifyExistMaterilaOfForeignTousse){ + if(ids == 0){ + parentNode.removeChild(record); + }else{ + showResult('已经存在的材料不能删除' , null , sstsConfig.messagePauseTimeOnPackingPage); + } + }else{ + parentNode.removeChild(record); + } + } + }); + }else{ + menuArray.push({ + text : "添加材料", + iconCls :'btn_ext_add', + handler : function() { + addForeignTousseMaterial(record.get("tousseDefinitionId")); + } + },{ + text : "删除", + hidden:(id != ''), + iconCls :'btn_ext_pause', + handler : function() { + var parentNode = record.parentNode; + parentNode.removeChild(record); + } + }); + } + var nodemenu = new top.Ext4.menu.Menu({ + items : menuArray + }); + nodemenu.showAt(e.getXY()); + } + } + }) + ] + } + ] + }); */ + var setHeight; + if(top.screen.height > 863){ + if(sstsConfig.expandFieldsOfForeignTousseApplicationForm && sstsConfig.expandFieldsOfForeignTousseApplicationForm.length > 0){ + setHeight = 259; }else{ - submintForeignTousseForm(ACTION_TYPE_ADD, needPrint); + setHeight = 348; } - - } -} - -/** - * 拍照 - * @param tousseName 包定义名称 - * @param tousseDefinitionId 包定义id - */ -/* function takePhone(tousseName,tousseDefinitionId){ - if(Ext4.chromeVersion < 62){ - showResult("请使用62以上版本的chrome浏览器!" , null , sstsConfig.messagePauseTimeOnPackingPage); - return ; - } - // 弹出窗口 - var pageUrl = WWWROOT + '/disinfectsystem/test/video.jsp?goodsName='+ tousseName +'&imageType='+imageTypeCameraApplication; - //如果为打开申请单修改,则可以追加拍照图片 - if(foreignTousseApplicationId){ - pageUrl += '&objectId='+tousseDefinitionId; - } - var style="menubar=no,location=no,directories=no,toolbar=no,statusbar=no,resizable=no,"+getCenterWindowPos(1920,1080)+",scrollbars=no"; - var popwin=window.open(pageUrl,'图片采集',style); - if(popwin != null ){ - popwin.focus(); - } -} */ - -/** - * 拍照 - * @param tousseName 包定义名称 - * @param tousseDefinitionId 包定义id - * @param isLook 是查看还是拍摄 - */ -function takeImgAndVideo(tousseName,tousseDefinitionId,isLook){ - if(Ext4.chromeVersion < 62){ - showResult("请使用62以上版本的chrome浏览器!" , null , sstsConfig.messagePauseTimeOnPackingPage); - return ; - } - - var imageIds = document.getElementById("imageIds").value; - var videoIds = document.getElementById("videoIds").value; - - if(imageIds == ""){ - imageIds = null; - } - - if(videoIds == ""){ - videoIds = null; - } - if(tousseDefinitionId == "null"){ - tousseDefinitionId = ""; - } - - var urls = WWWROOT + '/disinfectsystem/test/videoAndImg.jsp?goodsName='+ tousseName +'&imageType='+imageTypeCameraApplication+'&videoType='+videoType+'&objectId='+tousseDefinitionId+'&videoIds='+videoIds+'&imageIds='+imageIds+'&isLook='+isLook; - var videoImgWin = openFullSizeWindowWithName(urls,true,'图片视频拍摄'); - if(videoImgWin != null ){ - videoImgWin.focus(); - } - -} -/* function takeImgAndVideo(tousseName,tousseDefinitionId,isLook){ - if(Ext4.chromeVersion < 62){ - showResult("请使用62以上版本的chrome浏览器!" , null , sstsConfig.messagePauseTimeOnPackingPage); - return ; - } - var imageIds = document.getElementById("imageIds").value; - var videoIds = document.getElementById("videoIds").value; - if(imageIds == ""){ - imageIds = null; - } - - if(videoIds == ""){ - videoIds = null; - } - if(tousseDefinitionId == "null"){ - tousseDefinitionId = ""; - } - - var urls = WWWROOT + '/disinfectsystem/test/videoAndImg.jsp?goodsName='+ tousseName +'&imageType='+imageTypeCameraApplication+'&videoType='+videoType+'&objectId='+tousseDefinitionId+'&videoIds='+videoIds+'&imageIds='+imageIds+'&isLook='+isLook; - takeImgAndVideoWin = new top.Ext4.window.Window({ - id : 'playVideoWin', - layout : 'fit', - title : tousseName+'的图片/视频', - width :1020,//document.body.clientWidth - height:600,//document.body.clientHeight - modal : true, - border : false, - html:"", - plain : true - }); - - takeImgAndVideoWin.show(); -} */ - -//记录每个包名对应的图片id -//var goodsNameImageFile = {}; -var goodsNameImageFile = {}; -var goodsNameVideoFile = {}; -//接收新上传的imageFile的id -/* function returnImageFileId(goodsName , imageFileId){ - - if(goodsNameImageFile[goodsName]){ - var imageFileArray = goodsNameImageFile[goodsName]; - imageFileArray.push(imageFileId); - goodsNameImageFile[goodsName] = imageFileArray; }else{ - var imageFileArray = []; - imageFileArray.push(imageFileId); - goodsNameImageFile[goodsName] = imageFileArray; - } -} */ - -/** - * 打开外来器械包申请单的窗口. - * @param id 外来器械包申请单 - * @param formType 操作类型 - * @param ismodify 是点击修改按钮还是点击姓名列的文字链接打开弹窗的,false是点击修改按钮 - */ -function openForeignTousseForm(id, formType,ismodify){ - if(ismodify == undefined){ - ismodify = true; - } - foreignTousseApplicationId = id; - currentWashClassifyType = null; - - //外来器械申请时是否显示原始包定义(如果为true显示原始,否则显示最近一次申请的) - var isShowForeignTousseAncestorDefinitionForApply = getObjValueFromJs('sstsConfig.isShowForeignTousseAncestorDefinitionForApply',false); - - var urgentLevelStore = new Ext4.data.Store({ - proxy : { - type : 'ajax', - url : WWWROOT + '/disinfectSystem/baseData/urgentLevelAction!getUrgentsForSelect.do', - reader : { - type : 'json', - root : 'data' - } - }, - fields : [ - {name : 'id',mapping : 'id'}, - {name : 'urgentLevel',mapping : 'urgentLevel'}, - {name : 'urgentDefaultValue',mapping : 'urgentDefaultValue'} - ] - }); - urgentLevelStore.load(); - - //外来器械包的store - var foreignTousseJsonStore = new Ext4.data.Store({ - proxy : { - type : 'ajax', - url : WWWROOT + '/disinfectSystem/baseData/tousseDefinitionAction!getForeignTousseDefinitionNames.do', - reader : { - type : 'json', - root : 'data' - }, - extraParams : { - isShowForeignTousseAncestorDefinitionForApply : isShowForeignTousseAncestorDefinitionForApply - } - }, - - fields : [{name : 'id',mapping : 'id'}, - {name : 'spelling',mapping : 'spelling'}, - {name : 'name',mapping : 'name'}, - {name : 'displayName',mapping : 'displayName'}, - {name : 'amount',mapping : 'amount'}, - {name : 'suppler',mapping : 'suppler'}, - {name : 'includeImplant',mapping : 'includeImplant'}, - {name : 'packageSize',mapping : 'packageSize'}, - {name : 'foreignToussePrintAmount',mapping : 'foreignToussePrintAmount'}, - {name : 'splitNumber',mapping : 'splitNumber'}, - {name : 'materials',mapping : 'materials'}, - {name : 'contactName',mapping : 'contactName'}, - {name : 'phoneNumber',mapping : 'phoneNumber'} - ], - listeners : { - beforeload: function(store, operation, eOpts){ - var suppler1Comp = top.Ext4.getCmp("suppler1"); - if(suppler1Comp != null){ - store.proxy.extraParams.supplierName = suppler1Comp.getValue(); - } - } - } - }); - - //手术间的store - var operationRoomJsonStore = new Ext4.data.Store({ - proxy : { - type : 'ajax', - url : WWWROOT + '/disinfectSystem/baseData/operationRoomAction!getOperationRoomByOrgUnitCode.do', - reader : { - type : 'json', - root : 'data' - } - }, - fields :[ - {name : 'id',mapping : 'id'}, - {name : 'operationRoomName',mapping : 'operationRoomName'}, - {name : 'orgUnitCoding',mapping : 'orgUnitCoding'} - ], - listeners : { - beforeload: function(store, operation, eOpts){ - store.proxy.extraParams.orgUnitCode = orgUnitCodeOperationRoom; - } + if(sstsConfig.expandFieldsOfForeignTousseApplicationForm && sstsConfig.expandFieldsOfForeignTousseApplicationForm.length > 0){ + setHeight = 159; + }else{ + setHeight = 248; } - }); - - /** - * 常用医生的store - */ - var commonlyUsedDoctorJsonStore = new Ext4.data.Store({ - pageSize:200, - proxy : { - type : 'ajax', - url : WWWROOT + '/disinfectSystem/baseData/commonlyUsedDoctorAction!getDoctorBykeyWord.do', - reader : { - type : 'json', - root : 'data' - } - }, - fields : [{name : 'id',mapping : 'id'}, - {name : 'doctor',mapping : 'doctor'} - ] - }); - - //供应商联系人Store - supplierContacJsonStore = new Ext4.data.Store({ - proxy : { - type : 'ajax', - url : WWWROOT + '/disinfectSystem/baseData/supplierAction!getsupplierContacData.do', - reader : { - type : 'json', - root : 'data' - } - }, - fields : [ - {name : 'id',mapping : 'id'}, - {name : 'name',mapping : 'name'}, - {name : 'phoneNumber',mapping : 'phoneNumber'} - ], - listeners : { - beforeload: function(store, operation, eOpts){ - var suppler1Comp = top.Ext4.getCmp("suppler1"); - var supplierName = suppler1Comp.getValue(); - if(supplierName != "" && supplierName != null ){ - store.proxy.extraParams.supplierName = supplierName; - }else{ - //供应商选择框没值就看是否有添加过器械信息,用器械信息里面的供应商名称 - store.proxy.extraParams.supplierName = oldSupplierName; - } - }, - load: function(store, records, eOpts){ - if (records && records.length > 0) { - var record = records[0]; - top.Ext4.getCmp("supplierContactName").setValue(record.get('name')); - top.Ext4.getCmp("supplierPhoneNumber").setValue(record.get('phoneNumber')); - } else { - //因为要支持可输入,所以load后不进行清除,修改依据为ZSSXLRMYY-171 - //top.Ext4.getCmp("supplierContactName").setValue(''); - //top.Ext4.getCmp("supplierPhoneNumber").setValue(''); - } - } - } - }); - - //归还联系人Store - returnContactJsonStore = new Ext4.data.Store({ - proxy : { - type : 'ajax', - url : WWWROOT + '/disinfectSystem/baseData/supplierAction!getsupplierContacData.do', - reader : { - type : 'json', - root : 'data' - } - }, - fields : [ - {name : 'id',mapping : 'id'}, - {name : 'name',mapping : 'name'}, - {name : 'phoneNumber',mapping : 'phoneNumber'} - ], - listeners : { - beforeload: function(store, operation, eOpts){ - var suppler1Comp = top.Ext4.getCmp("suppler1"); - var supplierName = suppler1Comp.getValue(); - if(supplierName != "" && supplierName != null ){ - store.proxy.extraParams.supplierName = supplierName; - }else{ - //供应商选择框没值就看是否有添加过器械信息,用器械信息里面的供应商名称 - store.proxy.extraParams.supplierName = oldSupplierName; - } - } - } - }); - - - //供应室的store - var foldersCompanyJsonStore = new Ext4.data.Store({ - pageSize : 12, - proxy : { - type : 'ajax', - url : WWWROOT + '/disinfectSystem/baseData/supplierAction!getSupplierData.do', - extraParams : {supplierType : supplierType}, - reader : { - type : 'json', - totalProperty:'totalCount', - root : 'data' - } - }, - fields : [ - {name : 'id',mapping : 'id'}, - {name : 'name',mapping : 'name'}, - {name : 'contactName',mapping : 'contactName'}, - {name : 'phoneNumber',mapping : 'phoneNumber'} - ] - }); - - var forigntousseTbar = [ - { - text: "器械包名称:" - },{ - xtype : 'combo', - id : 'foreignTousseName1', - name : 'foreignTousseName1', - queryParam : 'spell', - minChars : 0, - valueField : 'id', - displayField : 'name', - width : 220, - listConfig: {width : 220}, - matchFieldWidth: false, - store : foreignTousseJsonStore, - lazyInit : true, - triggerAction : 'all', - hideTrigger : false, - typeAhead : false, - allowBlank : true, - queryDelay: sstsConfig.onlySelectExistedForeignTousse ? 1300: 0, - forceSelection: sstsConfig.onlySelectExistedForeignTousse ? true: false, - listeners : { - select:function(combo, records, index){ - var suppler1Comp = top.Ext4.getCmp("suppler1"); - suppler1Comp.forceSelection = false; - suppler1Comp.setValue(records[0].get("suppler")); - suppler1Comp.forceSelection = true; - supplierContacJsonStore.load(); - returnContactJsonStore.load(); - } - } - },{ - text: "供应商:" - },{ - xtype : 'combo', - id : 'suppler1', - name : 'suppler1', - queryParam : 'supplierName', - minChars : 0, - valueField : 'name', - displayField : 'name', - width : 200, - listConfig: {width : 270}, - matchFieldWidth: false, - store : foldersCompanyJsonStore, - pageSize : 12, - queryDelay: 1300, //滞后1300ms发起请求 -// forceSelection : true, - lazyInit : true, - triggerAction : 'all', - hideTrigger : false, - typeAhead : false, - allowBlank : true, - listeners : { - select: function(combo, records, eOpts){ - var foreignTousseName1Comp = top.Ext4.getCmp("foreignTousseName1"); - foreignTousseName1Comp.setValue(''); - foreignTousseJsonStore.reload(); - supplierContacJsonStore.load(); - returnContactJsonStore.load(); - } - } - },{ - text: "加急级别:", - hidden: !sstsConfig.enableUrgentFunction - },{ - xtype : 'combo', - width : 60, - id : 'urgentLevel1', - name : 'urgentLevel1', - store : urgentLevelStore, - valueField : 'id', - displayField : 'urgentLevel', - hidden: !sstsConfig.enableUrgentFunction, - minChars : 0, - forceSelection : true, - lazyInit : true, - editable:true, - triggerAction : 'all', - typeAhead : false - },{ - xtype:'button', - id : 'addTousseBt', - text: "添加", - iconCls : 'btn_ext_add', - handler : function() { - currentWashClassifyType = null; - - var foreignTousseName = top.Ext4.getCmp('foreignTousseName1').getRawValue(); - var tousseDefinitionId = top.Ext4.getCmp('foreignTousseName1').getValue(); - if(isNaN(tousseDefinitionId)){ - tousseDefinitionId = ""; - } - var suppler = top.Ext4.getCmp('suppler1').getValue(); - if(sstsConfig.enableUrgentFunction){ - var urgentLevel = top.Ext4.getCmp('urgentLevel1').getRawValue(); - var urgentLevelId = top.Ext4.getCmp('urgentLevel1').getValue(); - } - - //保存添加器械信息时带的供应商名称 - oldSupplierName =suppler; - if(Ext4.isEmpty(foreignTousseName)){ - showResult("请选择器械包!"); - top.Ext4.getCmp('foreignTousseName1').focus(); - return false; - }else if(Ext4.isEmpty(suppler)){ - showResult("请选择供应商!"); - top.Ext4.getCmp('suppler1').focus(); - return false; - } - - //是否允许申请多套外来器械包 - if(!sstsConfig.allowApplyMultipleForeignTousse && foreignTousseStore.getRootNode().childNodes.length > 0){ - showResult("只能申请一个外来器械包!"); - return false; - } - - //1、获取外来器械包的部分属性 - var record = foreignTousseJsonStore.findRecord("id", tousseDefinitionId); - var materials = []; - var packageSize = ''; - var foreignToussePrintAmount = 0; - var splitNumber = 0; - if(record){ - packageSize = record.get('packageSize'); - foreignToussePrintAmount = record.get('foreignToussePrintAmount'); - splitNumber = record.get('splitNumber'); - } - - //2、获取外来器械包的材料信息 - Ext4.Ajax.request({ - url : WWWROOT + '/disinfectSystem/baseData/tousseDefinitionAction!loadForeignTousseIncludeMaterials.do', - params : {id : tousseDefinitionId}, - async : false, - success : function(response, options) { - var result = Ext4.JSON.decode(response.responseText); - if(result.success){ - var materialsJson = result.data; - for(var i = 0;i < materialsJson.length;i++){ - materials.push({ - id : materialsJson[i].id, //材料实例的id - tousseName : materialsJson[i].materialName, - includeImplant : materialsJson[i].includeImplant, - amount : materialsJson[i].amount, - usedAmountOfIncludeImplant : 0, - implantAmountOfUseRecord : 0, - minDismantleAmount : materialsJson[i].minDismantleAmount, - washClassifyType:materialsJson[i].washClassifyType, - type : 'material', - leaf : true - }); - } - - } - }, - failure : function(response, opts) { - showResult(response.responseText); - } - }); - - var tousseItem = Ext4.create('foreignTousseItemModel',{ - id : 0, - tousseDefinitionId : tousseDefinitionId, - oldTousseName: foreignTousseName, - tousseName: foreignTousseName, - weight:"", - oldSupplierName : suppler, - supplierName : suppler, - packageSize : (packageSize ? packageSize : defaultPackageSize), - foreignToussePrintAmount : (foreignToussePrintAmount ? foreignToussePrintAmount : defaultforeignToussePrintAmount), - splitNumber : (splitNumber ? splitNumber : defaultSplitNumber), - amount : 1, - includeImplant : '', - price : foreignToussePriceOfSysParams, - urgentLevel:urgentLevel, - urgentLevelId:urgentLevelId, - type : 'tousse', - usedAmountOfIncludeImplant : 0, - implantAmountOfUseRecord : 0, - minDismantleAmount : 0, - leaf : false, - expanded : true, - children : materials - }); - var rootNode = foreignTousseStore.getRootNode(); - rootNode.appendChild(tousseItem); - top.Ext4.getCmp('foreignTousseName1').setValue(''); - } - },{ - text: "", - id : 'materialAmountInfo' - } - ]; - - var bbars = []; - //是否隐藏植入物使用数量列 - var includeImplantUsedAmountHidden = false; - var confirmRecycle = false; - if(formType == 'apply'){ - includeImplantUsedAmountHidden = true; - - //是否禁用“确认归还”按钮 - var disableReturn = true; - //是否禁用“提前归还”按钮 - var disableEarlyReturn = true; - if(id && !SSTS_ForeignTousseApplication_Return){ - DWREngine.setAsync(false); - ForeignTousseApplicationTableManager.isForeignTousseCanReturn(id,function(result){ - var json = JSON.parse(result); - disableReturn = json.disableReturn; - disableEarlyReturn = json.disableEarlyReturn; - }); - DWREngine.setAsync(true); - } - - bbars = [{ - text : '打印预览', - hidden : (id == "" ? true : false), - handler : function() { - printForeignTousseApplication_local(1); - } - },{ - text : '打印', - hidden : (id == "" ? true : false), - handler : function() { - printForeignTousseApplication_local(0); - } - },{ - text : '提交', - id : 'commitBtn', - //hidden:(id != ""), - hidden:(id != "" && ismodify),//点击姓名列的文字链接和点击工具栏的修改按钮,隐藏提交按钮 - handler : function() { - if(document.getElementById("imageIdsAndGoodsName")){ - goodsNameImageFile = document.getElementById("imageIdsAndGoodsName").value; - if(goodsNameImageFile != ""){ - goodsNameImageFile = JSON.parse(goodsNameImageFile); - } - } - - if(document.getElementById("videoIdsAndGoodsName").value){ - goodsNameVideoFile = document.getElementById("videoIdsAndGoodsName").value; - if(goodsNameVideoFile != ""){ - goodsNameVideoFile = JSON.parse(goodsNameVideoFile); - } - } - checkAndsubmintForeignTousseForm(id,false,ismodify); - } - },{ - text : '提交并打印', - id : 'commitPrintBtn', - hidden:(id != "" && ismodify),//点击姓名列的文字链接和点击工具栏的修改按钮,隐藏提交按钮 - //hidden:(id != ""), - handler : function() { - checkAndsubmintForeignTousseForm(id,true,ismodify); - } - },{ - text : '确认归还', - id : 'returnBtn', - disabled : disableReturn, - handler : function(){ - var tmpWindow = new top.Ext4.window.Window({ - title : '请确认', - modal : true, - border : true, - html : '
  确认归还' + entityName + '信息?  

', - buttonAlign : 'center', - buttons:[{ - text:'是', - handler : function() { - tmpWindow.close(); - if(!foreignTousseForm.getForm().isValid()){ - showResult('请正确填写表单各值'); - return false; - } - var success = getForeignTousseInfo(); - if(success){ - submintForeignTousseForm(actionType_confirmReturn, false); - } - } - },{ - text:'否', - handler : function() { - tmpWindow.close(); - } - }] - }); - tmpWindow.show(); - } - },{ - text : '提前归还', - disabled:disableEarlyReturn, - handler : function(){ - //由于Ext4.MessageBox.confirm兼容性问题,在全部申请单列表中点【是】按钮事件无反应,故而改用window显示 - var tmpWindow = new top.Ext4.window.Window({ - title : '请确认', - modal : true, - border : true, - html : '
  提前归还会终止申请单,并删除装配任务,是否要提前归还?  

', - buttonAlign : 'center', - buttons:[{ - text:'是', - handler : function() { - tmpWindow.close(); - if(!foreignTousseForm.getForm().isValid()){ - showResult('请正确填写表单各值'); - return false; - } - var success = getForeignTousseInfo(); - if(success){ - submintForeignTousseForm(actionType_confirmReturn, false); - } - } - },{ - text:'否', - handler : function() { - tmpWindow.close(); - } - }] - }); - - tmpWindow.show(); - } - },{ - text : '查看清洗分类类型', - hidden:((id || !sstsConfig.washClassifyTypeFastClearing) ? true : false), - handler : function() { - openWashClassifyTypeWindow(); - } - },{ - text : '取消', - handler : function() { - foreignTousseApplyWindow.close(); - } - }] - }else if(formType == 'recycle'){ - - }else if(formType == 'interfere'){ - bbars = [{ - text : '保存', - handler : function() { - if (!foreignTousseForm.getForm().isValid()) { - showResult('请正确填写表单各值'); - return false; - } - if(foreignTousseStore.getRootNode().length == 0){ - showResult('申请的物品不能为空!'); - return false; - } - var success = getForeignTousseInfo(); - if(success){ - submintForeignTousseForm(ACTION_TYPE_INTERFERE, false); - } - } - },{ - text : '取消', - handler : function() { - foreignTousseApplyWindow.close(); - } - }] } - //foreignTousseTreeGrid的列 - var foreignTousseColumns = [{ - dataIndex : 'tousseDefinitionId', - hidden : true - },{ - header: '供应商', - width : includeImplantUsedAmountHidden ? 200 : 170, - sortable: true, - xtype : 'treecolumn', - dataIndex: 'supplierName', - editor: { - xtype : 'combo', - valueField : 'name', - displayField : 'name', - store : foldersCompanyJsonStore, - pageSize : 12, - listConfig: {width : 270}, - queryParam : 'supplierName', - minChars : 0, - matchFieldWidth: false, - forceSelection : true, - lazyInit : true, - triggerAction : 'all', - hideTrigger : false, - typeAhead : false, - allowBlank: false, - listeners : { - focus : function(value) { - var supplierName = top.Ext4.getCmp('suppler1').getValue(); - oldSupplierName = supplierName; - } - } - } - },{ - header: '器械包/材料名称', - width : includeImplantUsedAmountHidden ? 200 : 170, - align:'center', - sortable: true, - dataIndex: 'tousseName', - editor: { - xtype: 'textfield', - allowDecimals :false, - minValue: 0, - listeners : { - 'focus':function(){ - this.selectText(); - } - } - } - },{ - header: '是否植入物', - width : 75, - align:'center', - sortable: true, - dataIndex: 'includeImplant', - editor: { - xtype : 'combo', - id : 'isIncludeImplant', - name : 'isIncludeImplant', - width : 130, - valueField : 'yesOrNo', - displayField : 'yesOrNo', - store : new top.Ext4.data.SimpleStore({ - fields : [ 'yesOrNo' ], - data : [['是'],['否']] - }), - allowBlank: true, - forceSelection : true - } - },{ - header: '数量', - width : 40, - align:'center', - sortable: true, - dataIndex : 'amount', - editor: { - xtype: 'numberfield', - allowBlank: true, - allowDecimals :false, - minValue: 0, - listeners : { - 'focus':function(){ - this.selectText(); - } - } - } - },{ - header: '单价', - width : 40, - align:'center', - sortable: true, - dataIndex: 'price', - editor: { - xtype: 'numberfield', - allowBlank: true, - allowDecimals :true, - decimalPrecision: 2, - minValue: 0, - listeners : { - 'focus':function(){ - this.selectText(); - } - } - } - },{ - header: '加急级别', - width : 60, - align:'center', - sortable: true, - dataIndex: 'urgentLevel', - hidden:!sstsConfig.enableUrgentFunction, - editor: { - xtype : 'combo', - id : 'urgentLevel', - name : 'urgentLevel', - valueField : 'urgentLevel', - displayField : 'urgentLevel', - store : urgentLevelStore, - allowBlank: true, - forceSelection : true, - listeners : { - select: function(v,r,p) { - currentRecord.set("urgentLevel",r[0].data.urgentLevel); - currentRecord.set("urgentLevelId",r[0].data.id); - }, - blur:function(thiz){ - if(thiz.getValue() == null){ - currentRecord.set('urgentLevelId',null); - } - } - } - } - },{ - header:'植入物使用数量', - width:100, - align:'center', - dataIndex:'usedAmountOfIncludeImplant', - hidden : includeImplantUsedAmountHidden, - editor: { - xtype: 'numberfield', - allowBlank: true, - allowDecimals :false, - minValue: 0, - listeners : { - 'focus':function(){ - this.selectText(); - } - } - } - },{ - header: '可拆卸数量', - width : 75, - align:'center', - sortable: true, - dataIndex: 'minDismantleAmount', - editor: { - xtype: 'numberfield', - allowBlank: true, - allowDecimals :false, - minValue: 0, - listeners : { - 'focus':function(){ - this.selectText(); - } - } - } - },{ - header: '打印份数', - width : 75, - align:'center', - sortable: true, - hidden: !sstsConfig.enableForeignToussePrintAmount, - dataIndex: 'foreignToussePrintAmount', - editor: { - xtype: 'numberfield', - allowBlank: true, - allowDecimals :false, - minValue: 0, - listeners : { - 'focus':function(){ - this.selectText(); - } - } - } - },{ - header: '拆包份数', - width : 75, - align:'center', - sortable: true, - hidden: !sstsConfig.enableForeignTousseSplitNumberProperty, - dataIndex: 'splitNumber', - editor: { - xtype: 'numberfield', - allowBlank: true, - allowDecimals :false, - minValue: 0, - listeners : { - 'focus':function(){ - this.selectText(); - } - } - } - },{ - header: '大小', - width : 60, - align:'center', - sortable: true, - dataIndex: 'packageSize', - editor: { - xtype : 'combo', - id : 'packageSize', - name : 'packageSize', - valueField : 'value', - displayField : 'value', - editable:false, - store : new top.Ext4.data.SimpleStore({ - fields : [ 'value' ], - data : packageSizeArray - }), - allowBlank: true, - forceSelection : true - } - },{ - dataIndex : 'oldTousseName', - hidden : true - },{ - dataIndex : 'oldSupplierName', - hidden : true - },{ - dataIndex : 'urgentLevelId', - hidden : true - }, { - header: '图片', - width : 80, - align:'center', - sortable: true, - dataIndex: 'type', - renderer: function(v,p,record,rowIndex, columnIndex, store){ - var isLeaf = record.get('leaf'); - var tousseName = record.get('tousseName'); - var tousseDefinitionId = record.get('tousseDefinitionId'); - if(!isLeaf){ - var currentPage = 1; - var materialId = ""; - var imgName = IMAGE_TYPE_TOUSSE; - var iframeHeight = window.screen.height; - var url = WWWROOT+'/disinfectsystem/touchScreen/recycle/tousseImage.jsp?resolution=1980&clientHeight='+iframeHeight+'&parentPageName=application&tousseDefinitionID='+tousseDefinitionId+'&materialId='+materialId+'&tousseName='+encodeURIComponent(tousseName)+'&imgName='+encodeURIComponent(imgName)+'&number='+currentPage; - - //var btnHtml = ""; - var btnHtml = ""; - if(sstsConfig.showCameraPhoto){ - /* if(id){ - //只有再次打开该单修改时,才能查看图片 - btnHtml += " "; - } */ - //btnHtml += " "; - if(id == ""){ - tousseDefinitionId = null; - } - btnHtml += " "; - } - return btnHtml; - } - } - }]; - //增加重量字段 - if(sstsConfig.foreignTousseAddWeight){ - foreignTousseColumns.splice(3, 0, { - header: '重量(公斤)', - width : 70, - align:'center', - sortable: true, - dataIndex: 'weight', - editor: { - xtype: 'numberfield', - allowBlank: false, - allowNegative: false, // 不允许负数 - allowDecimals: true, // 允许小数点 - minValue: 0, - listeners : { - 'focus':function(){ - this.selectText(); - } - } - } - }); - } - //foreignTousseTreeGrid的store - foreignTousseStore = new Ext4.data.TreeStore({ - model: foreignTousseItemModel, - proxy: { - type: 'ajax', - url: WWWROOT + '/disinfectSystem/foreigntousseapplication/foreignTousseApplicationAction!loadForeignTousseItems.do' - }, - listeners : { - beforeload : function(store, operation) { - var params = {//参数 - applicationId : id, - confirmRecycle : confirmRecycle - }; - Ext4.apply(store.proxy.extraParams, params); - }, - datachanged: function(store,eOpts){ - refreshMaterialAmountInfo(); - }, - update: function( store, record, operation, eOpts ){ - refreshMaterialAmountInfo(); - } - }, - folderSort: true - }); - - - - settleDepartJsonStore = new Ext4.data.JsonStore({ - autoLoad: true, - proxy : { - type : 'ajax', - url : WWWROOT + '/disinfectSystem/baseData/supplyRoomConfigAction!getSettleAccountsDepartJson.do?showDisableOrgUnit=false', - reader : { - type : 'json', - root : 'data' - } - }, - fields : [ - {name : 'id',mapping : 'id'}, - {name : 'name',mapping : 'name'} - ] - }); - - //申请科室的store - applyDepartJsonStore = new Ext4.data.Store({ - //limit参数,每页显示条数,默认为25 - pageSize: isIE6OrIE7 ? 15 : 50, - proxy : { - type : 'ajax', - url : WWWROOT + '/disinfectSystem/baseData/supplyRoomConfigAction!getApplicationDepartJson.do?showDisableOrgUnit=false', - reader : { - type : 'json', - totalProperty : 'totalCount', - root : 'data' - } - }, - fields : [ - {name : 'id',mapping : 'id'}, - {name : 'name',mapping : 'name'} - ] - }); - - //simon-add:处理科室数据源,加载时设置默认处理科室 - handleDepartmentStore = new Ext4.data.JsonStore({ - autoLoad: true, - proxy : { - type : 'ajax', - url : WWWROOT + '/disinfectSystem/baseData/supplyRoomConfigAction!getfTHandleDepartAndTaskGroupJsonArray.do', - reader : { - type : 'json', - root : 'data' - } - }, - fields : [ - {name : 'handleDepartCoding',mapping : 'departCode'}, - {name : 'handleDepart',mapping : 'departName'}, - {name : 'taskGroup',mapping : 'taskGroup'} - ], - listeners:{ - load:function(records){ - //simon-add:items为外来器械配置的处理科室,高级视图中"科室供应室配置"中“外来器械参数设置” - var handleDeparts=records.data.items; - var HDLength=handleDeparts.length; - var handleDepartStore = new Ext4.data.JsonStore({ - autoLoad: true, - proxy : { - type : 'ajax', - url : WWWROOT + '/systemmanage/getCssdsByApplyDepartAndType.do', - reader : { - type : 'json', - root : 'data' - } - }, - fields : [ - {name : 'defaultHandleDepart',mapping : 'defaultHandleDepart'}, - {name : 'cssdOrgUnitCode',mapping : 'cssdOrgUnitCode'}, - {name : 'name',mapping : 'cssdOrgUnitName'} - ], - listeners:{ - beforeload : function(store, operation, eOpts){ - //每次加载之前传“申请科室编码”和“物品类型”两个参数 - store.proxy.extraParams.applyDepartCode = top.Ext4.getCmp('departCoding').getValue(); - store.proxy.extraParams.tousseType = "器械包"; - }, - load:function(records){ - //simon-add:defualtHandleDeparts为可服务此申请科室的供应室,高级视图中"供应室服务临床科室配置" - var defualtHandleDeparts=records.data.items; - var DHDLength=defualtHandleDeparts.length; - /* - * 首先判断外来器械配置的处理科室handleDeparts数量 - * 1.为0则不选择,为1则选择此科室 - * 大于1,继续判断handleDeparts与服务此申请科室的供应室defualtHandleDeparts的交集情况 - * 1.交集为0,不设置默认处理科室 - * 2.为1,则设置此科室 - * 3.大于1,再判断其中有没有“是否默认处理科室”参数为“是”的科室。 - * 4.(有多个科室同时参数设置“是”的情况?)有“是”,则选择此科室,没有是,则不设置默认处理科室 - */ - - - //外来器械配置的处理科室handleDeparts数量为1则选择此科室 - if(HDLength==1){ - var handleDepart=handleDeparts[0].data.handleDepart; - var handleDepartCoding=handleDeparts[0].data.handleDepartCoding; - top.Ext4.getCmp("handleDepart").setValue(handleDepart); - top.Ext4.getCmp("handleDepartCoding").setValue(handleDepartCoding); - }else if(HDLength>1){ - //handleDeparts与服务此申请科室的供应室defualtHandleDeparts的交集 - var sameArray=new Array(); - //“是否默认处理科室”参数为“是”的科室在sameArray中的index - var indexArray=new Array(); - for(var h=0;h1){ - /*交集大于1,再判断其中有没有“是否默认处理科室”参数为“是”的科室,如果参数为“是”的科室数量为1则设置为此科室 - * 其他情况,不设置。 - */ - if(indexArray.length==1){ - var index=indexArray[0]; - var handleDepart=sameArray[index].handleDepart; - var handleDepartCoding=sameArray[index].handleDepartCoding; - top.Ext4.getCmp("handleDepart").setValue(handleDepart); - top.Ext4.getCmp("handleDepartCoding").setValue(handleDepartCoding); - } - } - } - } - } - }); - - } - } - - }); - - //处理方式的store - var processTypeJsonStore = new Ext4.data.Store({ - fields : [ 'typeName' ], - proxy : { - type : 'ajax', - url : WWWROOT + '/disinfectSystem/foreigntousseapplication/foreignTousseApplicationAction!getProcessType.do', - reader : { - type : 'array' - } - } - }); - foreignTousseForm = new top.Ext4.form.Panel({ id : 'foreignToussForm', frame : true, border : 0, labelSeparator : ':', bodyPadding : '5 5 0', - autoScroll : true, + //autoScroll : true, buttonAlign : 'center', buttons : bbars, fieldDefaults : { labelAlign : 'right' }, - layout : { - type : 'vbox' - }, - items : [ - { + layout : 'form', + items : [{ xtype : 'fieldset', title : '基础信息', collapsible : false, - height : 250, + //height : 360, width : top.screen.width > 1280 ? 930 : 920,//900 - defaultType : 'textfield', - layout : { - type : 'vbox' - }, - items : [ - { - xtype : 'container', - width : '100%', - layout : 'hbox', - flex : 1, - items : [ + items : [{ + layout : 'column', + columnWidth :1, + items:[ {xtype : 'hidden',name : 'id',id : 'id'}, {xtype : 'hidden',fieldLabel : '科室编号 ',name : 'departCoding',id : 'departCoding'}, {xtype : 'hidden',fieldLabel : '结算科室编号',name : 'settleAccountsDepartCoding',id : 'settleAccountsDepartCoding'}, @@ -2093,183 +2825,208 @@ {xtype : 'hidden',name : 'barcodeStr',id : 'barcodeStr'}, {xtype : 'hidden',name : 'recyclingTime',id : 'recyclingTime'}, { - xtype : 'textfield', - width : '33.3%', - fieldLabel : '申请人', - maxLength : '50', - id : 'applicant', - name : 'applicant', - allowBlank : false, - flex : 1, - readOnly : true, - value : $Id('userName').value, - readOnly : true, - fieldCls : 'fieldReadOnlyNoRemoveAndTop' + layout : 'form', + labelWidth :70, + columnWidth :.33, + height:heightVal, + items : [{ + xtype : 'textfield', + width : '33.3%', + fieldLabel : '申请人', + maxLength : '50', + id : 'applicant', + name : 'applicant', + allowBlank : false, + flex : 1, + readOnly : true, + value : $Id('userName').value, + readOnly : true, + fieldCls : 'fieldReadOnlyNoRemoveAndTop' + }] },{ - xtype : 'textfield', - width : '33.3%', - fieldLabel : '申请时间', - id : 'applicationTime', - name : 'applicationTime', - editable:false, - flex : 1, - format : 'Y-m-d H:i', - fieldCls : 'fieldReadOnlyNoRemoveAndTop' + layout : 'form', + labelWidth :70, + columnWidth :.33, + height:heightVal, + items : [{ + xtype : 'textfield', + width : '33.3%', + fieldLabel : '申请时间', + id : 'applicationTime', + name : 'applicationTime', + editable:false, + flex : 1, + format : 'Y-m-d H:i', + fieldCls : 'fieldReadOnlyNoRemoveAndTop' + }] },{ - xtype : 'textfield', - width : '33.3%', - fieldLabel : '流水号', - id : 'serialNumber', - name : 'serialNumber', - allowBlank : true, - readOnly:true, - flex : 1, - fieldCls : 'fieldReadOnlyNoRemoveAndTop' - } - ] - },{ - xtype : 'container', - width : '100%', - layout : 'hbox', - flex : 1, - items : [{ - xtype : 'combo', - width : '33.3%', - fieldLabel : '申请科室', - id : 'depart', - name : 'depart', - queryParam : 'spell', - minChars : 0, - valueField : 'name', - displayField : 'name', - store : applyDepartJsonStore, - pageSize : 100, - matchFieldWidth: false, - listConfig: {width: 300}, - queryDelay: 1300, //滞后1300ms发起请求 - forceSelection : true, - lazyInit : true, - triggerAction : 'all', - hideTrigger : true, - typeAhead : false, - allowBlank : false, - flex : 1, - listeners:{ - select:function(combo, record, index){ - var setObj = { - 'departCoding' : 'id', - 'settleAccountsDepart' : 'name', - 'settleAccountsDepartCoding' : 'id' - } - - if(saveOrgUnitCode != null && saveOrgUnitCode != record[0].get('id')){ - top.Ext4.getCmp('operationRoom').setValue(""); - saveOrgUnitCode = null; - } - - orgUnitCodeOperationRoom = record[0].get('id'); - operationRoomJsonStore.proxy.extraParams.orgUnitCode = orgUnitCodeOperationRoom; - operationRoomJsonStore.load(); - resetComboData({val: record[0].get('name'), property : 'name'}, settleDepartJsonStore, setObj); - //simon-update:根据"申请科室"值,查询对应设置的"结算科室" - DWREngine.setAsync(false); - Ext4.Ajax.request({ - url : WWWROOT + '/disinfectSystem/baseData/supplyRoomConfigAction!getSupplyRoomConfigByCoding.do', - params : {'orgUnitCode':record[0].get('id'),'type':3}, - timeout : 600000, - success : function(response, options) { - var result= Ext4.JSON.decode(response.responseText); - //simon-add:如果申请科室配置的默认结算科室不为空,那么设置此值为页面结算科室默认值 - if(!isUndefinedOrNullOrEmpty(result.settleAccountsDepart)&&!isUndefinedOrNullOrEmpty(result.settleAccountsDepartCoding)){ - top.Ext4.getCmp('settleAccountsDepart').setValue(result.settleAccountsDepart); - top.Ext4.getCmp('settleAccountsDepartCoding').setValue(result.settleAccountsDepartCoding); + layout : 'form', + labelWidth :70, + columnWidth :.33, + height:heightVal, + items : [{ + xtype : 'textfield', + width : '33.3%', + fieldLabel : '流水号', + id : 'serialNumber', + name : 'serialNumber', + allowBlank : true, + readOnly:true, + flex : 1, + fieldCls : 'fieldReadOnlyNoRemoveAndTop' + }] + },{ + layout : 'form', + labelWidth :70, + columnWidth :.5, + height:heightVal, + items : [{ + xtype : 'combo', + width : '33.3%', + fieldLabel : '申请科室', + id : 'depart', + name : 'depart', + queryParam : 'spell', + minChars : 0, + valueField : 'name', + displayField : 'name', + store : applyDepartJsonStore, + pageSize : 100, + matchFieldWidth: false, + listConfig: {width: 300}, + queryDelay: 1300, //滞后1300ms发起请求 + forceSelection : true, + lazyInit : true, + triggerAction : 'all', + hideTrigger : true, + typeAhead : false, + allowBlank : false, + flex : 1, + listeners:{ + select:function(combo, record, index){ + var setObj = { + 'departCoding' : 'id', + 'settleAccountsDepart' : 'name', + 'settleAccountsDepartCoding' : 'id' } + + if(saveOrgUnitCode != null && saveOrgUnitCode != record[0].get('id')){ + top.Ext4.getCmp('operationRoom').setValue(""); + saveOrgUnitCode = null; + } + + orgUnitCodeOperationRoom = record[0].get('id'); + operationRoomJsonStore.proxy.extraParams.orgUnitCode = orgUnitCodeOperationRoom; + operationRoomJsonStore.load(); + resetComboData({val: record[0].get('name'), property : 'name'}, settleDepartJsonStore, setObj); + //simon-update:根据"申请科室"值,查询对应设置的"结算科室" + DWREngine.setAsync(false); + Ext4.Ajax.request({ + url : WWWROOT + '/disinfectSystem/baseData/supplyRoomConfigAction!getSupplyRoomConfigByCoding.do', + params : {'orgUnitCode':record[0].get('id'),'type':3}, + timeout : 600000, + success : function(response, options) { + var result= Ext4.JSON.decode(response.responseText); + //simon-add:如果申请科室配置的默认结算科室不为空,那么设置此值为页面结算科室默认值 + if(!isUndefinedOrNullOrEmpty(result.settleAccountsDepart)&&!isUndefinedOrNullOrEmpty(result.settleAccountsDepartCoding)){ + top.Ext4.getCmp('settleAccountsDepart').setValue(result.settleAccountsDepart); + top.Ext4.getCmp('settleAccountsDepartCoding').setValue(result.settleAccountsDepartCoding); + } + }, + failure : function(response, opts) { + showResult(response.responseText); + } + }); + DWREngine.setAsync(true); + }, + focus : function(thiz){ + thiz.selectText(); }, - failure : function(response, opts) { - showResult(response.responseText); + change : function(combo, record, index){ + var departVal = top.Ext4.getCmp("depart").getValue(); + if(departVal == "" || departVal == null || departVal == undefined){ + orgUnitCodeOperationRoom = ""; + operationRoomJsonStore.proxy.extraParams.orgUnitCode = orgUnitCodeOperationRoom; + operationRoomJsonStore.load(); + } } - }); - DWREngine.setAsync(true); - }, - focus : function(thiz){ - thiz.selectText(); - }, - change : function(combo, record, index){ - var departVal = top.Ext4.getCmp("depart").getValue(); - if(departVal == "" || departVal == null || departVal == undefined){ - orgUnitCodeOperationRoom = ""; - operationRoomJsonStore.proxy.extraParams.orgUnitCode = orgUnitCodeOperationRoom; - operationRoomJsonStore.load(); } - } - } - },{ - xtype : 'combo', - fieldLabel : '结算科室', - id : 'settleAccountsDepart', - name : 'settleAccountsDepart', - queryParam : 'spell', - minChars : 0, - valueField : 'name', - displayField : 'name', - store : settleDepartJsonStore, - forceSelection : true, - lazyInit : true, - triggerAction : 'all', - width : '33.3%', - queryDelay: 1300, //滞后1300ms发起请求 - hideTrigger : true, - typeAhead : false, - allowBlank : false, - flex : 1, - listeners:{ - select:function(combo, record, index){ - resetComboData({val : record[0].get('name'),property : 'name'}, settleDepartJsonStore, {'settleAccountsDepartCoding' : 'id'}); - }, - focus : function(thiz){ - thiz.selectText(); - } - } - }] - },{ - xtype : 'container', - width : '100%', - layout : 'hbox', - flex : 1, - items : [ - //simon-add - { - xtype : 'combo', - fieldLabel : '处理科室', - id : 'handleDepart', - name : 'handleDepart', - minChars : 0, - valueField : 'handleDepart', - displayField : 'handleDepart', - store : handleDepartmentStore, - forceSelection : false, - lazyInit : true, - width : '33.3%', - triggerAction : 'all', - hideTrigger : false, - typeAhead : false, - allowBlank : false, - flex : 1, - listeners:{ - select:function(combo, records, index){ - var record = transformRecords(records); - var handleDepart=record.data.handleDepart; - var handleDepartCoding=record.data.handleDepartCoding; - top.Ext4.getCmp("handleDepart").setValue(handleDepart); - top.Ext4.getCmp("handleDepartCoding").setValue(handleDepartCoding); - }, - focus : function(thiz){ - thiz.selectText(); + }] + },{ + layout : 'form', + labelWidth :70, + columnWidth :.5, + height:heightVal, + items : [{ + xtype : 'combo', + fieldLabel : '结算科室', + id : 'settleAccountsDepart', + name : 'settleAccountsDepart', + queryParam : 'spell', + minChars : 0, + valueField : 'name', + displayField : 'name', + store : settleDepartJsonStore, + forceSelection : true, + lazyInit : true, + triggerAction : 'all', + width : '33.3%', + queryDelay: 1300, //滞后1300ms发起请求 + hideTrigger : true, + typeAhead : false, + allowBlank : false, + flex : 1, + listeners:{ + select:function(combo, record, index){ + resetComboData({val : record[0].get('name'),property : 'name'}, settleDepartJsonStore, {'settleAccountsDepartCoding' : 'id'}); + }, + focus : function(thiz){ + thiz.selectText(); + } } - } - }, - { + }] + },{ + layout : 'form', + labelWidth :70, + columnWidth :.5, + height:heightVal, + items : [{ xtype : 'combo', + fieldLabel : '处理科室', + id : 'handleDepart', + name : 'handleDepart', + minChars : 0, + valueField : 'handleDepart', + displayField : 'handleDepart', + store : handleDepartmentStore, + forceSelection : false, + lazyInit : true, + width : '33.3%', + triggerAction : 'all', + hideTrigger : false, + typeAhead : false, + allowBlank : false, + flex : 1, + listeners:{ + select:function(combo, records, index){ + var record = transformRecords(records); + var handleDepart=record.data.handleDepart; + var handleDepartCoding=record.data.handleDepartCoding; + top.Ext4.getCmp("handleDepart").setValue(handleDepart); + top.Ext4.getCmp("handleDepartCoding").setValue(handleDepartCoding); + }, + focus : function(thiz){ + thiz.selectText(); + } + } + }] + },{ + layout : 'form', + labelWidth :70, + columnWidth :.5, + height:heightVal, + items : [{ + xtype : 'combo', fieldLabel : '处理方式', id : 'processType', name : 'processType', @@ -2280,34 +3037,38 @@ forceSelection : true, triggerAction : 'all', flex : 1 - } - ] - },{ - xtype : 'container', - width : '100%', - layout : 'hbox', - flex : 1, - items : [ - { - xtype : 'textfield', - fieldLabel : '住院号', - maxLength : '50', - id : 'hospitalNumber', - name : 'hospitalNumber', - width : '33.3%', - allowBlank : true, - enableKeyEvents : true, - listeners : { - specialkey : function(field, ee) { + }] + },{ + layout : 'form', + labelWidth :70, + columnWidth :.33, + height:heightVal, + items : [{ + xtype : 'textfield', + fieldLabel : '住院号', + maxLength : '50', + id : 'hospitalNumber', + name : 'hospitalNumber', + width : '33.3%', + allowBlank : true, + enableKeyEvents : true, + listeners : { + specialkey : function(field, ee) { if (ee.getKey() == Ext4.EventObject.ENTER) { var jsonStr = "{\"patientNum\":\"" + field.value + "\",\"numType\":\"hospitalNum\",\"sourcePage\":\"0\"}"; loadPatientInfoByValAndType(jsonStr); } } - }, - flex : 1 - },{ + }, + flex : 1 + }] + },{ + layout : 'form', + labelWidth :70, + columnWidth :.33, + height:heightVal, + items : [{ xtype : 'textfield', fieldLabel : '诊疗号', maxLength : '100', @@ -2326,7 +3087,13 @@ } }, flex : 1 - }, { + }] + },{ + layout : 'form', + labelWidth :70, + columnWidth :.33, + height:heightVal, + items : [{ xtype : 'textfield', fieldLabel : '病人姓名', maxLength : '50', @@ -2335,15 +3102,15 @@ width : '33.3%', allowBlank : true, flex : 1 - } - ] - },{ - xtype : 'container', - width : '100%', - layout : 'hbox', - hidden : sstsConfig.hidePatientArea, - flex : 1, - items : [{ + }] + },{ + layout : 'form', + labelWidth :70, + columnWidth :.33, + id:"patientAreaWrapper", + //hidden : sstsConfig.hidePatientArea, + height:heightVal, + items : [{ xtype : 'textfield', fieldLabel : '病区', maxLength : '50', @@ -2352,35 +3119,49 @@ width : '33.3%', allowBlank : true, flex : 1 - },{ + }] + },{ + layout : 'form', + labelWidth :70, + columnWidth :.33, + height:heightVal, + id:"roomNumberWrapper", + //hidden : sstsConfig.hidePatientArea, + items : [{ xtype : 'textfield', fieldLabel : '病室', maxLength : '50', id : 'roomNumber', name : 'roomNumber', width : '33.3%', allowBlank : true, - hidden : sstsConfig.hideRoomNumber, + //hidden : sstsConfig.hideRoomNumber, flex : 1 - }, { + }] + },{ + layout : 'form', + labelWidth :70, + columnWidth :.33, + height:heightVal, + id:"bedNumberWrapper", + //hidden : sstsConfig.hidePatientArea, + items : [{ xtype : 'textfield', fieldLabel : '床位', maxLength : '50', id : 'bedNumber', name : 'bedNumber', width : '33.3%', allowBlank : true, - hidden : sstsConfig.hideRoomNumber, + //hidden : sstsConfig.hideRoomNumber, flex : 1 - } - ] - },{ - xtype : 'container', - width : '100%', - layout : 'hbox', - flex : 1, - items : [ - { + }] + },{ + layout : 'form', + labelWidth :70, + columnWidth :.33, + height:heightVal, + items : [{ xtype : 'textfield', fieldLabel : '年龄', // maxLength : '3', @@ -2390,7 +3171,13 @@ // allowDecimals : false, allowNegative : false, flex : 1 - }, { + }] + },{ + layout : 'form', + labelWidth :70, + columnWidth :.33, + height:heightVal, + items : [{ xtype : 'combo', fieldLabel : '性别', valueField : 'typeName', @@ -2407,7 +3194,13 @@ data : [['男'],['女']] }), flex : 1 - },{ + }] + },{ + layout : 'form', + labelWidth :70, + columnWidth :.33, + height:heightVal, + items : [{ xtype : 'textfield', fieldLabel : '病人所属科室', maxLength : '16', @@ -2416,23 +3209,27 @@ width : '33.3%', allowBlank : true, flex : 1 - } - ] - },{ - xtype : 'container', - width : '100%', - layout : 'hbox', - flex : 1, - items : [ - { + }] + },{ + layout : 'form', + labelWidth :70, + columnWidth :.33, + height:heightVal, + items : [{ xtype : 'textfield', fieldLabel : '手术名称', id : 'surgery', name : 'surgery', width : '33.3%', allowBlank : true, flex : 1 - }, { + }] + },{ + layout : 'form', + labelWidth :70, + columnWidth :.33, + height:heightVal, + items : [{ xtype : 'datefield', fieldLabel : '手术时间', id : 'operationTime', @@ -2442,9 +3239,15 @@ format : 'Y-m-d H:i', allowBlank : true, flex : 1 - },{ + }] + },{ + layout : 'form', + labelWidth :70, + columnWidth :.33, + height:heightVal, + items : [{ fieldLabel : '医生', - xtype : 'combo', + xtype : 'combo', id : 'doctor', name : 'doctor', width : '33.3%', @@ -2453,8 +3256,8 @@ minChars : 0, //valueField : 'doctorName', displayField : 'doctor', - pageSize : 0, - listConfig: {width: 300}, + pageSize : 0, + listConfig: {width: 300}, forceSelection : true, lazyInit : true, triggerAction : 'all', @@ -2463,16 +3266,13 @@ allowBlank : true, forceSelection:false, store : commonlyUsedDoctorJsonStore - - } - ] - },{ - xtype : 'container', - width : '100%', - layout : 'hbox', - flex : 1, - items : [ - { + }] + },{ + layout : 'form', + labelWidth :70, + columnWidth :.33, + height:heightVal, + items : [{ xtype : 'combo', fieldLabel : '手术间', id : 'operationRoom', @@ -2500,7 +3300,13 @@ saveOrgUnitCode = record[0].get("orgUnitCoding"); } } - },{ + }] + },{ + layout : 'form', + labelWidth :70, + columnWidth :.33, + height:heightVal, + items : [{ xtype : 'combo', fieldLabel : '供应商联系人', id : 'supplierContactName', @@ -2511,8 +3317,8 @@ flex : 1, queryParam : 'contactName', minChars : 0, - flex : .33, - listConfig: {width: 300}, + flex : .33, + listConfig: {width: 300}, forceSelection : false, lazyInit : true, triggerAction : 'all', @@ -2526,7 +3332,7 @@ supplierName = top.Ext4.getCmp('suppler1').getValue(); //获取供应商信息 if(!supplierName && oldSupplierName == null){ - showResult('请先选择供应商!'); + showResult('请先选择供应商!'); return false; } }, @@ -2540,7 +3346,13 @@ } } } - },{ + }] + },{ + layout : 'form', + labelWidth :70, + columnWidth :.33, + height:heightVal, + items : [{ xtype : 'textfield', fieldLabel : '联系电话', id : 'supplierPhoneNumber', @@ -2549,17 +3361,15 @@ // readOnly: true, allowBlank : true, flex : .33 - } - ] - },{ - xtype : 'container', - width : '66%', - layout : 'hbox', - id : 'returnContactContainer', - hidden : true, - flex : 1, - items : [ - { + }] + },{ + layout : 'form', + labelWidth :70, + columnWidth :.33, + height:heightVal, + id:"returnContactNameWrapper", + hidden:true, + items : [{ xtype : 'combo', fieldLabel : '归还联系人', id : 'returnContactName', @@ -2570,8 +3380,8 @@ flex : 1, queryParam : 'contactName', minChars : 0, - flex : .34, - listConfig: {width: 300}, + flex : .34, + listConfig: {width: 300}, forceSelection : false, lazyInit : true, triggerAction : 'all', @@ -2590,367 +3400,495 @@ } } } - },{ + }] + },{ + layout : 'form', + labelWidth :70, + columnWidth :.33, + height:heightVal, + id:"returnContactPhoneNumberWrapper", + hidden:true, + items : [{ xtype : 'textfield', fieldLabel : '归还联系人电话', id : 'returnContactPhoneNumber', name : 'returnContactPhoneNumber', width : '34%', allowBlank : true, flex : .34 - } - ] - },{ - xtype : 'container', - width : '100%', - layout : 'hbox', - flex : 1, - items : [{ + }] + },{ + layout : 'form', + labelWidth :70, + columnWidth :.33, + height:heightVal, + hidden:true, + id : "sterilizationMethodWrapper", + items : [{ xtype : 'textfield', + fieldLabel : "灭菌方法", + allowBlank : true, + name : "sterilizationMethod", + id : "sterilizationMethod", + width : '33.3%', + flex : 1 + }] + },{ + layout : 'form', + labelWidth :70, + columnWidth :.33, + height:heightVal, + hidden:true, + id : "sterilizationTempWrapper", + items : [{ + xtype : 'numberfield', + fieldLabel : "灭菌温度(°C)", + allowBlank : true, + hideTrigger:true, + name : 'sterilizationTemp', + id : 'sterilizationTemp', + width : '33.3%', + flex : 1 + }] + },{ + layout : 'form', + labelWidth :70, + columnWidth :.33, + hidden:true, + height:heightVal, + id : "sterilizationTimeWrapper", + items : [{ + xtype : 'numberfield', + fieldLabel : "灭菌时间(分钟)", + allowBlank : true, + hideTrigger:true, + name : 'sterilizationTime', + id : 'sterilizationTime', + width : '33.3%', + flex : 1 + }] + },{ + layout : 'form', + labelWidth :70, + columnWidth :.33, + height:heightVal, + id : "dryTimeWrapper", + hidden:true, + items : [{ + xtype : 'numberfield', + fieldLabel : "干燥时间(分钟)", + allowBlank : true, + hideTrigger:true, + name : 'dryTime', + id : 'dryTime', + flex : 1 + }] + },{ + layout : 'form', + columnWidth : 1, + labelWidth :70, + id : "explainWrapper", + hidden:true, + items : [{ + xtype : 'textarea', + fieldLabel : "清洗消毒的特别要求和说明", + name : "explain", + id : "explain", + anchor : '98.5%', + height : 40 + }] + },{ + layout : 'form', + columnWidth : 1, + labelWidth :70, + items : [{ + xtype : 'textfield', fieldLabel : '备注', id : 'remark', name : 'remark', flex : .67 - }] - } - ] - } , - { - flex : 1, - xtype : 'container', - layout : 'hbox', - items:[ - top.Ext4.create('foreignTousseTreeGrid', { - id : 'foreignTousseTreeGridForm', - columns : foreignTousseColumns, - flex : 1, - border : true, - tbar : forigntousseTbar, - store : foreignTousseStore, - width : 930, - height: 320, - forceFit: true, - listeners : { - 'itemcontextmenu' : function(menutree, record, items, index, e) { - e.preventDefault(); - e.stopEvent(); - - var menuArray = []; - - var leaf = record.get("leaf"); - - if(leaf){ - menuArray.push({ - text : "删除", - iconCls :'btn_ext_pause', - handler : function() { - var parentNode = record.parentNode; - var ids = record.get("id"); - if(sstsConfig.disableModifyExistMaterilaOfForeignTousse){ - if(ids == 0){ - parentNode.removeChild(record); + }] + } + ] + }] + },{ + layout:'column', + items:[{ + layout : 'form', + columnWidth :1, + //columnWidth : top.screen.width < 1280 ? 0.57 : 0.55, + items:[ + top.Ext4.create('foreignTousseTreeGrid', { + id : 'foreignTousseTreeGridForm', + columns : foreignTousseColumns, + flex : 1, + border : true, + tbar : forigntousseTbar, + store : foreignTousseStore, + width : 930, + //height: top.screen.height > 863 ? 259 : 159, + height: setHeight, + autoHeight:true, + forceFit: true, + listeners : { + 'itemcontextmenu' : function(menutree, record, items, index, e) { + e.preventDefault(); + e.stopEvent(); + + var menuArray = []; + + var leaf = record.get("leaf"); + + if(leaf){ + menuArray.push({ + text : "删除", + iconCls :'btn_ext_pause', + handler : function() { + var parentNode = record.parentNode; + var ids = record.get("id"); + if(sstsConfig.disableModifyExistMaterilaOfForeignTousse){ + if(ids == 0){ + parentNode.removeChild(record); + }else{ + showResult('已经存在的材料不能删除' , null , sstsConfig.messagePauseTimeOnPackingPage); + } }else{ - showResult('已经存在的材料不能删除' , null , sstsConfig.messagePauseTimeOnPackingPage); + parentNode.removeChild(record); } - }else{ - parentNode.removeChild(record); - } - } - }); - }else{ - menuArray.push({ - text : "添加材料", - iconCls :'btn_ext_add', - handler : function() { - addForeignTousseMaterial(record.get("tousseDefinitionId")); - } - },{ - text : "删除", - hidden:(id != ''), - iconCls :'btn_ext_pause', - handler : function() { - var parentNode = record.parentNode; - parentNode.removeChild(record); - } - }); - } - var nodemenu = new top.Ext4.menu.Menu({ - items : menuArray - }); - nodemenu.showAt(e.getXY()); - } - } - }) - ] - } - ] - }); + } + }); + }else{ + menuArray.push({ + text : "添加材料", + iconCls :'btn_ext_add', + handler : function() { + addForeignTousseMaterial(record.get("tousseDefinitionId")); + } + },{ + text : "删除", + hidden:(id != ''), + iconCls :'btn_ext_pause', + handler : function() { + var parentNode = record.parentNode; + parentNode.removeChild(record); + } + }); + } + var nodemenu = new top.Ext4.menu.Menu({ + items : menuArray + }); + nodemenu.showAt(e.getXY()); + } + } + }) + ] + }] + }] + //buttons : [] + }); - foreignTousseApplyWindow = new top.Ext4.window.Window({ - id : 'foreignTousseApplicationWin', - title : '外来器械单信息', -// width : 950, - height : 650, -// height : top.screen.height > 1000 ? 600 : 500, - width : top.screen.width > 1280 ? 960 : 950, - resizable :false, - modal : true, - border : false, - plain : true, - layout : 'fit', - items : [ foreignTousseForm ] - }); - if(formType == 'interfere'){ - top.Ext4.getCmp('foreignTousseName1').disable(); - top.Ext4.getCmp('suppler1').disable(); - top.Ext4.getCmp('addTousseBt').hide(); + + + foreignTousseApplyWindow = new top.Ext4.window.Window({ + id : 'foreignTousseApplicationWin', + title : '外来器械单信息', +// width : 950, + height : top.screen.height > 863 ? 710 : 600, //710 +// height : top.screen.height > 1000 ? 600 : 500, + width : top.screen.width > 1280 ? 960 : 950, + resizable :false, + modal : true, + border : false, + plain : true, + layout : 'fit', + items : [ foreignTousseForm ] + }); + + if(formType == 'interfere'){ + top.Ext4.getCmp('foreignTousseName1').disable(); + top.Ext4.getCmp('suppler1').disable(); + top.Ext4.getCmp('addTousseBt').hide(); } - //打开时判断设置的字段是否是只读,配置在readOnlyFieldsOnForeignTousseInfoPage数组里面的,就会设置为只读 - if(sstsConfig.readOnlyFieldsOnForeignTousseInfoPage && sstsConfig.readOnlyFieldsOnForeignTousseInfoPage.length > 0){ - for(var i = 0;i < sstsConfig.readOnlyFieldsOnForeignTousseInfoPage.length;i++){ - var readOnlyList = sstsConfig.readOnlyFieldsOnForeignTousseInfoPage[i]; - var readOnlyDom = top.Ext4.getCmp(readOnlyList); - readOnlyDom.readOnly = true; - readOnlyDom.fieldCls = 'fieldReadOnlydisabled'; - } + + if(sstsConfig.hidePatientArea){ + top.Ext4.getCmp('patientArea').hide(); + top.Ext4.getCmp('patientAreaWrapper').hide(); + top.Ext4.getCmp('roomNumberWrapper').hide(); + top.Ext4.getCmp('roomNumber').hide(); + top.Ext4.getCmp('bedNumberWrapper').hide(); + top.Ext4.getCmp('bedNumber').hide(); } - - foreignTousseApplyWindow.on('close',function(w){ - if(document.getElementById("imageIdsAndGoodsName")){ - document.getElementById("imageIdsAndGoodsName").value = ""; - } - - if(document.getElementById("videoIdsAndGoodsName")){ - document.getElementById("videoIdsAndGoodsName").value = ""; - } - if(document.getElementById("imageIds")){ - document.getElementById("imageIds").value = ""; - } - if(document.getElementById("videoIds")){ - document.getElementById("videoIds").value = ""; - } - }); + if(sstsConfig.hideRoomNumber){ + top.Ext4.getCmp('patientArea').show(); + top.Ext4.getCmp('patientAreaWrapper').show(); + top.Ext4.getCmp('roomNumberWrapper').hide(); + top.Ext4.getCmp('roomNumber').hide(); + top.Ext4.getCmp('bedNumberWrapper').hide(); + top.Ext4.getCmp('bedNumber').hide(); + } + + //打开时判断设置的字段是否是只读,配置在readOnlyFieldsOnForeignTousseInfoPage数组里面的,就会设置为只读 + if(sstsConfig.readOnlyFieldsOnForeignTousseInfoPage && sstsConfig.readOnlyFieldsOnForeignTousseInfoPage.length > 0){ + for(var i = 0;i < sstsConfig.readOnlyFieldsOnForeignTousseInfoPage.length;i++){ + var readOnlyList = sstsConfig.readOnlyFieldsOnForeignTousseInfoPage[i]; + var readOnlyDom = top.Ext4.getCmp(readOnlyList); + readOnlyDom.readOnly = true; + readOnlyDom.fieldCls = 'fieldReadOnlydisabled'; + } + } - foreignTousseApplyWindow.show(); - - if (id) {// 编辑 - foreignTousseForm.form.load( { - url : WWWROOT + '/disinfectSystem/foreigntousseapplication/foreignTousseApplicationAction!loadForeignTousseApplication.do', - method : 'GET', - waitMsg : '正在加载数据,请稍候', - success : function(form, action) { - if(top.Ext4.getCmp("applicant").getValue() != curUserName){ - showResult("该申请单只能由申请人修改!"); - top.Ext4.getCmp('commitBtn').hide(); - top.Ext4.getCmp('commitPrintBtn').hide(); - } - //点击修改按钮并且已经在回收页面打开过,不准修改,隐藏提交按钮 - if(!ismodify && action.result.data.readed == 1){ - showResult("该申请单已经被回收人员查阅,不允许自行修改!"); - top.Ext4.getCmp('commitBtn').hide(); - top.Ext4.getCmp('commitPrintBtn').hide(); - } - //初始化供应商联系人值 - var contactName = action.result.data.supplierContactName; - top.Ext4.getCmp('supplierContactName').setRawValue(contactName); - oldSupplierName = action.result.data.supplierName; - - //初始化供应商联系人值 - var returnContactName = action.result.data.returnContactName; - top.Ext4.getCmp('returnContactName').setRawValue(returnContactName); - - //如果单的状态为待回收,则将归还联系人选项填好 - var recyclingStatus = action.result.data.recyclingStatus; - if(recyclingStatus == '待回收'){ - top.Ext4.getCmp('returnContactContainer').setVisible(true); - } - - //设置申请科室 - var depart = action.result.data.depart; - var departCoding = action.result.data.departCoding; - applyDepartJsonStore.load({ - params: {spell: depart, departmentCode: departCoding}, - callback: function(records, operation, success) { - if (records && records.length > 0) { - top.Ext4.getCmp("depart").setValue(depart); - top.Ext4.getCmp("departCoding").setValue(departCoding); - } - } - }); - - //设置结算科室 - var settleAccountsDepart = action.result.data.settleAccountsDepart; - - //设置性别 - var patientSex = action.result.data.patientSex; - top.Ext4.getCmp("patientSex").setValue(patientSex); - - //设置处理方式 - var processType = action.result.data.processType; - var processTypeComp = top.Ext4.ComponentQuery.query("#foreignToussForm #processType")[0]; - processTypeComp.forceSelection = false; - processTypeComp.setValue(processType); - processTypeComp.forceSelection = true; - - //设置手术间 - top.Ext4.getCmp("operationRoom").setValue(action.result.data.operationRoom); - - //设置手术时间 - var operationTime = action.result.data.operationTime; - if(operationTime != ""){ - var trainingStartTime = new Date(Date.parse(operationTime.replace(/-/g,"/"))); - top.Ext4.getCmp("operationTime").setValue(trainingStartTime.format('Y-m-d H:i')); - } - }, - failure : function(form, action) { - showResult("加载失败,请联系管理员!"); - }, - params : { - id : id + //新增字段使用expandFieldsOfForeignTousseApplicationForm配置项控制显示和隐藏 + if(sstsConfig.expandFieldsOfForeignTousseApplicationForm && sstsConfig.expandFieldsOfForeignTousseApplicationForm.length > 0){ + for(var j = 0;j < sstsConfig.expandFieldsOfForeignTousseApplicationForm.length;j++){ + var showList = sstsConfig.expandFieldsOfForeignTousseApplicationForm[j]; + var showListDom = top.Ext4.getCmp(showList); + if(showListDom){ + showListDom.show(); } - }); - }else{ - // 1、查找默认的“申请科室”和“结算科室”,首先取科室供应室配置的,再取config里面的配置,都没有取到才设置为当前登录科室的 - var depart = $Id('depart').value; - var departCoding = $Id('departCoding').value; - var appDepart = depart; - var appDepartCode = departCoding; - var settleAccountsDepart = depart; - var settleAccountsDepartCode = departCoding; - oldSupplierName = null;//初始化供应商名称 - - if (sstsConfig.enableForeignTousseApplyDepartment) { - DWREngine.setAsync(false); - SupplyRoomConfigTableManager.getFtApplyDepartment(function(result){ - var data = JSON.parse(result); - if (!isUndefinedOrNullOrEmpty(data)) { - var ftApplyDepartment = data.ftApplyDepartment; - var ftApplyDepartmentCode = data.ftApplyDepartmentCode; - if (ftApplyDepartment && ftApplyDepartmentCode) { - appDepart = ftApplyDepartment; - appDepartCode = ftApplyDepartmentCode; - settleAccountsDepart = ftApplyDepartment; - settleAccountsDepartCode = ftApplyDepartmentCode; - } - } - }); - DWREngine.setAsync(true); } - - var foreignTousseAppliationDefaultDepartment = getObjValueFromJs('sstsConfig.foreignTousseAppliationDefaultDepartment',null); - if(!isUndefinedOrNullOrEmpty(foreignTousseAppliationDefaultDepartment)){ - var departCfg = foreignTousseAppliationDefaultDepartment[appDepartCode]; - var searchCode = ''; - if(!isUndefinedOrNullOrEmpty(departCfg)){ - if(!isUndefinedOrNullOrEmpty(departCfg.appDepartCode)){ - appDepartCode = departCfg.appDepartCode; - if(appDepartCode != departCoding){ - searchCode = appDepartCode; - } - } - if(!isUndefinedOrNullOrEmpty(departCfg.settleAccountsDepartCode)){ - settleAccountsDepartCode = departCfg.settleAccountsDepartCode; - if(settleAccountsDepartCode != departCoding && settleAccountsDepartCode != searchCode){ - if(searchCode == ''){ - searchCode = settleAccountsDepartCode; - }else{ - searchCode += ","+settleAccountsDepartCode; - } - } - } - } - if(searchCode != ''){ - // 根据编码查找部门名字 - DWREngine.setAsync(false); - OrgUnitTableManager.getOrgNamesByCodes(searchCode,function(codeNameInfoStr){ - var codeNameInfo = JSON.parse(codeNameInfoStr); - if(!isUndefinedOrNullOrEmpty(codeNameInfo[appDepartCode])){ - appDepart = codeNameInfo[appDepartCode]; - } - if(!isUndefinedOrNullOrEmpty(codeNameInfo[settleAccountsDepartCode])){ - settleAccountsDepart = codeNameInfo[settleAccountsDepartCode]; - } - }); - DWREngine.setAsync(true); - } - } - - // 2、设置默认的“申请科室”和“结算科室”,因为数据分页了所以重新去后台取 - applyDepartJsonStore.load({ - params: {spell: appDepart, departmentCode: appDepartCode}, - callback: function(records, operation, success) { - if (records && records.length > 0) { - top.Ext4.getCmp("depart").setValue(appDepart); - top.Ext4.getCmp("departCoding").setValue(appDepartCode); - } - } - }); - orgUnitCodeOperationRoom = appDepartCode; - //simon-add:根据申请科室编码查找此申请科室设置的默认结算科室;如果没有配置默认的结算科室,那么结算科室默认显示为可结算的申请科室 - top.Ext4.getCmp("settleAccountsDepart").setValue(settleAccountsDepart); - top.Ext4.getCmp("settleAccountsDepartCoding").setValue(settleAccountsDepartCode); - DWREngine.setAsync(false); - Ext4.Ajax.request({ - url : WWWROOT + '/disinfectSystem/baseData/supplyRoomConfigAction!getSupplyRoomConfigByCoding.do', - params : {'orgUnitCode':appDepartCode,'type':3}, - timeout : 600000, - success : function(response, options) { - var result= Ext4.JSON.decode(response.responseText); - - if(!isUndefinedOrNullOrEmpty(result.settleAccountsDepart)&&!isUndefinedOrNullOrEmpty(result.settleAccountsDepartCoding)){ - top.Ext4.getCmp('settleAccountsDepart').setValue(result.settleAccountsDepart); - top.Ext4.getCmp('settleAccountsDepartCoding').setValue(result.settleAccountsDepartCoding); - } - }, - failure : function(response, opts) { - showResult(response.responseText); - } - }); - DWREngine.setAsync(true); - - //3、光标定位到“器械包名称combo” - top.Ext4.getCmp("foreignTousseName1").focus('', 10); - - if(sstsConfig.foreiginTousseApplicationWarningTimeRange - && sstsConfig.foreiginTousseApplicationWarningTimeRange.length > 0){ - - //获取服务器时间 - getServerTime("HH:mm",top.Ext4,null,myFun); - function myFun(serverTime){ - for(var i = 0;i < sstsConfig.foreiginTousseApplicationWarningTimeRange.length;i++){ - var warningBeginTime = sstsConfig.foreiginTousseApplicationWarningTimeRange[i][0]; - var warningEndTime = sstsConfig.foreiginTousseApplicationWarningTimeRange[i][1]; - if(serverTime >= warningBeginTime && serverTime <= warningEndTime){ - showNoticeWindow(); - break; - } - } - } - - function showNoticeWindow(){ - //判断当前时间是否位于所设置的超时时间范围,如果是,则打开超时处理确认提示筐(广医二院需求) - var messageVal = "
器械送达时间超时,请选择超时处理方式:


"; - var msgBox = new top.Ext4.window.MessageBox(); - msgBox.autoShow=true; - msgBox.autoScroll=true; - msgBox.overflowY='auto'; - msgBox.confirm({ - title: '超时处理', - padding: '0 10 10 10', - autoScroll: true, - height: 200, - width : 400, - autoShow: true, - msg: messageVal, - fn: function(btn){ - - }, - buttons: Ext4.MessageBox.OKCANCEL, - icon: Ext4.Msg.WARNING - }); - } - } - } + } + + foreignTousseApplyWindow.on('close',function(w){ + if(document.getElementById("imageIdsAndGoodsName")){ + document.getElementById("imageIdsAndGoodsName").value = ""; + } + + if(document.getElementById("videoIdsAndGoodsName")){ + document.getElementById("videoIdsAndGoodsName").value = ""; + } + if(document.getElementById("imageIds")){ + document.getElementById("imageIds").value = ""; + } + if(document.getElementById("videoIds")){ + document.getElementById("videoIds").value = ""; + } + }); + + + foreignTousseApplyWindow.show(); + + if (id) {// 编辑 + foreignTousseForm.form.load( { + url : WWWROOT + '/disinfectSystem/foreigntousseapplication/foreignTousseApplicationAction!loadForeignTousseApplication.do', + method : 'GET', + waitMsg : '正在加载数据,请稍候', + success : function(form, action) { + if(top.Ext4.getCmp("applicant").getValue() != curUserName){ + showResult("该申请单只能由申请人修改!"); + top.Ext4.getCmp('commitBtn').hide(); + top.Ext4.getCmp('commitPrintBtn').hide(); + } + //点击修改按钮并且已经在回收页面打开过,不准修改,隐藏提交按钮 + if(!ismodify && action.result.data.readed == 1){ + showResult("该申请单已经被回收人员查阅,不允许自行修改!"); + top.Ext4.getCmp('commitBtn').hide(); + top.Ext4.getCmp('commitPrintBtn').hide(); + } + //初始化供应商联系人值 + var contactName = action.result.data.supplierContactName; + top.Ext4.getCmp('supplierContactName').setRawValue(contactName); + oldSupplierName = action.result.data.supplierName; + + //初始化供应商联系人值 + var returnContactName = action.result.data.returnContactName; + top.Ext4.getCmp('returnContactName').setRawValue(returnContactName); + + //如果单的状态为待回收,则将归还联系人选项填好 + var recyclingStatus = action.result.data.recyclingStatus; + if(recyclingStatus == '待回收'){ + //top.Ext4.getCmp('returnContactContainer').setVisible(true); + top.Ext4.getCmp('returnContactName').show(); + top.Ext4.getCmp('returnContactNameWrapper').show(); + top.Ext4.getCmp('returnContactPhoneNumberWrapper').show(); + top.Ext4.getCmp('returnContactPhoneNumber').show(); + } + + //设置申请科室 + var depart = action.result.data.depart; + var departCoding = action.result.data.departCoding; + applyDepartJsonStore.load({ + params: {spell: depart, departmentCode: departCoding}, + callback: function(records, operation, success) { + if (records && records.length > 0) { + top.Ext4.getCmp("depart").setValue(depart); + top.Ext4.getCmp("departCoding").setValue(departCoding); + } + } + }); + + //设置结算科室 + var settleAccountsDepart = action.result.data.settleAccountsDepart; + + //设置性别 + var patientSex = action.result.data.patientSex; + top.Ext4.getCmp("patientSex").setValue(patientSex); + + //设置处理方式 + var processType = action.result.data.processType; + var processTypeComp = top.Ext4.ComponentQuery.query("#foreignToussForm #processType")[0]; + processTypeComp.forceSelection = false; + processTypeComp.setValue(processType); + processTypeComp.forceSelection = true; + + //设置手术间 + top.Ext4.getCmp("operationRoom").setValue(action.result.data.operationRoom); + + //设置手术时间 + var operationTime = action.result.data.operationTime; + if(operationTime != ""){ + var trainingStartTime = new Date(Date.parse(operationTime.replace(/-/g,"/"))); + top.Ext4.getCmp("operationTime").setValue(trainingStartTime.format('Y-m-d H:i')); + } + }, + failure : function(form, action) { + showResult("加载失败,请联系管理员!"); + }, + params : { + id : id + } + }); + }else{ + // 1、查找默认的“申请科室”和“结算科室”,首先取科室供应室配置的,再取config里面的配置,都没有取到才设置为当前登录科室的 + var depart = $Id('depart').value; + var departCoding = $Id('departCoding').value; + var appDepart = depart; + var appDepartCode = departCoding; + var settleAccountsDepart = depart; + var settleAccountsDepartCode = departCoding; + oldSupplierName = null;//初始化供应商名称 + + if (sstsConfig.enableForeignTousseApplyDepartment) { + DWREngine.setAsync(false); + SupplyRoomConfigTableManager.getFtApplyDepartment(function(result){ + var data = JSON.parse(result); + if (!isUndefinedOrNullOrEmpty(data)) { + var ftApplyDepartment = data.ftApplyDepartment; + var ftApplyDepartmentCode = data.ftApplyDepartmentCode; + if (ftApplyDepartment && ftApplyDepartmentCode) { + appDepart = ftApplyDepartment; + appDepartCode = ftApplyDepartmentCode; + settleAccountsDepart = ftApplyDepartment; + settleAccountsDepartCode = ftApplyDepartmentCode; + } + } + }); + DWREngine.setAsync(true); + } + + var foreignTousseAppliationDefaultDepartment = getObjValueFromJs('sstsConfig.foreignTousseAppliationDefaultDepartment',null); + if(!isUndefinedOrNullOrEmpty(foreignTousseAppliationDefaultDepartment)){ + var departCfg = foreignTousseAppliationDefaultDepartment[appDepartCode]; + var searchCode = ''; + if(!isUndefinedOrNullOrEmpty(departCfg)){ + if(!isUndefinedOrNullOrEmpty(departCfg.appDepartCode)){ + appDepartCode = departCfg.appDepartCode; + if(appDepartCode != departCoding){ + searchCode = appDepartCode; + } + } + if(!isUndefinedOrNullOrEmpty(departCfg.settleAccountsDepartCode)){ + settleAccountsDepartCode = departCfg.settleAccountsDepartCode; + if(settleAccountsDepartCode != departCoding && settleAccountsDepartCode != searchCode){ + if(searchCode == ''){ + searchCode = settleAccountsDepartCode; + }else{ + searchCode += ","+settleAccountsDepartCode; + } + } + } + } + if(searchCode != ''){ + // 根据编码查找部门名字 + DWREngine.setAsync(false); + OrgUnitTableManager.getOrgNamesByCodes(searchCode,function(codeNameInfoStr){ + var codeNameInfo = JSON.parse(codeNameInfoStr); + if(!isUndefinedOrNullOrEmpty(codeNameInfo[appDepartCode])){ + appDepart = codeNameInfo[appDepartCode]; + } + if(!isUndefinedOrNullOrEmpty(codeNameInfo[settleAccountsDepartCode])){ + settleAccountsDepart = codeNameInfo[settleAccountsDepartCode]; + } + }); + DWREngine.setAsync(true); + } + } + + // 2、设置默认的“申请科室”和“结算科室”,因为数据分页了所以重新去后台取 + applyDepartJsonStore.load({ + params: {spell: appDepart, departmentCode: appDepartCode}, + callback: function(records, operation, success) { + if (records && records.length > 0) { + top.Ext4.getCmp("depart").setValue(appDepart); + top.Ext4.getCmp("departCoding").setValue(appDepartCode); + } + } + }); + orgUnitCodeOperationRoom = appDepartCode; + //simon-add:根据申请科室编码查找此申请科室设置的默认结算科室;如果没有配置默认的结算科室,那么结算科室默认显示为可结算的申请科室 + top.Ext4.getCmp("settleAccountsDepart").setValue(settleAccountsDepart); + top.Ext4.getCmp("settleAccountsDepartCoding").setValue(settleAccountsDepartCode); + DWREngine.setAsync(false); + Ext4.Ajax.request({ + url : WWWROOT + '/disinfectSystem/baseData/supplyRoomConfigAction!getSupplyRoomConfigByCoding.do', + params : {'orgUnitCode':appDepartCode,'type':3}, + timeout : 600000, + success : function(response, options) { + var result= Ext4.JSON.decode(response.responseText); + + if(!isUndefinedOrNullOrEmpty(result.settleAccountsDepart)&&!isUndefinedOrNullOrEmpty(result.settleAccountsDepartCoding)){ + top.Ext4.getCmp('settleAccountsDepart').setValue(result.settleAccountsDepart); + top.Ext4.getCmp('settleAccountsDepartCoding').setValue(result.settleAccountsDepartCoding); + } + }, + failure : function(response, opts) { + showResult(response.responseText); + } + }); + DWREngine.setAsync(true); + + //3、光标定位到“器械包名称combo” + top.Ext4.getCmp("foreignTousseName1").focus('', 10); + + if(sstsConfig.foreiginTousseApplicationWarningTimeRange + && sstsConfig.foreiginTousseApplicationWarningTimeRange.length > 0){ + + //获取服务器时间 + getServerTime("HH:mm",top.Ext4,null,myFun); + function myFun(serverTime){ + for(var i = 0;i < sstsConfig.foreiginTousseApplicationWarningTimeRange.length;i++){ + var warningBeginTime = sstsConfig.foreiginTousseApplicationWarningTimeRange[i][0]; + var warningEndTime = sstsConfig.foreiginTousseApplicationWarningTimeRange[i][1]; + if(serverTime >= warningBeginTime && serverTime <= warningEndTime){ + showNoticeWindow(); + break; + } + } + } + + function showNoticeWindow(){ + //判断当前时间是否位于所设置的超时时间范围,如果是,则打开超时处理确认提示筐(广医二院需求) + var messageVal = "
器械送达时间超时,请选择超时处理方式:


"; + var msgBox = new top.Ext4.window.MessageBox(); + msgBox.autoShow=true; + msgBox.autoScroll=true; + msgBox.overflowY='auto'; + msgBox.confirm({ + title: '超时处理', + padding: '0 10 10 10', + autoScroll: true, + height: 200, + width : 400, + autoShow: true, + msg: messageVal, + fn: function(btn){ + + }, + buttons: Ext4.MessageBox.OKCANCEL, + icon: Ext4.Msg.WARNING + }); + } + } + } } \ No newline at end of file Index: ssts-web/src/main/webapp/disinfectsystem/config/cssdsyy/print/printConfig.js =================================================================== diff -u -r25296 -r27866 --- ssts-web/src/main/webapp/disinfectsystem/config/cssdsyy/print/printConfig.js (.../printConfig.js) (revision 25296) +++ ssts-web/src/main/webapp/disinfectsystem/config/cssdsyy/print/printConfig.js (.../printConfig.js) (revision 27866) @@ -1122,26 +1122,32 @@ {label : "申请人:", dataIndex : 'applicant', fontSize : 11, position : ["150","4%","90%",10]}, {label : "打印时间:", dataIndex : 'printTime', fontSize : 11, position : ["150","80mm","90%",10]}, - {label : "备注:", dataIndex : 'remark', fontSize : 11, position : ["180","4%","90%",5]}, + {label : "备注:", dataIndex : 'remark', fontSize : 11, position : ["180","4%","90%",20]}, - {label : "手术名称:", dataIndex : 'surgery', fontSize : 11, position : ["250","4%","90%",10]}, - {label : "手术医生:", dataIndex : 'doctor', fontSize : 11, position : ["290","4%","90%",10]}, - {label : "手术时间:", dataIndex : 'operationTime', fontSize : 11, position : ["330","4%","90%",10]}, + {label : "手术名称:", dataIndex : 'surgery', fontSize : 11, position : ["230","4%","90%",10]}, + {label : "手术医生:", dataIndex : 'doctor', fontSize : 11, position : ["260","4%","90%",10]}, + {label : "送达时间:", dataIndex : 'applicationTime', fontSize : 11, position : ["290","4%","90%",10]}, + {label : "手术时间:", dataIndex : 'operationTime', fontSize : 11, position : ["320","4%","90%",10]}, + {label : "清洗消毒的特别要求和说明:", dataIndex : 'explain', fontSize : 11, position : ["350","4%","90%",10]}, + {label : "灭菌方法:", dataIndex : 'sterilizationMethod', fontSize : 11, position : ["380","4%","90%",10]}, + {label : "灭菌温度:", dataIndex : 'sterilizationTemp', fontSize : 11, position : ["380","55mm","90%",10]}, + {label : "灭菌时间:", dataIndex : 'sterilizationTime', fontSize : 11, position : ["380","100mm","90%",10]}, + {label : "干燥时间:", dataIndex : 'dryTime', fontSize : 11, position : ["380","145mm","90%",10]}, + {label : "手术器械清单:", dataIndex : '', fontSize : 11, position : ["410","4%","90%",10]}, - {label : "手术器械清单:", dataIndex : '', fontSize : 11, position : ["370","4%","90%",10]}, + {label : "公司名称:", dataIndex : 'supplierName', fontSize : 11, position : ["740","4%","90%",5]}, + {label : "联系方式:", dataIndex : '', fontSize : 11, position : ["780","4%","90%",5]}, + {label : "送包日期及时间:", dataIndex : '', fontSize : 11, position : ["820","4%","90%",5]}, + {label : "送包者签名:", dataIndex : '', fontSize : 11, position : ["860","4%","90%",5]}, + {label : "回收者签名:", dataIndex : '', fontSize : 11, position : ["900","4%","90%",5]}, + {label : " 为规范外来器械的管理,保证清洗消毒和灭菌质量,减少器械的损耗,请您配合消毒供应中心填好器械处理相关信息,我们将按照您提供的信息进行清洗消毒和灭菌,如果您不提供相关信息,消毒供应中心可拒绝接收处理您送来的器械;若您提供的信息不准确,由此产生的后果将由您和贵公司承担。衷心感谢您的支持和配合。", dataIndex : '', fontSize : 9, position : ["940","4%","90%",40]} - {label : "公司名称:", dataIndex : 'supplierName', fontSize : 11, position : ["680","4%","90%",5]}, - {label : "联系方式:", dataIndex : '', fontSize : 11, position : ["720","4%","90%",5]}, - {label : "送包日期及时间:", dataIndex : '', fontSize : 11, position : ["760","4%","90%",5]}, - {label : "送包者签名:", dataIndex : '', fontSize : 11, position : ["800","4%","90%",5]}, - {label : "回收者签名:", dataIndex : '', fontSize : 11, position : ["840","4%","90%",5]} - ], goodsTable :{ rowHeight : 25, - position : ["400","8%","170mm","1000"], + position : ["430","8%","170mm","1000"], content : [ {header : "序号", dataIndex : 'serialNumber', width : 60, align : 'center', fontSize : 11}, {header : "名称", dataIndex : 'goodsName', width : 300, align : 'left', fontSize : 11}, Index: ssts-web/src/main/webapp/disinfectsystem/basedatamanager/tousse/foreignTousseView.js =================================================================== diff -u -r17536 -r27866 --- ssts-web/src/main/webapp/disinfectsystem/basedatamanager/tousse/foreignTousseView.js (.../foreignTousseView.js) (revision 17536) +++ ssts-web/src/main/webapp/disinfectsystem/basedatamanager/tousse/foreignTousseView.js (.../foreignTousseView.js) (revision 27866) @@ -137,6 +137,10 @@ {header : "器械包类别",width : 100,dataIndex : 'tousseType'}, {header : "包装类型",width : 100,dataIndex : 'packageType'}, {header : "供应商",width : 180,dataIndex : 'supplierName'}, + {header : "灭菌方法",width : 100,dataIndex : 'sterilizationMethod'}, + {header : "灭菌温度(°C)",width : 100,dataIndex : 'sterilizationTemp'}, + {header : "灭菌时间(分钟)",width : 100,dataIndex : 'sterilizationTime'}, + {header : "干燥时间(分钟)",width : 100,dataIndex : 'dryTime'}, // {header : "打印标签类型",width : 100,dataIndex : 'barcodePaperType'}, {header : "拼音码",width : 80,dataIndex : 'spelling'}, {id : 'wbCode',header : "五笔码",width : 80,dataIndex : 'wbCode'} @@ -150,7 +154,12 @@ {name : 'spelling'}, // {name : 'barcodePaperType'}, {name : 'wbCode'}, - {name : 'supplierName'} + {name : 'supplierName'}, + {name : 'sterilizationMethod'}, + {name : 'sterilizationTemp'}, + {name : 'sterilizationTime'}, + {name : 'dryTime'} + ]; var filters = new Ext.grid.GridFilters({ Index: ssts-web/src/main/webapp/disinfectsystem/config/cssdsyy/config.js =================================================================== diff -u -r27538 -r27866 --- ssts-web/src/main/webapp/disinfectsystem/config/cssdsyy/config.js (.../config.js) (revision 27538) +++ ssts-web/src/main/webapp/disinfectsystem/config/cssdsyy/config.js (.../config.js) (revision 27866) @@ -67,5 +67,7 @@ //打印器械包标签时,是否打印一次性物品材料,只有加大标签和大标签才会打印 tousseLabelPrintDisposableGoods : true, //禁用基数限制 - disableCardinalNumLimit:true + disableCardinalNumLimit:true, + //外来器械申请单的扩展字段,灭菌方法、灭菌温度(°C)、灭菌时间(分钟)、干燥时间(分钟)、清洗消毒特别要求和说明 + expandFieldsOfForeignTousseApplicationForm : ["sterilizationMethodWrapper","sterilizationTempWrapper","sterilizationTimeWrapper","dryTimeWrapper","explainWrapper"] } \ No newline at end of file Index: ssts-web/src/main/webapp/ext-4.2.3/resources/ext-theme-green/green-theme-sandbox-all-fontSize15.css =================================================================== diff -u -r14608 -r27866 --- ssts-web/src/main/webapp/ext-4.2.3/resources/ext-theme-green/green-theme-sandbox-all-fontSize15.css (.../green-theme-sandbox-all-fontSize15.css) (revision 14608) +++ ssts-web/src/main/webapp/ext-4.2.3/resources/ext-theme-green/green-theme-sandbox-all-fontSize15.css (.../green-theme-sandbox-all-fontSize15.css) (revision 27866) @@ -12803,4 +12803,9 @@ .x4-tab-noicon .x4-tab-icon { display: none +} + +#foreignToussForm .x4-panel-body-default{ + background:none; + border-width: 0px; } \ No newline at end of file Index: ssts-web/src/main/webapp/disinfectsystem/basedatamanager/foreigntoussedefinition/foreignTousseDefinitionForm.js =================================================================== diff -u -r21637 -r27866 --- ssts-web/src/main/webapp/disinfectsystem/basedatamanager/foreigntoussedefinition/foreignTousseDefinitionForm.js (.../foreignTousseDefinitionForm.js) (revision 21637) +++ ssts-web/src/main/webapp/disinfectsystem/basedatamanager/foreigntoussedefinition/foreignTousseDefinitionForm.js (.../foreignTousseDefinitionForm.js) (revision 27866) @@ -319,7 +319,7 @@ labelAlign : 'left', bodyStyle : 'padding:5px 5px 0px 5px;', autoWidth : true, - labelWidth : 80, + labelWidth : 90, autoHeight : true, autoScroll : false, items : [{ @@ -350,7 +350,7 @@ items : [{ columnWidth : .33, layout : 'form', - labelWidth : 80, + labelWidth : 90, items : [{ xtype : 'textfield', fieldLabel : "器械包名称", @@ -364,7 +364,7 @@ }, { columnWidth : .33, layout : 'form', - labelWidth : 80, + labelWidth : 90, items : [{ xtype : 'combo', fieldLabel : "供应商", @@ -388,7 +388,7 @@ }, { columnWidth : .33, layout : 'form', - labelWidth : 80, + labelWidth : 90, items : [{ xtype : 'textfield', fieldLabel : "拼音码", @@ -402,7 +402,7 @@ }, { columnWidth : .33, layout : 'form', - labelWidth : 80, + labelWidth : 90, items : [{ xtype : 'textfield', fieldLabel : "五笔码", @@ -416,7 +416,7 @@ },{ columnWidth : .33, layout : 'form', - labelWidth : 80, + labelWidth : 90, items:[{ xtype : 'combo', fieldLabel : '默认包装类型', @@ -434,7 +434,7 @@ },{ columnWidth : .33, layout : 'form', - labelWidth : 80, + labelWidth : 90, items:[{ xtype : 'combo', fieldLabel : '标签纸类型', @@ -451,9 +451,58 @@ anchor : '95%' }] },{ + columnWidth : .33, + layout : 'form', + labelWidth : 90, + items : [{ + xtype : 'textfield', + fieldLabel : "灭菌方法", + allowBlank : true, + name : "sterilizationMethod", + id : "sterilizationMethod", + //readOnly : true, + anchor : '95%' + }] + },{ + columnWidth : .33, + layout : 'form', + labelWidth : 90, + items:[{ + xtype : 'numberfield', + fieldLabel : "灭菌温度(°C)", + allowBlank : true, + name : 'sterilizationTemp', + id : 'sterilizationTemp', + anchor : '95%' + }] + },{ + columnWidth : .33, + layout : 'form', + labelWidth : 90, + items:[{ + xtype : 'numberfield', + fieldLabel : "灭菌时间(分钟)", + allowBlank : true, + name : 'sterilizationTime', + id : 'sterilizationTime', + anchor : '95%' + }] + },{ + columnWidth : .33, + layout : 'form', + labelWidth : 90, + items:[{ + xtype : 'numberfield', + fieldLabel : "干燥时间(分钟)", + allowBlank : true, + name : 'dryTime', + id : 'dryTime', + anchor : '95%' + }] + },{ columnWidth : .33, layout : 'form', - labelWidth : 80, + labelWidth : 90, items:[{ xtype : 'numberfield', fieldLabel : "打印份数", @@ -467,7 +516,7 @@ },{ columnWidth : .33, layout : 'form', - labelWidth : 80, + labelWidth : 90, items:[{ xtype : 'combo', fieldLabel : '是否停用', @@ -490,7 +539,7 @@ },{ columnWidth : .33, layout : 'form', - labelWidth : 80, + labelWidth : 90, items:[{ xtype : 'combo', fieldLabel : '大小', @@ -512,7 +561,7 @@ },{ columnWidth : .33, layout : 'form', - labelWidth : 80, + labelWidth : 90, hidden: !sstsConfig.enableForeignTousseSplitNumberProperty, items:[{ xtype : 'numberfield', @@ -527,7 +576,7 @@ },{ columnWidth : .33, layout : 'form', - labelWidth : 80, + labelWidth : 90, hidden: !sstsConfig.enableForeignToussePrintAmount, items:[{ xtype : 'numberfield', @@ -542,7 +591,7 @@ },{ columnWidth : .33, layout : 'form', - labelWidth : 80, + labelWidth : 90, items:[{ xtype : 'combo', fieldLabel : '打印份数来源', @@ -564,8 +613,7 @@ },{ columnWidth : 1, layout : 'form', - labelWidth : 80, - labelAlign:"right", + labelWidth : 90, items:[{ xtype : 'textarea', fieldLabel : "配包注意事项", @@ -575,6 +623,19 @@ id : "note", anchor : '100%' }] + },{ + columnWidth : 1, + layout : 'form', + labelWidth : 90, + items:[{ + xtype : 'textarea', + fieldLabel : "清洗消毒的特别要求和说明", + allowBlank : true, + height :35, + name : "explain", + id : "explain", + anchor : '100%' + }] }] },{ columnWidth : 1, @@ -643,7 +704,7 @@ id : 'foreignTousseDefinitionWin', layout : 'fit', title : '外来器械包信息', - width : 900, + width : 920, border : false, modal : true, autoHeight : true,