|
|
@@ -278,31 +278,24 @@ Ext.define('KitchenSink.view.binding.ChildForm', {
|
|
|
listeners:{
|
|
|
blur:function(f,a,b,c){
|
|
|
if(f.value&&f.value!=''&&f.isValid()){
|
|
|
- // var url = 'https://sso.ubtob.com' + '/api/user/checkMobile?mobile='+f.value;
|
|
|
- // saas.util.BaseUtil.request({url })
|
|
|
- // .then(function(res) {
|
|
|
- // if(res.success) {
|
|
|
- // }
|
|
|
- // })
|
|
|
- // .catch(function(response) {
|
|
|
- // });
|
|
|
- // Ext.Ajax.request({
|
|
|
- // url: Ext.manifest.server.accountPath + '/api/user/checkMobile',
|
|
|
- // params: {
|
|
|
- // mobile: f.value
|
|
|
- // },
|
|
|
- // method: 'GET',
|
|
|
- // headers:{
|
|
|
- // 'Access-Control-Allow-Origin': '*',
|
|
|
- // "Content-Type": 'application/json;charset=UTF-8'
|
|
|
- // },
|
|
|
- // success: function (response) {
|
|
|
- // debugger
|
|
|
- // },
|
|
|
- // failure: function (response) {
|
|
|
- // debugger
|
|
|
- // }
|
|
|
- // });
|
|
|
+ Ext.Ajax.request({
|
|
|
+ url: 'http://192.168.253.31:8560/api/account/account/checkMobile?mobile='+f.value,
|
|
|
+ method: 'GET',
|
|
|
+ headers:{
|
|
|
+ 'Access-Control-Allow-Origin': '*',
|
|
|
+ "Content-Type": 'application/json;charset=UTF-8'
|
|
|
+ },
|
|
|
+ success: function (response) {
|
|
|
+ if(localJson.success){
|
|
|
+ saas.util.BaseUtil.showSuccessToast('保存成功');
|
|
|
+ form.ownerCt._parent.store.load()
|
|
|
+ form.ownerCt.close();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ failure: function (response) {
|
|
|
+ debugger
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -517,6 +510,11 @@ Ext.define('KitchenSink.view.binding.ChildForm', {
|
|
|
me.accountinformation();
|
|
|
return;
|
|
|
}
|
|
|
+ //账户资料新增特殊保存逻辑
|
|
|
+ if(me.dataKind=='accountadd'){
|
|
|
+ me.accountadd();
|
|
|
+ return;
|
|
|
+ }
|
|
|
|
|
|
Ext.Array.each(names,function(name) {
|
|
|
if(name){
|
|
|
@@ -618,5 +616,53 @@ Ext.define('KitchenSink.view.binding.ChildForm', {
|
|
|
console.error(res);
|
|
|
saas.util.BaseUtil.showErrorToast('保存失败: ' + res.message);
|
|
|
});
|
|
|
+ },
|
|
|
+ accountadd:function(){
|
|
|
+ var me = this;
|
|
|
+ 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);
|
|
|
+
|
|
|
+ Ext.Array.each(names,function(name) {
|
|
|
+ if(name){
|
|
|
+ var dataField = form.down('[name='+name+']');
|
|
|
+ if(dataField&&dataField.value){
|
|
|
+ params[name] = dataField.value;
|
|
|
+ params._value = dataField.value;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ params['username'] = params['mobile'];
|
|
|
+ params['type'] = 1;
|
|
|
+ //保存接口
|
|
|
+ saas.util.BaseUtil.request({
|
|
|
+ url: belong.reqUrl,
|
|
|
+ params: JSON.stringify(params),
|
|
|
+ method: 'POST'
|
|
|
+ })
|
|
|
+ .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);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ saas.util.BaseUtil.showSuccessToast('保存成功');
|
|
|
+ form.ownerCt.close();
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch(function(res) {
|
|
|
+ me.setLoading(false);
|
|
|
+ console.error(res);
|
|
|
+ saas.util.BaseUtil.showErrorToast('保存失败: ' + res.message);
|
|
|
+ });
|
|
|
}
|
|
|
});
|