/**
|
* 初始化提现列表详情对话框
|
*/
|
var TPubWithdrawalInfoDlg = {
|
tPubWithdrawalInfoData : {},
|
validateFields: {
|
remark: {
|
validators: {
|
notEmpty: {
|
message: '备注不能为空'
|
}/*,
|
regexp: {
|
regexp: /^.{1,250}$/,
|
message: '备注不能超过250个长度'
|
}*/
|
}
|
},
|
}
|
};
|
|
/**
|
* 验证数据是否为空
|
*/
|
TPubWithdrawalInfoDlg.validate = function () {
|
$('#withdrawalInfoForm').data("bootstrapValidator").resetForm();
|
$('#withdrawalInfoForm').bootstrapValidator('validate');
|
return $("#withdrawalInfoForm").data('bootstrapValidator').isValid();
|
};
|
|
/**
|
* 清除数据
|
*/
|
TPubWithdrawalInfoDlg.clearData = function() {
|
this.tPubWithdrawalInfoData = {};
|
}
|
|
/**
|
* 设置对话框中的数据
|
*
|
* @param key 数据的名称
|
* @param val 数据的具体值
|
*/
|
TPubWithdrawalInfoDlg.set = function(key, val) {
|
this.tPubWithdrawalInfoData[key] = (typeof val == "undefined") ? $("#" + key).val() : val;
|
return this;
|
}
|
|
/**
|
* 设置对话框中的数据
|
*
|
* @param key 数据的名称
|
* @param val 数据的具体值
|
*/
|
TPubWithdrawalInfoDlg.get = function(key) {
|
return $("#" + key).val();
|
}
|
|
/**
|
* 关闭此对话框
|
*/
|
TPubWithdrawalInfoDlg.close = function() {
|
parent.layer.close(window.parent.TPubWithdrawal.layerIndex);
|
}
|
|
/**
|
* 收集数据
|
*/
|
TPubWithdrawalInfoDlg.collectData = function() {
|
this
|
.set('id')
|
.set('userId')
|
.set('handleTime')
|
.set('balance')
|
.set('money')
|
.set('state')
|
.set('remark')
|
.set('code')
|
.set('name')
|
.set('userType')
|
.set('insertTime')
|
.set('flag')
|
.set('withdrawalType');
|
}
|
|
/**
|
* 立即处理
|
*/
|
TPubWithdrawalInfoDlg.immediately = function(){
|
|
this.clearData();
|
this.collectData();
|
|
if(!this.validate()){
|
return ;
|
}
|
var remark = $("#remark").val();
|
if (remark.length > 250){
|
Feng.info("备注不能超过250个字");
|
return;
|
}
|
var state = $("input[name='state']:checked").val();
|
//前端批量提交。不动后台逻辑
|
var ids=$("#ids").val();
|
var idStringArray=ids.split(",");
|
var errorCount=0;
|
var successCount=0;
|
$.each(idStringArray,function(index,value){
|
//TODO
|
//暂定前台批量提交,不改后台逻辑
|
var ajax = new $ax(Feng.ctxPath + "/tPubWithdrawal/immediately", function(data){
|
successCount++;
|
},function(data){
|
errorCount++;
|
});
|
ajax.set("id",value);
|
ajax.set("state",state);
|
ajax.set("remark",$("#remark").val());
|
ajax.start();
|
});
|
if(successCount>0){
|
Feng.success("处理成功条数:"+successCount+",失败条数:"+errorCount);
|
window.parent.TPubWithdrawal.table.refresh();
|
TPubWithdrawalInfoDlg.close();
|
}else{
|
//全部处理失败
|
Feng.error("处理失败!条数:"+errorCount);
|
}
|
|
//提交信息
|
/*var ajax = new $ax(Feng.ctxPath + "/tPubWithdrawal/immediately", function(data){
|
Feng.success("处理成功!");
|
window.parent.TPubWithdrawal.table.refresh();
|
TPubWithdrawalInfoDlg.close();
|
},function(data){
|
Feng.error("处理失败!" + data.responseJSON.message + "!");
|
});
|
ajax.set("id",$("#id").val());
|
ajax.set("state",state);
|
ajax.set("remark",$("#remark").val());
|
ajax.start();*/
|
}
|
|
|
$(function() {
|
Feng.initValidator("withdrawalInfoForm", TPubWithdrawalInfoDlg.validateFields);
|
});
|