退货申请及回复,加页面效果
<script type="text/javascript"> function sendReturnedPurchaseApply(){ var orderNm = $("#orderNm").val(); var messageCont = $("#messageCont").val(); var userId = $("#sysUserId").val(); if(orderNm == "" || orderNm == null){ alertMessage("请输入订单编号"); return false; } if(messageCont == "" || messageCont == null){ alertMessage("请输入内容"); return false; } //非空验证结束 $.ajaxSettings['contentType'] = "application/x-www-form-urlencoded; charset=utf-8"; $.ajax({ type:"POST",url:"/returnedPurchase/sendReturnedPurchaseApply.json", data:{userId:userId,orderNm:orderNm,messageCont:messageCont}, dataType:"json", success:function(data){ if (data.success == "true") { $("#orderNm").attr("value",""); $("#messageCont").attr("value","如果您的问题还没有解决,请回复管理员!"); window.location.reload(); <%--location.href = "<%=request.getContextPath()%>/returnedPurchase.ac?_method=get&userId="+userId;--%> }else{ alertMessage("订单编号错误,请重新输入!"); } }, error:function(XMLHttpRequest, textStatus) { if (XMLHttpRequest.status == 500) { var result = eval("(" + XMLHttpRequest.responseText + ")"); alert(result.jsonError.errorText); } } }); } function sendReply(t){ var target = t.parents(".area"); var textarea = target.find("[name='sessionCont']"); var sessionCont = textarea.val(); var applyId = target.find("[name='applyId']").val(); var userId = $("#sysUserId").val(); if(sessionCont == "" || sessionCont == null){ alertMessage("请输入内容"); return false; } //非空验证结束 $.ajax({ type:"POST",url:"/returnedPurchase/sendReply.json", data:{applyId:applyId,userId:userId,sessionCont:sessionCont}, dataType:"json", success:function(data){ if (data.success == "true") { textarea.attr("value","如果您的问题还没有解决,请回复管理员!"); window.location.reload(); }else{ alertMessage("订单编号错误,请重新输入!"); } } }); } function alertMessage(message){ alert(message); return false; } function showReply(t){ var target = t.parents(".minBox").find(".area"); if(target.is(":visible")){ t.find("img").attr("src","../page/vesun/images/register_showPower.gif"); target.slideToggle("fast"); }else{ t.find("img").attr("src","../page/vesun/images/register_showPower2.gif"); target.slideToggle("fast"); } } </script> <div var="list" /> <c:if test="${empty list}"> <div var="returnedPurchaseApplyVo"> <div onclick="showReply($(this))"><img src="${frontPath}/page/vesun/images/register_showPower.gif" /></a> </div> <div style="display:none;"> <div var="returnedPurchaseSessionVoSet"> <div cols="" rows="">如果您的问题还没有解决,请回复管理员!</textarea></div><div name="applyId" value="${returnedPurchaseApplyVo.returnedPurchaseApplyId}"/> <div onclick="sendReply($(this))">回复给管理员</a></div> </div> </div> </c:forEach> <div id="sysUserId" value="${sysUser.sysUserId}"/> <div value="" type="text"/></div><div name="" cols="" rows="">如果您的问题还没有解决,请回复管理员!</textarea></div><div onclick="sendReturnedPurchaseApply()">提交退货申请</a></div> </div></div> </div>?