Index: ssts-web/src/main/webapp/disinfectsystem/foreigntousseapplication/foreignTousseInfoForm.js =================================================================== diff -u -r28073 -r28366 --- ssts-web/src/main/webapp/disinfectsystem/foreigntousseapplication/foreignTousseInfoForm.js (.../foreignTousseInfoForm.js) (revision 28073) +++ ssts-web/src/main/webapp/disinfectsystem/foreigntousseapplication/foreignTousseInfoForm.js (.../foreignTousseInfoForm.js) (revision 28366) @@ -341,13 +341,13 @@ 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(); - - 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(); + var recyclingTime = top.Ext4.getCmp('recyclingTime').getValue(); + + 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(); @@ -404,14 +404,14 @@ summary.tousses = tousses; //第一次回收时间 summary.recyclingTime = recyclingTime; - summary.printType = printType; - - summary.sterilizationMethod = sterilizationMethod; - summary.sterilizationTime = sterilizationTime; - summary.sterilizationTemp = sterilizationTemp; - summary.dryTime = dryTime; - summary.explain = explain; + summary.printType = printType; + 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+')的打印配置'; @@ -1087,11 +1087,11 @@ {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 : 'phoneNumber',mapping : 'phoneNumber'}, + {name : 'sterilizationMethod',mapping : 'sterilizationMethod'}, + {name : 'sterilizationTemp',mapping : 'sterilizationTemp'}, + {name : 'sterilizationTime',mapping : 'sterilizationTime'}, + {name : 'dryTime',mapping : 'dryTime'}, {name : 'explain',mapping : 'explain'} ], listeners : { @@ -1265,29 +1265,29 @@ suppler1Comp.setValue(records[0].get("suppler")); suppler1Comp.forceSelection = true; supplierContacJsonStore.load(); - returnContactJsonStore.load(); - //给配置项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")); - }else{ - if(foreignTousseStore.getRootNode().childNodes.length == 0){ - 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")); - } - } + returnContactJsonStore.load(); + //给配置项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")); + }else{ + if(foreignTousseStore.getRootNode().childNodes.length == 0){ + 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")); + } + } } } } @@ -1419,34 +1419,94 @@ 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 + + Ext4.Ajax.request({ + url : WWWROOT+'/disinfectSystem/baseData/tousseDefinitionAction!loadComboTousseByForeignTousseId.do?foreignTousseId='+tousseDefinitionId, + success : function(response, options) { + var result = top.Ext4.decode(response.responseText); + if(result.success){ + if(result.data.length > 0){ + for(var i=0;i 863){ - if(sstsConfig.expandFieldsOfForeignTousseApplicationForm && sstsConfig.expandFieldsOfForeignTousseApplicationForm.length > 0){ - setHeight = 259; - }else{ - setHeight = 348; - } - }else{ - if(sstsConfig.expandFieldsOfForeignTousseApplicationForm && sstsConfig.expandFieldsOfForeignTousseApplicationForm.length > 0){ - setHeight = 159; - }else{ - setHeight = 248; - } - } - - 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 : 'form', - items : [{ - xtype : 'fieldset', - title : '基础信息', - collapsible : false, - //height : 360, - width : top.screen.width > 1280 ? 930 : 920,//900 - 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'}, - //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'}, - { - 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' - }] - },{ - 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' - }] - },{ - 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(); - }, - 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(); - } - } - } - }] - },{ - 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', - valueField : 'typeName', - displayField : 'typeName', - store : processTypeJsonStore, - allowBlank: true, - forceSelection : true, - triggerAction : 'all', - flex : 1 - }] - },{ - 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 - }] - },{ - layout : 'form', - labelWidth :70, - columnWidth :.33, - height:heightVal, - items : [{ - 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 - }] - },{ - layout : 'form', - labelWidth :70, - columnWidth :.33, - height:heightVal, - items : [{ - xtype : 'textfield', - fieldLabel : '病人姓名', - maxLength : '50', - id : 'patient', - name : 'patient', - width : '33.3%', - allowBlank : true, - flex : 1 - }] - },{ - layout : 'form', - labelWidth :70, - columnWidth :.33, - id:"patientAreaWrapper", - //hidden : sstsConfig.hidePatientArea, - height:heightVal, - items : [{ - xtype : 'textfield', - fieldLabel : '病区', - maxLength : '50', - id : 'patientArea', - name : 'patientArea', - 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, - 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, - flex : 1 - }] - },{ - layout : 'form', - labelWidth :70, - columnWidth :.33, - height:heightVal, - items : [{ - xtype : 'textfield', - fieldLabel : '年龄', -// maxLength : '3', - id : 'patientAge', - name : 'patientAge', - width : '33.3%', -// allowDecimals : false, - allowNegative : false, - flex : 1 - }] - },{ - layout : 'form', - labelWidth :70, - columnWidth :.33, - height:heightVal, - items : [{ - 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 - }] - },{ - layout : 'form', - labelWidth :70, - columnWidth :.33, - height:heightVal, - items : [{ - xtype : 'textfield', - fieldLabel : '病人所属科室', - maxLength : '16', - id : 'ascriptionDepartment', - name : 'ascriptionDepartment', - width : '33.3%', - allowBlank : true, - flex : 1 - }] - },{ - 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', - name : 'operationTime', - width : '33.3%', - selectOnFocus :true, - format : 'Y-m-d H:i', - allowBlank : true, - flex : 1 - }] - },{ - layout : 'form', - labelWidth :70, - columnWidth :.33, - height:heightVal, - items : [{ - 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 - }] - },{ - layout : 'form', - labelWidth :70, - columnWidth :.33, - height:heightVal, - 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"); - } - } - }] - },{ - layout : 'form', - labelWidth :70, - columnWidth :.33, - height:heightVal, - items : [{ - 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); - } - } - } - }] - },{ - layout : 'form', - labelWidth :70, - columnWidth :.33, - height:heightVal, - items : [{ - xtype : 'textfield', - fieldLabel : '联系电话', - id : 'supplierPhoneNumber', - name : 'supplierPhoneNumber', - width : '33.3%', -// readOnly: true, - allowBlank : true, - flex : .33 - }] - },{ - layout : 'form', - labelWidth :70, - columnWidth :.33, - height:heightVal, - id:"returnContactNameWrapper", - hidden:true, - 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); - } - } - } - }] - },{ - 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 - }] - },{ - 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 - }] - } - ] - }] - },{ - 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{ - 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()); - } - } - }) - ] - }] - }] - //buttons : [] - }); - - - + var setHeight; + if(top.screen.height > 863){ + if(sstsConfig.expandFieldsOfForeignTousseApplicationForm && sstsConfig.expandFieldsOfForeignTousseApplicationForm.length > 0){ + setHeight = 259; + }else{ + setHeight = 348; + } + }else{ + if(sstsConfig.expandFieldsOfForeignTousseApplicationForm && sstsConfig.expandFieldsOfForeignTousseApplicationForm.length > 0){ + setHeight = 159; + }else{ + setHeight = 248; + } + } + 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 : 'form', + items : [{ + xtype : 'fieldset', + title : '基础信息', + collapsible : false, + //height : 360, + width : top.screen.width > 1280 ? 930 : 920,//900 + 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'}, + //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'}, + { + 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' + }] + },{ + 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' + }] + },{ + 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(); + }, + 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(); + } + } + } + }] + },{ + 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', + valueField : 'typeName', + displayField : 'typeName', + store : processTypeJsonStore, + allowBlank: true, + forceSelection : true, + triggerAction : 'all', + flex : 1 + }] + },{ + 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 + }] + },{ + layout : 'form', + labelWidth :70, + columnWidth :.33, + height:heightVal, + items : [{ + 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 + }] + },{ + layout : 'form', + labelWidth :70, + columnWidth :.33, + height:heightVal, + items : [{ + xtype : 'textfield', + fieldLabel : '病人姓名', + maxLength : '50', + id : 'patient', + name : 'patient', + width : '33.3%', + allowBlank : true, + flex : 1 + }] + },{ + layout : 'form', + labelWidth :70, + columnWidth :.33, + id:"patientAreaWrapper", + //hidden : sstsConfig.hidePatientArea, + height:heightVal, + items : [{ + xtype : 'textfield', + fieldLabel : '病区', + maxLength : '50', + id : 'patientArea', + name : 'patientArea', + 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, + 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, + flex : 1 + }] + },{ + layout : 'form', + labelWidth :70, + columnWidth :.33, + height:heightVal, + items : [{ + xtype : 'textfield', + fieldLabel : '年龄', +// maxLength : '3', + id : 'patientAge', + name : 'patientAge', + width : '33.3%', +// allowDecimals : false, + allowNegative : false, + flex : 1 + }] + },{ + layout : 'form', + labelWidth :70, + columnWidth :.33, + height:heightVal, + items : [{ + 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 + }] + },{ + layout : 'form', + labelWidth :70, + columnWidth :.33, + height:heightVal, + items : [{ + xtype : 'textfield', + fieldLabel : '病人所属科室', + maxLength : '16', + id : 'ascriptionDepartment', + name : 'ascriptionDepartment', + width : '33.3%', + allowBlank : true, + flex : 1 + }] + },{ + 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', + name : 'operationTime', + width : '33.3%', + selectOnFocus :true, + format : 'Y-m-d H:i', + allowBlank : true, + flex : 1 + }] + },{ + layout : 'form', + labelWidth :70, + columnWidth :.33, + height:heightVal, + items : [{ + 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 + }] + },{ + layout : 'form', + labelWidth :70, + columnWidth :.33, + height:heightVal, + 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"); + } + } + }] + },{ + layout : 'form', + labelWidth :70, + columnWidth :.33, + height:heightVal, + items : [{ + 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); + } + } + } + }] + },{ + layout : 'form', + labelWidth :70, + columnWidth :.33, + height:heightVal, + items : [{ + xtype : 'textfield', + fieldLabel : '联系电话', + id : 'supplierPhoneNumber', + name : 'supplierPhoneNumber', + width : '33.3%', +// readOnly: true, + allowBlank : true, + flex : .33 + }] + },{ + layout : 'form', + labelWidth :70, + columnWidth :.33, + height:heightVal, + id:"returnContactNameWrapper", + hidden:true, + 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); + } + } + } + }] + },{ + 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 + }] + },{ + 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 + }] + } + ] + }] + },{ + 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{ + 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()); + } + } + }) + ] + }] + }] + //buttons : [] + }); + + + + foreignTousseApplyWindow = new top.Ext4.window.Window({ id : 'foreignTousseApplicationWin', title : '外来器械单信息', @@ -3619,26 +3679,26 @@ top.Ext4.getCmp('foreignTousseName1').disable(); top.Ext4.getCmp('suppler1').disable(); top.Ext4.getCmp('addTousseBt').hide(); - } - - 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(); - } - - 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(); - } + } + 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(); + } + + 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++){ @@ -3647,18 +3707,18 @@ readOnlyDom.readOnly = true; readOnlyDom.fieldCls = 'fieldReadOnlydisabled'; } - } - - //新增字段使用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(); - } - } } + + //新增字段使用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(); + } + } + } foreignTousseApplyWindow.on('close',function(w){ if(document.getElementById("imageIdsAndGoodsName")){ @@ -3708,10 +3768,10 @@ //如果单的状态为待回收,则将归还联系人选项填好 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('returnContactContainer').setVisible(true); + top.Ext4.getCmp('returnContactName').show(); + top.Ext4.getCmp('returnContactNameWrapper').show(); + top.Ext4.getCmp('returnContactPhoneNumberWrapper').show(); top.Ext4.getCmp('returnContactPhoneNumber').show(); } Index: ssts-web/src/main/webapp/homepage/menuconfigure.js =================================================================== diff -u -r28127 -r28366 --- ssts-web/src/main/webapp/homepage/menuconfigure.js (.../menuconfigure.js) (revision 28127) +++ ssts-web/src/main/webapp/homepage/menuconfigure.js (.../menuconfigure.js) (revision 28366) @@ -954,7 +954,7 @@ {hidden :SSTS_ImportBaseData_manager,text:"导入导出基础数据",href:WWWROOT+'/disinfectsystem/basedatamanager/importbasedata/importBasedata.mhtml',hrefTarget:linkTarget,leaf:true}, {hidden :SSTS_IPAndOrgUnitMapping,text:"IP对应的默认科室配置",href:WWWROOT+'/disinfectsystem/basedatamanager/iPAndOrgUnitMapping/iPAndOrgUnitMappingView.jsp',hrefTarget:linkTarget,leaf:true}, {hidden :SSTS_GoodsBindingConfig,text:"物品绑定",href:WWWROOT+ '/disinfectsystem/goodsBindingConfig/goodsBindingConfigView.jsp',hrefTarget:linkTarget,leaf:true}, - {hidden :SSTS_ForeignTousseApplication_Combo,text:"外来器械包组合",href:WWWROOT+'/disinfectsystem/CombinationKits/CombinationKitsView.jsp',hrefTarget:linkTarget,leaf:true}, + {hidden :!sstsConfig.enableForeignTousseApplicationCombo,text:"外来器械包组合",href:WWWROOT+'/disinfectsystem/CombinationKits/CombinationKitsView.jsp',hrefTarget:linkTarget,leaf:true}, {hidden :SSTS_GoodsFilterConfig,text:"物品黑白名单过滤设置",href:WWWROOT+'/disinfectsystem/goodFilterConfig/goodFilterTemplate.jsp',hrefTarget:linkTarget,leaf:true}, {hidden :SSTS_UrgentLevel_manager,text:"加急级别管理",href:WWWROOT+'/disinfectsystem/basedatamanager/urgentLevel/urgentLevelView.jsp',hrefTarget:linkTarget,leaf:true}, {hidden :SSTS_OperationRoom_manager,text:"手术间管理",href:WWWROOT+'/disinfectsystem/basedatamanager/operationRoom/operationRoom.jsp',hrefTarget:linkTarget,leaf:true}, Index: ssts-web/src/main/webapp/disinfectsystem/CombinationKits/CombinationKits.js =================================================================== diff -u -r28319 -r28366 --- ssts-web/src/main/webapp/disinfectsystem/CombinationKits/CombinationKits.js (.../CombinationKits.js) (revision 28319) +++ ssts-web/src/main/webapp/disinfectsystem/CombinationKits/CombinationKits.js (.../CombinationKits.js) (revision 28366) @@ -21,7 +21,7 @@ if (ids == null) { ids = records[i].data['id']; } else { - ids = ids + ';' + records[i].data['id']; + ids = ids + ',' + records[i].data['id']; } } top.Ext4.Msg.confirm( @@ -30,7 +30,7 @@ function(button) { if ('yes' == button) { top.Ext4.Ajax.request({ - url : WWWROOT+'/disinfectSystem/foreignTousseCombinationController/deleteDataByIds.mhtml?ids='+ ids, + url : WWWROOT+'/disinfectSystem/baseData/tousseDefinitionAction!deleteForeignCombo.do?comboIds='+ ids, success : function(response, options) { var result = top.Ext4.decode(response.responseText); if (result && result.success) { @@ -50,32 +50,28 @@ var fields = [ {name : 'id', mapping : 'id'}, - {name : 'name', mapping : 'name'}, + {name : 'tousseName', mapping : 'tousseName'}, {name : 'spelling', mapping : 'spelling'}, - {name : 'wbcode', mapping : 'wbcode'}, - {name : 'configUser', mapping : 'configUser'}, + {name : 'wbCode', mapping : 'wbCode'}, {name : 'remark', mapping : 'remark'} ]; var columns = [{ - header: "器械包名称", dataIndex: 'name', width: 470, minWidth:70, maxWidth:470, filterable: true, filter: {type: 'string'}, renderer : rendererFun + header: "器械包名称", dataIndex: 'tousseName', width: '20%', minWidth:70, maxWidth:470, filterable: true, filter: {type: 'string'}, renderer : rendererFun },{ - header: "拼音码", dataIndex: 'spelling', width: 300, minWidth:70, maxWidth:300, filterable: true, filter: {type: 'string'} + header: "拼音码", dataIndex: 'spelling', width: '20%', minWidth:70, maxWidth:300, filterable: true, filter: {type: 'string'} },{ - header: "五笔码", dataIndex: 'wbcode', width: 200, minWidth: 300, filterable: true, filter: {type: 'string'} + header: "五笔码", dataIndex: 'wbCode', width: '20%', minWidth: 300, filterable: true, filter: {type: 'string'} },{ - header: "配置人", dataIndex: 'configUser', width: 300, minWidth: 300, filterable: true, filter: {type: 'numeric'} - },{ - header: "备注", dataIndex: 'remark', width: 300, minWidth: 300, filterable: true, filter: {type: 'numeric'} + header: "备注", dataIndex: 'remark', width: '30%', minWidth: 300, filterable: true, filter: {type: 'string'} }]; grid = Ext4.create('ExtJs.forgon4.Grid', { title : entityName, - dataUrl:'http://rap2api.taobao.org/app/mock/85153/disinfectSystem/grid/gridController/getGrid.mhtml', + dataUrl:WWWROOT + '/disinfectSystem/baseData/tousseDefinitionAction!loadForeignTousseCombosList.do', fields : fields, columns : columns, - sorters : { property : 'transitionTime', direction: 'DESC'}, - extraParams : {}, //如果你要自定义参数,这里一定要先给一个空的对象,要不然会报空异常 + extraParams : {}, showRightClick : false, tbar : [{ text : '添加', @@ -112,7 +108,6 @@ } }] }); - var viewport = Ext4.create('Ext4.Viewport', { layout : 'fit', items : grid Index: ssts-web/src/main/webapp/disinfectsystem/CombinationKits/CombinationKitsForm.js =================================================================== diff -u -r25179 -r28366 --- ssts-web/src/main/webapp/disinfectsystem/CombinationKits/CombinationKitsForm.js (.../CombinationKitsForm.js) (revision 25179) +++ ssts-web/src/main/webapp/disinfectsystem/CombinationKits/CombinationKitsForm.js (.../CombinationKitsForm.js) (revision 28366) @@ -3,170 +3,251 @@ * */ var windowObj; //窗口 var formObj; //表单 -var nodeDefinitionsStore; +var nodeDefinitionsStore = new Ext4.data.Store({ + fields: [ + {name : 'id'}, + {name : 'name'}, + {name : 'packageType'}, + {name : 'supplierName'} + ] +}); /*删除*/ -function deleteItem(){ +function deleteItem(suppler,name){ var count = nodeDefinitionsStore.getCount(); - var nodes; - for (var i = 0; i < count.length; i++) { - nodes = nodeDefinitionsStore.data.items[i]; + for (var i = 0; i < count; i++) { + var item = nodeDefinitionsStore.data.items[i]; + if(item.data.supplierName == suppler && item.data.name == name){ + nodeDefinitionsStore.remove(item); + } } - nodeDefinitionsStore.remove(nodes); +} +/**** 查询器械包名称 start****/ +var tousseNameComboBoxFun = function() { + var tousseNameStore = new Ext4.data.Store({ + proxy : { + type : 'ajax', + url: WWWROOT + '/disinfectSystem/baseData/tousseDefinitionAction!getAllTousseDefinitionData.do', + reader : { + type : 'json', + totalProperty:'totalCount', + root : 'data' + } + }, + fields: [ + { name: 'id', mapping: 'id' }, + { name: 'spelling', mapping: 'spelling' }, + { name: 'wbCode', mapping: 'wbCode' }, + { name: 'name', mapping: 'name' }, + { name: 'displayName', mapping: 'displayName' } + ] + }); + var tousseNameBox = top.Ext4.create('Ext.form.ComboBox', { + columnWidth: 0.33, + labelWidth: 100, + labelAlign: 'right', + xtype: 'combo', + id: 'tousseName', + name: 'tousseName', + valueField: 'name', + displayField: 'displayName', + fieldLabel: '器械包名称', + queryParam: 'spell', + value:'1', + minChars: 0, + listWidth: 180, + forceSelection: false, + hideTrigger: true, + typeAhead: true, + store: tousseNameStore, + listeners:{ + select:function(combo, record, index){ + var spelling = record[0].data.spelling; + var wbCode = record[0].data.wbCode; + top.Ext4.getCmp('spelling').setValue(spelling); + top.Ext4.getCmp('wbCode').setValue(wbCode); + } + } + }); + + return tousseNameBox; } +/**** 查询器械包名称 end****/ + +/**** 供应商 start ****/ +var foldersCompanyStore = new Ext4.data.Store({ + pageSize : 12, + proxy : { + type : 'ajax', + url : WWWROOT + '/disinfectSystem/baseData/supplierAction!getSupplierData.do', + extraParams : {supplierType : '外来器械租用商'}, + reader : { + root : 'data' + } + }, + fields : [ + {name : 'id',mapping : 'id'}, + {name : 'name',mapping : 'name'}, + {name : 'contactName',mapping : 'contactName'}, + {name : 'phoneNumber',mapping : 'phoneNumber'} + ] +}); +var foldersCompanyComboBoxFun = function(){ + var foldersCompanyBox = top.Ext4.create('Ext.form.ComboBox', { + xtype : 'combo', + id : 'suppler', + name : 'suppler', + queryParam : 'supplierName', + minChars : 0, + valueField : 'name', + displayField : 'name', + width : 200, + listConfig: {width : 270}, + matchFieldWidth: false, + store : foldersCompanyStore, + pageSize : 12, + queryDelay: 1300, + lazyInit : true, + triggerAction : 'all', + hideTrigger : false, + typeAhead : false, + allowBlank : true, + listeners : { + select: function(combo, records, eOpts){ + var foreignTousseNameComp = top.Ext4.getCmp("foreignTousseName"); + foreignTousseNameComp.setValue(''); + foreignTousseNameStore.reload(); + } + } + }) + + return foldersCompanyBox; +} +/**** 供应商 end ****/ + +/**** 选择器械包 startv ****/ +var foreignTousseNameStore = new Ext4.data.Store({ + pageSize : 12, + proxy : { + type : 'ajax', + url : WWWROOT + '/disinfectSystem/baseData/tousseDefinitionAction!getForeignTousseDefinitionNames.do', + reader : { + type : 'json', + totalProperty : 'totalCount', + root : 'data' + }, + extraParams : { + isShowForeignTousseAncestorDefinitionForApply : true + } + }, + fields : [ + {name : 'id',mapping : 'id'}, + {name : 'name',mapping : 'name'}, + {name : 'displayName',mapping : 'displayName'}, + {name : 'amount',mapping : 'amount'}, + {name : 'suppler',mapping : 'suppler'}, + {name : 'includeImplant',mapping : 'includeImplant'}, + {name : 'packageType',mapping : 'packageType'} + ], + listeners : { + beforeload: function(store, operation, eOpts){ + var supplerComp = top.Ext4.getCmp("suppler"); + if(supplerComp != null){ + store.proxy.extraParams.supplierName = supplerComp.getValue(); + } + } + } +}); +var foreignTousseNameComboBoxFun = function(){ + var foreignTousseNameCompanyBox = top.Ext4.create('Ext.form.ComboBox', { + xtype : 'combo', + id : 'foreignTousseName', + name : 'foreignTousseName', + queryParam : 'spell', + minChars : 0, + valueField : 'id', + displayField : 'name', + width : 240, + listConfig: {width : 240}, + matchFieldWidth: false, + store : foreignTousseNameStore, + pageSize : 12, + lazyInit : true, + triggerAction : 'all', + hideTrigger : false, + typeAhead : false, + allowBlank : true, + listeners : { + select:function(combo, records, index){ + var supplerComp = top.Ext4.getCmp("suppler"); + var packageTypeComp = top.Ext4.getCmp("packageType"); + var ids = top.Ext4.getCmp("ids"); + supplerComp.forceSelection = false; + supplerComp.setValue(records[0].get("suppler")); + supplerComp.forceSelection = true; + packageTypeComp.setValue(records[0].get("packageType")); + ids.setValue(records[0].get("id")); + } + } + }) + + return foreignTousseNameCompanyBox; +} +/**** 选择器械包 end ****/ + function addAndEditRecord(id) { //按钮 function renderDeleteButton(v,p,record){ - return ""; + return ""; } /*保存*/ function saves(){ - var name =top.Ext4.getCmp('name').getValue(); - var suppler =top.Ext4.getCmp('suppler').getValue(); + var tousseName =top.Ext4.getCmp('tousseName').getValue(); var remark = top.Ext4.getCmp('remark').getValue(); - var foreignTousseName =top.Ext4.getCmp('foreignTousseName').getValue(); - var data; var itme=[]; var count = nodeDefinitionsStore.getCount(); + if(count > 0){ - for (var i = 0; i < count.length; i++) { + for (var i = 0; i < count; i++) { data = nodeDefinitionsStore.data.items[i]; - itme.push({id:data.data.id,name:data.data.name,suppler:data.data.suppler,packageType:data.data.packageType}) - + itme[i] = data.data.id; } }else{ showResult('没有添加器械包数据'); return false; } - if(!name){ + + if(!tousseName){ showResult('器械包名称不能为空'); return false; - } - if(id==''){ - if(!suppler){ - showResult('请选择供应商'); - return false; - } - if(!foreignTousseName){ - showResult('请选择器械包'); - return false; - } - } top.Ext4.Ajax.request({ - url:WWWROOT+'disinfectSystem/foreignTousseCombinationController/saveForeignTousseCombination.mhtml', + url:WWWROOT+'/disinfectSystem/baseData/tousseDefinitionAction!bindingForeignComboTousse.do', params: { - id:id, - name:name, + comboId:id || '', + comboTousseIds:itme.join(','), remark:remark, - foreignTousseList:JSON.stringify(itme) + tousseName:tousseName }, success: function(response, options) { - var result = top.Ext4.decode(response.responseText); - if(result.success && result.data){ - showResult(action.result.message); - } - grid.reloadData(); - windowObj.close(); + var result = Ext4.decode(response.responseText); + showResult(result.msg); + if(result.success){ + setTimeout(function() { + grid.reloadData(); + windowObj.close(); + }, 1000); + } }, failure : function(response, options) { showResult('对不起!服务器正忙,加载失败'); } }) } - /*选择供应商取值*/ - var appSupplerJsonStore = new top.Ext4.data.Store({ - pageSize: 50, - autoLoad:false, - proxy : { - type : 'ajax', - url:WWWROOT+'/disinfectSystem/baseData/sterilizerController/getAllSterilizer.mhtml', - reader : { - type : 'json', - totalProperty : 'totalCount', - root : 'rows' - } - }, - fields : [ - {name : 'id',mapping : 'id'}, - {name : 'name',mapping : 'name'} - ], - listeners:{ - beforeload:function(store, operation, eOpts){ - var suppler =top.Ext4.getCmp('suppler').getValue();//供应商名称 - var params = { - supplierName:suppler, - supplierType:'外来器械租用商' - }; - Ext4.apply(store.proxy.extraParams, params); - } - } - }); - - /*Annie 选择器械包名称*/ - var appSupplierNameJsonStore = new top.Ext4.data.Store({ - pageSize: 50, - autoLoad:true, - proxy : { - type : 'ajax', - url:WWWROOT+'/disinfectSystem/baseData/tousseDefinitionController/getForeignTousseDefinitionNames.mhtml', - reader : { - type : 'json', - totalProperty : 'totalCount', - root : 'rows' - } - }, - fields : [ - {name : 'id',mapping : 'id'}, - {name : 'packageType',mapping:'packageType'}, - {name : 'name',mapping : 'name'} - ], - listeners:{ - beforeload:function(store, operation, eOpts){ - var foreignTousseName =top.Ext4.getCmp('foreignTousseName').getValue(); - var params = { - supplierName:foreignTousseName - }; - Ext4.apply(store.proxy.extraParams, params); - } - } - }); - - /** - * 转换records,因为Ext4的combo的select事件有点小bug,第二个参数records在API写的是一个数组类型,但是在某种情况下他是一个对象(即:手动输入一个Store存在的数据时),因此写下此函数,转换一下 - * @param records - * @returns - */ - function transformRecords(records) { - var record = records; - if (records && records.length > 0){ - record = records[0]; - } - return record; - } - - top.Ext4.define('NodeModel', { - extend : 'top.Ext4.data.Model', - fields: [ - {name : 'id'}, - {name : 'name'}, - {name : 'spelling'}, - {name : 'wbcode'}, - {name : 'packageType'}, - {name : 'suppler'}, - {name : 'configDateStr'}, - {name : 'configUser'}, - {name : 'remark'}] - }); - //请求明细接口 - nodeDefinitionsStore = top.Ext4.create('top.Ext4.data.Store', { - model : "NodeModel" - }); - var InstrumentComnTreeGrid = top.Ext4.create('top.Ext4.grid.Panel', { useArrows: true, multiSelect: false, @@ -176,89 +257,11 @@ store : nodeDefinitionsStore, viewConfig : {loadMask : {msg : '正在加载,请稍候...'}}, tbar:[ + {text: "选择供应商:"},foldersCompanyComboBoxFun(), + {text:"选择器械包"},foreignTousseNameComboBoxFun(), { - text: "选择供应商:" - }, - { - xtype : 'combo', - id : 'suppler', - name : 'suppler', - queryParam : 'spell', - minChars : 0, - valueField : 'name', - displayField : 'name', - width : 250, - listConfig: {width : 300}, - matchFieldWidth: false, - store : appSupplerJsonStore, - lazyInit : true, - triggerAction : 'all', - hideTrigger : false, - typeAhead : false, - forceSelection:false, - allowBlank : true, - pageSize : 100, - listeners : { - select:function(combo, records, index){ - appSupplierNameJsonStore.load(); - var foreignTousseNameComp = top.Ext4.getCmp("foreignTousseName"); - var counts =appSupplierNameJsonStore.getCount() - if(counts >0 ){ - foreignTousseNameComp.setValue(appSupplierNameJsonStore.getAt(0).getData().name); - top.Ext4.getCmp('packageType1').setValue(appSupplierNameJsonStore.getAt(0).getData().packageType); - top.Ext4.getCmp('ids').setValue(appSupplierNameJsonStore.getAt(0).getData().id); - }else{ - foreignTousseNameComp.setValue(''); - } - appSupplerJsonStore.load(); - }, - specialkey: function(field, event, eOpts) { - if (event.getKey() === event.TAB) { - event.stopEvent(); - } - } - } - }, - {text:"选择器械包"}, - - { - xtype : 'combo', - id : 'foreignTousseName', - name : 'foreignTousseName', - queryParam : 'spell', - minChars : 0, - valueField : 'name', - displayField : 'name', - width : 220, - listConfig: {width : 300}, - matchFieldWidth: false, - store : appSupplierNameJsonStore, - lazyInit : true, - triggerAction : 'all', - hideTrigger : false, - typeAhead : false, - forceSelection:false, - allowBlank : true, - pageSize : 100, - listeners : { - select:function(combo, records, index){ - top.Ext4.getCmp('ids').setValue(records[0].get('id')); - top.Ext4.getCmp('packageType1').setValue(records[0].get('packageType')); - appSupplerJsonStore.load(); - var supplerComp = top.Ext4.getCmp("suppler"); - supplerComp.setValue(''); - appSupplierNameJsonStore.load(); - - }, - specialkey: function(field, event, eOpts) { - if (event.getKey() === event.TAB) { - event.stopEvent(); - } - } - } - },{ xtype:'hidden', - id : 'packageType1', + id : 'packageType', name : 'packageType' }, { @@ -271,9 +274,10 @@ width : 60, iconCls : 'btn_ext_add', handler:function(){ + var ids=top.Ext4.getCmp('ids').getValue(); var suppler=top.Ext4.getCmp('suppler').getRawValue(); - var foreignTousseName =top.Ext4.getCmp('foreignTousseName').getRawValue() - var packageType = top.Ext4.getCmp('packageType') + var foreignTousseName =top.Ext4.getCmp('foreignTousseName').getRawValue(); + var packageType = top.Ext4.getCmp('packageType').getValue(); if(!suppler){ showResult('请选择供应商'); return false; @@ -282,17 +286,31 @@ showResult('请选择器械包'); return false; } - nodeDefinitionsStore.add({ - "id":top.Ext4.getCmp('ids').getValue(), - "name":top.Ext4.getCmp('foreignTousseName').getRawValue(), - "packageType":top.Ext4.getCmp('packageType1').getValue(), - "suppler":top.Ext4.getCmp('suppler').getValue()}); + var count = nodeDefinitionsStore.getCount(); + var isAdd = true; + for (var i = 0; i < count; i++) { + var item = nodeDefinitionsStore.data.items[i]; + if(item.data.supplierName == suppler && item.data.name == foreignTousseName){ + isAdd = false; + } + } + + if(isAdd){ + nodeDefinitionsStore.add({ + "id":ids, + "name":foreignTousseName, + "packageType":packageType, + "supplierName":suppler + }); + }else { + showResult('【'+suppler+'】的器械包【'+foreignTousseName+'】已存在,请重新添加!'); + } } - }, + } ], columns: [{ - header:'供应商', dataIndex:'suppler', width: 200, sortable: false, menuDisabled : true + header:'供应商', dataIndex:'supplierName', width: 200, sortable: false, menuDisabled : true },{ header:'器械包名称', dataIndex:'name', width: 200, sortable: false, menuDisabled : true },{ @@ -312,17 +330,17 @@ autoScroll : true, buttonAlign : 'center', buttons : [{ - text : '取消', - handler : function() { - windowObj.close(); - } - },{ id:'save', name:'save', text : '保存', handler : function(){ saves() } + },{ + text : '取消', + handler : function() { + windowObj.close(); + } }], fieldDefaults : { labelAlign : 'right', @@ -338,35 +356,18 @@ width : '100%', layout : 'column', title : '基础数据', - items : [{ + items : [tousseNameComboBoxFun(),{ layout : 'form', columnWidth : .33, bodyStyle : {background : '#EBF5EC', border : 0}, items : [{ xtype : 'textfield', border : 0, - fieldLabel : '器械包名称', - name : "name", - id : "name", - enableKeyEvents : true, - listeners : { - - } - }] - },{ - layout : 'form', - columnWidth : .33, - bodyStyle : {background : '#EBF5EC', border : 0}, - items : [{ - xtype : 'textfield', - border : 0, fieldLabel : '拼音码', name : "spelling", id : "spelling", enableKeyEvents : true, - listeners : { - - } + readOnly:true }] },{ layout : 'form', @@ -376,13 +377,11 @@ xtype : 'textfield', border : 0, fieldLabel : '五笔码', - name : "wbcode", - id : "wbcode", + name : "wbCode", + id : "wbCode", readOnly : false, enableKeyEvents : true, - listeners : { - - } + readOnly:true }] },{ xtype: 'textareafield', @@ -413,21 +412,35 @@ items : formObj }); windowObj.show(); + + top.Ext4.getCmp('tousseName').setRawValue(''); + top.Ext4.getCmp('spelling').setValue(''); + top.Ext4.getCmp('wbCode').setValue(''); + top.Ext4.getCmp('remark').setValue(''); + nodeDefinitionsStore.removeAll(); + nodeDefinitionsStore = new Ext4.data.Store({ + fields: [ + {name : 'id'}, + {name : 'name'}, + {name : 'packageType'}, + {name : 'supplierName'} + ] + }); + if(!isUndefinedOrNullOrEmpty(id)){ //页面加载请求数据 top.Ext4.Ajax.request({ - url : WWWROOT+'/disinfectSystem/foreignTousseCombinationController/loadDataById.mhtml?id='+id, + url : WWWROOT+'/disinfectSystem/baseData/tousseDefinitionAction!loadForeignTousseAndComboTousse.do?comboId='+id, success : function(response, options) { var result = top.Ext4.decode(response.responseText); if(result.success && result.data){ - //渲染数据 - top.Ext4.getCmp('name').setValue(result.data.name); + top.Ext4.getCmp('tousseName').setRawValue(result.data.tousseName); top.Ext4.getCmp('spelling').setValue(result.data.spelling); - top.Ext4.getCmp('wbcode').setValue(result.data.wbcode); + top.Ext4.getCmp('wbCode').setValue(result.data.wbCode); top.Ext4.getCmp('remark').setValue(result.data.remark); - if(result.data.foreignTousseList && result.data.foreignTousseList.length > 0){ - for (var i = 0; i < result.data.foreignTousseList.length; i++) { - nodeDefinitionsStore.add(result.data.foreignTousseList[i]); + if(result.data.comboTousses && result.data.comboTousses.length > 0){ + for (var i = 0; i < result.data.comboTousses.length; i++) { + nodeDefinitionsStore.add(result.data.comboTousses[i]); } } }