前台:function queryTsr(){
var agentNo;
var userName;
var userCode;
var tsrType = document.getElementById("tsrType").value;
var pointTsr = document.getElementById("pointTsr").value;
alert(tsrType);
alert(pointTsr);
if(tsrType=="" || tsrType==null){
alert("请选择坐席输入类型!");
return false;
}
if(pointTsr=="" || pointTsr==null){
alert("请输入坐席!");
return false;
}
if(tsrType=="1"){
agentNo=pointTsr;
form1.action = "<%=request.getContextPath()%>/getUserAll.do?agentNo="+agentNo;
}
if(tsrType=="2"){
userCode=pointTsr;
form1.action = "<%=request.getContextPath()%>/getUserAll.do?userCode="+userCode;
}
if(tsrType=="3"){
userName=pointTsr;
form1.action = "<%=request.getContextPath()%>/getUserAll.do?userName="+userName;
}
$("form[name='form1']").ajaxSubmit({async: false,
type: "post",
data:{},
contentType:"application/x-www-form-urlencoded; charset=UTF-8",
success:function(json){
var data = eval('(' + json + ')');
var userAllList=data.data;
var allUser=$("#userAll");
allUser.html("");
for(var i=0;i<userAllList.length;i++){
var userAll=userAllList[i];
var td="<td class='inputbg' border='0' colspan='6'>"+
"<input name='userName' disabled='disabled' class='inputbg' style='color:#ff0000;font-family:黑体' value='"+userAll.userName+"'/>"+
"<input name='umCode' disabled='disabled' class='inputbg' value='"+userAll.umCode+"'/>"+
"<input name='agentId' disabled='disabled' class='inputbg' value='"+userAll.agentId+"'/>"+
"</td>";
allUser.append(td);
allUser.show();
}
}
});
}
后台controller
List userAllList = (List) this.getDispatch().dispatchRequest(
CommonUtils.getAggregatedSearchDTO("role.searchUserAll", userDto),
ServiceRequestId.AGGREGATED_SEARCH_ACTION);
ajaxDTO.setData(userAllList);
ajaxDTO.setMsg("success");
resultMap.put(AjaxUtil.JSON_RETURN_OBJECT, AjaxUtil.toJson(ajaxDTO));
// resultMap.put("userAllList", userAllList);
return new ModelAndView(this.getSuccessView(),resultMap);
var agentNo;
var userName;
var userCode;
var tsrType = document.getElementById("tsrType").value;
var pointTsr = document.getElementById("pointTsr").value;
alert(tsrType);
alert(pointTsr);
if(tsrType=="" || tsrType==null){
alert("请选择坐席输入类型!");
return false;
}
if(pointTsr=="" || pointTsr==null){
alert("请输入坐席!");
return false;
}
if(tsrType=="1"){
agentNo=pointTsr;
form1.action = "<%=request.getContextPath()%>/getUserAll.do?agentNo="+agentNo;
}
if(tsrType=="2"){
userCode=pointTsr;
form1.action = "<%=request.getContextPath()%>/getUserAll.do?userCode="+userCode;
}
if(tsrType=="3"){
userName=pointTsr;
form1.action = "<%=request.getContextPath()%>/getUserAll.do?userName="+userName;
}
$("form[name='form1']").ajaxSubmit({async: false,
type: "post",
data:{},
contentType:"application/x-www-form-urlencoded; charset=UTF-8",
success:function(json){
var data = eval('(' + json + ')');
var userAllList=data.data;
var allUser=$("#userAll");
allUser.html("");
for(var i=0;i<userAllList.length;i++){
var userAll=userAllList[i];
var td="<td class='inputbg' border='0' colspan='6'>"+
"<input name='userName' disabled='disabled' class='inputbg' style='color:#ff0000;font-family:黑体' value='"+userAll.userName+"'/>"+
"<input name='umCode' disabled='disabled' class='inputbg' value='"+userAll.umCode+"'/>"+
"<input name='agentId' disabled='disabled' class='inputbg' value='"+userAll.agentId+"'/>"+
"</td>";
allUser.append(td);
allUser.show();
}
}
});
}
后台controller
List userAllList = (List) this.getDispatch().dispatchRequest(
CommonUtils.getAggregatedSearchDTO("role.searchUserAll", userDto),
ServiceRequestId.AGGREGATED_SEARCH_ACTION);
ajaxDTO.setData(userAllList);
ajaxDTO.setMsg("success");
resultMap.put(AjaxUtil.JSON_RETURN_OBJECT, AjaxUtil.toJson(ajaxDTO));
// resultMap.put("userAllList", userAllList);
return new ModelAndView(this.getSuccessView(),resultMap);