ajax 传 json 数组
作者:chrispy
var obj = {};
obj.collectionCompanyId = newIdObj[0]; //企业ID
obj.entrustCompanyId = 111; //委托公司ID
obj.startingTime = 222; //开始时间
obj.endTime = 333; //结束时间
obj.user = new Array();
for(var i = 0; i < csyListBox.find('.checkboxList').length; i++){
var ul = csyListBox.find('ul').eq(i);
var userList = {};
userList.userId = ul.attr('id');//催收员用户id
userList.userName = ul.find('.userName').text(); //催收员账号
userList.realName = ul.find('.realName').text(); //催收员姓名
userList.moneyLimitCount = ul.find('.moneyLimitCount').val(); //分单限制金额
userList.caseLimitCount = ul.find('.caseLimitCount').val(); //分单案件限制数量
if(csyListBox.find('.checkboxList').eq(i).is(':checked')){
obj.user.push(userList);
}
}
$.ajax({
url:'/case_center/caseDistribute/ViewExpectResults',
contentType:"application/json",
data: JSON.stringify(obj),
dataType:'json',
type:'post',
success:function(data){
var data = data;
//console.log(data);
}
});