|
|
@@ -5,6 +5,7 @@ Ext.define('saas.view.sys.account.AddWindow', {
|
|
|
extend: 'saas.view.document.kind.ChildForm',
|
|
|
xtype: 'sys-account-addwindow',
|
|
|
dataKind:'accountadd',//类型标识
|
|
|
+ height: 325,
|
|
|
belong:{
|
|
|
columns:[{
|
|
|
dataIndex:'realname',
|
|
|
@@ -18,61 +19,89 @@ Ext.define('saas.view.sys.account.AddWindow', {
|
|
|
etc:{
|
|
|
accountadd:{
|
|
|
items:[{
|
|
|
- xtype:'textfield',
|
|
|
- fieldLabel: '联系号码',
|
|
|
- name: 'mobile',
|
|
|
- hideTrigger:true,
|
|
|
- allowBlank:false,
|
|
|
- maxLength: 30,
|
|
|
- regex:/^1(3|4|5|7|8)\d{9}$/,
|
|
|
- regexText:'请输入正确的手机号码',
|
|
|
- listeners:{
|
|
|
- change:function(f,a,b){
|
|
|
- if(a==''){
|
|
|
- f._lastCheckValue = ''
|
|
|
- }
|
|
|
- },
|
|
|
- blur:function(f,a,b,c){
|
|
|
- var form = f.ownerCt;
|
|
|
- if(f.value&&f.value!=''&&f.isValid()&&f._lastCheckValue!=f.value){
|
|
|
- f._lastCheckValue = f.value;
|
|
|
- form.setLoading(true);
|
|
|
- Ext.Ajax.request({
|
|
|
- url: '/api/account/account/checkMobile?mobile='+f.value,
|
|
|
- method: 'GET',
|
|
|
- headers:{
|
|
|
- 'Access-Control-Allow-Origin': '*',
|
|
|
- "Content-Type": 'application/json;charset=UTF-8',
|
|
|
- },
|
|
|
- success: function (response) {
|
|
|
- form.setLoading(false);
|
|
|
- var localJson = Ext.decode(response.responseText);
|
|
|
- if(localJson.success){
|
|
|
- if(localJson.data.hasRegister){
|
|
|
- saas.util.BaseUtil.showSuccessToast('校验成功:手机号已在优软云注册');
|
|
|
+ xtype: 'fieldcontainer',
|
|
|
+ layout: 'column',
|
|
|
+ items: [{
|
|
|
+ beforeLabelTextTpl: "<font color=\"red\" style=\"position:relative; top:2px;right:2px; font-weight: bolder;\">*</font>",
|
|
|
+ xtype:'textfield',
|
|
|
+ fieldLabel: '手机号码',
|
|
|
+ name: 'mobile',
|
|
|
+ hideTrigger:true,
|
|
|
+ allowBlank:false,
|
|
|
+ maxLength: 30,
|
|
|
+ columnWidth:0.7,
|
|
|
+ regex:/^1(3|4|5|7|8)\d{9}$/,
|
|
|
+ regexText:'请输入正确的手机号码',
|
|
|
+ listeners:{
|
|
|
+ change:function(f,a,b){
|
|
|
+ if(a==''){
|
|
|
+ f._lastCheckValue = ''
|
|
|
+ }
|
|
|
+ },
|
|
|
+ blur:function(f,a,b,c){
|
|
|
+ var form = f.ownerCt;
|
|
|
+ if(f.value&&f.value!=''&&f.isValid()&&f._lastCheckValue!=f.value){
|
|
|
+ f._lastCheckValue = f.value;
|
|
|
+ form.setLoading(true);
|
|
|
+ Ext.Ajax.request({
|
|
|
+ url: '/api/account/account/checkMobile?mobile='+f.value,
|
|
|
+ method: 'GET',
|
|
|
+ headers:{
|
|
|
+ 'Access-Control-Allow-Origin': '*',
|
|
|
+ "Content-Type": 'application/json;charset=UTF-8',
|
|
|
+ },
|
|
|
+ success: function (response) {
|
|
|
+ form.setLoading(false);
|
|
|
+ var localJson = Ext.decode(response.responseText);
|
|
|
+ if(localJson.success){
|
|
|
+ f.hasRegister = localJson.data.hasRegister;
|
|
|
+ if(localJson.data.hasRegister){
|
|
|
+ f.ownerCt.down('[name=hasAccount]').show();
|
|
|
+ f.ownerCt.down('[name=noAccount]').hide();
|
|
|
+ }else{
|
|
|
+ f.ownerCt.down('[name=hasAccount]').hide();
|
|
|
+ f.ownerCt.down('[name=noAccount]').show();
|
|
|
+ }
|
|
|
}else{
|
|
|
- saas.util.BaseUtil.showErrorToast('校验失败:手机号未在优软云注册');
|
|
|
+ saas.util.BaseUtil.showErrorToast('校验失败:'+localJson.message);
|
|
|
+ f.setValue('');
|
|
|
+ f.ownerCt.down('[name=hasAccount]').hide();
|
|
|
+ f.ownerCt.down('[name=noAccount]').hide();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ failure: function (response) {
|
|
|
+ if(response.responseText){
|
|
|
+ var localJson = Ext.decode(response.responseText);
|
|
|
+ saas.util.BaseUtil.showErrorToast('校验失败:'+localJson.message);
|
|
|
+ f.setValue('');
|
|
|
+ }else{
|
|
|
+ saas.util.BaseUtil.showErrorToast('手机号校验接口连接超时');
|
|
|
f.setValue('');
|
|
|
}
|
|
|
- }else{
|
|
|
- saas.util.BaseUtil.showErrorToast('校验失败:'+localJson.message);
|
|
|
- f.setValue('');
|
|
|
- }
|
|
|
- },
|
|
|
- failure: function (response) {
|
|
|
- if(response.responseText){
|
|
|
- var localJson = Ext.decode(response.responseText);
|
|
|
- saas.util.BaseUtil.showErrorToast('校验失败:'+localJson.message);
|
|
|
- f.setValue('');
|
|
|
- }else{
|
|
|
- saas.util.BaseUtil.showErrorToast('手机号校验接口连接超时');
|
|
|
- f.setValue('');
|
|
|
}
|
|
|
- }
|
|
|
- });
|
|
|
+ });
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
+ },{
|
|
|
+ hidden:true,
|
|
|
+ name:'hasAccount',
|
|
|
+ xtype:'button',
|
|
|
+ cls:'x-btn-showicon',
|
|
|
+ style:'background:#fff;border:none;padding:7px 0 7px 0;',
|
|
|
+ text:'已注册优软云',
|
|
|
+ icon:'resources/images/default/toast_over.png',
|
|
|
+ columnWidth:0.3,
|
|
|
+ },{
|
|
|
+ name:'noAccount',
|
|
|
+ hidden:true,
|
|
|
+ xtype:'button',
|
|
|
+ cls:'x-btn-showicon',
|
|
|
+ style:'background:#fff;border:none;padding:7px 0 7px 0;',
|
|
|
+ text:'未注册优软云',
|
|
|
+ icon:'resources/images/default/toast_close.png',
|
|
|
+ columnWidth:0.3,
|
|
|
+ }]
|
|
|
},{
|
|
|
xtype:'textfield',
|
|
|
fieldLabel: '真实姓名',
|
|
|
@@ -81,6 +110,7 @@ Ext.define('saas.view.sys.account.AddWindow', {
|
|
|
regexText:'请输入汉字',
|
|
|
allowBlank:false,
|
|
|
maxLength: 30,
|
|
|
+ columnWidth:0.5
|
|
|
},{
|
|
|
xtype:'textfield',
|
|
|
fieldLabel: '邮箱',
|
|
|
@@ -132,10 +162,18 @@ Ext.define('saas.view.sys.account.AddWindow', {
|
|
|
},{
|
|
|
xtype:'datamulticombo',
|
|
|
dataUrl:'/api/account/role/list',
|
|
|
- fieldLabel: '关联角色',
|
|
|
+ fieldLabel: '岗位角色',
|
|
|
name: 'roleIds',
|
|
|
allowBlank:false,
|
|
|
maxLength: 30,
|
|
|
+ },{
|
|
|
+ margin:'5 0 0 0',
|
|
|
+ xtype:'displayfield',
|
|
|
+ fieldLabel: '注意事项',
|
|
|
+ beforeLabelTextTpl: "",
|
|
|
+ value:'添加的账户拥有访问系统的权限,请勿随意添加',
|
|
|
+ fieldStyle:'color:#999;margin-top: 9px;',
|
|
|
+ lableStyle:'color: #f16161;'
|
|
|
}]
|
|
|
}
|
|
|
},
|
|
|
@@ -144,7 +182,6 @@ Ext.define('saas.view.sys.account.AddWindow', {
|
|
|
var belong = this.belong;
|
|
|
me.setLoading(true);
|
|
|
var form=this.down('form');
|
|
|
- var combo = this._combo;
|
|
|
var params = {};
|
|
|
var names = belong.columns.map(column => column.dataIndex);
|
|
|
|
|
|
@@ -153,7 +190,9 @@ Ext.define('saas.view.sys.account.AddWindow', {
|
|
|
var dataField = form.down('[name='+name+']');
|
|
|
if(dataField&&dataField.value){
|
|
|
params[name] = dataField.value;
|
|
|
- params._value = dataField.value;
|
|
|
+ }
|
|
|
+ if(dataField.name=='mobile'){
|
|
|
+ params['hasRegister'] = dataField.hasRegister;
|
|
|
}
|
|
|
}
|
|
|
});
|