<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>项目管理-进件申请</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <meta name="decorator" content="base"/>
    <link rel="stylesheet" href="${ctxPlugin}/lib/layuiAdmin/dist/layuiadmin/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="${ctxPlugin}/lib/layuiAdmin/dist/layuiadmin/style/admin.css" media="all">
    <link rel="stylesheet" href="${ctxPlugin}/static/css/reset.css" media="all">
    <style>
        html{ background: #FFF}

        .layui-input-block {
            margin-left: 148px;
        }

        .layui-form-label {
            width: 148px;
        }
        .title1 {
            border-left: 4px solid #1b6073;
            padding-left: 20px;
            font-size: 14px;
            margin: 10px auto;
            font-weight: 600;
            height: 34px;
            line-height: 34px;
            background-color: #f4f6f9;
            color: #666666;
        }
        .clearfix{*zoom:1;}
        .clearfix:before,.clearfix:after{display:table; line-height:0; content:"";}
        .clearfix:after{clear:both;}

        .operate-footer{
            z-index: 1;
        }
        .layui-elem-quote{
            margin-bottom: 10px;
        }
    </style>
</head>
<body>
<div class="aaa">
    <div class="layui-form " id="detailSet">
        <div class="layui-card-body  pt-20 h-350" action="" >
            <c:if test="${entry.applyStatus eq '3'}">
                <div style="color:#ff0000;">
                   进件审批驳回备注：${application.examineFailReason}
                </div>
            </c:if>

            <form class="clearfix" id="form1">
                <blockquote class="layui-elem-quote">基本信息</blockquote>

                <div class="layui-col-xs12 mb-5 pr-30">
                    <div class="layui-inline layui-col-xs4">
                        <label class="layui-form-label"><i class="red">*</i>租赁类型：</label>
                        <div class="layui-input-block">
                            <select name="leaseType" lay-verify="required" lay-filter="leaseType" >
                                <option value="">请选择</option>
                                <option value="0" <c:if test="${basic.leaseType eq '0'}" > selected</c:if>>融资租赁直租</option>
                                <option value="1" <c:if test="${basic.leaseType eq '1'}" > selected</c:if>>融资租赁回租</option>
                                <option value="2" <c:if test="${basic.leaseType eq '2'}" > selected</c:if>>经营租赁直租</option>
                            </select>
                        </div>
                    </div>
                    <div class="layui-inline layui-col-xs4">
                        <label class="layui-form-label"><i class="red">*</i>厂商：</label>
                        <div class="layui-input-block">
                            <input type="text"  name="manufacturer"  lay-verify="required" disabled  class="layui-input layui-disabled layui-bg-gray" value="能辉">
                        </div>
                    </div>
                    <div class="layui-inline layui-col-xs4">
                        <label class="layui-form-label"><i class="red">*</i>厂商登记注册号码：</label>
                        <div class="layui-input-block">
                            <input type="text"  name="manufacturerRegno"  lay-verify="required"  class="layui-input " value="${basic.manufacturerRegno}">
                        </div>
                    </div>
                </div>
                <div class="layui-col-xs12 mb-5 pr-30">
                    <div class="layui-inline layui-col-xs4">
                        <label class="layui-form-label"><i class="red">*</i>运维方登记注册号码：</label>
                        <div class="layui-input-block">
                            <input type="text"  name="factoryRegno"  lay-verify="required"  class="layui-input " value="${basic.factoryRegno}">
                        </div>
                    </div>
                    <div class="layui-inline layui-col-xs4">
                        <label class="layui-form-label"><i class="red">*</i>出卖人登记注册号码：</label>
                        <div class="layui-input-block">
                            <input type="text"  name="seller"  lay-verify="required"  class="layui-input " value="${basic.seller}">
                        </div>
                    </div>
                </div>
            </form>

            <form class="clearfix" id="form2">
                <blockquote class="layui-elem-quote">客户信息</blockquote>

                <div class="layui-col-xs12 mb-5 pr-30">
                    <div class="layui-inline layui-col-xs4">
                        <label class="layui-form-label "><i class="red">*</i>单位名称：</label>
                        <div class="layui-input-block">
                            <input type="text"  name="workCorp"  lay-verify="required"  class="layui-input" value="${perInfo.workCorp}">
                        </div>
                    </div>
                </div>
                <div class="layui-col-xs12 mb-5 pr-30">
                    <div class="layui-inline layui-col-xs4">
                        <label class="layui-form-label"><i class="red">*</i>职业：</label>
                        <div class="layui-input-block">
                            <select name="occupation" lay-verify="required">
                                <option value="">请选择</option>
                                <option value="0" <c:if test="${perInfo.occupation eq '0'}" > selected</c:if>>国家机关、党群组织、企业、事业单位负责人</option>
                                <option value="1" <c:if test="${perInfo.occupation eq '1'}" > selected</c:if>>专业技术人员</option>
                                <option value="3" <c:if test="${perInfo.occupation eq '3'}" > selected</c:if>>办事人员和有关人员</option>
                                <option value="4" <c:if test="${perInfo.occupation eq '4'}" > selected</c:if>>商业、服务业人员</option>
                                <option value="5" <c:if test="${perInfo.occupation eq '5'}" > selected</c:if>>农、林、牧、渔、水利业生产人员</option>
                                <option value="6" <c:if test="${perInfo.occupation eq '6'}" > selected</c:if>>生产、运输设备操作人员及有关人员</option>
                                <option value="X" <c:if test="${perInfo.occupation eq 'X'}" > selected</c:if>>军人</option>
                                <option value="Y" <c:if test="${perInfo.occupation eq 'Y'}" > selected</c:if>>不便分类的其他从业人员</option>
                                <option value="Z" <c:if test="${perInfo.occupation eq 'Z'}" > selected</c:if>>未知</option>
                            </select>
                        </div>
                    </div>
                    <div class="layui-inline layui-col-xs4">
                        <label class="layui-form-label"><i class="red">*</i>职务：</label>
                        <div class="layui-input-block">
                            <select name="headShip" lay-verify="required">
                                <option value="">请选择</option>
                                <option value="1" <c:if test="${perInfo.headShip eq '1'}" > selected</c:if>>高级领导（行政级别局级及局级以上领导或大公司高级管理人员）</option>
                                <option value="2" <c:if test="${perInfo.headShip eq '2'}" > selected</c:if>>中级领导（行政级别局级以下领导或大公司中级管理人员）</option>
                                <option value="3" <c:if test="${perInfo.headShip eq '3'}" > selected</c:if>>一般员工</option>
                                <option value="4" <c:if test="${perInfo.headShip eq '4'}" > selected</c:if>>其他</option>
                                <option value="9" <c:if test="${perInfo.headShip eq '9'}" > selected</c:if>>未知</option>
                            </select>
                        </div>
                    </div>
                    <div class="layui-inline layui-col-xs4">
                        <label class="layui-form-label"><i class="red">*</i>职称：</label>
                        <div class="layui-input-block">
                            <select name="position" lay-verify="required">
                                <option value="">请选择</option>
                                <option value="0" <c:if test="${perInfo.position eq '0'}" > selected</c:if>>无</option>
                                <option value="1" <c:if test="${perInfo.position eq '1'}" > selected</c:if>>高级</option>
                                <option value="2" <c:if test="${perInfo.position eq '2'}" > selected</c:if>>中级</option>
                                <option value="3" <c:if test="${perInfo.position eq '3'}" > selected</c:if>>初级</option>
                                <option value="9" <c:if test="${perInfo.position eq '9'}" > selected</c:if>>未知</option>
                            </select>
                        </div>
                    </div>
                </div>

                <div class="layui-col-xs12 mb-5 pr-30">
                    <div class="layui-inline layui-col-xs4">
                        <label class="layui-form-label"><i class="red">*</i>行业：</label>
                        <div class="layui-input-block">
                            <select name="industry" lay-verify="required">
                                <option value="929" selected>太阳能发电</option>
                            </select>
                        </div>
                    </div>
                    <div class="layui-inline layui-col-xs4">
                        <label class="layui-form-label"><i class="red">*</i>最高学位：</label>
                        <div class="layui-input-block">
                            <select name="eduDegree" lay-verify="required">
                                <option value="">请选择</option>
                                <option value="0" <c:if test="${perInfo.eduDegree eq '0'}" > selected</c:if>>其他</option>
                                <option value="1" <c:if test="${perInfo.eduDegree eq '1'}" > selected</c:if>>名誉博士</option>
                                <option value="2" <c:if test="${perInfo.eduDegree eq '2'}" > selected</c:if>>博士</option>
                                <option value="3" <c:if test="${perInfo.eduDegree eq '3'}" > selected</c:if>>硕士</option>
                                <option value="4" <c:if test="${perInfo.eduDegree eq '4'}" > selected</c:if>>学士</option>
                                <option value="9" <c:if test="${perInfo.eduDegree eq '9'}" > selected</c:if> >未知</option>
                            </select>
                        </div>
                    </div>
                    <div class="layui-inline layui-col-xs4">
                        <label class="layui-form-label"><i class="red">*</i>最高学历：</label>
                        <div class="layui-input-block">
                            <select name="eduExperience" lay-verify="required">
                                <option value="">请选择</option>
                                <option value="POST_GRADUATE_OR_HIGHER" <c:if test="${perInfo.eduExperience eq 'POST_GRADUATE_OR_HIGHER'}" > selected</c:if>>硕士或以上学位</option>
                                <option value="UNDERGRADUATE" <c:if test="${perInfo.eduExperience eq 'UNDERGRADUATE'}" > selected</c:if>>本科</option>
                                <option value="PROFESSIONAL_TRAINING" <c:if test="${perInfo.eduExperience eq 'PROFESSIONAL_TRAINING'}" > selected</c:if>>专科</option>
                                <option value="SENIOR" <c:if test="${perInfo.eduExperience eq 'SENIOR'}" > selected</c:if>>高中</option>
                                <option value="JUNIOR" <c:if test="${perInfo.eduExperience eq 'JUNIOR'}" > selected</c:if>>初中</option>
                                <option value="PRIMARY" <c:if test="${perInfo.eduExperience eq 'PRIMARY'}" > selected</c:if>>小学</option>
                            </select>
                        </div>
                    </div>
                </div>
                <div class="layui-col-xs12 mb-5 pr-30">
                    <div class="layui-inline layui-col-xs4">
                        <label class="layui-form-label">自有房产情况：</label>
                        <div class="layui-input-block">
                            <select name="houseProperty" >
                                <option value="">请选择</option>
                                <option value="0" <c:if test="${perInfo.houseProperty eq '0'}" > selected</c:if>>无自有房产</option>
                                <option value="1" <c:if test="${perInfo.houseProperty eq '1'}" > selected</c:if>>自置</option>
                                <option value="2" <c:if test="${perInfo.houseProperty eq '2'}" > selected</c:if>>按揭</option>
                                <option value="3" <c:if test="${perInfo.houseProperty eq '3'}" > selected</c:if>>亲属楼宇</option>
                                <option value="4" <c:if test="${perInfo.houseProperty eq '4'}" > selected</c:if>>集体宿舍</option>
                                <option value="5" <c:if test="${perInfo.houseProperty eq '5'}" > selected</c:if>>租房</option>
                                <option value="6" <c:if test="${perInfo.houseProperty eq '6'}" > selected</c:if>>共有住宅</option>
                                <option value="7" <c:if test="${perInfo.houseProperty eq '7'}" > selected</c:if>>其他</option>
                                <option value="9" <c:if test="${perInfo.houseProperty eq '9'}" > selected</c:if>>未知</option>
                            </select>
                        </div>
                    </div>

                    <div class="layui-inline layui-col-xs4">
                        <label class="layui-form-label"><i class="red">*</i>居住情况：</label>
                        <div class="layui-input-block">
                           <select name="familyStatus" lay-verify="required">
                               <option value="">请选择</option>
                               <option value="1" <c:if test="${perInfo.familyStatus eq '1'}" > selected</c:if>>自置</option>
                               <option value="2" <c:if test="${perInfo.familyStatus eq '2'}" > selected</c:if>>按揭</option>
                               <option value="3" <c:if test="${perInfo.familyStatus eq '3'}" > selected</c:if>>亲属楼宇</option>
                               <option value="4" <c:if test="${perInfo.familyStatus eq '4'}" > selected</c:if>>集体宿舍</option>
                               <option value="5" <c:if test="${perInfo.familyStatus eq '5'}" > selected</c:if>>租房</option>
                               <option value="6" <c:if test="${perInfo.familyStatus eq '6'}" > selected</c:if>>共有住宅</option>
                               <option value="7" <c:if test="${perInfo.familyStatus eq '7'}" > selected</c:if>>其他</option>
                               <option value="9" <c:if test="${perInfo.familyStatus eq '9'}" > selected</c:if>>未知</option>
                           </select>
                        </div>
                    </div>
                </div>
                <div class="layui-col-xs12 mb-5 pr-30">
                    <div class="layui-inline layui-col-xs4">
                        <label class="layui-form-label"><i class="red">*</i>客户类型：</label>
                        <div class="layui-input-block">
                            <select name="superviseClientType" lay-verify="required">
                                <option value="">请选择</option>
                                <option value="01" <c:if test="${perInfo.superviseClientType eq '01'}" > selected</c:if>>个体工商户</option>
                                <option value="02" <c:if test="${perInfo.superviseClientType eq '02'}" > selected</c:if>>小企业主</option>
                                <option value="03" <c:if test="${perInfo.superviseClientType eq '03'}" > selected</c:if> <c:if test="${empty perInfo.superviseClientType}" > selected</c:if> >其他</option>
                            </select>
                        </div>
                    </div>
                    <div class="layui-inline layui-col-xs4">
                        <label class="layui-form-label"><i class="red">*</i>业务品种：</label>
                        <div class="layui-input-block">
                           <select name="superviseBizType" lay-verify="required">
                               <option value="01" selected>个人经营性</option>
                           </select>

                        </div>
                    </div>
                    <div class="layui-inline layui-col-xs4">
                        <label class="layui-form-label"><i class="red">*</i>婚姻状况：</label>
                        <div class="layui-input-block">
                            <select name="marriageInfo" lay-verify="required">
                                <option value="">请选择</option>
                                <option value="UNMARRIED" <c:if test="${perInfo.marriageInfo eq 'UNMARRIED'}" > selected</c:if>>未婚</option>
                                <option value="MARRIED" <c:if test="${perInfo.marriageInfo eq 'MARRIED'}" > selected</c:if>>已婚</option>
                                <option value="DIVORCED" <c:if test="${perInfo.marriageInfo eq 'DIVORCED'}" > selected</c:if>>离婚</option>
                                <option value="WIDOWED" <c:if test="${perInfo.marriageInfo eq 'WIDOWED'}" > selected</c:if>>丧偶</option>
                                <option value="OTHER" <c:if test="${perInfo.marriageInfo eq 'OTHER'}" > selected</c:if> <c:if test="${empty perInfo.marriageInfo }" > selected</c:if>>其他</option>
                            </select>
                        </div>
                    </div>
                </div>

                <div class="layui-col-xs12 mb-5 pr-30">

                    <div class="layui-inline layui-col-xs4">
                        <label class="layui-form-label">配偶性别：</label>
                        <div class="layui-input-block">
                            <select name="spouseSex" >
                                <option value="">请选择</option>
                                <option value="MALE" <c:if test="${perInfo.spouseSex eq 'MALE'}" > selected</c:if>>女</option>
                                <option value="FEMALE" <c:if test="${perInfo.spouseSex eq 'FEMALE'}" > selected</c:if>>男</option>
                                <option value="UNKNOW" <c:if test="${perInfo.spouseSex eq 'UNKNOW'}" > selected</c:if>>未知</option>
                            </select>
                        </div>
                    </div>

                    <div class="layui-inline layui-col-xs4">
                        <label class="layui-form-label">配偶姓名：</label>
                        <div class="layui-input-block">
                            <input type="text"  name="partnerNameSpan"  autocomplete="off"  class="layui-input" value="${perInfo.partnerNameSpan}">
                        </div>
                    </div>
                </div>

                <div class="layui-col-xs12 mb-5 pr-30">
                    <div class="layui-inline layui-col-xs4">
                        <label class="layui-form-label">配偶证件类型：</label>
                        <div class="layui-input-block">
                            <select name="spouseIdCardType" >
                                <option value="">请选择</option>
                                <option value="0" <c:if test="${perInfo.spouseIdCardType eq '0'}" > selected</c:if>>身份证</option>
                                <option value="1" <c:if test="${perInfo.spouseIdCardType eq '1'}" > selected</c:if>>护照</option>
                                <option value="2" <c:if test="${perInfo.spouseIdCardType eq '2'}" > selected</c:if>>军官证</option>
                                <option value="3" <c:if test="${perInfo.spouseIdCardType eq '3'}" > selected</c:if>>户口簿</option>
                                <option value="4" <c:if test="${perInfo.spouseIdCardType eq '4'}" > selected</c:if>>士兵证</option>
                                <option value="5" <c:if test="${perInfo.spouseIdCardType eq '5'}" > selected</c:if>>警官证</option>
                                <option value="6" <c:if test="${perInfo.spouseIdCardType eq '6'}" > selected</c:if>>台湾同胞来往内地通行证</option>
                                <option value="7" <c:if test="${perInfo.spouseIdCardType eq '7'}" > selected</c:if>>港澳居民来往内地通行证</option>
                                <option value="8" <c:if test="${perInfo.spouseIdCardType eq '8'}" > selected</c:if>>外国人居住证</option>
                                <option value="9" <c:if test="${perInfo.spouseIdCardType eq '9'}" > selected</c:if>>临时身份证</option>
                                <option value="10" <c:if test="${perInfo.spouseIdCardType eq '10'}" > selected</c:if>>其他证件</option>
                            </select>
                        </div>
                    </div>

                    <div class="layui-inline layui-col-xs4">
                        <label class="layui-form-label">配偶证件号码：</label>
                        <div class="layui-input-block">
                            <input type="text"  name="spouseIdCardNo" lay-verify="idCord"  class="layui-input" value="${perInfo.spouseIdCardNo}">
                        </div>
                    </div>
                </div>

                <div class="layui-col-xs12 mb-5 pr-30">
                    <div class="layui-inline layui-col-xs4">
                        <label class="layui-form-label"><i class="red">*</i>客户开户行：</label>
                        <div class="layui-input-block">
                            <input type="text"  name="payBankName"  lay-verify="required"  class="layui-input" value="${perInfo.payBankName}">
                        </div>
                    </div>
                    <div class="layui-inline layui-col-xs4">
                        <label class="layui-form-label"><i class="red">*</i>客户银行账号：</label>
                        <div class="layui-input-block">
                            <input type="text"  name="payAccountNo"  lay-verify="required"  class="layui-input" value="${perInfo.payAccountNo}" onkeyup="this.value=this.value.replace(/[^0-9-]+/,'');">
                        </div>
                    </div>
                </div>
            </form>

            <form class="clearfix" id="form4">
                <blockquote class="layui-elem-quote">设备清单</blockquote>

                <div class="layui-col-xs12 mb-5 pr-30">
                    <div class="layui-inline layui-col-xs4">
                        <label class="layui-form-label"><i class="red">*</i>租赁物名称：</label>
                        <div class="layui-input-block">
                            <input type="text"  name="fullName"  lay-verify="required"  class="layui-input" value="${leaseItem.fullName}">
                        </div>
                    </div>
                    <div class="layui-inline layui-col-xs4">
                        <label class="layui-form-label"><i class="red">*</i>逆变器生产商：</label>
                        <div class="layui-input-block">
                            <input type="text"  name="producer"  lay-verify="required"  class="layui-input" value="${leaseItem.producer}">
                        </div>
                    </div>
                    <div class="layui-inline layui-col-xs4">
                        <label class="layui-form-label"><i class="red">*</i>规格：</label>
                        <div class="layui-input-block">
                            <input type="text"  name="productModel"  lay-verify="required"  class="layui-input" value="${leaseItem.productModel}">
                        </div>
                    </div>

                </div>

                <div class="layui-col-xs12 mb-5 pr-30 ">
                    <div class="layui-inline layui-col-xs4">
                        <label class="layui-form-label"><i class="red">*</i>装机容量：</label>
                        <div class="layui-input-block">
                            <input type="text"  name="installedCapacity"  class="layui-input" value="${leaseItem.installedCapacity}">
                            <span class="pos-a h-32 lh-32 layui-span-unit">W</span>
                        </div>
                    </div>
                    <div class="layui-inline layui-col-xs4">
                        <label class="layui-form-label"><i class="red">*</i>组件生产商：</label>
                        <div class="layui-input-block">
                            <input type="text"  name="moduleProducer"  class="layui-input" value="${leaseItem.moduleProducer}">
                        </div>
                    </div>
                    <div class="layui-inline layui-col-xs4">
                        <label class="layui-form-label"><i class="red">*</i>逆变器编号：</label>
                        <div class="layui-input-block">
                            <input type="text"  name="inverterNumber"  class="layui-input" value="${leaseItem.inverterNumber}">
                        </div>
                    </div>
                </div>
                <div class="layui-col-xs12 mb-5 pr-30 ">
                    <div class="layui-inline layui-col-xs4">
                        <label class="layui-form-label"><i class="red">*</i>逆变器品牌：</label>
                        <div class="layui-input-block">
                            <input type="text"  name="inverterBrand"  class="layui-input" value="${leaseItem.inverterBrand}">
                        </div>
                    </div>
                    <div class="layui-inline layui-col-xs4">
                        <label class="layui-form-label"><i class="red">*</i>逆变器型号：</label>
                        <div class="layui-input-block">
                            <input type="text"  name="inverterModel"  class="layui-input" value="${leaseItem.inverterModel}">
                        </div>
                    </div>
                    <div class="layui-inline layui-col-xs4">
                        <label class="layui-form-label"><i class="red">*</i>组件数量：</label>
                        <div class="layui-input-block">
                            <input type="text"  name="moduleQuantity" lay-verify="required"  class="layui-input" value="${leaseItem.moduleQuantity}" onkeyup="this.value=this.value.replace(/\D/g,'')">
                            <span class="pos-a h-32 lh-32 layui-span-unit">块</span>
                        </div>
                    </div>
                </div>

                <div class="layui-col-xs12 mb-10 pr-30">
                    <label class="layui-form-label w-130"><i class="red">*</i>购售地址：</label>
                    <div class="layui-input-block ml-130">
                        <div class="layui-col-xs2 pr-10">
                            <select class="province" id="province" name="electricProvince" lay-filter="province" lay-search lay-verify="required">
                                <option value="">请选择省</option>
                                <c:forEach items="${province}" var="pro">
                                    <option value="${pro.columns.ProvinceName}" title="${pro.columns.ProvinceID}" <c:if test="${leaseItem.electricProvince == pro.columns.ProvinceName }">selected</c:if>>${pro.columns.ProvinceName}</option>
                                </c:forEach>
                            </select>
                        </div>
                        <div class="layui-col-xs2 pr-10">
                            <select class="city" name="electricCity" id="city" lay-filter="city" lay-search lay-verify="required">
                                <option value="">请选择市</option>
                                <c:forEach items="${city}" var="cityList">
                                    <option value="${cityList.columns.CityName}" title="${cityList.columns.CityID}" <c:if test="${leaseItem.electricCity == cityList.columns.CityName}">selected</c:if>>${cityList.columns.CityName}</option>
                                </c:forEach>
                            </select>
                        </div>
                        <div class="layui-col-xs2 pr-10">
                            <select class="area" name="electricArea" id="area" lay-filter="area" lay-search lay-verify="required">
                                <option value="">请选择县/区</option>
                                <c:forEach items="${area}" var="areaList">
                                    <option value="${areaList.columns.DistrictName}" <c:if test="${leaseItem.electricArea == areaList.columns.DistrictName}">selected</c:if>>${areaList.columns.DistrictName}</option>
                                </c:forEach>
                            </select>
                        </div>
                        <div class="layui-col-xs6">
                            <input type="text" name="electricAddress" class="layui-input layui-col-lg2"
                                   value="${leaseItem.electricAddress}" placeholder="详细地址">
                        </div>
                    </div>
                </div>
            </form>
        </div>
        <div style="height: 70px;"></div>
        <div class="layui-form-item operate-footer" style="text-align: center;">
            <input type="button" lay-filter="temp" id="temp" class="layui-btn" value="暂存">
            <input type="button" lay-submit lay-filter="confirm" id="confirm" class="layui-btn " value="提交">
            <input type="button"   value="取消" class="layui-btn layui-btn-primary " lay onclick="closeDiv();" >
        </div>
    </div>
</div>

<script src="${ctxPlugin}/lib/layuiAdmin/dist/layuiadmin/layui/layui.js"></script>
<script>
    var entryId='${entryId}';

    var idCordReq = /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/;
    //初始数据
    layui.config({
        base: '${ctxPlugin}/lib/layuiAdmin/dist/layuiadmin/' //静态资源所在路径
    }).extend({
        index: 'lib/index' //主入口模块
    }).use(['form', 'table', 'upload', 'jquery','laydate','upload'], function () {
        $ = layui.$
        ,form = layui.form
        ,laydate = layui.laydate;
        var  upload = layui.upload;

        upload.render({
            elem: '#uploaderone1' //绑定元素
            , url: '${ctx}/common/uploadFile2' //上传接口
            ,before: function(obj){
                //预读本地文件示例，不支持ie8
                obj.preview(function (index, file, result) {
                });
            }
            , done: function (res) {
                //上传完毕回调
                addImg(res.path,"uploaderone1","imgsDiv1","idCardFrontImg");
            }
            , error: function () {
                //请求异常回调
            }
        });

        upload.render({
            elem: '#uploaderone2' //绑定元素
            , url: '${ctx}/common/uploadFile2' //上传接口
            ,before: function(obj){
                //预读本地文件示例，不支持ie8
                obj.preview(function (index, file, result) {
                });
            }
            , done: function (res) {
                //上传完毕回调
                addImg(res.path,"uploaderone2","imgsDiv2","idCardBackImg");
            }
            , error: function () {
                //请求异常回调
            }
        });

        upload.render({
            elem: '#uploaderone3' //绑定元素
            , url: '${ctx}/common/uploadFile2' //上传接口
            ,before: function(obj){
                //预读本地文件示例，不支持ie8
                obj.preview(function (index, file, result) {
                });
            }
            , done: function (res) {
                //上传完毕回调
                addImg(res.path,"uploaderone3","imgsDiv3","housePropertyImg");
            }
            , error: function () {
                //请求异常回调
            }
        });

        upload.render({
            elem: '#uploaderone4' //绑定元素
            , url: '${ctx}/common/uploadFile2' //上传接口
            ,before: function(obj){
                //预读本地文件示例，不支持ie8
                obj.preview(function (index, file, result) {
                });
            }
            , done: function (res) {
                //上传完毕回调
                addImg(res.path,"uploaderone4","imgsDiv4","residenceFrontImg");
            }
            , error: function () {
                //请求异常回调
            }
        });

        upload.render({
            elem: '#uploaderone5' //绑定元素
            , url: '${ctx}/common/uploadFile2' //上传接口
            ,before: function(obj){
                //预读本地文件示例，不支持ie8
                obj.preview(function (index, file, result) {
                });
            }
            , done: function (res) {
                //上传完毕回调
                addImg(res.path,"uploaderone5","imgsDiv5","residenceBackImg");
            }
            , error: function () {
                //请求异常回调
            }
        });

        upload.render({
            elem: '#uploaderone6' //绑定元素
            , url: '${ctx}/common/uploadFile2' //上传接口
            ,before: function(obj){
                //预读本地文件示例，不支持ie8
                obj.preview(function (index, file, result) {
                });
            }
            , done: function (res) {
                //上传完毕回调
                addImg(res.path,"uploaderone6","imgsDiv6","accountCardImg");
            }
            , error: function () {
                //请求异常回调
            }
        });



        function addImg(data,id,imgsDiv,classimg){
            $("#"+id).hide();
            var html = '<div class="bj-img imgSpan"><span class="layui-icon-close layui-icon" onclick="delImg(this,\''+id+'\')"></span>';
            html += '<img src="${commonStaticImgPath}'+data+'" height="700" width="1200"/>';
            html += '<input type="hidden" class="'+classimg+'" name="'+classimg+'" value="'+data+'"/> </div>';
            $("#"+imgsDiv).append(html);
           /* //图片查看效果
            viewer.update();*/
        }

        laydate.render({
            elem: '#insuranceDateFrom'
            ,trigger: 'click'
            ,format:"yyyyMMdd"
        });

        laydate.render({
            elem: '#insuranceDateTo'
            ,trigger: 'click'
            ,format:"yyyyMMdd"
        });



        form.verify({
            loginName:function(value,item){
                if(!$.trim(value)){
                    return "登录账号不能为空,请输入登录账号！";
                }
                if($.trim(value).length<4){
                    return "登录账号不得小于4位,请重新输入！";
                }
                if($.trim(value).length>12){
                    return "登录账号不得大于12位,请重新输入！";
                }
            },

            telephone:function(value,item){
                if(!$.trim(value)){
                    return "手机号码不能为空,请输入手机号码后保存！";
                }
                if(!myreg.test($.trim(value))){
                    return "请输入正确的手机号码后保存！";
                }
            },

            idCord:function(value,item){
                if(!isBlank(value) &&　! idCordReq.test($.trim(value))){
                    return "配偶证件号码格式不正确";
                }
            }

        });


        form.on('select(leaseType)', function(data){
            var leaseType = $(data.elem).find("option:selected").val();
            if(leaseType=='2' || leaseType=='3'){
                $("#leaseScheme").val('2022081900002-1-2');
                $("#seller").val('能辉科技有限公司');
                $("#venderModelFlag").val('N');
                $("#graceType").val('10');
                $(".financingAmount").hide();
            }else{
                $("#leaseScheme").val('2022081900002-1-1');
                $("#venderModelFlag").val('Y');
                $("#graceType").val('60');

                $(".financingAmount").show();
            }
            form.render('select');

        });

        form.on('select(province)', function (data) {
            var province = $(data.elem).find("option:selected").attr("title");
            $("#city").empty();
            if (isBlank(province)) {
                $("#city").append("<option value=''>请选择市</option>");
                return "";
            }
            $.ajax({
                type: "POST",
                url: "${ctx}/main/redirect/getCitysByProId",
                data: {
                    province: province
                },
                success: function (result) {
                    if (result == "205") {
                        layer.msg("暂无数据!")
                        return
                    }
                    var html = "";
                    for (var i = 0; i < result.length; i++) {
                        var city = result[i];
                        html = html + '<option value="' + city.columns.CityName + '" title="' + city.columns.CityID + '">' + city.columns.CityName + '</option>';
                    }
                    $("#city").append(html);
                    form.render('select');
                },
                complete: function () {
                    var city = $("#city").find("option:selected").attr("title");
                    $("#area").empty()
                    if (isBlank(city)) {
                        $("#area").append("<option value=''>请选择县/区</option>");
                        return "";
                    }
                    $.ajax({
                        type: "POST",
                        url: "${ctx}/main/redirect/getAreaByCityId",
                        data: {
                            city: city
                        },
                        success: function (result) {
                            if (result == "205") {
                                layer.msg("暂无数据!")
                                return
                            }
                            var html = "";
                            for (var i = 0; i < result.length; i++) {
                                var area = result[i];
                                html = html + '<option value="' + area.columns.DistrictName + '" >' + area.columns.DistrictName + '</option>';
                            }
                            $("#area").append(html);
                            form.render('select');
                        }
                    });
                }

            });

        });

        form.on('select(city)', function (data) {
            var city = $(data.elem).find("option:selected").attr("title");
            $("#area").empty();
            if (isBlank(city)) {
                $("#area").append("<option value=''>请选择县/区</option>");
                return "";
            }
            $.ajax({
                type: "POST",
                url: "${ctx}/main/redirect/getAreaByCityId",
                data: {
                    city: city
                },
                success: function (result) {
                    if (result == "205") {
                        layer.msg("暂无数据!")
                        return
                    }
                    var html = "";
                    for (var i = 0; i < result.length; i++) {
                        var area = result[i];
                        html = html + '<option value="' + area.columns.DistrictName + '" >' + area.columns.DistrictName + '</option>';
                    }
                    $("#area").append(html);
                    form.render('select');
                }
            });
        });

        var saveFlag=false;
        form.on('submit(confirm)', function(data){
            if(saveFlag){
                return false;
            }
            var date1={};
            $($("#form1").serializeArray()).each(function(){
                date1[this.name] = this.value;
            });
            var date2={}
            $($("#form2").serializeArray()).each(function(){
                date2[this.name] = this.value;
            });

            var date4={};
            $($("#form4").serializeArray()).each(function(){
                date4[this.name] = this.value;
            });

            var date={
                entryId:entryId,
                resultType:1,
                applicationBasic:date1,
                perInfo:date2,
                leaseItem:date4,
            }
            console.log(date);

            saveFlag=true;

            $.ajax({
                url:'${ctx}/customerEntryExtra/addIncomingApplication',
                method:'post',
                contentType : "application/json;charsetset=UTF-8",
                data:JSON.stringify(date),
                success:function(res){
                    console.log(res);
                    if(res.code=="200"){
                        parent.layer.msg("保存成功",{time:1000});
                        closeDiv();
                        parent.table.reload('test');
                    }else{
                        layer.msg(res.errMsg,{time:1000},function(){
                            saveFlag=false;
                        });
                    }
                },
                complete:function (data) {
                }
            }) ;
        });

        var saveFlag1=false;
        $("#temp").click(function(){
            if(saveFlag1){
                return false;
            }
            var zip1=$("input[name=familyZip]").val();
            var zip2=$("input[name=mailingZip]").val();

            if($.trim(zip1).length>6){
                layer.msg("家庭地址邮政编码不得大于6位,请重新输入！");

                return false;
            }

            if($.trim(zip2).length>6){
                layer.msg( "通讯地址邮政编码不得大于6位,请重新输入！");
                return false;
            }

            var date1={};
            $($("#form1").serializeArray()).each(function(){
                date1[this.name] = this.value;
            });
            var date2={}
            $($("#form2").serializeArray()).each(function(){
                date2[this.name] = this.value;
            });

            var date4={};
            $($("#form4").serializeArray()).each(function(){
                date4[this.name] = this.value;
            });

            var date={
                entryId:entryId,
                resultType:0,
                applicationBasic:date1,
                perInfo:date2,
                leaseItem:date4,
            }
            console.log(date);
            saveFlag1=true;
            $.ajax({
                url:'${ctx}/customerEntryExtra/addIncomingApplication',
                method:'post',
                contentType : "application/json;charsetset=UTF-8",
                data:JSON.stringify(date),
                success:function(res){
                    console.log(res);
                    if(res.code=="200"){
                        parent.layer.msg("保存成功",{time:1000});
                        closeDiv();
                        parent.table.reload('test');
                    }else{
                        layer.msg(res.errMsg,{time:1000},function(){
                            saveFlag1=false;
                        });
                    }
                },
                complete:function (data) {

                }
            }) ;
        })

    })

    function  closeDiv() {
        var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
        parent.layer.close(index);
    }

    function isBlank(val) {
        if (val == null || val == '' || val == undefined) {
            return true;
        }
        return false;
    }


    function delImg(that,id){
        $("#"+id).show();
        $(that).parent().remove();
    }

</script>
</body>
</html>

