//定义
var tempData = {};
//补充搜素条件
tempData.customerId = customerId;
tempData.year = year;
tempData.month = month;
//转换格式
var conditionStr = JSON.stringify(tempData);
var url = "${pageContext.request.contextPath}/statisticsCtrl/getOrderNewDayCountByYearAndMonth";
//post调用
$.post(url, {"conditionStr": conditionStr}, function (data) {
if (data.success) {
var resultData = data.data;
//初始化报表折线图
getEcharts(year,month,resultData.days,resultData.count);
//填充表格数据
allValue = [];
if(resultData.days && resultData.days.length>0){
for(var i=0;i<resultData.days.length;i++){
var dataTemp = {};
dataTemp.customerId = customerId;
dataTemp.year = year;
dataTemp.month = month;
dataTemp.count = resultData.count;
dataTemp.days = resultData.days;
allValue.push(dataTemp);
}
}
table.render({
elem: '#orderStaticstisTable'
, height: 'full-115'
, data: allValue
, cols:
[[ //表头
{field: 'customerId', title: '客户',hide:true}
,{field: 'year', title: '年份',hide:true}
,{field: 'month', title: '月份',hide:true}
,{field: 'days', title: '日期'}
, {field: 'count', title: '下单量'}
]]
,limit:50
})
} else {
layer.msg(data.errorMsg);
}
})