jquery easyui 表头固定 datagrid 弹出框 AJAX刷新页面

直接上效果图一:
jquery easyui 表头固定 datagrid 弹出框 AJAX刷新页面_第1张图片

直接上效果图二:
jquery easyui 表头固定 datagrid 弹出框 AJAX刷新页面_第2张图片

代码一:
public void findComplainData(ActionMapping mapping,
			ActionForm form, HttpServletRequest request,
			HttpServletResponse response) throws Exception {
		Connection conn = null;
		PreparedStatement stmt = null;
		ResultSet rs = null;
		P6PreparedStatement p6stmt = null;
		try {
			String carNo = request.getParameter("carNo");
			String model = request.getParameter("model");
			String custPo = request.getParameter("custPo");
			String custName = request.getParameter("custName");
			String complainStart = request.getParameter("complainStart");
			String complainEnd = request.getParameter("complainEnd");
			String complainStateVal = request.getParameter("complainState");
			String returnStateVal = request.getParameter("returnState");
			String claimStateVal = request.getParameter("claimState");
			String pagestr = request.getParameter("page");
			int page = pagestr == null ? 1 : Integer.parseInt(pagestr);
			String rowsstr = request.getParameter("rows");
			int rows = rowsstr == null ? 20 : Integer.parseInt(rowsstr);
			int startnum = rows * (page-1) + 1;
			int endnum = rows * page;
			conn = tools.getConnection("JappsDS01");
			
			String coresql = "SELECT R.BASE_UID,(SELECT ALTERNATE_NAME FROM SPFS.USER_DETAILS IUD WHERE IUD.EMP_ID=R.APPLIER) APPLIER_NAME,TO_CHAR(T.CUSTOMDATE,'YYYY-MM-DD') CUSTOMDATE,R.STATUS PSTATUS,(SELECT STATUS FROM SPFS.BASE_FORM WHERE BASE_UID = (SELECT MAX(M.BASE_UID) FROM SPFS.BASE_FORM M,SPFS.SPFS32_8D_CLAI N WHERE M.BASE_UID = N.BASE_UID AND N.WD_BASE_UID = R.BASE_UID AND M.STATUS <> 'D' AND M.STATUS <> 'V' AND M.STATUS <> 'T')) CSTATUS,";
			coresql += " (SELECT STATUS FROM SPFS.BASE_FORM WHERE BASE_UID = (SELECT MAX(P.BASE_UID) FROM SPFS.BASE_FORM P,SPFS.SPFS33_8D_INFO Q WHERE P.BASE_UID = Q.BASE_UID AND Q.WD_BASE_UID = R.BASE_UID AND P.STATUS <> 'D' AND P.STATUS <> 'V' AND P.STATUS <> 'T')) DSTATUS,T.PLACE,T.LEASTS,T.MODEL,T.BADCATEGORY,";
			coresql += " T.CUSTOMCODE,T.SHIPPCS,T.NUMBERPCS,T.NUMBERSET,T.BADDESC FROM SPFS.SPFS30_8D_SELL T LEFT JOIN SPFS.BASE_FORM R ON T.BASE_UID = R.BASE_UID WHERE R.STATUS <> 'D' AND R.STATUS <> 'V' AND R.STATUS <> 'T' AND T.LEASTS IS NOT NULL ";
			if (carNo != null && !"".equals(carNo.trim())) {
				coresql += " AND T.LEASTS LIKE '%" + carNo.trim() + "%'";
			}
			if (model != null && !"".equals(model.trim())) {
				coresql += " AND T.MODEL LIKE '%" + model.trim() + "%'";
			}
			if (custPo != null && !"".equals(custPo.trim())) {
				coresql += " AND T.BADCATEGORY LIKE '%" + custPo.trim() + "%'";
			}
			if (custName != null && !"".equals(custName.trim())) {
				coresql += " AND T.CUSTOMCODE LIKE '%" + custName.trim() + "%'";
			}
			if (complainStart != null && !"".equals(complainStart.trim())) {
				coresql += " AND TRUNC(T.DATE_CREATE) >=TO_DATE('" + complainStart.trim() + "','YYYY-MM-DD')";
			}
			if (complainEnd != null && !"".equals(complainEnd.trim())) {
				coresql += " AND TRUNC(T.DATE_CREATE) <=TO_DATE('" + complainEnd.trim() + "','YYYY-MM-DD')";
			}
			
			coresql = "SELECT CORE.* FROM (" + coresql + ") CORE WHERE 1 = 1";
			if (complainStateVal != null && !"".equals(complainStateVal.trim())) {
				coresql += " AND PSTATUS IN (" + complainStateVal.substring(1) + ")";
			}
			if (returnStateVal != null && !"".equals(returnStateVal.trim())) {
				coresql += " AND DSTATUS IN (" + returnStateVal.substring(1) + ")";
			}
			if (claimStateVal != null && !"".equals(claimStateVal.trim())) {
				coresql += " AND CSTATUS IN (" + claimStateVal.substring(1) + ")";
			}
			String countsql = "SELECT COUNT(1) AS CNT FROM (" + coresql +")";
			
			coresql += " ORDER BY LEASTS DESC";
			coresql = "SELECT OD.* FROM (SELECT ROWNUM RN,ID.* FROM (" + coresql + ") ID WHERE ROWNUM <= " + endnum + ") OD WHERE RN >=" + startnum;
			stmt = conn.prepareStatement(coresql);
			p6stmt = new P6PreparedStatement(null, stmt, null, coresql);
			loger.debug(p6stmt.getQueryFromPreparedStatement());
			rs = stmt.executeQuery();
			
			JSONArray json = new JSONArray();
			JSONObject object = null;
			String place = null;
			String complainState = null;
			String returnState = null;
			String claimState = null;
			String status = null;
			String badDesc = null;
			while (rs.next()) {
				object = new JSONObject();
				status = rs.getString("PSTATUS");
				if ("E".equals(status)) {
					complainState = "已完成";
				} else if ("R".equals(status)) {
					complainState = "退回";
				} else if ("P".equals(status)) {
					complainState = "审核中";
				}
				place = rs.getString("PLACE");
				if (place != null) {
					if (place.indexOf("5009") > -1) {
						status = rs.getString("CSTATUS");
						if ("E".equals(status)) {
							claimState = "已完成";
						} else if ("R".equals(status)) {
							claimState = "退回";
						} else if ("P".equals(status)) {
							claimState = "审核中";
						} else {
							claimState = "未申请";
						}
					} else {
						claimState = "---";
					}
					if (place.indexOf("5010") > -1) {
						status = rs.getString("DSTATUS");
						if ("E".equals(status)) {
							returnState = "已完成";
						} else if ("R".equals(status)) {
							returnState = "退回";
						} else if ("P".equals(status)) {
							returnState = "审核中";
						} else {
							returnState = "未申请";
						}
					} else {
						returnState = "---";
					}
				} else {
					claimState = "无";
					returnState = "无";
				}
				object.put("complainState", complainState);
				object.put("returnState", returnState);
				object.put("claimState", claimState);
				object.put("uid", rs.getString("BASE_UID"));
				object.put("applierName", rs.getString("APPLIER_NAME"));
				object.put("customDate", rs.getString("CUSTOMDATE"));
				object.put("carNo", rs.getString("LEASTS"));
				object.put("model", rs.getString("MODEL"));
				object.put("custPo", rs.getString("BADCATEGORY"));
				object.put("custName", rs.getString("CUSTOMCODE"));
				object.put("shipPcs", rs.getString("SHIPPCS"));
				object.put("numberPcs", rs.getString("NUMBERPCS"));
				object.put("numberSet", rs.getString("NUMBERSET"));
				badDesc = rs.getString("BADDESC");
				if (badDesc != null && badDesc.length() >= 50) {
					badDesc = badDesc.replaceAll("<br>", "");
					badDesc = badDesc.substring(0, 50) + "........";
				}
				object.put("badDesc", badDesc);
				json.put(object);
			}
			rs.close();
			stmt.close();
			
			stmt = conn.prepareStatement(countsql);
			p6stmt = new P6PreparedStatement(null, stmt, null, countsql);
			loger.debug(p6stmt.getQueryFromPreparedStatement());
			rs = stmt.executeQuery();
			int total = 0;
			if (rs.next()) {
				total = rs.getInt("CNT");
			}
			rs.close();
			stmt.close();
			
			JSONArray data = new JSONArray();
			object = new JSONObject();
			object.put("total", total);
			object.put("rows", json);
			data.put(object);
			
			response.setCharacterEncoding("UTF-8");
			PrintWriter out = response.getWriter();
			String jsonstr = data.toString().replaceAll("\\\\", "");
			out.println(jsonstr.substring(1, jsonstr.length() - 1));
			out.close();
		} catch (Exception e) {
			e.printStackTrace();
		} finally {
			try {
				if (conn != null && !conn.isClosed()) {
					conn.close();
				}
			} catch (Exception e) {
				loger.error(e);
			}
		}
	}
	
	public void findState1(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response)
			throws Exception {
		String baseuid = request.getParameter("uid");
		if (baseuid != null) {
			Connection conn = null;
			PreparedStatement stmt = null;
			ResultSet rs = null;
			P6PreparedStatement p6stmt = null;
			try {
				String sql = "SELECT DECODE(KA.APPROVER_ACTION,'T','申请',DECODE(KA.APPROVAL_STATUS,'A','同意','R','退回','------')) APPROVER_ACTION,"
						+ "DECODE(KA.APPROVER_ACTION,'T','申请人',NAME_DESC) APPROVED_DESC,DECODE(KA.APPROVAL_STATUS,'P','------',ALTERNATE_NAME) "
						+ "APPROVER_NAME_ENG,NVL(TO_CHAR(KD.APPROVED_DATE,'YYYY-MM-DD HH24:MI:SS'),'------') APPROVED_DATE,NVL(KD.FLOW_COMMENT,'------') FLOW_COMMENT FROM SPFS.FLOW_BOX KA "
						+ "LEFT JOIN SPFS.FLOW_HISTORY KD ON KD.BASE_UID = KA.BASE_UID AND KA.FLOW_HIS_SEQ=KD.FLOW_HIS_SEQ "
						+ "LEFT JOIN SPFS.USER_DETAILS KB ON KA.APPROVER_EMP=KB.EMP_ID  "
						+ "LEFT JOIN SPFS.FORM_ROLE KC ON KA.ROLE_UID = KC.ROLE_UID WHERE KA.BASE_UID = '"
						+ baseuid
						+ "' AND ((KA.APPROVAL_STATUS='A' AND KA.APPROVER_ACTION='T') "
						+ "OR (KA.APPROVAL_STATUS='P' AND KA.APPROVER_ACTION='S') "
						+ "OR (KA.APPROVAL_STATUS='A' AND KA.APPROVER_ACTION='A') "
						+ "OR (KA.APPROVAL_STATUS='R' AND KA.APPROVER_ACTION='A') "
						+ "OR (KA.APPROVAL_STATUS IN ('A','R') AND KA.APPROVER_ACTION='S' AND KA.APPROVER_EMP NOT IN ('FINISHED','FILED'))) "
						+ "ORDER BY STATION,BRANCH ";
				conn = tools.getConnection("JappsDS01");
				stmt = conn.prepareStatement(sql);
				p6stmt = new P6PreparedStatement(null, stmt, null, sql);
				loger.debug(p6stmt.getQueryFromPreparedStatement());
				rs = stmt.executeQuery();
				JSONArray json = new JSONArray();
				JSONObject object = null;
				String comment = null;
				while (rs.next()) {
					object = new JSONObject();
					object.put("approveAction", rs.getString("APPROVER_ACTION"));
					object.put("approverName",
							rs.getString("APPROVER_NAME_ENG"));
					object.put("approveDate", rs.getString("APPROVED_DATE"));
					object.put("approveDesc", rs.getString("APPROVED_DESC"));
					comment = rs.getString("FLOW_COMMENT");
					if (comment != null && comment.length() >= 50) {
						comment = comment.replaceAll("<br>", "");
						comment = comment.substring(0, 50) + "........";
					}
					object.put("approveComment", comment);
					json.put(object);
				}
				rs.close();
				stmt.close();

				JSONArray data = new JSONArray();
				object = new JSONObject();
				object.put("total", json.length());
				object.put("rows", json);
				data.put(object);
				response.setCharacterEncoding("UTF-8");
				PrintWriter out = response.getWriter();
				String jsonstr = data.toString().replaceAll("\\\\", "");
				out.println(jsonstr.substring(1, jsonstr.length() - 1));
				out.close();

			} catch (Exception e) {
				e.printStackTrace();
			} finally {
				try {
					if (conn != null && !conn.isClosed()) {
						conn.close();
					}
				} catch (Exception e) {
					loger.error(e);
				}
			}
		}
	}

	public void findState2(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response)
			throws Exception {
		String baseuid = request.getParameter("uid");
		if (baseuid != null) {
			Connection conn = null;
			PreparedStatement stmt = null;
			ResultSet rs = null;
			P6PreparedStatement p6stmt = null;
			try {
				String sql = "SELECT DECODE(KA.APPROVER_ACTION,'T','申请',DECODE(KA.APPROVAL_STATUS,'A','同意','R','退回','------')) APPROVER_ACTION,"
						+ "DECODE(KA.APPROVER_ACTION,'T','申请人',NAME_DESC) APPROVED_DESC,DECODE(KA.APPROVAL_STATUS,'P','------',ALTERNATE_NAME) "
						+ "APPROVER_NAME_ENG,NVL(TO_CHAR(KD.APPROVED_DATE,'YYYY-MM-DD HH24:MI:SS'),'------') APPROVED_DATE,NVL(KD.FLOW_COMMENT,'------') FLOW_COMMENT FROM SPFS.FLOW_BOX KA "
						+ "LEFT JOIN SPFS.FLOW_HISTORY KD ON KD.BASE_UID = KA.BASE_UID AND KA.FLOW_HIS_SEQ=KD.FLOW_HIS_SEQ "
						+ "LEFT JOIN SPFS.USER_DETAILS KB ON KA.APPROVER_EMP=KB.EMP_ID  "
						+ "LEFT JOIN SPFS.FORM_ROLE KC ON KA.ROLE_UID = KC.ROLE_UID WHERE KA.BASE_UID=(SELECT MAX(BASE_UID) "
						+ "FROM SPFS.SPFS33_8D_INFO KF WHERE KF.WD_BASE_UID='"
						+ baseuid
						+ "') AND ((KA.APPROVAL_STATUS='A' AND KA.APPROVER_ACTION='T') "
						+ "OR (KA.APPROVAL_STATUS='P' AND KA.APPROVER_ACTION='S') "
						+ "OR (KA.APPROVAL_STATUS='A' AND KA.APPROVER_ACTION='A') "
						+ "OR (KA.APPROVAL_STATUS='R' AND KA.APPROVER_ACTION='A') "
						+ "OR (KA.APPROVAL_STATUS IN ('A','R') AND KA.APPROVER_ACTION='S' AND KA.APPROVER_EMP NOT IN ('FINISHED','FILED'))) "
						+ "ORDER BY STATION,BRANCH ";
				conn = tools.getConnection("JappsDS01");
				stmt = conn.prepareStatement(sql);
				p6stmt = new P6PreparedStatement(null, stmt, null, sql);
				loger.debug(p6stmt.getQueryFromPreparedStatement());
				rs = stmt.executeQuery();
				JSONArray json = new JSONArray();
				JSONObject object = null;
				String comment = null;
				while (rs.next()) {
					object = new JSONObject();
					object.put("approveAction", rs.getString("APPROVER_ACTION"));
					object.put("approverName",
							rs.getString("APPROVER_NAME_ENG"));
					object.put("approveDate", rs.getString("APPROVED_DATE"));
					object.put("approveDesc", rs.getString("APPROVED_DESC"));
					comment = rs.getString("FLOW_COMMENT");
					if (comment != null && comment.length() >= 50) {
						comment = comment.replaceAll("<br>", "");
						comment = comment.substring(0, 50) + "........";
					}
					object.put("approveComment", comment);
					json.put(object);
				}
				rs.close();
				stmt.close();

				JSONArray data = new JSONArray();
				object = new JSONObject();
				object.put("total", json.length());
				object.put("rows", json);
				data.put(object);
				response.setCharacterEncoding("UTF-8");
				PrintWriter out = response.getWriter();
				String jsonstr = data.toString().replaceAll("\\\\", "");
				out.println(jsonstr.substring(1, jsonstr.length() - 1));
				out.close();

			} catch (Exception e) {
				e.printStackTrace();
			} finally {
				try {
					if (conn != null && !conn.isClosed()) {
						conn.close();
					}
				} catch (Exception e) {
					loger.error(e);
				}
			}
		}
	}

	public void findState3(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response)
			throws Exception {
		String baseuid = request.getParameter("uid");
		if (baseuid != null) {
			Connection conn = null;
			PreparedStatement stmt = null;
			ResultSet rs = null;
			P6PreparedStatement p6stmt = null;
			try {
				String sql = "SELECT DECODE(KA.APPROVER_ACTION,'T','申请',DECODE(KA.APPROVAL_STATUS,'A','同意','R','退回','------')) APPROVER_ACTION,"
						+ "DECODE(KA.APPROVER_ACTION,'T','申请人',NAME_DESC) APPROVED_DESC,DECODE(KA.APPROVAL_STATUS,'P','------',ALTERNATE_NAME) "
						+ "APPROVER_NAME_ENG,NVL(TO_CHAR(KD.APPROVED_DATE,'YYYY-MM-DD HH24:MI:SS'),'------') APPROVED_DATE,NVL(KD.FLOW_COMMENT,'------') FLOW_COMMENT FROM SPFS.FLOW_BOX KA "
						+ "LEFT JOIN SPFS.FLOW_HISTORY KD ON KD.BASE_UID = KA.BASE_UID AND KA.FLOW_HIS_SEQ=KD.FLOW_HIS_SEQ "
						+ "LEFT JOIN SPFS.USER_DETAILS KB ON KA.APPROVER_EMP=KB.EMP_ID  "
						+ "LEFT JOIN SPFS.FORM_ROLE KC ON KA.ROLE_UID = KC.ROLE_UID WHERE KA.BASE_UID=(SELECT MAX(BASE_UID) "
						+ "FROM SPFS.SPFS32_8D_CLAI KF WHERE KF.WD_BASE_UID='"
						+ baseuid
						+ "') AND ((KA.APPROVAL_STATUS='A' AND KA.APPROVER_ACTION='T') "
						+ "OR (KA.APPROVAL_STATUS='P' AND KA.APPROVER_ACTION='S') "
						+ "OR (KA.APPROVAL_STATUS='A' AND KA.APPROVER_ACTION='A') "
						+ "OR (KA.APPROVAL_STATUS='R' AND KA.APPROVER_ACTION='A') "
						+ "OR (KA.APPROVAL_STATUS IN ('A','R') AND KA.APPROVER_ACTION='S' AND KA.APPROVER_EMP NOT IN ('FINISHED','FILED'))) "
						+ "ORDER BY STATION,BRANCH ";
				conn = tools.getConnection("JappsDS01");
				stmt = conn.prepareStatement(sql);
				p6stmt = new P6PreparedStatement(null, stmt, null, sql);
				loger.debug(p6stmt.getQueryFromPreparedStatement());
				rs = stmt.executeQuery();
				JSONArray json = new JSONArray();
				JSONObject object = null;
				String comment = null;
				while (rs.next()) {
					object = new JSONObject();
					object.put("approveAction", rs.getString("APPROVER_ACTION"));
					object.put("approverName",
							rs.getString("APPROVER_NAME_ENG"));
					object.put("approveDate", rs.getString("APPROVED_DATE"));
					object.put("approveDesc", rs.getString("APPROVED_DESC"));
					comment = rs.getString("FLOW_COMMENT");
					if (comment != null && comment.length() >= 50) {
						comment = comment.replaceAll("<br>", "");
						comment = comment.substring(0, 50) + "........";
					}
					object.put("approveComment", comment);
					json.put(object);
				}
				rs.close();
				stmt.close();

				JSONArray data = new JSONArray();
				object = new JSONObject();
				object.put("total", json.length());
				object.put("rows", json);
				data.put(object);
				response.setCharacterEncoding("UTF-8");
				PrintWriter out = response.getWriter();
				String jsonstr = data.toString().replaceAll("\\\\", "");
				out.println(jsonstr.substring(1, jsonstr.length() - 1));
				out.close();

			} catch (Exception e) {
				e.printStackTrace();
			} finally {
				try {
					if (conn != null && !conn.isClosed()) {
						conn.close();
					}
				} catch (Exception e) {
					loger.error(e);
				}
			}
		}
	}


