自己解决了
// 请求后台更新
admin.ajax({
url : 'trans',
method : 'post',
dataType : 'json',
data : {
dataSource : dataLs.dataSource,
tablename : JSON.stringify(dataLs.tablename),
reqType : JSON.stringify(dataLs.reqType),
content : JSON.stringify(dataLs.content),
fieldType : JSON.stringify(dataLs.fieldType),
tj : JSON.stringify(dataLs.tj),
},
// async : false, 需要显示等待框时,不可使用同步
beforeSend : function( XMLHttpRequest ){
index_load = layer.load(2,{
shade: [0.3, '#fff']
});
//admin.showLoading(loadingObj);
},
success : function(res){
layer.close(index_load);
if( res.code == 0 ){
searchList();
layer.msg("计算完成!");
}else{
console.log(res);
if( res.Description == "从数据类型 varchar 转换为 float 时出错。" ){
layer.msg("第" + res.ErrRow + "行数据,公式不正确!");
}else{
layer.msg( "第" + res.ErrRow + "行数据,发生:" + res.Description + "的错误!");
}
}
},
complete : function(){
// admin.removeLoading(loadingObj);
}
});