// 1,通过ajax查询
function query() {
var applyNo = $("#applyNo").val();//获取页面的查询条件
var entName = $("#entName").val();
var formName = $("#formName").val();
var socialCode = $("#socialCode").val();
var certNo = $("#certNo").val();
var beginTime = $("#beginTime").val();
var endTime = $("#endTime").val();
/*if(beginTime !=null || beginTime !=""){
beginTime = beginTime.replace(/-/g,'');//替换所有-
}
if(endTime !=null || endTime !="") {
endTime = endTime.replace(/-/g,'');
}*/
var requestUrl = context + "/service/bizapply/queryInfo";
// var requestUrl = context + "/service/bizapply/queryInfo/" + entName + "/"+ formName;
$.ajax({
type : "post",
dataType : "json",
data : {
"applyNo" : applyNo,
"entName" : entName,
"formName" : formName,
"socialCode" : socialCode,
"certNo" : certNo,
"beginTime" : beginTime,
"endTime" : endTime,
},
url : requestUrl,
success : function(Json) {//Json为后台model里传过来的数组
var obj = eval(Json.data);//注意,list里可能不是个单纯数组,因此需要取data
$("#dataList tbody").html("");//先清空表,再将查询的数据拼接上去
for (var i=0;i= 10) {
submitTime += mon + "-";
}else {
submitTime += "0" + mon + "-";
}
if(day >= 10) {
submitTime += day;
}else {
submitTime += "0" + day;
}
submitTime +=" ";
if(h >= 10) {
submitTime += h + ":";
}else {
submitTime += "0" + h + ":";
}
if(m >= 10) {
submitTime += m;
}else {
submitTime += "0" + m;
}
var $tr = $("
");
$tr.append(""+(i+1)+" | ");
$tr.append(""+obj[i].APPLY_NO+" | ");
$tr.append(""+obj[i].ENT_NAME+" | ");
$tr.append(""+obj[i].SOCIAL_CODE+" | ");
$tr.append(""+obj[i].FORM_NAME+" | ");
$tr.append(""+obj[i].FORM_ID+" | ");
// $tr.append(""+year+"-"+mon+"-"+day+" "+h+":"+m+" | ");
$tr.append(""+submitTime+" | ");
$tr.append(""+obj[i].CERT_NO+" | ");
$("#dataList tbody").append($tr);
}
},error: function () {
alert("加载失败");
}
});
}
//后台写法,此处只返回model
@RequestMapping(value = "/queryInfo", method = RequestMethod.POST)
@ResponseBody
public Map queryInfo(String entName, String formName, String socialCode, String certNo,
String applyNo, String beginTime, String endTime, HttpServletRequest request) {
Map model = new HashMap();
List