Index: ssts-web/src/main/webapp/systemmanage/userFormExt.js =================================================================== diff -u -r30664 -r37776 --- ssts-web/src/main/webapp/systemmanage/userFormExt.js (.../userFormExt.js) (revision 30664) +++ ssts-web/src/main/webapp/systemmanage/userFormExt.js (.../userFormExt.js) (revision 37776) @@ -64,11 +64,13 @@ Ext.getCmp('confirmpwd').setValue(""); return false; } - var checkPasswordResult = testPasswordReg(passwdValue,Ext.getCmp('name').getValue()) - if(!checkPasswordResult.success){ - Ext.MessageBox.show({title:'错误提示', msg:checkPasswordResult.msg, buttons:Ext.Msg.OK,icon:Ext.Msg.ERROR}); - return false; - } + if(verifyPasswordWhenNewUser == '是'){ + var checkPasswordResult = testPasswordReg(passwdValue,Ext.getCmp('name').getValue()) + if(!checkPasswordResult.success){ + Ext.MessageBox.show({title:'错误提示', msg:checkPasswordResult.msg, buttons:Ext.Msg.OK,icon:Ext.Msg.ERROR}); + return false; + } + } } isRepeatLogninId = false; DWREngine.setAsync(false); @@ -90,6 +92,11 @@ if(!Ext.isEmpty(id)){ hidePWD = true; } + //ZSRY-72:增加密码设置要求提示语 + var msg = '' + if(verifyPasswordWhenNewUser == '是'){ + msg = getModifyPwdMsg(); + } var orgUnitId = getURLParameter('orgUnitId','0'); var formObj = new Ext.FormPanel({ labelAlign: 'left', @@ -320,13 +327,30 @@ fieldLabel:'备注', height:60, width: 400 - }], + }, { + items:[{ + hidden:msg == ''?true:false, + layout:'column', + items:[{ + id:'showPwdMessage', + xtype:'textfield', + width : 390, + allowBlank : true, + labelSeparator:'', + labelWidth:0, + anchor: '99%', + readOnly : true, + cls : 'fieldReadOnlyNoRemove', + value: msg + }] + }] + }], buttons: [{ id:'print', text: '打印预览', handler: function(){ - printBarcode(this,1); + printBarcode(1); } },{ text: '编辑', @@ -337,18 +361,22 @@ text: '保存并打印', hidden: !enableSaveBtn, handler: function(){ - saveAndPrint(this,0); + saveFun(this,2); } }, { id:'saveBtn', text: '保存', hidden: !enableSaveBtn, - handler: save + handler: function(){ + saveFun(this,0); + } },{ text: '保存并新建', id:'saveAndNewBtn', hidden: !enableSaveBtn, - handler: saveAndNew + handler: function(){ + saveFun(this,1); + } },{ text: '取消', handler:gohistory @@ -360,6 +388,9 @@ Ext.getCmp('passwd').hide(); Ext.getCmp('confirmpwd').hide(); } + if(msg !== ''){ + Ext.getCmp('showPwdMessage').el.dom.style.color = 'red'; + } formObj.form.load({ url:WWWROOT+'/systemmanage/user/loadForm.do', method:'GET', @@ -375,7 +406,7 @@ FormUtils.setReadOnly(formObj.form.el.dom, true); } - function printBarcode(obj,type){ + function printBarcode(type){ var barcode = Ext.getCmp('barcode').getRawValue(); if(barcode == null || barcode == ""){ barcode = ""; @@ -396,84 +427,40 @@ DWREngine.setAsync(true); printUserInfo(barcode,userName,orgUnitNames,name,type); } - - function save(){ - this.disable(); //按钮禁用 + + function saveFun(that,saveType){ + that.disable(); //按钮禁用 if(!formObj.form.isValid()){ Ext.MessageBox.show({title:'错误提示', msg:'请正确填写表单各值。',buttons:Ext.Msg.OK,icon:Ext.Msg.ERROR}); - this.enable(); + that.enable(); return false; } if(!validateUser(id)){ - this.enable(); + that.enable(); return false; } + formObj.form.submit({ url:WWWROOT+'/systemmanage/user/save.do', method:'POST', waitMsg:'正在保存数据,请稍候', waitTitle:'提交表单', success:function(form,action){ - history.go(-1); + if(saveType == 0){ + history.go(-1); + }else if(saveType == 1){ + location.href=WWWROOT + "/systemmanage/userFormExt.jsp?orgUnitId="+orgUnitId+"&editMode=true"; + }else if(saveType == 2){ + history.go(-1); + printBarcode(2); + } }, failure:function(form, action){ - alert('failure = '+action.failureType); + alert('保存失败:'+action.failureType); } }); } - function saveAndPrint(obj,type){ - obj.disable(); - if(!formObj.form.isValid()){ - Ext.MessageBox.show({title:'错误提示', msg:'请正确填写表单各值。',buttons:Ext.Msg.OK,icon:Ext.Msg.ERROR}); - obj.enable(); - return false; - } - if(!validateUser(id)){ - obj.enable(); - return false; - } - formObj.form.submit({ - url:WWWROOT+'/systemmanage/user/save.do', - method:'POST', - waitMsg:'正在保存数据,请稍候', - waitTitle:'提交表单', - success:function(form,action){ - history.go(-1); -// var barcodeStr = action.result.barcode; - printBarcode(null,type); - }, - failure:function(form, action){ - alert('failure = '+action.failureType); - } - }); - } - - function saveAndNew(){ - this.disable(); - if(!formObj.form.isValid()){ - Ext.MessageBox.show({title:'错误提示', msg:'请正确填写表单各值。',buttons:Ext.Msg.OK,icon:Ext.Msg.ERROR}); - this.enable(); - return false; - } - if(!validateUser(id)){ - this.enable(); - return false; - } - formObj.form.submit({ - url:WWWROOT+'/systemmanage/user/save.do', - method:'POST', - waitMsg:'正在保存数据,请稍候', - waitTitle:'提交表单', - success:function(form,action){ - location.href=WWWROOT + "/systemmanage/userFormExt.jsp?orgUnitId="+orgUnitId+"&editMode=true"; - }, - failure:function(form, action){ - alert('failure = '+action.failureType); - } - }); - } - function edit(){ this.setVisible(false); Ext.getCmp('saveBtn').setVisible(true);