<div title="加盟填表" data-options="closable:false" style="overflow:auto;padding:20px;"> <form action="${pageContext.request.contextPath}/pcTechnician/audit" name="myform" method="post" enctype="multipart/form-data"> <table width="776" border="0"> <tr valign="top" align="center"> <input type="hidden" name="bianhao" class="txt" value="${wxUser.wxUserName}" id="identifierIds"/> <td height="21" colspan="7"><span style="font-size:18px; font-weight:bold">加盟申请表</span></td> </tr> <tr> <td height="14" colspan="7" align="center"><span style="color:#CC9900">注:你的应聘信息将作为初审的重要条件,请你尽量把信息填写完整。谢谢!</span></td> </tr> <tr valign="bottom" align="center"> <td height="18" colspan="7"><span style="font-weight:bold">门店信息</span></td> </tr> <tr> <td colspan="7" align="center">(店铺加盟填写)</td> </tr> <tr> <td height="22" colspan="7" align="left"> <input name="wxyid" type="hidden" value="${wxWeixiuyuan.idwxWeixiuyuan}" readonly> 单位名称<input type="text" name="dwmc" id="dwmc" class="txt" value="${wxWeixiuyuan.wxWeixiuyuanGongshiname}" readonly/> 负责人<input type="text" name="fzr" id="fzr" value="${wxWeixiuyuan.wxWeixiuyuanGongshifuzeren}" class="txt"readonly/> 成立日期<input type="text" name="clrq" id="clrq" class="txt" value="${wxWeixiuyuan.wxWeixiuyuanChengliriqi}" onclick="return showCalendar('clrq', 'y-mm-dd');" readonly/> </td> </tr> <tr> <td height="26" colspan="7" align="left">营业执照编号 <input type="text" value="${wxWeixiuyuan.wxWeixiuyuanYingyezhizhao}" name="yyzzId" style="width:605px;" class="txt" readonly/> </td> </tr> <tr> <td height="24" colspan="7" align="left">负责人身份证 <input type="text" value="${wxWeixiuyuan.wxWeixiuyuanFuzerenId}" name="fzrId" style="width:605px;" class="txt" readonly/> </td> </tr> <tr> <td height="18" colspan="7" align="center" valign="bottom"><span style="font-weight:bold">技师信息</span></td> </tr> <tr> <td height="18" colspan="7" align="center" valign="top">(店铺、技师加盟均填写)</td> </tr> <tr> <td width="71" height="27" style="padding-left:20px;"><span style="color:red">*</span>姓名</td> <td colspan="5"><input value="${wxWeixiuyuan.wxWeixiuyuanUsername}" type="text" name="txtUser" id="txtUser" style="width:80px" class="txt" readonly /> 性别 男 <input type="radio" name="sex" value="男" <c:if test="${wxWeixiuyuan.wxWeixiuyuanSex=='男'}" >checked="checked"</c:if> readonly/> 女 <input type="radio" name="sex" value="女" <c:if test="${wxWeixiuyuan.wxWeixiuyuanSex=='女'}" >checked="checked"</c:if> readonly /> 民族 <input type="text" name="minzu" value="${wxWeixiuyuan.wxWeixiuyuanMingzhu}" style="width:80px" class="txt" readonly/> 接单日期 <input type="text" name="jdtime" value="${wxWeixiuyuan.wxWeixiuyuanJiedanriqi}" style="width:80px" id="jdtime" class="txt" onclick="return showCalendar('jdtime', 'y-mm-dd');" readonly/> </td> </tr> <tr> <td height="26"><span style="color:red">*</span>出生年月</td> <td colspan="5"><input type="text" value="${wxWeixiuyuan.wxWeixiuyuanBirthday}" name="dof" id="dof" style="width:80px" class="txt" onclick="return showCalendar('dof', 'y-mm-dd');" readonly/> 年龄<input type="text" value="${wxWeixiuyuan.wxWeixiuyuanAge}" name="age" id="age" style="width:80px;" class="txt" readonly/> <span style="color:red">*</span>身高 <input value="${wxWeixiuyuan.wxWeixiuyuanHeight}" type="text" name="shengao" style="width:80px" class="txt"readonly/></td> </tr> <tr> <td rowspan="3" align="center"><span style="color:red">*</span>联系方式</td> <td height="30" colspan="6" valign="bottom"> 手机号码: <input type="text" value="${wxWeixiuyuan.wxWeixiuyuanMobilephone}" name="phone" id="phone" class="txt" readonly> 固定电话: <input type="text" name="telpho" value="${wxWeixiuyuan.wxWeixiuyuanFixnumber}" id="telpho" style="width:240px;" class="txt" readonly/> </td> </tr> <tr> <td height="31" colspan="6" valign="bottom"> QQ: <input type="text" name="qq" class="txt" value="${wxWeixiuyuan.wxWeixiuyuanQq}" readonly> 邮箱地址: <input type="text" value="${wxWeixiuyuan.wxWeixiuyuanEmail}" name="Emial" id="Email" style="width:240px;" class="txt" readonly/> </td> </tr> <tr> <td height="25" colspan="6" valign="bottom"> 紧急联系人: <input type="text" name="lxr" id="lxr" class="txt" value="${wxWeixiuyuan.wxWeixiuyuanErgencyperson}" readonly> 紧急联系方式: <input type="text" name="lxrfs" id="lxrfs" value="${wxWeixiuyuan.wxWeixiuyuanErgencypersonnum}" style="width:240px;" class="txt" readonly/> </td> </tr> <tr> <td height="25" colspan="6" valign="bottom"> 推荐用户名: <input type="text" name="tjyhm" id="tjyhm" value="${wxWeixiuyuan.wxWeixiuyuanErgencypersonnum}" style="width:240px;" class="txt" readonly/> </td> </tr> <tr> <td height="24" align="center"><span style="color:red">*</span>户籍地址</td> <td colspan="6"><input type="text" name="hujidizhi" value="${wxWeixiuyuan.wxWeixiuyuanHujidizhi}" id="houadd" style="width:605px;" class="txt" readonly/></td> </tr> <tr> <td rowspan="2" align="center"><span style="color:red">*</span>驻点地址</td> <td height="15" colspan="6"> <input type="text" name="province" id="province" value="${wxWeixiuyuan.wxAddress.wxAddressProvince}" style="width:100px;" class="txt" readonly />省/市 <input type="text" name="city" id="city" value="${wxWeixiuyuan.wxAddress.wxAddressCity}" style="width:100px" class="txt" readonly/>地市 <input type="text" name="district" value="${wxWeixiuyuan.wxAddress.wxAddressDistrict}" id="area"style="width:100px" class="txt" readonly/>区/市、县 <input type="text" name="street" value="${wxWeixiuyuan.wxAddress.wxAddressDetailed}" id="street" style="width:100px" class="txt" readonly/>街/镇/路/号/房 </td> </tr> <tr> <td height="15" colspan="4"> 获取经纬度 <span style="float:right; padding-right:5px;"> <a href="http://api.map.baidu.com/lbsapi/getpoint/index.html" target="_blank"> <img src="${pageContext.request.contextPath}/style/images/ditu.png" /></a> </span> </td> <td width="153"><input type="text" name="jingweidu" value="${wxWeixiuyuan.wxWeixiuyuanJingdu},${wxWeixiuyuan.wxWeixiuyuanWeidu}" readonly/>将经纬度拷贝到这里</td> <td width="2"> </td> </tr> <tr> <td height="17" align="center"><span style="color:red">*</span>身份证号</td> <td colspan="6"><input type="text" value="${wxWeixiuyuan.wxWeixiuyuanShenfenzheng}" name="idcard" id="idcard" style="width:605px;" class="txt" readonly/></td> </tr> <tr> <td height="15" colspan="7" align="center"><span style="font-weight:bold; font-size:13px;">行业技术信息</span></td> </tr> <tr> <td height="15" align="center"><span style="color:red;">*</span>行业经验</td> <td colspan="6"><input type="text" value="${wxWeixiuyuan.wxWeixiuyuanHangyejingyan}" name="exp" id="exp" style="width:100px;" class="txt" readonly/> <select name="cjsbnw" id="cjsbnw" style="width:110px;"onfocus="this.defOpt=this.selectedIndex" onchange="this.selectedIndex=this.defOpt;"> <option>选择三包内外</option> <option <c:if test="${wxWeixiuyuan.wxWeixiuyuanCJsanbaoneiwai==1}">selected="selected" </c:if> value="1" >不限</option> <option <c:if test="${wxWeixiuyuan.wxWeixiuyuanCJsanbaoneiwai==2}">selected="selected" </c:if> value="2" >保内</option> <option <c:if test="${wxWeixiuyuan.wxWeixiuyuanCJsanbaoneiwai==3}">selected="selected" </c:if> value="3" >保外</option> </select> </td> </tr> <tr> <td colspan="7" align="center"><span style="font-weight:bold; font-size:13px;">选择维修项目、区域</span></td> </tr> <tr> <td rowspan="8" align="left"><span style="color:red">*</span>项目选择</td> </tr> <%--服务项目开始--%> <c:forEach items="${daleiAndxiaolei}" var="xm"> <tr> <td colspan="6"> ${xm.key}: <c:forEach items="${xm.value}" var="xiaolei"> ${xiaolei.wxFuwuxiaoleiName} <input type="checkbox" <c:forEach items="${xiangmu}" var="xm"> <c:if test="${xm==xiaolei.wxFuwuxiaoleiName}"> checked="checked" </c:if> </c:forEach> name="cb" value="${xiaolei.wxFuwuxiaoleiName}" readonly/> </c:forEach> </td> </tr> </c:forEach> <tr> <td colspan="7" align="center"><span style="font-weight:bold; font-size:13px;">维 修 专 长</span></td> </tr> <tr> <td colspan="7" style="padding-left:0px"> <textarea cols="90" rows="8" name="wxzc" class="txt" readonly>${wxWeixiuyuan.wxWeixiuyuanWeixiuzhuanchang}</textarea> </td> </tr> <tr> <td>身份证正面</td> <td colspan="6"><img src="../../style/images/${wxWeixiuyuan.wxWeixiuyuanTupian}" style="width: 150px; height: 150px; border:1px solid #e1e1e1;"></td> </tr> <tr> <td>身份证反面</td> <td colspan="6"><img src="../../style/images/${wxWeixiuyuan.wxWeixiuyuanTupian1}" style="width: 150px; height: 150px; border:1px solid #e1e1e1;"></td> </tr> <tr> <td height="40"> </td> <td width="173"> </td> <td width="68"> </td> <td width="102" valign="bottom"><input type="button" name="sub" value=" 审 核 " onclick="autid()" /></td> <td colspan="2"></td> <td> </td> </tr> </table> </form> </div>
function autid(){ var bianhao = document.getElementById("identifierIds").value; $.ajax({ type:"post", async:false, url:"${pageContext.request.contextPath}/pcTechnician/audit", dataType: "html",//兼容firefox下jquery ajax 返回 [object XMLDocument]处理 data:{ "bianhao":bianhao }, success:function(data){ alert(data); } }); }
@RequestMapping(value = "/audit",method = RequestMethod.POST) public void audit(String bianhao,PrintWriter printWriter){ if(bianhao != null && !bianhao.equals("")){ WxUser wxUser=userService.getUserByUsername(bianhao); if(wxUser.getWxUserUserType() == 0 && wxUser.getWxUserWeixiuyuanId() != null && !wxUser.getWxUserWeixiuyuanId().equals("")){//当用户状态是新建而且是技师 WxWeixiuyuan wxWeixiuyuan=weixiuyuanService.getById(wxUser.getWxUserWeixiuyuanId());//技师存在 if(wxWeixiuyuan != null){ wxUser.setWxUserUserType(1);//将用户状态改为在线 userService.updateUser(wxUser); printWriter.print("审核成功!"); return ; } } } printWriter.print("审核失败!原因可能是此人已经审核过了,或是停用,或是并非技师。"); }
关于object XMLDocument一开始采用此方法ServletActionContext.getResponse().setContentType("text/html;charset=UTF-8");可行,可后来却不知为何抛出空指针异常,最后在ajax中加入dataType: "html",就好了。