Index: ssts-web/src/main/webapp/disinfectsystem/basedatamanager/departmentapptemplate/departmentAppTemplateForm.js =================================================================== diff -u -r28977 -r28981 --- ssts-web/src/main/webapp/disinfectsystem/basedatamanager/departmentapptemplate/departmentAppTemplateForm.js (.../departmentAppTemplateForm.js) (revision 28977) +++ ssts-web/src/main/webapp/disinfectsystem/basedatamanager/departmentapptemplate/departmentAppTemplateForm.js (.../departmentAppTemplateForm.js) (revision 28981) @@ -179,9 +179,10 @@ {name : 'externalCode',mapping : 'externalCode'}, {name : 'displayName',mapping : 'displayName'}, {name : 'unit',mapping : 'unit'}, + {name : 'unitForDisplay',mapping : 'unitForDisplay'}, {name : 'packageSpec',mapping : 'packageSpec'}, {name : 'price',mapping : 'price'}, - {name : 'minApplyAmount',mapping : 'minApplyAmount'}, + {name : 'minApplyAmount',mapping : 'minApplyAmount'}, {name : 'maxApplyAmount',mapping : 'maxApplyAmount'}, {name : 'amount',mapping : 'amount'}] ) @@ -282,25 +283,10 @@ }]); var diposableGoodsCm = new top.Ext.grid.ColumnModel([{ - id:'id', - name:'id', - hidden :true, - dataIndex : 'id' - },{ - id : 'minApplyAmount', - name:'minApplyAmount', - dataIndex : 'minApplyAmount', - hidden :true - },{ - id : 'maxApplyAmount', - name:'maxApplyAmount', - dataIndex : 'maxApplyAmount', - hidden :true - },{ id : 'diposableGoodsName', header : "一次性物品名称", dataIndex : 'diposableGoodsName', - width:210 + width:150 },{ id : 'packageSpec', header : "包装规格", @@ -325,28 +311,36 @@ focus : function(thiz){ thiz.selectText(); }, + specialkey : function(field, ee) { + var eventKey = ee.getKey(); + if(eventKey == 13){ + this.blur(); + } + }, blur:function(thiz){ - thiz.selectText(); + var that = thiz; + that.selectText(); var configGrid = top.Ext.getCmp('configGrid3'); var rows = configGrid.getSelectionModel().getSelections();// 返回值为 Record 数组 var maxApplyAmount = 0; var minApplyAmount = 0; - var amount = parseInt(thiz.value); + var amount = parseInt(that.value); if (rows) { for ( var i = 0; i < rows.length; i++) { maxApplyAmount = parseInt(rows[i].data.maxApplyAmount || 0); minApplyAmount = parseInt(rows[i].data.minApplyAmount || 0); } } + if(amount !== 0 && maxApplyAmount !== 0 && amount > maxApplyAmount){ showResult('【该一次性物品最大申请数量为'+maxApplyAmount+',申请数量不能大于最大申请数量。】'); - thiz.setValue(''); + that.setValue(''); return; } if(amount !== 0 && minApplyAmount !== 0 && Math.floor(amount/minApplyAmount) !== (amount/minApplyAmount)){ showResult('【该一次性物品最小申请数量为'+minApplyAmount+',所填数量必须是'+minApplyAmount+'的倍数。】'); - thiz.setValue(''); + that.setValue(''); return; } } @@ -892,7 +886,11 @@ top.Ext.getCmp('minApplyAmount').setValue(record.data.minApplyAmount); top.Ext.getCmp('maxApplyAmount').setValue(record.data.maxApplyAmount); top.Ext.getCmp('packageSpec').setValue(record.data.packageSpec); - top.Ext.getCmp('unit').setValue(record.data.unit); + if((record.data.unitForDisplay || '') == ''){ + top.Ext.getCmp('unit').setValue(record.data.unit); + }else { + top.Ext.getCmp('unit').setValue(record.data.unitForDisplay); + } }, specialkey : function(field, ee) { if (ee.getKey() == Ext.EventObject.ENTER) {