Index: ssts-web/src/main/webapp/disinfectsystem/assestManagement/expensiveGoods/expensiveGoodsAuthorizationForm.js =================================================================== diff -u -r22109 -r22121 --- ssts-web/src/main/webapp/disinfectsystem/assestManagement/expensiveGoods/expensiveGoodsAuthorizationForm.js (.../expensiveGoodsAuthorizationForm.js) (revision 22109) +++ ssts-web/src/main/webapp/disinfectsystem/assestManagement/expensiveGoods/expensiveGoodsAuthorizationForm.js (.../expensiveGoodsAuthorizationForm.js) (revision 22121) @@ -66,23 +66,6 @@ allowBlank : false, minValue:1, listeners : { - change : function(numberField, newValue, oldValue) { - var rowIndex = top.Ext.getCmp('configGrid').getStore().getCount();//grid的行数 - var configStore = top.Ext.getCmp('configGrid').getStore(); - var judge = []; - for(var i =0 ;i < rowIndex ; i++ ){ - var electRecord = configStore.getAt(i); - var a = configStore.getAt(i).data.certification; - if(judge.contains(newValue)){ - showResult('已包含授权证:'+ newValue +',不可重复添加!'); - judge.splice(0,judge.length); //数组清空 - numberField.setValue(oldValue); - return false; - }else{ - judge.push(electRecord.get('certification')); - } - } - } } }) // }, { @@ -465,6 +448,30 @@ showResult('所选耗材太多,请重新选择!'); return false; } + + //验证授权证号是否重复 + var rowIndex = top.Ext.getCmp('configGrid').getStore().getCount();//grid的行数 + var configStore = top.Ext.getCmp('configGrid').getStore(); + var judge = []; + for(var i =0 ;i < rowIndex ; i++ ){ + var electRecord = configStore.getAt(i); + var certification = configStore.getAt(i).data.certification; + if(certification != ''){ + if(judge.contains(certification)){ + showResult('已包含授权证:'+ certification +',不可重复添加!'); + judge.splice(0,judge.length); //数组清空 + this.enable(); + return false; + }else{ + judge.push(certification); + } + }else{ + showResult('请填写授权证号!'); + this.enable(); + return false; + } + } + if(sstsConfig.enableExpensiveGoods){ //高值耗材启用才验证 var certificationCount = configStore.getCount(); if (certificationCount <= 0 ){ Index: ssts-web/src/main/webapp/disinfectsystem/basedatamanager/supplier/expensiveGoodsSupplierForm.js =================================================================== diff -u -r22110 -r22121 --- ssts-web/src/main/webapp/disinfectsystem/basedatamanager/supplier/expensiveGoodsSupplierForm.js (.../expensiveGoodsSupplierForm.js) (revision 22110) +++ ssts-web/src/main/webapp/disinfectsystem/basedatamanager/supplier/expensiveGoodsSupplierForm.js (.../expensiveGoodsSupplierForm.js) (revision 22121) @@ -104,29 +104,7 @@ allowBlank : false, minValue:1, listeners : { - change : function(textField, newValue, oldValue) { - var rowIndex = top.Ext.getCmp('configGrid').getStore().getCount();//grid的行数 - var configStore = top.Ext.getCmp('configGrid').getStore(); - var judge = []; - for(var i =0 ;i < rowIndex ; i++ ){ - var electRecord = configStore.getAt(i); - var certification = configStore.getAt(i).data.certification; - //获取所点证件的信息 - var rows = top.Ext.getCmp('configGrid').getSelectionModel().getSelections();// 返回值为 Record 数组 - //获取证件号 - var newCertification = rows[0].data.certification; - if(newCertification != newValue){ - if(judge.contains(newValue)){ - showResult('已包含相同证号:'+ newValue +',不可重复添加!'); - judge.splice(0,judge.length); //数组清空 - textField.setValue(oldValue); - return false; - }else{ - judge.push(certification); - } - } - } - } + } }) }, { @@ -688,6 +666,28 @@ return false; } + //验证证件号是否重复 + var rowIndex = top.Ext.getCmp('configGrid').getStore().getCount();//grid的行数 + var configStore = top.Ext.getCmp('configGrid').getStore(); + var judge = []; + for(var i =0 ;i < rowIndex ; i++ ){ + var certification = configStore.getAt(i).data.certification; + if(certification != ''){ + if(judge.contains(certification)){ + showResult('已包含相同证号:'+ certification +',不可重复添加!'); + judge.splice(0,judge.length); //数组清空 + this.enable(); + return false; + }else{ + judge.push(certification); + } + }else{ + showResult('请填写证件号!'); + this.enable(); + return false; + } + } + var rentTousse = top.Ext.getCmp('rentTousse').getValue(); if(sstsConfig.enableExpensiveGoods){ //高值耗材启用才验各类证件 var certificationCount = configStore.getCount();