<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/include/taglib.jsp" %>
<!DOCTYPE html>
<html>
<head>
<title>编辑</title>
<%@ include file="/include/header.jsp"%>
<%@ include file="/include/zTree.jsp" %>
<script src="${ctx}/js/component/tree.js" type="text/javascript"></script>
<link type="text/css" rel="stylesheet" href="${ctx}/css/baseFrame.css" />
<style>
	.page a {
		color: #333;
	}
	input.page_input{
		border:1px solid #ddd;
	}
	.c_table td {
	    border: 1px solid #ddd;
	    padding: 0px 5px;
	}
	.t_c input {
	    background: #00B591;
	    border: none;
	    padding: 5px 10px;
	    border-radius: 3px;
	    color: #fff;
	}
	textarea {
	    padding: 5px;
	    margin-top: 5px;
	    border-radius: 3px;
	}
</style>
</head>
<body>
	<div>   <!-- class="dialog_main"-->
		<div class="b_box">
			<form id="sysUserForm" action="post">
				<input type="hidden" name="CSRFToken" value="${csrfToken}" />
				<input type="hidden" name="markUser" value="${markUser}" />
				<input type="hidden" name="markStatus" value="${markStatus}"/>
				<table class="c_table m_t10">
					<tr>
						<td class="t_tit" id="case_type" style="color:red"></td>
						<td title="${caseName}"><input style="width:95%" type="text" id="caseName" name="caseName" data-validaterole="caseName" data-rule="caseName" data-param='{"code" : "mmm","ml":20}' data-message='最大不能超过<!=ml!>' value="${caseName}" disabled="disabled" /></td>
					</tr>
					<tr>
						<td class="t_tit">申请说明</td>
						<td>
							<ul class="applyCon">
								<li data-option="I1001">
									<input type="checkbox" class="check_box" data-applycon="I1001,驾驶资格存疑">驾驶资格存疑
								</li>
								<li data-option="I1002">
									<input type="checkbox" class="check_box" data-applycon="I1002,酒驾、醉驾、毒驾">酒驾、醉驾、毒驾
								</li>
								<li data-option="I1003">
									<input type="checkbox" class="check_box" data-applycon="I1003,交通肇事逃逸、冒名顶替">交通肇事逃逸、冒名顶替
								</li>
								<li data-option="I1005">
									<input type="checkbox" class="check_box" data-applycon="I1005,故意制造事故">故意制造事故
								</li>
								<li data-option="I1006">
									<input type="checkbox" class="check_box" data-applycon="I1006,虚构保险标的">虚构保险标的
								</li>
								<li data-option="I1007">
									<input type="checkbox" class="check_box" data-applycon="I1007,扩大损失">扩大损失
								</li>
								<li data-option="I2002">
									<input type="checkbox" class="check_box" data-applycon="I2002,医疗事故及费用">医疗事故及费用
								</li>
								<li data-option="I2003">
									<input type="checkbox" class="check_box" data-applycon="I2003,护理标准">护理标准
								</li>
								<li data-option="I2004">
									<input type="checkbox" class="check_box" data-applycon="I2004,伤残等级">伤残等级
								</li>
								<li data-option="I3001">
									<input type="checkbox" class="check_box" data-applycon="I3001,个人信息真实性">个人信息真实性
								</li>
								<li data-option="I3002">
									<input type="checkbox" class="check_box" data-applycon="I3002,误工标准">误工标准
								</li>
								<li data-option="I3003">
									<input type="checkbox" class="check_box" data-applycon="I3003,被抚养人生活费情况">被抚养人生活费情况
								</li>
								<li data-option="F0003">
									<input type="checkbox" class="check_box" data-applycon="F0003,三责险翻倍出险时间核实">三责险翻倍出险时间核实
								</li>
							</ul>
						</td>
					</tr>
					<tr>
						<td class="t_tit">备注信息</td>
						<td><textarea id="markMess" style="width:95%;height:120px;" value="${markMess}">${markMess}</textarea></td>
					</tr>
				</table>		
			</form>
		</div>
		<div class="m_t10 t_c">
			<input type="button" class="b_btn" id="confrimSend" value="确定" />
		</div>
	</div>
	
	<script type="text/javascript">	
		$(function(){
			$(".close_btn").click(function(){
				checked_val="",markMess='';
			})
			var caseName=$("#caseName").val();
			$("#confrimSend").click(function(){
				var markUser=$("input[name='markUser']").val();
				
				var markMess=$("#markMess").val();
				var markStatus=$("input[name='markStatus']").val();
				var applyReasonList="";
				var str=new Date().getTime().toString();
				var id=str+Math.floor(Math.random()*1000);
				$(".applyCon .check_box").each(function(){
					if(this.checked){
						var applyCon=$(this).data("applycon");
						applyReasonList=applyReasonList+applyCon+";";
					}
				});
				
				if(applyReasonList.length==0){
					alert("请选择申请说明！");
					return;
				}
					$.ajax({
					type:"POST",
					data: {markUser:markUser,caseName:caseName,applyReasonList:applyReasonList,markMess:markMess,groupNo:id},
					url:"${ctx}/outService/againSendResearch.do",//请求接口
					success:function(result){
						if(result.status=="err"){
							alert(result.mess);
							return;
						}
						alert(result);
						if(result=="人工号分公司号与M6不匹配,无法发起调查"){
							parent.location.replace("${ctx}/outService/canSendM6.do?ts=" + new Date().getTime());
							return;
						}
						var str=result.substring(0,1);
						if(str==0){
							parent.location.replace("${ctx}/outService/backSendM6.do?ts=" + new Date().getTime());
						}else{
							parent.location.replace("${ctx}/outService/alreadySendM6.do?ts=" + new Date().getTime());
						}
							
					}
				})

				
				

			})
		});
	/*// 验证
	seajs.use(["component/validate", "component/tip"], function(validate, tip) {
		var ntip = function() {
			// 定义一个提示对象
			return new tip({});
		};

		// 定义一个验证对象
		var d = new validate({
			con: "#adminRankForm",
			// 验证容器
			ntip: ntip,
			onSubmit: "#confrimSend" // 提交按钮
		});

		// 设置拼装规则: 这里加上各个验证规则
		d.setValidateRule({ caseName: ["isBlank", "checkLen"] });
		d.setValidateRule({ 申请说明: ["isBlank", "checkLen"] });

	
		// 注册保存按钮事件
		d.bind("onsubmit", function() {
			if (confirm('确定提交？')) {
				// 序列化表单参数
				var serializedForm = $("#sysUserForm").serialize();
				$.post("${ctx}/sysUser/edit.do", serializedForm, function(result) {
					if ("succ" == result) {
						alert("操作成功");
						// 刷新列表页面
						parent.location.replace("${ctx}/sysPersonal/alreadySendM6.do?ts=" + new Date().getTime()); //如果发表成功则跳到列表界面 
						// 关闭弹窗窗口
						parent.sysUserDialog.close();
					} else if ("notThroughSecurityCheck" == result["isThroughSecurityCheck"]) { // 如果不通过安全检查
						var mess = result["mess"];
						$.post("${ctx}/common/notThroughSecurityCheck.do?ts=" + new Date().getTime(), mess, function(res) {
							alert(res);
						}, "json");

					} else {
						alert(result);
					}
				},
				"json");
			}
	
		});
	});*/
	</script>
</body>
</html>