代码二:
<%
	String path = request.getContextPath();
	String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
	
%>
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>客诉管理</title>
    <link rel="stylesheet" type="text/css" href="themes/default/easyui.css">
    <link rel="stylesheet" type="text/css" href="themes/icon.css">
    <link rel="stylesheet" type="text/css" href="demo.css">
    <style type="text/css">
        #fm{
            margin:0;
            padding:10px 30px;
        }
        .ftitle{
            font-size:14px;
            font-weight:bold;
			color:#555;
            margin-bottom:10px;
            margin-top:10px;
            border-bottom:1px solid #ccc;
        }
        .ftext{
        	font-size:10px;
        	font-weight:normal;
        }
        .fitem{
            margin-bottom:5px;
        }
        .flable{
            margin-bottom:15px;
        }
        .fitem label{
            display:inline-block;
            width:80px;
			text-align:right;
			font-size:12px;
            font-weight:bold;
			color:#666;
        }
    </style>
    <script type="text/javascript" src="jquery.js"></script>
    <script type="text/javascript" src="jquery.datagrid.js"></script>
</head>
<body>
	<div style="text-align: center;padding-left:20px;">
    <table id="dg" title="客诉管理" class="easyui-datagrid" style="width:1080px;height:580px;"
            url="<%=basePath%>SPFS37001.do?reqCode=findComplainData" loadMsg="加载数据中....."
            toolbar="#toolbar" pagination="true" pagesize="16" remoteSort="false"
            pageList="[16,38,66,100]" showFooter="true"
            rownumbers="true" singleSelect="true">
        <thead>
            <tr>
                <th colspan="3">状态</th>
                <th rowspan="2" field="customDate" width="80" sortable="true" align="center">客诉日期</th>
                <th rowspan="2" field="applierName" width="80" sortable="true" align="center">申请人</th>
                <th rowspan="2" field="carNo" width="128" sortable="true" align="left">CAR号</th>
				<th rowspan="2" field="model" width="120" sortable="true" align="left">生成型号</th>
				<th rowspan="2" field="custPo" width="130" sortable="true" align="left">客户品名</th>
				<th rowspan="2" field="custName" width="170" sortable="true" align="left">客户名称</th>
				<th rowspan="2" field="shipPcs" width="100" sortable="true" align="center">出货数量(PCS)</th>
				<th colspan="2">不良数量(PCS)</th>
				<th rowspan="2" field="badDesc" width="400" sortable="true" align="left">不良描述</th>
            </tr>
            <tr>
            	<th field="complainState" width="60" sortable="true" align="center">客诉单</th>
				<th field="returnState" width="60" sortable="true" align="center">退货单</th>
				<th field="claimState" width="60" sortable="true" align="center">索赔单</th>
				<th field="numberPcs" width="60" sortable="true" align="center">PCB</th>
				<th field="numberSet" width="60" sortable="true" align="center">PCBA</th>
            </tr>
        </thead>
    </table>
    <div id="toolbar" style="padding: 5px 15px;">
        <a href="javascript:void(0)" class="easyui-linkbutton" style="float:right;" iconCls="icon-search" onclick="newUser()">查询</a>
        <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-edit" onclick="queryStateInfo()">明细</a>
    </div>
    
    <div id="dlg" class="easyui-dialog" style="width:450px;height:380px;padding:10px 20px"
            closed="true" buttons="#dlg-buttons">
        <div class="ftitle">录入条件<span class="ftext">(备注:支持模糊查询,不需要‘%’)</span></div>
        <form id="fm" method="post" novalidate>
            <div class="fitem">
                <label>客户名称:</label>
                <input id="custName" name="custName" class="easyui-validatebox">
            </div>
            <div class="fitem">
                <label>客户品名:</label>
                <input id="custPo" name="custPo" class="easyui-validatebox">
            </div>
            <div class="fitem">
                <label>生成型号:</label>
                <input id="model" name="model" class="easyui-validatebox">
            </div>
            <div class="fitem">
                <label>CAR号:</label>
                <input id="carNo" name="carNo" class="easyui-validatebox">
            </div>
			<div class="fitem">
                <label>投诉日期>=:</label>
                <input id="complainStart" name="complainStart" class="easyui-datebox">
            </div>
			<div class="fitem">
                <label>投诉日期<=:</label>
                <input id="complainEnd" name="complainEnd" class="easyui-datebox">
            </div>
            <div class="fitem">
                <label>客诉单:</label>
                <input name="complainState" type="checkbox" value="P">
                <span>审核中</span>
                <input name="complainState" type="checkbox" value="R">
                <span>退回</span>
                <input name="complainState" type="checkbox" value="E">
                <span>已完成</span>
            </div>
            <div class="fitem">
                <label>退货单:</label>
                <input name="returnState" type="checkbox" value="P">
                <span>审核中</span>
                <input name="returnState" type="checkbox" value="R">
                <span>退回</span>
                <input name="returnState" type="checkbox" value="E">
                <span>已完成</span>
            </div>
            <div class="fitem">
                <label>索赔单:</label>
                <input name="claimState" type="checkbox" value="P">
                <span>审核中</span>
                <input name="claimState" type="checkbox" value="R">
                <span>退回</span>
                <input name="claimState" type="checkbox" value="E">
                <span>已完成</span>
            </div>
        </form>
    </div>
    <div id="dlg-buttons" style="text-align:center;">
        <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-ok" onclick="queryComplainInfo()">查询</a>
    </div>
    
    <div id="dlgstate" class="easyui-dialog" style="width:840px;height:510px;padding:10px 20px"
            closed="true" buttons="#dlgstate-buttons">
        <table id="dg1" class="easyui-datagrid" style="width:756px;" loadMsg="客诉状态加载中....."
	    	url="<%=basePath%>SPFS37001.do?reqCode=findState1" singleSelect="true">
	        <thead>
	            <tr>
	                <th field="approveDesc" width="120" align="center"><span style="color:#0e2d5f;font:bold 12px Arial;">客诉单</span></th>
					<th field="approverName" width="100" align="center">人员</th>
	                <th field="approveAction" width="80" align="center">受理</th>
					<th field="approveDate" width="150" align="center">时间</th>
					<th field="approveComment" width="290" align="center">描述</th>
	            </tr>
	        </thead>
	    </table>
	    <div class="flable"></div>
        <table id="dg2" class="easyui-datagrid" style="width:756px;" loadMsg="退货状态加载中....."
	    	url="<%=basePath%>SPFS37001.do?reqCode=findState2" singleSelect="true">
	        <thead>
	            <tr>
					<th field="approveDesc" width="120" align="center"><span style="color:#0e2d5f;font:bold 12px Arial;">退货单</span></th>
					<th field="approverName" width="100" align="center">人员</th>
	                <th field="approveAction" width="80" align="center">受理</th>
					<th field="approveDate" width="150" align="center">时间</th>
					<th field="approveComment" width="290" align="center">描述</th>
	            </tr>
	        </thead>
	    </table>
	    <div class="flable"></div>
        <table id="dg3" class="easyui-datagrid" style="width:756px;" loadMsg="索赔状态加载中....."
	    	url="<%=basePath%>SPFS37001.do?reqCode=findState3" singleSelect="true">
	        <thead>
	            <tr>
					<th field="approveDesc" width="120" align="center"><span style="color:#0e2d5f;font:bold 12px Arial;">索赔单</span></th>
					<th field="approverName" width="100" align="center">人员</th>
	                <th field="approveAction" width="80" align="center">受理</th>
					<th field="approveDate" width="150" align="center">时间</th>
					<th field="approveComment" width="290" align="center">描述</th>
	            </tr>
	        </thead>
	    </table>
    </div>
    <div id="dlgstate-buttons" style="text-align:center;">
        <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-redo" onclick="closeState()">关闭</a>
    </div>
	</div>
    <script type="text/javascript">
    	function queryComplainInfo() {
    		$('#dlg').dialog('close');
    		var queryParams = $('#dg').datagrid('options').queryParams;  
    		queryParams.custName = $("#custName").val();
    		queryParams.custPo = $("#custPo").val();
    		queryParams.model = $("#model").val();
    		queryParams.carNo = $("#carNo").val();
    		queryParams.complainStart = $("#complainStart").datebox('getValue');
    		queryParams.complainEnd = $("#complainEnd").datebox('getValue');
    		var complainStateStr = "";
    		$("input[name='complainState']:checked").each(function() {
    			complainStateStr += ",'" + $(this).val() + "'";
    		});
    		queryParams.complainState = complainStateStr;
    		var returnStateStr = "";
    		$("input[name='returnState']:checked").each(function() {
    			returnStateStr += ",'" + $(this).val() + "'";
    		});
    		queryParams.returnState = returnStateStr;
    		var claimStateStr = "";
    		$("input[name='claimState']:checked").each(function() {
    			claimStateStr += ",'" + $(this).val() + "'";
    		});
    		queryParams.claimState = claimStateStr;
    		$("#dg").datagrid('reload');
    	}
    	function queryStateInfo() {
    		var selected = $('#dg').datagrid('getSelected');
			if (selected){
				var queryParams = $('#dg1').datagrid('options').queryParams;
	    		queryParams.uid = selected.uid;
	    		$("#dg1").datagrid('reload');
	    		
	    		queryParams = $('#dg2').datagrid('options').queryParams;
	    		queryParams.uid = selected.uid;
	    		$("#dg2").datagrid('reload');
	    		
	    		queryParams = $('#dg3').datagrid('options').queryParams;
	    		queryParams.uid = selected.uid;
	    		$("#dg3").datagrid('reload');
				$('#dlgstate').dialog('open').dialog('setTitle','明细');
			} else {
				alert("请先选择一项");
			}
    	}
        function newUser(){
            $('#dlg').dialog('open').dialog('setTitle','查询界面');
        }
        function closeState() {
        	$("#dlgstate").dialog('close');
        }
		$.fn.datebox.defaults.formatter = function(date){
			var y = date.getFullYear();
			var m = date.getMonth()+1;
			var d = date.getDate();
			return y+'-'+m+'-'+d;
		}
		$("#complainStart").datebox();
		$("#complainEnd").datebox();
    </script>
</body>
</html>


也可以直接下载附件做参考下吧

你可能感兴趣的:(jquery,easyui)