`
cqh520llr
  • 浏览: 509982 次
  • 性别: Icon_minigender_1
  • 来自: 深圳
文章分类
社区版块
存档分类
最新评论

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

 
阅读更多
直接上效果图一:


直接上效果图二:


代码一:
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>


也可以直接下载附件做参考下吧
  • 大小: 73.8 KB
  • 大小: 39.8 KB
分享到:
评论

相关推荐

    jQuery EasyUI编辑DataGrid用combobox实现多级联动

    在jQuery EasyUI中,DataGrid是一种常用的表格展示控件,它可以与各种编辑器结合使用,如combobox(下拉框)来实现更丰富的交互功能。本文主要探讨的是如何利用jQuery EasyUI的DataGrid和combobox组件实现多级联动的...

    struts2+ajax+easyui+json+datagrid增删改查

    Struts2、Ajax、EasyUI、JSON 和 DataGrid 是现代Web开发中常用的技术组合,用于构建功能丰富的交互式用户界面。下面将详细解释这些技术及其在实现增删改查、分页和排序功能中的作用。 **Struts2** 是一个基于MVC...

    datagrid 多表头及动态生成的实现

    本篇文章将详细介绍如何使用JQuery EasyUI插件中的datagrid组件实现多表头以及动态生成表格的功能。 #### 技术背景 - **JQuery EasyUI**:是一款基于jQuery的UI工具包,用于简化网页界面的开发。它提供了多种用户...

    Jquery-easyUI动态菜单

    **jQuery EasyUI动态菜单详解** jQuery EasyUI 是一个基于 jQuery 的轻量级前端框架,它提供了丰富的组件,如对话框、表单、菜单等,帮助开发者快速构建用户界面。在这个"Jquery-easyUI动态菜单"项目中,我们将会...

    Jquery EasyUI 1.4版本官方开发包+中文版API开发文档

    jQuery EasyUI 是一个基于 jQuery 的前端框架,它简化了网页用户界面组件的创建,提供了丰富的UI控件,如表格、对话框、树形菜单、表单等。1.4 版本是其早期的一个稳定版本,包含了一系列改进和增强功能。 在jQuery...

    Juery easyUi edatagride

    **jQuery EasyUI eDataGrid** 是一个基于jQuery和EasyUI框架的数据网格组件,它扩展了基本的DataGrid功能,提供了更丰富的特性和交互性。EasyUI是一个轻量级的前端开发框架,它使得构建用户界面变得简单快捷。在这个...

    jQuery+EasyUI实现头部固定带滚动条table表格特效源码.zip

    本资源"jQuery+EasyUI实现头部固定带滚动条table表格特效源码.zip"提供了一个使用这两者实现的特定功能:在表格数据过多时,保持表头固定,同时在页面内添加滚动条,以方便用户查看和操作。 jQuery是一个轻量级、高...

    EasyUI的DataGrid绑定Json数据源的示例代码

    EasyUI是一个基于jQuery的用户界面库,它提供了一系列的UI组件,让开发者能够快速地构建起具备良好交互性的网页应用。其中,DataGrid组件是EasyUI用来展示数据列表的重要组件,类似于其他技术中的表格控件。DataGrid...

    jQuery EasyUI使用教程:为数据网格创建复杂工具栏.docx

    jQuery EasyUI 是一个基于 jQuery 的前端框架,它提供了一系列易于使用的组件,如数据网格、对话框、表单等,帮助开发者快速构建用户界面。在本教程中,我们将深入探讨如何利用 jQuery EasyUI 为数据网格创建功能...

    Jquery 插件datagrid最新版本下载

    **jQuery Datagrid插件详解** jQuery Datagrid是一款广泛使用的数据网格插件,它基于jQuery库,为Web开发者提供了强大的数据展示和操作功能。这个插件允许用户以表格形式展示大量数据,同时支持分页、排序、过滤、...

    jQuery带滚动条头部固定表格代码.zip

    3. **jQuery与EasyUI**:在页面加载完成后,使用jQuery选择器找到表格元素,并调用EasyUI的`datagrid`方法来初始化表格。在配置项中,可以设置表格的列宽、行高、数据源等参数。 4. **自定义插件或扩展**:由于...

    easyui学习笔记(九)源码

    EasyUI 是一个基于 jQuery 的轻量级前端框架,主要用于构建用户界面。在 EasyUI 的学习过程中,源码分析是理解其工作原理、优化应用及定制组件的关键步骤。本笔记主要探讨的是 EasyUI 中与 `datagrid` 相关的部分,...

    easyui分页

    Ajax请求通常使用jQuery的`$.ajax`或者EasyUI提供的`datagrid`的`loadData`方法: ```javascript $("#studentTable").datagrid({ onLoadSuccess: function(data) { // 数据加载成功后的回调 }, onLoadError: ...

    SYPRO示例项目源码和EasyUI入门视频教程

    第12课(讲解datagrid的formatter的应用,格式化时间、行样式、列样式、表头居中,内容居右等应用)(formatter的提示功能,由于录制问题,没有录制到提示信息,所以大家自己去测试一下吧,不能重新录制了。) 第13课...

    js文件翻页

    `&lt;link&gt;`标签引用了jQuery EasyUI的主题样式表,`&lt;script&gt;`标签包含了jQuery库和jQuery EasyUI库,这些库提供了用于创建DataGrid和实现分页功能的API。 2. 数据网格定义: `&lt;table id="dg" ...&gt;`定义了一个...

    十五款提高表格操作的jQuery插件

    14. **EasyUI DataGrid**:EasyUI DataGrid是基于jQuery EasyUI框架的表格组件,提供分页、排序、过滤等功能,界面简洁美观。 15. **GridStack**:虽然主要是用于布局,但GridStack也可以用于创建可拖动、可调整...

    创建自己的jquery表格插件

    在本文中,我们将探讨如何创建一个基于jQuery的表格插件,这个插件是受到easyUI的dataGrid的启发,具备动态加载JSON数据、自动分页、全选与反选、行悬停变色以及隔行变色等功能。下面将详细介绍这个过程。 首先,...

Global site tag (gtag.js) - Google Analytics