<%@ page language="java" contentType="text/html;charset=UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%@ taglib uri="/WEB-INF/tld/fns.tld" prefix="fns" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<link type="text/css" rel="stylesheet" href="<c:url value='/resources/version_new/css/public.css' />" />
<link type="text/css" rel="stylesheet" href="<c:url value='/resources/version_new/css/idangerous.swiper2.7.6.css' />" />
<link type="text/css" rel="stylesheet" href="<c:url value='/resources/version_new/css/basic.css' />" />
<link rel="stylesheet" href="<c:url value='/resources/versions-2.0.2/css/reset.css' />">
<link rel="stylesheet" href="<c:url value='/resources/versions-2.0.2/css/applicant.css' />">
<link rel="stylesheet" href="<c:url value='/resources/versions-2.0.2/css/laydate.css' />">
<link rel="stylesheet" href="<c:url value='/resources/versions-2.0.2/css/animate.min.css' />">

<div class="increased-styles redues-increased animated" style="display: block;top: 0;left: 0;margin-left: 0;">
	<div class="increased-cont">
		<h2>企业人员变动-员工离职，可在保单中减少相应的被保险人。</h2>
		<form id="minus_detail_list_form">
			<input type="hidden" name="ins_insurance_slip_id" value="${iprVo.ins_insurance_slip_id}">
			<input type="hidden" name="revise_type" value="2">
			<input type="hidden" name="sign" id="minus_sign" value="1"><%--0暂存，1提交--%>
			<div class="increased-time clearfix">
				<div class="time">
					<span>生效时间</span>
					<input title="生效时间" type="text" data-val="required" id="minus_inception_date" name="inception_date" onclick="laydate({elem:'#minus_inception_date',istime: true,istoday: false,min: '${min}',max: '${max}', format: 'YYYY-MM-DD'})">
				</div>
			</div>

			<div class="increased-table redues-table">
				<div class="increased-thead redues-thead">
					<ul class="clearfix">
						<li class="s1">
							<span>姓名</span>
						</li>
						<li class="s2">
							<span>证件类型</span>
						</li>
						<li class="s3">
							<span>证件号</span>
						</li>
						<li class="s4">
							<span>手机号</span>
						</li>
						<li class="s5">
							<span>工种</span>
						</li>
						<%--<li class="s6">
							<span>方案</span>
						</li>--%>
						<li class="s7">
							<span>性别</span>
						</li>
						<li class="s8">
							<span>出生日期</span>
						</li>
						<li class="s9">
							<span>操作</span>
						</li>
					</ul>
				</div>
				<div class="increased-tbody redues-tbody">
					<ul>
						<c:choose>
							<c:when test="${empty ipdVoList }">
								<li >
									<p >暂无记录！！</p>
								</li>
							</c:when>
							<c:otherwise>
								<c:forEach items="${ipdVoList }" var="ipdVo" varStatus="i">
									<li class="clearfix">
										<input name="insPreservationDetailVoList[${i.index}].business_id" type="hidden" value="${ipdVo.business_id}">
										<input name="insPreservationDetailVoList[${i.index}].business_type" type="hidden" value="${ipdVo.business_type}">
										<input name="insPreservationDetailVoList[${i.index}].prev_record_id" type="hidden" value="${ipdVo.prev_record_id}">
										<input name="insPreservationDetailVoList[${i.index}].prev_card" type="hidden" value="${ipdVo.prev_card}">
										<div class="w1">
											<span>
												${empty ipdVo.name ? '-' : ipdVo.name}
												<input name="insPreservationDetailVoList[${i.index}].name" type="hidden" value="${ipdVo.name}">
											</span>
										</div>
										<div class="w2">
											<span>
												<c:if test="${ipdVo.id_type eq '0'}">身份证</c:if>
												<c:if test="${ipdVo.id_type eq '3'}">护照</c:if>
												<c:if test="${ipdVo.id_type eq '4'}">台胞证</c:if>
												<c:if test="${ipdVo.id_type eq '5'}">回乡证</c:if>
												<input name="insPreservationDetailVoList[${i.index}].id_type" type="hidden" value="${ipdVo.id_type}">
											</span>
										</div>
										<div class="w3">
											<span>
												${empty ipdVo.id_card ? '-' : ipdVo.id_card}
												<input name="insPreservationDetailVoList[${i.index}].id_card" type="hidden" value="${ipdVo.id_card}">
											</span>
										</div>
										<div class="w4">
											<span>
												${empty ipdVo.tel ? '-' : ipdVo.tel}
												<input name="insPreservationDetailVoList[${i.index}].tel" type="hidden" value="${ipdVo.tel}">
											</span>
										</div>
										<div class="w5">
											<span>
												${ipdVo.career eq '1' ? '内勤人员' : ipdVo.career eq '2' ? '保安人员' : ipdVo.career eq '3' ? '武装押运人员' : ipdVo.career eq '4' ? '保洁人员' : '内勤人员'}
												<input name="insPreservationDetailVoList[${i.index}].career" type="hidden" value="${ipdVo.career eq '1' ? '1' : ipdVo.career eq '2' ? '2' : ipdVo.career eq '3' ? '3' : ipdVo.career eq '4' ? '4' : '1'}">
											</span>
										</div>
										<div class="w7">
											<span>
												${empty ipdVo.sex ? '-' : ipdVo.sex eq '1' ? '男' : '女'}
												<input name="insPreservationDetailVoList[${i.index}].sex" type="hidden" value="${ipdVo.sex}">
											</span>
										</div>
										<div class="w8">
											<span>
												${empty ipdVo.birthday ? '-' : ipdVo.birthday}
												<input name="insPreservationDetailVoList[${i.index}].birthday" type="hidden" value="${ipdVo.birthday}">
											</span>
										</div>
										<div class="w9">
											<%--<span class="shan" onclick="deleteUpdateDetail(this)">删除</span>--%>
											<span class="shan">-</span>
										</div>
									</li>
								</c:forEach>
							</c:otherwise>
						</c:choose>
					</ul>
				</div>

			</div>
		</form>
	</div>
	<div class="increased-foot">
		<%--<span class="incre-cancel">取消</span>--%>
		<span onclick="minus_save_preservation();" class="incre-confirm">确认减员</span>
	</div>
