|
|
@@ -277,23 +277,37 @@ Ext.define('KitchenSink.view.binding.ChildForm', {
|
|
|
regexText:'请输入正确的手机号码',
|
|
|
listeners:{
|
|
|
blur:function(f,a,b,c){
|
|
|
+ var form = f.ownerCt;
|
|
|
+ form.setLoading(true);
|
|
|
if(f.value&&f.value!=''&&f.isValid()){
|
|
|
Ext.Ajax.request({
|
|
|
- url: 'http://192.168.253.31:8560/api/account/account/checkMobile?mobile='+f.value,
|
|
|
+ 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){
|
|
|
- saas.util.BaseUtil.showSuccessToast('保存成功');
|
|
|
- form.ownerCt._parent.store.load()
|
|
|
- form.ownerCt.close();
|
|
|
+ if(!localJson.data.hasRegister){
|
|
|
+ saas.util.BaseUtil.showSuccessToast('校验成功:手机号未被注册');
|
|
|
+ }else{
|
|
|
+ saas.util.BaseUtil.showErrorToast('校验失败:手机号已被注册');
|
|
|
+ f.setValue('');
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ saas.util.BaseUtil.showErrorToast('校验失败:'+localJson.message);
|
|
|
}
|
|
|
},
|
|
|
failure: function (response) {
|
|
|
- debugger
|
|
|
+ if(response.responseText){
|
|
|
+ var localJson = Ext.decode(response.responseText);
|
|
|
+ saas.util.BaseUtil.showErrorToast('校验失败:'+localJson.message);
|
|
|
+ }else{
|
|
|
+ saas.util.BaseUtil.showErrorToast('手机号校验接口连接超时');
|
|
|
+ }
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
@@ -310,6 +324,8 @@ Ext.define('KitchenSink.view.binding.ChildForm', {
|
|
|
fieldLabel: '邮箱',
|
|
|
name: 'email',
|
|
|
allowBlank:false,
|
|
|
+ regex:/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/,
|
|
|
+ regexText:'请输入正确的邮箱',
|
|
|
maxLength: 30,
|
|
|
}]
|
|
|
},
|
|
|
@@ -646,15 +662,7 @@ Ext.define('KitchenSink.view.binding.ChildForm', {
|
|
|
.then(function(localJson) {
|
|
|
me.setLoading(false);
|
|
|
if(localJson.success){
|
|
|
- var grid = form.ownerCt._parent ? form.ownerCt._parent.lookup('document-kind-Grid') : null;
|
|
|
- if(grid){
|
|
|
- grid.store.load();
|
|
|
- }
|
|
|
- if(combo){
|
|
|
- combo.store.load(function() {
|
|
|
- typeof combo.setValue == 'function' && combo.setValue(params._value);
|
|
|
- });
|
|
|
- }
|
|
|
+ form.ownerCt._parent.store.load();
|
|
|
saas.util.BaseUtil.showSuccessToast('保存成功');
|
|
|
form.ownerCt.close();
|
|
|
}
|