<%@ page language="java" errorPage="/error.jsp" pageEncoding="UTF-8"
	contentType="text/html; charset=UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<!DOCTYPE html>
<html>
<head>
<title>会员用户信息管理</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<!-- bootstrap 3.0.2 -->
<link href="<c:url value='/styles/lib/bootstrap.min.css'/>" rel="stylesheet" type="text/css" />
<link rel="stylesheet" href="${ctx }/styles/member/memberinfo.css?v=6.0">
<script src="${ctx }/scripts/lib/jquery-1.8.2.min.js"></script>
<script type="text/javascript"
	src="<c:url value='/scripts/loading/jquery.blockUI.js'/>"></script>
<script type="text/javascript"
	src="<c:url value='/scripts/loading/loading.js'/>"></script>
<script type="text/javascript">

$(function(){
	$("#selectrmk").bind("change",function(){
		var this_=$(this);
		var temp=$("#suggestion").val();
		$("#suggestion").val(temp+this_.val());
	});
});

function reviewOperate(status){
	var contextPath=$("#contextPath").val();
	var userId=$("#userId").val();
	var userName=$("#userName").val();
	var suggestion=$("#suggestion").val();
	if($.trim(suggestion).length>200){
		alert("审批说明不能超过200字.");
		return;
	}
	if(suggestion!=""&&suggestion.indexOf(";") >= 0){
		alert("包含特殊符号，请见英文;换成中文的");
		return;
	}
	
	$.ajax({
		url :contextPath+"/member/reviewOperate",
		type : "POST",
		data : {userId:userId,status:status,suggestion:suggestion,userName:userName},
		beforeSend: function(){
			showBlock();
		},
		success : function(data) {
			hideBlock();
			if("success"==data){
				alert("操作成功");
				window.close();
			}
			else{
				alert("处理失败，请稍后重试.");
			}
		},
		error : function(data) {
			hideBlock();
		}
	});
}
</script>
</head>
<body>
	<input type="hidden" value="${ctx}" id="contextPath">
	<input type="hidden" value="${model.id}" id="userId">
	
	<div class="title_Name"><h4><strong>企业人员审核</strong></h4></div>
	<div class="backgroundView">
		<hr>
		<div class="title"> 
			<label>姓名</label>
			<input type="text" style="width:290px;" id="userName" value="${model.userName }" >
		</div>
		<div class="title"> 
			<label>手机号</label>
			${model.userMobile }
		</div>
		<div class="title"> 
			<label>当前状态</label>
			<c:choose>
			<c:when test="${model.status=='0' }"><span style="color:red;">待审核</span></c:when>
			<c:when test="${model.status=='1' }">已认证</c:when>
			<c:when test="${model.status=='2' }">未认证</c:when>
			<c:otherwise></c:otherwise>
			</c:choose>
		</div>
		<div class="title"> 
			<label>详细信息</label>
			${organizationName }  ${virtualName }
		</div>
		<div class="title"> 
			<label>个人证件号</label>
			<c:choose>
			<c:when test="${!empty model.userCardNo }">
			${model.userCardNo }
			</c:when>
			<c:otherwise>
			暂无
			</c:otherwise>
			</c:choose>
		</div>
		<div class="title"> 
			<label>个人证件</label>
			<c:if test="${!empty model.imageUrl01 }">
				<a href="${imageServer }${model.imageUrl01 }" target="_blank"><img alt="" src="${imageServer }${model.imageUrl01 }" height="80px;"></a>
			</c:if>
			<c:if test="${!empty model.imageUrl02 }">
				<a href="${imageServer }${model.imageUrl02 }" target="_blank"><img alt="" src="${imageServer }${model.imageUrl02 }" height="80px;"></a>
			</c:if>
			<c:if test="${!empty model.imageUrl03 }">
				<a href="${imageServer }${model.imageUrl03 }" target="_blank"><img alt="" src="${imageServer }${model.imageUrl03 }" height="80px;"></a>
			</c:if>
		</div>
		
		<div class="title_Name" style="margin-top:80px"><strong>审批操作</strong></div>
		<hr>
		<div class="title"> 
			<label>审批说明</label>
			<select name="" id="selectrmk" class="selectrmk">
				<option value="">--请选择常用意见--</option>
				<option value="欢迎进入超级前台">欢迎进入超级前台</option>
				<option value="请填写实名认证信息或上传工牌，谢谢">请填写实名认证信息或上传工牌，谢谢</option>
			</select>
			<label></label>
			<textarea rows="4" cols="50" id="suggestion">${model.suggestion }</textarea>
		</div>
	</div>
	
	<div style="text-align: center;margin-top:10px;">
		<c:choose>
		<c:when test="${model.status=='0' || model.status=='' }">
			<a class="btn btn-primary" href="javascript:reviewOperate('1');" id='btn-save'>通过</a> 
			<a class="btn btn-danger" href="javascript:reviewOperate('2');" id='btn btn-danger'>不通过</a> 
		</c:when>
		<c:when test="${model.status=='1' }">
			<a class="btn btn-danger" href="javascript:reviewOperate('2');" id='btn btn-danger'>不通过</a> 
		</c:when>
		<c:when test="${model.status=='2' }">
			<a class="btn btn-primary" href="javascript:reviewOperate('1');" id='btn-save'>通过</a> 
		</c:when>
		<c:otherwise></c:otherwise>
		</c:choose>
		<a class="btn btn-back" href="javascript:window.close();">关闭</a>
	</div>
</body>
</html>