</div>
<script type="text/javascript" src="<c:url value='/resources/version_new/js/jquery-1.8.3.min.js' />"></script>
<script type="text/javascript" charset="utf-8" src="<c:url value='/resources/version_new/js/layer/layer.js' />"></script>
<script type="text/javascript" charset="utf-8" src="<c:url value='/resources/versions-2.0.2/js/laydate.js' />"></script>
<script type="text/javascript" charset="utf-8" src="<c:url value='/resources/versions-2.0.2/js/assure.js' />"></script>
<script type="text/javascript" charset="utf-8" src="<c:url value='/resources/commonJS/normalCheck.js' />"></script>
<script type="text/javascript" src="<c:url value='/resources/commonJS/validateIdent.js' />"></script>
<jsp:include page="../../../index/multi_init_param.jsp"/>
<script>
	var baseUrl = '${pageContext.request.contextPath }';
    function minus_save_preservation(){
        var index = layer.load(0, {shade: [0.3,'#808080']});
        var isT = 0;
        if($('#minus_inception_date').val() != ''){
            isT = 0;
        }else{
            layer.msg("请选择生效时间！");
            isT = 1;
        }
        if(isT == 0){
            $.ajax({
                type : 'POST',
                url : baseUrl + "/api/preservation/resultSet/minus_preservation_service",
                data : $("#minus_detail_list_form").serialize(),
                dataType : "json",
                success : function(data) {
                    if(data.statusCode == "200"){
                        layer.msg(data.message);
                        location.href = baseUrl + "/api/preservation/resultSet/openMessage";
                    }else{
                        layer.msg(data.message);
                    }
                    layer.close(index);
                },
                error: function(){
                    layer.close(index);
                }
            });
        }else{
            layer.close(index);
        }
    }
    $(function(){
        $('.redues-increased').parent().css("min-width","1100px");
        $('.redues-increased').parent().css("background","#FFF");
    });
</script>