<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp" %>
<!DOCTYPE HTML>
<html>
<head>
  <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">
  <link rel="stylesheet" href="${ctxPlugin}/lib/layuiAdmin/dist/layuiadmin/dist/viewer.css" media="all">
  <style>
    html {
      background-color: #fff;
      padding-bottom: 50px;
    }

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

    .layui-form-label {
      width: 110px;
    }

    input[type="radio"]:disabled, textarea:disabled, .layui-disabled {
      background-color: #ffffff;
    }

    .layui-select-title .layui-disabled{
      background-color: #eee !important;
    }

    .img-box2 > div {
      margin-right: -4px;
    }
  </style>
</head>
<body>
<div class="layui-form">
  <div class="layui-card">
    <div class="layui-card-body layui-col-xs12" id="LAY_app">
      <div class="layui-card">
        <blockquote class="layui-elem-quote">项目信息</blockquote>
        <div class="layui-card-body">
          <div class="layui-row layui-col-space12 layui-form-item">
            <div class="layui-col-lg3 layui-col-sm3">
              <label class="layui-form-label"><i class="mark">*</i>电站编码：</label>
              <div class="layui-input-block">
                <input type="text" id="powerStationCode" class="layui-input layui-bg-gray" value="${entry.powerStationCode}" disabled>
              </div>
            </div>
            <div class="layui-col-lg3 layui-col-sm3">
              <label class="layui-form-label">代理商：</label>
              <div class="layui-input-block">
                <input type="text" disabled class="layui-input " value="${entry.traderName}">
              </div>
            </div>
            <div class="layui-col-lg3 layui-col-sm3">
              <label class="layui-form-label">业务员：</label>
              <div class="layui-input-block">
                <input type="text" disabled class="layui-input " value="${entry.creator}">
              </div>
            </div>
          </div>
          <div class="layui-row layui-col-space12 layui-form-item">
            <div class="layui-col-lg3 layui-col-sm3">
              <label class="layui-form-label">电站状态：</label>
              <div class="layui-input-block">
                <input type="text" disabled class="layui-input"
                <c:choose>
                <c:when test="${entry.status eq '0'}">
                       <c:if test="${entry.credit eq '0'}">value="暂存"</c:if>
                       <c:if test="${entry.credit eq '1'}">value="待预审"</c:if>
                       <c:if test="${entry.credit eq '2'}">value="预审待审批"</c:if>
                       <c:if test="${entry.credit eq '3'}">value="预审审批中"</c:if>
                       <c:if test="${entry.credit eq '4' && entry.designAuditFlag eq '3'}">value="自审驳回"</c:if>
                       <c:if test="${entry.credit eq '4' && entry.designAuditFlag eq 'a'}">value="待设计"</c:if>
                       <c:if test="${entry.credit eq '4' && entry.designAuditFlag ne '3' && entry.designAuditFlag ne 'a'}">value="待踏勘"</c:if>
                       <c:if test="${entry.credit eq '5'}">value="预审拒绝"</c:if>
                </c:when>
                <c:when test="${entry.status eq '1'}">
                       <c:if test="${entry.designAuditFlag eq '1'}">value="待踏勘"</c:if>
                       <c:if test="${entry.designAuditFlag eq 'a'}">value="待设计"</c:if>
                       <c:if test="${entry.designAuditFlag eq '2'}">value="待自审"</c:if>
                       <c:if test="${entry.designAuditFlag eq '3'}">value="自审驳回"</c:if>
                       <c:if test="${entry.designAuditFlag eq '4'}">value="自审通过"</c:if>
                       <c:if test="${entry.designAuditFlag eq '5'}">value="设计审核驳回"</c:if>
                       <c:if test="${entry.designAuditFlag eq '6'}">value="设计审核通过"</c:if>
                       <c:if test="${entry.designAuditFlag eq '7'}">value="进件审核驳回"</c:if>
                       <c:if test="${entry.designAuditFlag eq '8'}">value="进件审核中"</c:if>
                       <c:if test="${entry.designAuditFlag eq '9'}">value="进件审核通过"</c:if>
                </c:when>
                <c:when test="${entry.status eq '2'}">
                       value="审核驳回"
                </c:when>
                <c:when test="${entry.status eq 'h'}">
                       value="待自审"
                </c:when>
                </c:choose>
                >
              </div>
            </div>
            <div class="layui-col-lg3 layui-col-sm3">
              <label class="layui-form-label">创建时间：</label>
              <div class="layui-input-block">
                <input type="text" disabled class="layui-input " value="<fmt:formatDate value="${entry.createTime}" pattern="yyyy-MM-dd HH:mm:ss"/>">
              </div>
            </div>
          </div>
        </div>
      </div>
      <div class="layui-card">
        <blockquote class="layui-elem-quote">产品信息</blockquote>
        <div class="layui-card-body">
          <div class="layui-row layui-col-space12 layui-form-item">
            <div class="layui-col-lg3 layui-col-sm3">
              <label class="layui-form-label">项目公司：</label>
              <div class="layui-input-block">
                <input type="text" disabled class="layui-input " value="${entry.projectCompanyName}">
              </div>
            </div>
            <div class="layui-col-lg3 layui-col-sm3">
              <label class="layui-form-label">备案类型：</label>
              <div class="layui-input-block">
                <input type="text" id="filingType" disabled class="layui-input"
                <c:choose>
                <c:when test="${entry.filingType eq '1'}">
                       value="农户备案"
                </c:when>
                <c:when test="${entry.filingType eq '2'}">
                       value="项目公司备案"
                </c:when>
                </c:choose>>
              </div>
            </div>
            <div class="layui-col-sm12 layui-col-md12">
              <table class="layui-table">
                <colgroup>
                  <col width="25%">
                  <col width="25%">
                  <col width="25%">
                  <col width="25%">
                </colgroup>
                <thead>
                <tr style="background: white">
                  <th style="text-align: center">序号</th>
                  <th style="text-align: center">产品编号</th>
                  <th style="text-align: center">产品名称</th>
                  <th style="text-align: center">屋顶类型</th>
                </tr>
                </thead>
                <tbody id="projectList">
                <c:forEach items="${projectList}" varStatus="vs" var="project">
                  <tr style="text-align: center" data-id="${project.columns.projectId}" class="projectTr" >
                    <td>${vs.count}</td>
                    <td>${project.columns.projectCode}</td>
                    <td>${project.columns.projectName}</td>
                    <td>${project.columns.roofType}</td>
                  </tr>
                </c:forEach>
                </tbody>
              </table>
            </div>
          </div>
        </div>
      </div>
      <div class="layui-card jibenxinxi ">
        <blockquote class="layui-elem-quote">业主信息</blockquote>
        <div class="layui-card-body ">
          <c:if test="${empty entry.tenantType || ('1' eq entry.tenantType)}">
            <div class="layui-row layui-col-space12 layui-form-item">

              <c:if test="${info.columns.tenant_name.status eq '1'}">
                <div class="layui-col-lg3 layui-col-sm3">
                  <label class="layui-form-label">业主姓名：</label>
                  <div class="layui-input-block">
                    <input type="text" id="tenantName" name="tenantName" class="layui-input" disabled value="${entry.tenantName}">
                  </div>
                </div>
              </c:if>
              <c:if test="${info.columns.id_code.status eq '1'}">
                <div class="layui-col-lg3 layui-col-sm3">
                  <label class="layui-form-label">身份证号：</label>
                  <div class="layui-input-block">
                    <input type="text" id="idCode" name="idCode" disabled class="layui-input" value="${entry.idCode}">
                  </div>
                </div>
              </c:if>
              <c:if test="${info.columns.age.status eq '1'}">
                <div class="layui-col-lg3 layui-col-sm3">
                  <div>
                    <label class="layui-form-label">年龄：</label>
                    <div class="layui-input-block">
                      <input type="text" name="age" id="age" class="layui-input" value="${entry.age}" disabled>
                    </div>
                  </div>
                </div>
              </c:if>

              <c:if test="${entry.tenantType eq '1'}">
                <c:if test="${info3.columns.birthday_date.status eq '1'}">
                  <div class="layui-col-lg3 layui-col-sm3">
                    <label class="layui-form-label">出生日期：</label>
                    <div class="layui-input-block">
                      <input type="text" id="birthdayDate" name="birthdayDate" disabled class="layui-input" value="<fmt:formatDate value="${entry.birthdayDate}" pattern="yyyy-MM-dd"/>">
                    </div>
                  </div>
                </c:if>
                <c:if test="${info3.columns.ic_validity_begin.status eq '1'}">
                  <div class="layui-col-lg3 layui-col-sm3">
                    <label class="layui-form-label">身份证生效日：</label>
                    <div class="layui-input-block">
                      <input type="text" id="icValidityBegin" name="icValidityBegin" disabled class="layui-input" value="<fmt:formatDate value="${entry.icValidityBegin}" pattern="yyyy-MM-dd"/>">
                    </div>
                  </div>
                </c:if>
                <c:if test="${info3.columns.ic_validity_end.status eq '1'}">
                  <div class="layui-col-lg3 layui-col-sm3">
                    <label class="layui-form-label">身份证到期日：</label>
                    <div class="layui-input-block">
                      <input type="text" id="icValidityEnd" name="icValidityEnd" disabled class="layui-input" value="<fmt:formatDate value="${entry.icValidityEnd}" pattern="yyyy-MM-dd"/>">
                    </div>
                  </div>
                </c:if>
              </c:if>
              <c:if test="${info.columns.gender.status eq '1'}">
                <div class="layui-col-lg3 layui-col-sm3">
                  <label class="layui-form-label">性别：</label>
                  <div class="layui-input-block">
                    <input type="radio"  id="maleRadio" name="gender" disabled title="男"
                           value="MALE" ${entry.gender eq 'MALE' ? 'checked' : ''}/>
                    <input type="radio" id="femaleRadio" name="gender" disabled title="女"
                           value="FEMALE" ${entry.gender eq 'FEMALE' ? 'checked' : ''}/>
                  </div>
                </div>
              </c:if>
              <c:if test="${info.columns.mobile.status eq '1'}">
                <div class="layui-col-lg3 layui-col-sm3" style="position:relative;">
                  <div>
                    <label class="layui-form-label">联系电话：</label>
                    <div class="layui-input-block">
                      <input type="text" name="mobile" disabled
                             class="layui-input" value="${entry.mobile}">
                    </div>
                  </div>
                </div>
              </c:if>
              <div class="layui-col-lg9 layui-col-sm9">
                <label class="layui-form-label"><i class="mark">*</i>安装地址：</label>
                <div class="layui-input-block">
                  <div class="layui-col-lg2 layui-col-sm2 pr-10">
                    <input type="text" class="layui-input" value="${entry.province}" disabled>
                  </div>
                  <div class="layui-col-lg2 layui-col-sm2 pr-10">
                    <input type="text" class="layui-input" value="${entry.city}" disabled>
                  </div>
                  <div class="layui-col-lg2 layui-col-sm2 pr-10">
                    <input type="text" class="layui-input" value="${entry.area}" disabled>
                  </div>
                  <div class="layui-col-lg6 layui-col-sm6">
                    <div class="layui-inline">
                      <input type="text" name="customerAddress" lay-verify="required"
                             autocomplete="off" class="layui-input layui-col-lg2 "
                             value="${entry.address}">
                    </div>
                  </div>
                </div>
              </div>
              <div class="layui-row layui-col-space12 layui-form-item">
                <c:if test="${info3.columns.id_card_front.status eq '1'}">

                  <div class="layui-col-lg4 layui-col-sm4">
                    <label class="layui-form-label"><i class="mark">*</i>身份证：</label>
                    <div class="layui-input-block img-box">
                      <div>
                        <div id="imgsDiv1">
                          <c:if test="${not empty entry.idCardFront}">
                            <div class="bj-img imgSpan">
                              <span class="layui-icon-close layui-icon" onclick="delImg(this,'uploader1')"></span>
                              <img src="${commonStaticImgPath}${entry.idCardFront}" height="700" width="1200"/>
                              <input type="hidden" class="idCardFront" value="${entry.idCardFront}"/>
                            </div>
                          </c:if>
                        </div>
                        <div class="upload-container <c:if test="${not empty entry.idCardFront}">hide</c:if>" id="uploader1">
                          <img src="" alt="img placeholder" id="imgsAdd1">
                        </div>
                        <div style="width: 80px; text-align: center; color: #FF0000">正面</div>
                      </div>
                      <div>
                        <div id="imgsDiv2">
                          <c:if test="${not empty entry.idCardBack}">
                            <div class="bj-img imgSpan">
                              <span class="layui-icon-close layui-icon" onclick="delImg(this,'uploader2')"></span>
                              <img src="${commonStaticImgPath}${entry.idCardBack}" height="700" width="1200"/>
                              <input type="hidden" class="idCardBack" value="${entry.idCardBack}"/>
                            </div>
                          </c:if>
                        </div>
                        <div class="upload-container <c:if test="${not empty entry.idCardBack}">hide</c:if>" id="uploader2">
                          <img src="" alt="img placeholder" id="imgsAdd2">
                        </div>
                        <div style="width: 80px; text-align: center; color: #FF0000">反面</div>
                      </div>
                    </div>
                  </div>
                </c:if>

                <c:if test="${info.columns.residence_booklet.status eq '1'}">
                  <div class="layui-col-lg4 layui-col-sm4">
                    <label class="layui-form-label w-120"><c:if test="${info.columns.residence_booklet.mustFillFlag eq '1'}"><i class="mark">*</i></c:if>户口本复印件：</label>
                    <div class="layui-input-block img-box ml-120">
                      <div style="display: flex;flex-wrap: wrap;">
                        <div id="imgsDiv3">
                          <c:set var="imgsDiv3Count" value="0"/>
                          <c:if test="${not empty entry.residenceBooklet}">
                            <c:forEach var="quaim" items="${entry.residenceBooklet.split(',')}" varStatus="vs">
                              <div class="bj-img imgSpan">
                                <span class="layui-icon-close layui-icon" onclick="delImg(this,'uploader3')"></span>
                                <img src="${commonStaticImgPath}${quaim}" height="700" width="1200"/>
                                <input type="hidden" class="residenceBooklet" value="${quaim}"/>
                              </div>
                              <c:set var="imgsDiv3Count" value="${vs.count}"/>
                            </c:forEach>
                          </c:if>
                        </div>
                        <div class="upload-container <c:if test="${imgsDiv3Count>=4}">hide</c:if>" id="uploader3">
                          <img src="" alt="img placeholder" id="imgsAdd3">
                        </div>
                      </div>
                    </div>
                  </div>
                </c:if>


                <c:if test="${info3.columns.house_ownership.status eq '1'}">
                  <div class="layui-row layui-col-space12 layui-form-item">
                    <div class="layui-col-lg11 layui-col-sm11">
                      <label class="layui-form-label"><c:if test="${info3.columns.house_ownership.mustFillFlag eq '1'}"><i class="mark">*</i></c:if>房产证明：</label>
                      <div class="layui-input-block img-box">
                        <div style="display: flex">
                          <div id="imgsDiv5">
                            <c:set var="houseOwnershipCount" value="0"/>
                            <c:if test="${not empty surveyRecord.houseOwnership}">
                              <c:forEach items="${surveyRecord.houseOwnership}" var="img" varStatus="vs">
                                <div class="bj-img imgSpan">
                                  <span class="layui-icon-close layui-icon" onclick="delImg(this,'uploader5')"></span>
                                  <img src="${commonStaticImgPath}${img}" height="700" width="1200"/>
                                  <input type="hidden" class="houseOwnership" value="${img}"/>
                                </div>
                                <c:set var="houseOwnershipCount" value="${vs.count}"/>
                              </c:forEach>
                            </c:if>
                          </div>
                          <div class="upload-container <c:if test="${houseOwnershipCount >= 8 }">hide</c:if>" id="uploader5">
                            <img src="" alt="img placeholder" id="imgsAdd5">
                          </div>
                        </div>
                      </div>
                    </div>
                  </div>
                </c:if>
              </div>
              <div class="layui-row layui-col-space12 layui-form-item">
                <c:if test="${info.columns.bank_card.status eq '1'}">
                  <div class="layui-col-lg4 layui-col-sm4">
                    <label class="layui-form-label"><i class="mark">*</i>银行卡照片：</label>
                    <div class="layui-input-block img-box">
                      <div>
                        <div id="imgsDiv4">
                          <c:if test="${not empty entry.bankCard}">
                            <div class="bj-img imgSpan">
                              <span class="layui-icon-close layui-icon" onclick="delImg(this,'uploader4')"></span>
                              <img src="${commonStaticImgPath}${entry.bankCard}" height="700" width="1200"/>
                              <input type="hidden" class="bankCard" value="${entry.bankCard}"/>
                            </div>
                          </c:if>
                        </div>
                        <div class="upload-container <c:if test="${not empty entry.bankCard}">hide</c:if>" id="uploader4">
                          <img src="" alt="img placeholder" id="imgsAdd4">
                        </div>
                      </div>
                    </div>
                  </div>
                </c:if>
                <c:if test="${info3.columns.credit_certificate.status eq '1'}">
                  <div class="layui-col-lg8 layui-col-sm8">
                    <label class="layui-form-label"><c:if test="${info3.columns.credit_certificate.mustFillFlag eq '1'}"><i class="mark">*</i></c:if>信誉凭证：</label>
                    <div class="layui-input-block img-box">
                      <div style="display: flex">
                        <div id="imgsDiv12">
                          <c:set var="creditCertificateCount" value="0"/>
                          <c:if test="${not empty orgFiles.creditCertificate}">
                            <c:forEach var="quaim" items="${orgFiles.creditCertificate.split(',')}" varStatus="vs">
                              <div class="bj-img imgSpan">
                                <span class="layui-icon-close layui-icon" onclick="delImg(this,'uploader12')"></span>
                                <img src="${commonStaticImgPath}${quaim}" height="700" width="1200"/>
                                <input type="hidden" class="creditCertificate" value="${quaim}"/>
                              </div>
                              <c:set var="creditCertificateCount" value="${vs.count}"/>
                            </c:forEach>
                          </c:if>
                        </div>
                        <div class="upload-container <c:if test="${creditCertificateCount >= 4}">hide</c:if>" id="uploader12">
                          <img src="" alt="img placeholder" id="imgsAdd12">
                        </div>
                      </div>
                    </div>
                  </div>
                </c:if>
              </div>
              <div class="layui-row layui-col-space12 layui-form-item">
                <c:if test="${info3.columns.exigence_name.status eq '1'}">
                  <div class="layui-col-lg3 layui-col-sm3">
                    <label class="layui-form-label"><c:if test="${info3.columns.exigence_name.mustFillFlag eq '1'}"><i class="mark">*</i></c:if>紧急联系人：</label>
                    <div class="layui-input-block">
                      <input type="text" name="exigenceName" id="exigenceName" lay-verify="required"
                             autocomplete="off" class="layui-input " value="${entry.exigenceName}">
                    </div>
                  </div>
                </c:if>
                <c:if test="${info3.columns.exigence_phone.status eq '1'}">
                  <div class="layui-col-lg3 layui-col-sm3">
                    <label class="layui-form-label"><c:if test="${info3.columns.exigence_phone.mustFillFlag eq '1'}"><i class="mark">*</i></c:if>联系方式：</label>
                    <div class="layui-input-block">
                      <input type="text" name="exigencePhone" id="exigencePhone" lay-verify="required"
                             autocomplete="off" class="layui-input " value="${entry.exigencePhone}">
                    </div>
                  </div>
                </c:if>
              </div>
              <c:if test="${info.columns.bank_name.status eq '1'}">
                <div class="layui-col-lg3 layui-col-sm3">
                  <label class="layui-form-label">银行账户名：</label>
                  <div class="layui-input-block">
                    <input type="text" name="bankName" id="bankName" disabled class="layui-input" value="${entry.tenantName}">
                  </div>
                </div>
              </c:if>

              <c:if test="${info.columns.bank_code.status eq '1'}">
                <div class="layui-col-lg3 layui-col-sm3">
                  <label class="layui-form-label">银行账户：</label>
                  <div class="layui-input-block">
                    <input type="text" name="bankCode" id="bankCode"  class="layui-input" value="${entry.bankCode}">
                  </div>
                </div>
              </c:if>
              <c:if test="${info.columns.tss_bank_num_name.columnType eq '1'}">
                <c:if test="${info.columns.tss_bank_num_name.status eq '1'}">
                  <div class="layui-row layui-col-space12 layui-form-item">
                    <div class="layui-col-lg6 layui-col-sm6" overflow="false">
                      <label class="layui-form-label"><c:if test="${info.columns.tss_bank_num_name.mustFillFlag eq '1'}"><i class="mark">*</i></c:if>开户行：</label>
                      <div class="layui-input-block">
                        <div id="tssBank"></div>
                      </div>
                    </div>
                  </div>
                </c:if>
              </c:if>
              <c:if test="${info.columns.tss_bank_num_name.columnType eq '2'}">
                <c:if test="${info.columns.tss_bank_num_name.status eq '1'}">
                  <div class="layui-col-lg4 layui-col-sm4">
                    <label class="layui-form-label"><c:if test="${info.columns.tss_bank_num_name.mustFillFlag eq '1'}"><i class="mark">*</i></c:if>开户行：</label>
                    <div class="layui-input-block">
                      <input type="text" name="tssBank" id="tssBank" lay-verify="required"
                             autocomplete="off" class="layui-input " value="${entry.tssBankNumName}">
                    </div>
                  </div>
                </c:if>
              </c:if>

              <div class="layui-row layui-col-space12 layui-form-item">
                <div class="layui-col-lg3 layui-col-sm3">
                  <label class="layui-form-label">划转方式：</label>
                  <div class="layui-input-block">
                    <input type="text" name="repaymentMethod" id="repaymentMethod" disabled class="layui-input"

                           <c:if test="${entry.filingType eq '1'}">value="二类卡"</c:if>
                           <c:if test="${entry.filingType eq '2'}">value="其他"</c:if>

                      <%--                                               <c:if test="${surveyRecord.repaymentMethod eq '1'}">value="二类卡"</c:if>--%>
                      <%--                                               <c:if test="${surveyRecord.repaymentMethod eq '2'}">value="光E宝"</c:if>--%>
                      <%--                                               <c:if test="${surveyRecord.repaymentMethod eq '0'}">value="其他"</c:if>--%>
                      <%--                                               lay-data="${surveyRecord.repaymentMethod}" --%>
                    >
                  </div>
                </div>
                  <%--                                <c:if test="${surveyRecord.repaymentMethod ne '0'}">--%>
                <c:if test="${entry.filingType ne '2'}">
                  <div class="layui-col-lg3 layui-col-sm3">
                    <label class="layui-form-label">账号名称：</label>
                    <div class="layui-input-block">
                      <input type="text" disabled class="layui-input" value="${card.name}">
                    </div>
                  </div>
                  <div class="layui-col-lg3 layui-col-sm3">
                    <label class="layui-form-label">二类卡号：</label>
                    <div class="layui-input-block">
                      <input type="text" disabled class="layui-input" value="${card.accountCode}">
                    </div>
                  </div>
                  <div class="layui-col-lg3 layui-col-sm3">
                    <label class="layui-form-label">联行号：</label>
                    <div class="layui-input-block">
                      <input type="text" disabled class="layui-input" value="${entry.tssBankNum}">
                    </div>
                  </div>
                </c:if>
              </div>
            </div>
          </c:if>
          <%--单位信息--%>
          <c:if test="${entry.tenantType eq '2'}">

            <c:if test="${info.columns.tenant_name.status eq '1'}">
              <div class="layui-col-lg3 layui-col-sm3">
                <label class="layui-form-label">单位名称：</label>
                <div class="layui-input-block">
                  <input type="text" name="tenantNameAnother" disabled class="layui-input" value="${entry.tenantName}">
                </div>
              </div>
            </c:if>
            <c:if test="${info.columns.regno.status eq '1'}">
              <div class="layui-col-lg3 layui-col-sm3">
                <label class="layui-form-label">信用代码：</label>
                <div class="layui-input-block">
                  <input type="text" name="regno" id="regno" disabled class="layui-input layui-bg-gray" value="${entry.regno}">
                </div>
              </div>
            </c:if>
            <c:if test="${info.columns.mobile.status eq '1'}">
              <div class="layui-col-lg3 layui-col-sm3" style="position:relative;">
                <div>
                  <label class="layui-form-label">联系方式：</label>
                  <div class="layui-input-block">
                    <input type="text" name="mobileAnother" disabled class="layui-input layui-bg-gray"  value="${entry.mobile}">
                  </div>
                </div>
              </div>
            </c:if>
            <c:if test="${info.columns.corp.status eq '1'}">
              <div class="layui-col-lg3 layui-col-sm3" style="position:relative;">
                <div>
                  <label class="layui-form-label">负责人姓名：</label>
                  <div class="layui-input-block">
                    <input type="text" name="corp" id="corp" disabled class="layui-input"  value="${entry.corp}">
                  </div>
                </div>
              </div>
            </c:if>
            <c:if test="${info.columns.id_code.status eq '1'}">
              <div class="layui-col-lg3 layui-col-sm3">
                <label class="layui-form-label">身份证号：</label>
                <div class="layui-input-block">
                  <input type="text" name="idCodeAnother" disabled class="layui-input" value="${entry.idCode}">
                </div>
              </div>
            </c:if>
            <div class="layui-col-lg9 layui-col-sm9">
              <label class="layui-form-label"><i class="mark">*</i>安装地址：</label>
              <div class="layui-input-block">
                <div class="layui-col-lg2 layui-col-sm2 pr-10">
                  <input type="text" class="layui-input" value="${entry.province}" disabled>
                </div>
                <div class="layui-col-lg2 layui-col-sm2 pr-10">
                  <input type="text" class="layui-input" value="${entry.city}" disabled>
                </div>
                <div class="layui-col-lg2 layui-col-sm2 pr-10">
                  <input type="text" class="layui-input" value="${entry.area}" disabled>
                </div>
                <div class="layui-col-lg6 layui-col-sm6">
                  <div class="layui-inline">
                    <input type="text" name="customerAddress" lay-verify="required"
                           autocomplete="off" class="layui-input layui-col-lg2 "
                           value="${entry.address}">
                  </div>
                </div>
              </div>
            </div>
            <div class="layui-row layui-col-space12 layui-form-item">
              <c:if test="${info.columns.regno_url.status eq '1'}">
                <div class="layui-col-lg4 layui-col-sm4">
                  <label class="layui-form-label"><i class="mark">*</i>营业执照：</label>
                  <div class="layui-input-block img-box">
                    <div>
                      <div>
                        <div id="imgsDiv35">
                          <c:if test="${not empty tenant and not empty tenant.regnoUrl}">
                            <div class="bj-img imgSpan">
                                <%--                                                            <span class="layui-icon-close layui-icon" onclick="delImg(this,'uploader35')"></span>--%>
                              <img src="${commonStaticImgPath}${tenant.regnoUrl}" height="700" width="1200"/>
                              <input type="hidden" class="regnoUrl" value="${tenant.regnoUrl}"/>
                            </div>
                          </c:if>
                        </div>
                        <div class="upload-container <c:if test="${not empty tenant || not empty tenant.regnoUrl}">hide</c:if>" id="uploader35">
                          <img src="" alt="img placeholder" id="imgsAdd35">
                        </div>
                      </div>
                    </div>
                  </div>
                </div>
              </c:if>
              <c:if test="${info.columns.id_card_front.status eq '1'}">
                <div class="layui-col-lg4 layui-col-sm4">
                  <label class="layui-form-label w-120"><i class="mark">*</i>负责人身份证：</label>
                  <div class="layui-input-block img-box ml-120">
                    <div>
                      <div id="imgsDiv33">
                        <c:if test="${not empty entry.idCardFront}">
                          <div class="bj-img imgSpan">
                              <%--                                                        <span class="layui-icon-close layui-icon" onclick="delImg(this,'uploader33')"></span>--%>
                            <img src="${commonStaticImgPath}${entry.idCardFront}" height="700" width="1200"/>
                            <input type="hidden" class="idCardFront" value="${entry.idCardFront}"/>
                          </div>
                        </c:if>
                      </div>
                      <div class="upload-container <c:if test="${not empty entry.idCardFront}">hide</c:if>" id="uploader33">
                        <img src="" alt="img placeholder" id="imgsAdd33">
                      </div>
                      <div style="width: 80px; text-align: center; color: #FF0000">正面</div>
                    </div>
                    <div>
                      <div id="imgsDiv34">
                        <c:if test="${not empty entry.idCardBack}">
                          <div class="bj-img imgSpan">
                              <%--                                                        <span class="layui-icon-close layui-icon" onclick="delImg(this,'uploader34')"></span>--%>
                            <img src="${commonStaticImgPath}${entry.idCardBack}" height="700" width="1200"/>
                            <input type="hidden" class="idCardBack" value="${entry.idCardBack}"/>
                          </div>
                        </c:if>
                      </div>
                      <div class="upload-container <c:if test="${not empty entry.idCardBack}">hide</c:if>" id="uploader34">
                        <img src="" alt="img placeholder" id="imgsAdd34">
                      </div>
                      <div style="width: 80px; text-align: center; color: #FF0000">反面</div>
                    </div>
                  </div>
                </div>
              </c:if>
              <c:if test="${info.columns.bank_card.status eq '1'}">
                <div class="layui-col-lg4 layui-col-sm4">
                  <label class="layui-form-label"><i class="mark">*</i>银行卡照片：</label>
                  <div class="layui-input-block img-box">
                    <div>
                      <div id="imgsDiv6">
                        <c:if test="${not empty entry.bankCard}">
                          <div class="bj-img imgSpan">
                            <span class="layui-icon-close layui-icon" onclick="delImg(this,'uploader6')"></span>
                            <img src="${commonStaticImgPath}${entry.bankCard}" height="700" width="1200"/>
                            <input type="hidden" class="bankCard" value="${entry.bankCard}"/>
                          </div>
                        </c:if>
                      </div>
                      <div class="upload-container <c:if test="${not empty entry.bankCard}">hide</c:if>" id="uploader6">
                        <img src="" alt="img placeholder" id="imgsAdd6">
                      </div>
                    </div>
                  </div>
                </div>
              </c:if>

            </div>
            <div class="layui-row layui-col-space12 layui-form-item">
              <c:if test="${info3.columns.resolution_paper_url.status eq '1'}">
                <div class="layui-col-lg4 layui-col-sm4">
                  <label class="layui-form-label"><c:if test="${info3.columns.resolution_paper_url.mustFillFlag eq '1'}"><i class="mark">*</i></c:if>村民代表大会决议书：</label>
                  <div class="layui-input-block img-box">
                    <div>
                      <div id="imgsDiv7">
                        <c:if test="${not empty orgFiles.resolutionPaperUrl}">
                          <div class="bj-img imgSpan">
                            <span class="layui-icon-close layui-icon" onclick="delImg(this,'uploader7')"></span>
                            <img src="${commonStaticImgPath}${orgFiles.resolutionPaperUrl}" height="700" width="1200"/>
                            <input type="hidden" class="resolutionPaperUrl" value="${orgFiles.resolutionPaperUrl}"/>
                          </div>
                        </c:if>
                      </div>
                      <div class="upload-container <c:if test="${not empty orgFiles.resolutionPaperUrl}">hide</c:if>" id="uploader7">
                        <img src="" alt="img placeholder" id="imgsAdd7">
                      </div>
                    </div>
                  </div>
                </div>
              </c:if>
              <c:if test="${info3.columns.yszc_url.status eq '1'}">
                <div class="layui-col-lg4 layui-col-sm4">
                  <label class="layui-form-label"><c:if test="${info3.columns.yszc_url.mustFillFlag eq '1'}"><i class="mark">*</i></c:if>村委议事章程：</label>
                  <div class="layui-input-block img-box">
                    <div>
                      <div  id="imgsDiv8">
                        <c:if test="${not empty orgFiles.yszcUrl}">
                          <div class="bj-img imgSpan">
                            <span class="layui-icon-close layui-icon" onclick="delImg(this,'uploader8')"></span>
                            <img src="${commonStaticImgPath}${orgFiles.yszcUrl}" height="700" width="1200"/>
                            <input type="hidden" class="yszcUrl" value="${orgFiles.yszcUrl}"/>
                          </div>
                        </c:if>
                      </div>
                      <div class="upload-container <c:if test="${not empty orgFiles.yszcUrl}">hide</c:if>" id="uploader8">
                        <img src="" alt="img placeholder" id="imgsAdd8">
                      </div>
                    </div>
                  </div>
                </div>
              </c:if>
              <c:if test="${info3.columns.account_info_url.status eq '1'}">
                <div class="layui-col-lg4 layui-col-sm4">
                  <label class="layui-form-label"><c:if test="${info3.columns.account_info_url.mustFillFlag eq '1'}"><i class="mark">*</i></c:if>对公账户信息：</label>
                  <div class="layui-input-block img-box">
                    <div>
                      <div id="imgsDiv9">
                        <c:if test="${not empty orgFiles.accountInfoUrl}">
                          <div class="bj-img imgSpan">
                            <span class="layui-icon-close layui-icon" onclick="delImg(this,'uploader9')"></span>
                            <img src="${commonStaticImgPath}${orgFiles.accountInfoUrl}" height="700" width="1200"/>
                            <input type="hidden" class="accountInfoUrl" value="${orgFiles.accountInfoUrl}"/>
                          </div>
                        </c:if>
                      </div>
                      <div class="upload-container <c:if test="${not empty orgFiles.accountInfoUrl}">hide</c:if>" id="uploader9">
                        <img src="" alt="img placeholder" id="imgsAdd9">
                      </div>
                    </div>
                  </div>
                </div>
              </c:if>
            </div>
            <div class="layui-row layui-col-space12 layui-form-item">
              <c:if test="${info3.columns.ownership_certificate_url.status eq '1'}">
                <div class="layui-col-lg4 layui-col-sm4">
                  <label class="layui-form-label"><c:if test="${info3.columns.ownership_certificate_url.mustFillFlag eq '1'}"><i class="mark">*</i></c:if>产权证明-集体土地使用证：</label>
                  <div class="layui-input-block img-box">
                    <div>
                      <div id="imgsDiv10">
                        <c:if test="${not empty orgFiles.ownershipCertificateUrl}">
                          <div class="bj-img imgSpan">
                            <span class="layui-icon-close layui-icon" onclick="delImg(this,'uploader10')"></span>
                            <img src="${commonStaticImgPath}${orgFiles.ownershipCertificateUrl}" height="700" width="1200"/>
                            <input type="hidden" class="ownershipCertificateUrl" value="${orgFiles.ownershipCertificateUrl}"/>
                          </div>
                        </c:if>
                      </div>
                      <div class="upload-container <c:if test="${not empty orgFiles.ownershipCertificateUrl}">hide</c:if>" id="uploader10">
                        <img src="" alt="img placeholder" id="imgsAdd10">
                      </div>
                    </div>
                  </div>
                </div>
              </c:if>
              <c:if test="${info3.columns.other_ownership_certificate_url.status eq '1'}">
                <div class="layui-col-lg4 layui-col-sm4">
                  <label class="layui-form-label"><c:if test="${info3.columns.other_ownership_certificate_url.mustFillFlag eq '1'}"><i class="mark">*</i></c:if>产权证明-不动产证书/查册证明/相关确权文件：</label>
                  <div class="layui-input-block img-box">
                    <div>
                      <div id="imgsDiv11">
                        <c:if test="${not empty orgFiles.otherOwnershipCertificateUrl}">
                          <div class="bj-img imgSpan">
                            <span class="layui-icon-close layui-icon" onclick="delImg(this,'uploader11')"></span>
                            <img src="${commonStaticImgPath}${orgFiles.otherOwnershipCertificateUrl}" height="700" width="1200"/>
                            <input type="hidden" class="otherOwnershipCertificateUrl" value="${orgFiles.otherOwnershipCertificateUrl}"/>
                          </div>
                        </c:if>
                      </div>
                      <div class="upload-container <c:if test="${not empty orgFiles.otherOwnershipCertificateUrl}">hide</c:if>" id="uploader11">
                        <img src="" alt="img placeholder" id="imgsAdd11">
                      </div>
                    </div>
                  </div>
                </div>
              </c:if>
            </div>
            <div class="layui-row layui-col-space12 layui-form-item">
              <c:if test="${info3.columns.exigence_name.status eq '1'}">
                <div class="layui-col-lg3 layui-col-sm3">
                  <label class="layui-form-label"><c:if test="${info3.columns.exigence_name.mustFillFlag eq '1'}"><i class="mark">*</i></c:if>紧急联系人：</label>
                  <div class="layui-input-block">
                    <input type="text" name="exigenceName" id="exigenceName" lay-verify="required"
                           autocomplete="off" class="layui-input " value="${entry.exigenceName}">
                  </div>
                </div>
              </c:if>
              <c:if test="${info3.columns.exigence_phone.status eq '1'}">
                <div class="layui-col-lg3 layui-col-sm3">
                  <label class="layui-form-label"><c:if test="${info3.columns.exigence_phone.mustFillFlag eq '1'}"><i class="mark">*</i></c:if>联系方式：</label>
                  <div class="layui-input-block">
                    <input type="text" name="exigencePhone" id="exigencePhone" lay-verify="required"
                           autocomplete="off" class="layui-input " value="${entry.exigencePhone}">
                  </div>
                </div>
              </c:if>
            </div>
            <c:if test="${info.columns.bank_name.status eq '1'}">
              <div class="layui-col-lg3 layui-col-sm3">
                <label class="layui-form-label">账户名称：</label>
                <div class="layui-input-block">
                  <input type="text" name="bankName" id="bankName"  disabled class="layui-input" value="${entry.tenantName}">
                </div>
              </div>
            </c:if>

            <c:if test="${info.columns.bank_code.status eq '1'}">
              <div class="layui-col-lg3 layui-col-sm3">
                <label class="layui-form-label">银行账号：</label>
                <div class="layui-input-block">
                  <input type="text" name="bankCode" id="bankCode"  class="layui-input" value="${entry.bankCode}">
                </div>
              </div>
            </c:if>

            <c:if test="${info.columns.tss_bank_num_name.columnType eq '1'}">
              <c:if test="${info.columns.tss_bank_num_name.status eq '1'}">
                <div class="layui-row layui-col-space12 layui-form-item">
                  <div class="layui-col-lg4 layui-col-sm4">
                    <label class="layui-form-label"><c:if test="${info.columns.tss_bank_num_name.mustFillFlag eq '1'}"><i class="mark">*</i></c:if>开户行：</label>
                    <div class="layui-input-block">
                      <div id="tssBank"></div>
                    </div>
                  </div>
                </div>
              </c:if>
            </c:if>
            <c:if test="${info.columns.tss_bank_num_name.columnType eq '2'}">
              <c:if test="${info.columns.tss_bank_num_name.status eq '1'}">
                <div class="layui-col-lg4 layui-col-sm4">
                  <label class="layui-form-label"><c:if test="${info.columns.tss_bank_num_name.mustFillFlag eq '1'}"><i class="mark">*</i></c:if>开户行：</label>
                  <div class="layui-input-block">
                    <input type="text" name="tssBank" id="tssBank" lay-verify="required"
                           autocomplete="off" class="layui-input " value="${entry.tssBankNumName}">
                  </div>
                </div>
              </c:if>
            </c:if>
          </c:if>
        </div>
      </div>
      <%--共签人信息--%>
      <c:if test="${entry.age >= 65 &&  '1' eq entry.tenantType}">
        <div class="layui-card">
          <blockquote class="layui-elem-quote">补充信息</blockquote>
          <div class="layui-card-body ">
            <div class="layui-row layui-col-space12 layui-form-item">
              <c:if test="${info3.columns.bp_name.status eq '1'}">
                <div class="layui-col-lg3 layui-col-sm3">
                  <label class="layui-form-label"><c:if test="${info3.columns.bp_name.mustFillFlag eq '1'}"><i class="mark">*</i></c:if>共签人名称：</label>
                  <div class="layui-input-block">
                    <input type="text" name="bpName" id="bpName" lay-verify="required" class="layui-input " value="${entry.bpName}" >
                  </div>
                </div>
              </c:if>
              <c:if test="${info3.columns.bp_id_card.status eq '1'}">
                <div class="layui-col-lg3 layui-col-sm3">
                  <label class="layui-form-label"><c:if test="${info3.columns.bp_id_card.mustFillFlag eq '1'}"><i class="mark">*</i></c:if>证件号码：</label>
                  <div class="layui-input-block">
                    <input type="text" name="bpIdCard" id="bpIdCard" lay-verify="required" class="layui-input " value="${entry.bpIdCard}" >
                  </div>
                </div>
              </c:if>
              <c:if test="${info3.columns.bp_mobile.status eq '1'}">
                <div class="layui-col-lg3 layui-col-sm3">
                  <label class="layui-form-label"><c:if test="${info3.columns.bp_mobile.mustFillFlag eq '1'}"><i class="mark">*</i></c:if>手机号：</label>
                  <div class="layui-input-block">
                    <input type="text" name="bpMobile" id="bpMobile" lay-verify="required" class="layui-input " value="${entry.bpMobile}" >
                  </div>
                </div>
              </c:if>
              <c:if test="${info3.columns.bp_relation.status eq '1'}">
                <div class="layui-col-lg3 layui-col-sm3">
                  <label class="layui-form-label"><c:if test="${info3.columns.bp_relation.mustFillFlag eq '1'}"><i class="mark">*</i></c:if>共签人关系：</label>
                  <div class="layui-input-block">
                    <select class="layui-input-block"  name="bpRelation" id="bpRelation">
                      <option value="">请先选择共签人关系:</option>
                      <c:forEach items="${bpRelationList}" var="bpRel">
                        <option value="${bpRel.columns.dict_value}" <c:if test="${bpRel.columns.dict_value eq entry.bpRelation}">selected</c:if>>${bpRel.columns.dict_value}</option>
                      </c:forEach>
                    </select>
                      <%--                                        <input type="text" name="bpRelation" id="bpRelation" class="layui-input" value="${entry.bpRelation}">--%>
                  </div>
                </div>
              </c:if>
              <c:if test="${info3.columns.bp_card_front.status eq '1' || info.columns.bp_card_back.status eq  '1'}">
                <div class="layui-col-lg4 layui-col-sm4">
                  <label class="layui-form-label"><c:if test="${info3.columns.bp_card_front.mustFillFlag eq '1' ||  info3.columns.bp_card_back.mustFillFlag eq '1' }"><i class="mark">*</i></c:if>身份证：</label>
                  <div class="layui-input-block img-box">
                    <c:if test="${info3.columns.bp_card_front.status eq '1'}">
                      <div>
                        <div id="imgsDiv30">
                          <c:if test="${not empty entry.bpCardFront}">
                            <div class="bj-img imgSpan">
                              <span class="layui-icon-close layui-icon" onclick="delImg(this,'uploader30')"></span>
                              <img src="${commonStaticImgPath}${entry.bpCardFront}" height="700" width="1200"/>
                              <input type="hidden" class="bpCardFront" value="${entry.bpCardFront}"/>
                            </div>
                          </c:if>
                        </div>
                        <div class="upload-container <c:if test="${not empty entry.bpCardFront}">hide</c:if>" id="uploader30">
                          <img src="" alt="img placeholder" id="imgsAdd30">
                        </div>
                        <div style="width: 80px; text-align: center; color: #FF0000">正面</div>
                      </div>
                    </c:if>
                    <c:if test="${info3.columns.bp_card_back.status eq '1'}">
                      <div>
                        <div id="imgsDiv31">
                          <c:if test="${not empty entry.bpCardBack}">
                            <div class="bj-img imgSpan">
                              <span class="layui-icon-close layui-icon" onclick="delImg(this,'uploader31')"></span>
                              <img src="${commonStaticImgPath}${entry.bpCardBack}" height="700" width="1200"/>
                              <input type="hidden" class="bpCardBack" value="${entry.bpCardBack}"/>
                            </div>
                          </c:if>
                        </div>
                        <div class="upload-container <c:if test="${not empty entry.bpCardBack}">hide</c:if>" id="uploader31">
                          <img src="" alt="img placeholder" id="imgsAdd31">
                        </div>
                        <div style="width: 80px; text-align: center; color: #FF0000">反面</div>
                      </div>
                    </c:if>
                  </div>
                </div>
              </c:if>
              <c:if test="${info3.columns.bp_file.status eq '1'}">
                <div class="layui-col-lg4 layui-col-sm4">
                  <label class="layui-form-label w-120"><c:if test="${info3.columns.bp_file.mustFillFlag eq '1'}"><i class="mark">*</i></c:if>子女证明材料：</label>
                  <div class="layui-input-block img-box ml-120">
                    <div style="display: flex;flex-wrap: wrap;">
                      <div id="imgsDiv32">
                        <c:set var="imgsDiv32Count" value="0"/>
                        <c:if test="${not empty entry.bpFile}">
                          <c:forEach var="quaim" items="${entry.bpFile.split(',')}" varStatus="vs">
                            <div class="bj-img imgSpan">
                              <span class="layui-icon-close layui-icon" onclick="delImg(this,'uploader32')"></span>
                              <img src="${commonStaticImgPath}${quaim}" height="700" width="1200"/>
                              <input type="hidden" class="bpFile" value="${quaim}"/>
                            </div>
                            <c:set var="imgsDiv32Count" value="${vs.count}"/>
                          </c:forEach>
                        </c:if>
                      </div>
                      <div class="upload-container <c:if test="${imgsDiv32Count>=4}">hide</c:if>" id="uploader32">
                        <img src="" alt="img placeholder" id="bpFile">
                      </div>
                    </div>
                  </div>
                </div>
              </c:if>
            </div>
          </div>
        </div>
      </c:if>
    </div>
  </div>
  <div class="operate-footer">
    <input type="button" class="layui-btn tempSaveOrder " value="暂存">
    <input type="button" class="layui-btn saveOrder " value="提交审核">
    <input type="button" class="layui-btn layui-btn-primary" value="关闭" onclick="cancel()">
  </div>
</div>


<script src="${ctxPlugin}/lib/layuiAdmin/dist/layuiadmin/layui/layui.js"></script>
<script src="${ctxPlugin}/lib/layuiAdmin/dist/layuiadmin/dist/viewer.js"></script>
<script src="${ctxPlugin}/lib/xm-select.js"></script>
<script>
  //图片查看效果
  var viewer = new Viewer(document.getElementById('LAY_app'));
  var $;
  // 联行号
  var tssBankNum = '${entry.tssBankNum}';
  // 银行名称
  var tssBankNumName = '${entry.tssBankNumName}';
  layui.config({
    base: '${ctxPlugin}/lib/layuiAdmin/dist/layuiadmin/' //静态资源所在路径
  }).extend({
    index: 'lib/index' //主入口模块
  }).use(['index', 'form', 'layedit', 'laydate', 'jquery', 'upload', 'layer'], function () {
    $ = layui.$
            , element = layui.element
            , form = layui.form
            , layer = layui.layer
            , laydate = layui.laydate;
    var upload = layui.upload;
    upload.render({
      elem: '#uploader1' //绑定元素
      , url: '${ctx}/common/weChat/uploadImageIden' //上传接口
      , before: function (obj) {
        //预读本地文件示例，不支持ie8
        obj.preview(function (index, file, result) {
        });
      }
      , done: function (res) {
        var obj =  JSON.parse(res.info)
        if (obj.code ==='500' || obj.data.face == null){
          layer.msg("身份信息上传失败,请确认后重试", {icon: 2});
          return
        }
        var data = obj.data.face.data
        console.log("data",data)
        var oidCode =  $("#idCode").val();
        $("#birthdayDate").val(convertToISOFormat(data.birthDate));
        if (data.idNumber !== oidCode) {
          layer.msg("上传的身份证号与当前业主信息不匹配，请上传当前业主的身份证正面照片", {icon: 2});
          return
        }
        //上传完毕回调
        addImg(res.path, "uploader1", "imgsDiv1", "idCardFront",1);
      }
      , error: function () {
        //请求异常回调
      }
    });
    upload.render({
      elem: '#uploader2' //绑定元素
      , url: '${ctx}/common/weChat/uploadImageIden' //上传接口
      , before: function (obj) {
        //预读本地文件示例，不支持ie8
        obj.preview(function (index, file, result) {
        });
      }
      , done: function (res) {
        var obj =  JSON.parse(res.info)
        if (obj.code ==='500'|| obj.data.back == null){
          layer.msg("身份信息上传失败,请确认后重试", {icon: 2});
          return
        }
        var data = obj.data.back.data
        console.log("data",data)
        if (data.validPeriod) {
          var split = data.validPeriod.split('-');
          var icValidityBegin = split[0].replaceAll('.', '-');
          var icValidityEnd = '9999-12-31'
          if (split[1] !== '长期') {
            icValidityEnd = split[1].replaceAll('.', '-');
          }
        }

        $("#icValidityBegin").val(icValidityBegin);
        $("#icValidityEnd").val(icValidityEnd);
        //上传完毕回调
        addImg(res.path, "uploader2", "imgsDiv2", "idCardBack",1);
      }
      , error: function () {
        //请求异常回调
      }
    });
    upload.render({
      elem: '#uploader3' //绑定元素   户口本复印件
      , url: '${ctx}/common/uploadFile' //上传接口
      , before: function (obj) {
        //预读本地文件示例，不支持ie8
        obj.preview(function (index, file, result) {
        });
      }
      , done: function (res) {
        //上传完毕回调
        addImg(res.path, "uploader3", "imgsDiv3", "residenceBooklet",4);
      }
      , error: function () {
        //请求异常回调
      }
    });
    upload.render({
      elem: '#uploader4' //绑定元素
      , url: '${ctx}/common/uploadFile' //上传接口
      , before: function (obj) {
        //预读本地文件示例，不支持ie8
        obj.preview(function (index, file, result) {
        });
      }
      , done: function (res) {
        //上传完毕回调
        addImg(res.path, "uploader4", "imgsDiv4", "bankCard",1);
      }
      , error: function () {
        //请求异常回调
      }
    });
    upload.render({
      elem: '#uploader5' //绑定元素
      , url: '${ctx}/common/uploadFile' //上传接口
      , before: function (obj) {
        //预读本地文件示例，不支持ie8
        obj.preview(function (index, file, result) {
        });
      }
      , done: function (res) {
        //上传完毕回调
        addImg(res.path, "uploader5", "imgsDiv5", "houseOwnership",8);
      }
      , error: function () {
        //请求异常回调
      }
    });
    upload.render({
      elem: '#uploader6' //绑定元素
      , url: '${ctx}/common/uploadFile' //上传接口
      , before: function (obj) {
        //预读本地文件示例，不支持ie8
        obj.preview(function (index, file, result) {
        });
      }
      , done: function (res) {
        //上传完毕回调
        addImg(res.path, "uploader6", "imgsDiv6", "bankCard",1);
      }
      , error: function () {
        //请求异常回调
      }
    });
    upload.render({
      elem: '#uploader7' //绑定元素
      , url: '${ctx}/common/uploadFile' //上传接口
      , before: function (obj) {
        //预读本地文件示例，不支持ie8
        obj.preview(function (index, file, result) {
        });
      }
      , done: function (res) {
        //上传完毕回调
        addImg(res.path, "uploader7", "imgsDiv7", "resolutionPaperUrl",1);
      }
      , error: function () {
        //请求异常回调
      }
    });
    upload.render({
      elem: '#uploader8' //绑定元素
      , url: '${ctx}/common/uploadFile' //上传接口
      , before: function (obj) {
        //预读本地文件示例，不支持ie8
        obj.preview(function (index, file, result) {
        });
      }
      , done: function (res) {
        //上传完毕回调
        addImg(res.path, "uploader8", "imgsDiv8", "yszcUrl",1);
      }
      , error: function () {
        //请求异常回调
      }
    });
    upload.render({
      elem: '#uploader9' //绑定元素
      , url: '${ctx}/common/uploadFile' //上传接口
      , before: function (obj) {
        //预读本地文件示例，不支持ie8
        obj.preview(function (index, file, result) {
        });
      }
      , done: function (res) {
        //上传完毕回调
        addImg(res.path, "uploader9", "imgsDiv9", "accountInfoUrl",1);
      }
      , error: function () {
        //请求异常回调
      }
    });
    upload.render({
      elem: '#uploader10' //绑定元素
      , url: '${ctx}/common/uploadFile' //上传接口
      , before: function (obj) {
        //预读本地文件示例，不支持ie8
        obj.preview(function (index, file, result) {
        });
      }
      , done: function (res) {
        //上传完毕回调
        addImg(res.path, "uploader10", "imgsDiv10", "ownershipCertificateUrl",1);
      }
      , error: function () {
        //请求异常回调
      }
    });
    upload.render({
      elem: '#uploader11' //绑定元素
      , url: '${ctx}/common/uploadFile' //上传接口
      , before: function (obj) {
        //预读本地文件示例，不支持ie8
        obj.preview(function (index, file, result) {
        });
      }
      , done: function (res) {
        //上传完毕回调
        addImg(res.path, "uploader11", "imgsDiv11", "otherOwnershipCertificateUrl",1);
      }
      , error: function () {
        //请求异常回调
      }
    });
    upload.render({
      elem: '#uploader12' //绑定元素
      , url: '${ctx}/common/uploadFile' //上传接口
      , before: function (obj) {
        //预读本地文件示例，不支持ie8
        obj.preview(function (index, file, result) {
        });
      }
      , done: function (res) {
        //上传完毕回调
        addImg(res.path, "uploader12", "imgsDiv12", "creditCertificate",4);
      }
      , error: function () {
        //请求异常回调
      }
    });
    upload.render({
      elem: '#uploader30' //绑定元素  补充信息
      , url: '${ctx}/common/weChat/uploadImageIden' //上传接口
      , before: function (obj) {
        //预读本地文件示例，不支持ie8
        obj.preview(function (index, file, result) {
        });
      }
      , done: function (res) {
        var obj =  JSON.parse(res.info);
        if (obj.code ==='500'){
          layer.msg("共签人身份信息上传失败,请确认后重试", {icon: 2});
          return;
        }
        var data = obj.data.face.data;
        console.log("data",data);
        $("#bpName").val(data.name);
        var age = getAge(data.idNumber);
        if(!isBlank(${partner.signerConditionAge}) && age>${partner.signerConditionAge}){
          layer.msg("年龄大于${partner.signerConditionAge}岁,小于18岁，不能作为共签人！", {icon: 2});
          return;
        }
        $("#bpIdCard").val(data.idNumber);
        //上传完毕回调
        addImg(res.path, "uploader30", "imgsDiv30", "bpCardFront",1);
      }
      , error: function () {
        //请求异常回调
      }
    });
    upload.render({
      elem: '#uploader31' //绑定元素  补充信息
      , url: '${ctx}/common/uploadFile' //上传接口
      , before: function (obj) {
        //预读本地文件示例，不支持ie8
        obj.preview(function (index, file, result) {
        });
      }
      , done: function (res) {
        //上传完毕回调
        addImg(res.path, "uploader31", "imgsDiv31", "bpCardBack",1);
      }
      , error: function () {
        //请求异常回调
      }
    });
    upload.render({
      elem: '#uploader32' //绑定元素  子女证明材料
      , url: '${ctx}/common/uploadFile' //上传接口
      , before: function (obj) {
        //预读本地文件示例，不支持ie8
        obj.preview(function (index, file, result) {
        });
      }
      , done: function (res) {
        //上传完毕回调
        addImg(res.path, "uploader32", "imgsDiv32", "bpFile",4);
      }
      , error: function () {
        //请求异常回调
      }
    });
    let initBankData = [];
    if (!isBlank(tssBankNumName) && !isBlank(tssBankNum)) {
      initBankData = [{name: tssBankNumName, value: tssBankNum, selected: true}];
    }
    var tssBankXm = xmSelect.render({
      el: '#tssBank',
      name: 'tssBank',
      radio: true,
      tips: '请输入查询',
      size: 'mini',
      style: {
        height: '30px',
      },
      paging: true,
      pageSize: 6,
      data: initBankData,
      clickClose: true,
      filterable: true,
      remoteSearch: true,
      remoteMethod: function (val, cb, show) {
        searchVal(val, cb, {
          name: val,
          partner:`${partner.id}`
        }, 'name');
      },
      on: function (data) {
        if (data.isAdd && data.arr.length > 0) {
          let d = data.arr[0];
          tssBankNumName = d.name;
          tssBankNum = d.value;
        } else {
          tssBankNumName = "";
          tssBankNum = "";
        }
      }
    });

    function searchVal(val, cb, searchData, filed) {
      if (!isBlank(val)) {
        $.ajax({
          type: 'post',
          url: '${ctx}/sysSettings/linkNumber/findLinkNumberList',
          data: searchData,
          async: false,
          dataType: 'json',
          success: function (d) {
            let arr = [];
            for (let i = 0; i < d.length; i++) {
              let data = {};
              data.name = d[i].columns.bank_name;
              data.value = d[i].columns.number;
              data.origin = d[i];
              arr.push(data);
            }
            cb(arr);
          }
        });
      } else {
        cb([]);
      }
    }


    //提交审核
    var submitFlag = false;
    $(".saveOrder").click(function () {
      if (submitFlag) {
        return;
      }
      let id = "${entry.id}";
      let residenceBooklet;//户口本复印件
      $(".residenceBooklet").each(function () {
        if (isBlank(residenceBooklet)) {
          residenceBooklet = $(this).val();
        } else {
          residenceBooklet = residenceBooklet + "," + $(this).val();
        }
      });


      let bankCard = $(".bankCard").val(); //银行卡照片
      // let houseOwnership=$(".houseOwnership").val(); //房产证
      let houseOwnership; //房产证
      $(".houseOwnership").each(function () {
        if (isBlank(houseOwnership)) {
          houseOwnership = $(this).val();
        } else {
          houseOwnership = houseOwnership + "," + $(this).val();
        }
      });
      let creditCertificate;//信誉凭证
      $(".creditCertificate").each(function () {
        if (isBlank(creditCertificate)) {
          creditCertificate = $(this).val();
        } else {
          creditCertificate = creditCertificate + "," + $(this).val();
        }
      });
      let exigenceName = $("#exigenceName").val();//紧急联系人
      let exigencePhone = $("#exigencePhone").val();//紧急联系人电话
      var address = $("input[name=customerAddress]").val();//用户地址
      let idCardFront = $('.idCardFront').val();//身份证正面
      let idCardBack = $('.idCardBack').val();//身份证反面
      let tenantType = "${entry.tenantType}";
      if (tenantType === "1") {
        if (isBlank(idCardFront)) {
          layer.msg("请上传身份证正面", {icon: 2});
          return
        }
        if (isBlank(idCardBack)) {
          layer.msg("请上传身份证背面", {icon: 2});
          return
        }
      }
      let bankName = $("#bankName").val(); //银行账号名称
      let bankCode = $("#bankCode").val(); //银行账号
      let bpName = $('#bpName').val();//共签人名称
      // let bpRelation = $('#bpRelation').val();//共签人与业主关系
      let bpRelation = $("#bpRelation").find("option:selected").val();//共签人与业主关系
      let bpIdCard = $('#bpIdCard').val();//共签人证件号码
      let bpMobile = $('#bpMobile').val();//共签人手机号
      let bpCardFront = $('.bpCardFront').val();//共签人身份证正面
      let bpCardBack = $('.bpCardBack').val();//共签人身份证反面

      let bpFile;   // 共签人子女证明材料
      $(".bpFile").each(function () {
        if (isBlank(bpFile)) {
          bpFile = $(this).val();
        } else {
          bpFile = bpFile + "," + $(this).val();
        }
      });
      console.log(bpFile);
      let birthdayDate = $('#birthdayDate').val(); //出生日期
      let icValidityBegin = $('#icValidityBegin').val(); //身份证生效日
      let icValidityEnd = $('#icValidityEnd').val(); //身份证到期日

      <c:if test="${entry.tenantType eq '1'}">
      <c:if test="${info3.columns.birthday_date.status eq '1'}">
      if (isBlank(birthdayDate)) {
        layer.msg("请上传身份证正面", {icon: 2});
        return
      }
      </c:if>

      <c:if test="${info3.columns.ic_validity_begin.status eq '1'}">
      if (isBlank(icValidityBegin)) {
        layer.msg("请上传身份证背面", {icon: 2});
        return
      }
      </c:if>

      <c:if test="${info3.columns.ic_validity_end.status eq '1'}">
      if (isBlank(icValidityEnd)) {
        layer.msg("请上传身份证背面", {icon: 2});
        return
      }
      </c:if>
      </c:if>
      //let bpFile = $('.bpFile').val();//共签人子女证明材料
      let resolutionPaperUrl = $('.resolutionPaperUrl').val();//村民代表大会决议书
      let yszcUrl = $('.yszcUrl').val();//村委议事章程
      let accountInfoUrl = $('.accountInfoUrl').val();//对公账户信息
      let ownershipCertificateUrl = $('.ownershipCertificateUrl').val();//产权证明-集体土地使用证
      let otherOwnershipCertificateUrl = $('.otherOwnershipCertificateUrl').val();//产权证明-不动产证书/查册证明/相关确权文件
      let bankNumName = tssBankNumName;
      <c:if test="${info.columns.tss_bank_num_name.columnType eq '2'}">
      bankNumName = $("#tssBank").val();
      </c:if>
      let SubmitArchivesReq = {
        entryId: id,
        type: 2,//1.暂存 2.提交
        residenceBooklet: residenceBooklet,//户口本复印件
        houseOwnership: houseOwnership,//房产证
        creditCertificate: creditCertificate,//信誉凭证
        exigenceName: exigenceName,//紧急联系人
        exigencePhone: exigencePhone,//紧急联系人手机号
        address: address,//详细地址
        idCardFront: idCardFront, // 身份证-正
        idCardBack: idCardBack, // 身份证-反
        bankName: bankName,//银行账号名称
        bankCode: bankCode,//银行账号
        tssBankNum: tssBankNum,//联行号
        tssBankNumName: bankNumName,//开户行
        bankCard: bankCard,//银行卡照片
        bpCardFront: bpCardFront,//共签人身份证照片-正面
        bpCardBack: bpCardBack,//共签人身份证照片-反面
        bpName: bpName,//共签人姓名
        bpRelation: bpRelation,//共签人与业主关系
        bpIdCard: bpIdCard,//共签人证件号码
        bpMobile: bpMobile,//共签人手机号
        bpFile: bpFile,//共签人子女证明材料
        resolutionPaperUrl: resolutionPaperUrl,//村民代表大会决议书
        yszcUrl: yszcUrl,//村委议事章程
        accountInfoUrl: accountInfoUrl,//对公账户信息
        ownershipCertificateUrl: ownershipCertificateUrl,//产权证明-集体土地使用证
        otherOwnershipCertificateUrl: otherOwnershipCertificateUrl,//产权证明-不动产证书/查册证明/相关确权文件
        birthdayDate: birthdayDate,//出生日期
        icValidityBegin: icValidityBegin,//身份证生效日
        icValidityEnd: icValidityEnd//身份证到期日
      }
      let index = layer.load(2, {shade: [0.5, '#fff'], content: ''});
      submitFlag = true;
      $.ajax({
        url: "${ctx}/customer/org/files/submitArchives",
        type: "POST",
        contentType: "application/json;charsetset=UTF-8",
        data: JSON.stringify(SubmitArchivesReq),
        success: function (result) {
          console.log(result);
          if (result.code === '200') {
            let index = parent.layer.getFrameIndex(window.name);
            layer.msg("保存成功", {icon: 1, time: 1000}, function () {
              parent.layer.close(index);
              parent.searchOrder(); //刷新父页面
            })
          } else {
            if (isBlank(result.errMsg)) {
              layer.msg("操作失败！请联系管理员！", {icon: 2});
            } else {
              layer.msg("操作失败，" + result.errMsg, {icon: 2});
            }
          }
          submitFlag = false;

        },
        complete: function () {
          layer.close(index);
        },
        error: function () {
          layer.msg("保存失败", {icon: 2});
          submitFlag = false;
        }
      })
    });

    //暂存
    var submitFlag = false;
    $(".tempSaveOrder").click(function () {
      if (submitFlag) {
        return;
      }
      let id = "${entry.id}";
      let residenceBooklet;//户口本复印件
      $(".residenceBooklet").each(function () {
        if (isBlank(residenceBooklet)) {
          residenceBooklet = $(this).val();
        } else {
          residenceBooklet = residenceBooklet + "," + $(this).val();
        }
      });

      let bankCard = $(".bankCard").val(); //银行卡照片
// let houseOwnership=$(".houseOwnership").val(); //房产证
      let houseOwnership; //房产证
      $(".houseOwnership").each(function () {
        if (isBlank(houseOwnership)) {
          houseOwnership = $(this).val();
        } else {
          houseOwnership = houseOwnership + "," + $(this).val();
        }
      });
      let creditCertificate;//信誉凭证
      $(".creditCertificate").each(function () {
        if (isBlank(creditCertificate)) {
          creditCertificate = $(this).val();
        } else {
          creditCertificate = creditCertificate + "," + $(this).val();
        }
      });
      let exigenceName = $("#exigenceName").val();//紧急联系人
      let exigencePhone = $("#exigencePhone").val();//紧急联系人电话
      var address = $("input[name=customerAddress]").val();//用户地址
      let idCardFront = $('.idCardFront').val();//身份证正面
      let idCardBack = $('.idCardBack').val();//身份证反面
      let tenantType = "${entry.tenantType}";
      if (tenantType === "1") {
        if (isBlank(idCardFront)) {
          layer.msg("请上传身份证正面", {icon: 2});
          return
        }
        if (isBlank(idCardBack)) {
          layer.msg("请上传身份证背面", {icon: 2});
          return
        }
      }
      let bankName = $("#bankName").val(); //银行账号名称
      let bankCode = $("#bankCode").val(); //银行账号
      let bpName = $('#bpName').val();//共签人名称
      let bpRelation = $('#bpRelation').val();//共签人与业主关系
      let bpIdCard = $('#bpIdCard').val();//共签人证件号码
      let bpMobile = $('#bpMobile').val();//共签人手机号
      let bpCardFront = $('.bpCardFront').val();//共签人身份证正面
      let bpCardBack = $('.bpCardBack').val();//共签人身份证反面
//let bpFile = $('.bpFile').val();//共签人子女证明材料
      let bpFile; // 共签人子女证明材料
      $(".bpFile").each(function () {
        if (isBlank(bpFile)) {
          bpFile = $(this).val();
        } else {
          bpFile = bpFile + "," + $(this).val();
        }
      });
      let resolutionPaperUrl = $('.resolutionPaperUrl').val();//村民代表大会决议书
      let yszcUrl = $('.yszcUrl').val();//村委议事章程
      let accountInfoUrl = $('.accountInfoUrl').val();//对公账户信息
      let ownershipCertificateUrl = $('.ownershipCertificateUrl').val();//产权证明-集体土地使用证
      let otherOwnershipCertificateUrl = $('.otherOwnershipCertificateUrl').val();//产权证明-不动产证书/查册证明/相关确权文件
      let birthdayDate = $('#birthdayDate').val(); //出生日期
      let icValidityBegin = $('#icValidityBegin').val(); //身份证生效日
      let icValidityEnd = $('#icValidityEnd').val(); //身份证到期日

      <c:if test="${entry.tenantType eq '1'}">
      <c:if test="${info3.columns.birthday_date.status eq '1'}">
      if (isBlank(birthdayDate)) {
        layer.msg("请上传身份证正面", {icon: 2});
        return
      }
      </c:if>

      <c:if test="${info3.columns.ic_validity_begin.status eq '1'}">
      if (isBlank(icValidityBegin)) {
        layer.msg("请上传身份证背面", {icon: 2});
        return
      }
      </c:if>

      <c:if test="${info3.columns.ic_validity_end.status eq '1'}">
      if (isBlank(icValidityEnd)) {
        layer.msg("请上传身份证背面", {icon: 2});
        return
      }
      </c:if>
      </c:if>

      let bankNumName = tssBankNumName;
      <c:if test="${info.columns.tss_bank_num_name.columnType eq '2'}">
      bankNumName = $("#tssBank").val();
      </c:if>
      let SubmitArchivesReq = {
        entryId: id,
        type: 1,//1.暂存 2.提交
        residenceBooklet: residenceBooklet,//户口本复印件
        address: address,//详细地址
        idCardFront: idCardFront, // 身份证-正
        idCardBack: idCardBack, // 身份证-反
        houseOwnership: houseOwnership,//房产证
        creditCertificate: creditCertificate,//信誉凭证
        exigenceName: exigenceName,//紧急联系人
        exigencePhone: exigencePhone,//紧急联系人手机号
        bankName: bankName,//银行账号名称
        bankCode: bankCode,//银行账号
        tssBankNum: tssBankNum,//联行号
        tssBankNumName: bankNumName,//开户行
        bankCard: bankCard,//银行卡照片
        bpCardFront: bpCardFront,//共签人身份证照片-正面
        bpCardBack: bpCardBack,//共签人身份证照片-反面
        bpName: bpName,//共签人姓名
        bpRelation: bpRelation,//共签人与业主关系
        bpIdCard: bpIdCard,//共签人证件号码
        bpMobile: bpMobile,//共签人手机号
        bpFile: bpFile,//共签人子女证明材料
        resolutionPaperUrl: resolutionPaperUrl,//村民代表大会决议书
        yszcUrl: yszcUrl,//村委议事章程
        accountInfoUrl: accountInfoUrl,//对公账户信息
        ownershipCertificateUrl: ownershipCertificateUrl,//产权证明-集体土地使用证
        otherOwnershipCertificateUrl: otherOwnershipCertificateUrl,//产权证明-不动产证书/查册证明/相关确权文件
        birthdayDate: birthdayDate,//出生日期
        icValidityBegin: icValidityBegin,//身份证生效日
        icValidityEnd: icValidityEnd,//身份证到期日
      }
      let index = layer.load(2, {shade: [0.5, '#fff'], content: ''});
      submitFlag = true;
      $.ajax({
        url: "${ctx}/customer/org/files/submitArchives",
        type: "POST",
        contentType: "application/json;charsetset=UTF-8",
        data: JSON.stringify(SubmitArchivesReq),
        success: function (result) {
          console.log(result);
          if (result.code === '200') {
            let index = parent.layer.getFrameIndex(window.name);
            layer.msg("保存成功", {icon: 1, time: 1000}, function () {
              parent.layer.close(index);
              parent.searchOrder(); //刷新父页面
            })
          } else {
            if (isBlank(result.errMsg)) {
              layer.msg("操作失败！请联系管理员！", {icon: 2});
            } else {
              layer.msg("操作失败，" + result.errMsg, {icon: 2});
            }
          }
          submitFlag = false;

        },
        complete: function () {
          layer.close(index);
        },
        error: function () {
          layer.msg("保存失败", {icon: 2});
          submitFlag = false;
        }
      })
    });

  });

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

  function addImg(data, id, imgsDiv, classimg, count) {
    var imgCount = $("#" + imgsDiv).find(".imgSpan").length;
    if ((imgCount + 1) >= count) {
      $("#" + 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 + '" value="' + data + '"/> </div>';
    $("#" + imgsDiv).append(html);
    //图片查看效果
    viewer.update();
  }

  function appendTr(data) {
    let d = data.arr[0].origin;
    tssBankNum = d.columns.number;
    tssBankNumName = d.columns.bank_name;
  }

  function appendTrAnother(data) {
    let d = data.arr[0].origin;
    tssBankNumAnother = d.columns.number;
    tssBankNumNameAnother = d.columns.bank_name;
  }

  function convertToISOFormat(dateString) {
    const dateComponents = dateString.split('年');
    const year = dateComponents[0];
    const monthDay = dateComponents[1].split('月');
    const month = monthDay[0];
    const day = monthDay[1].split('日')[0];
    let temp = year+"-"+month+"-"+day;
    return temp;
  }

  function isBlank(val) {
    if (val == null || val === '' || val === undefined) {
      return true;
    }
    return false;
  }
  function getAge(idCard) {
    // 从身份证号中获取出生日期
    var birthday = new Date(idCard.substring(6, 10), parseInt(idCard.substring(10, 12)) - 1, idCard.substring(12, 14));

    // 获取当前日期
    var today = new Date();

    // 计算年龄
    var age = today.getFullYear() - birthday.getFullYear();

    // 如果当前月份小于出生月份，或者当前月份等于出生月份但是当前日期小于出生日期，则年龄减一
    if (today.getMonth() < birthday.getMonth() || (today.getMonth() === birthday.getMonth() && today.getDate() < birthday.getDate())) {
      age--;
    }
    return age;
  }

  // 关闭弹框
  function cancel() {
    var index = parent.layer.getFrameIndex(window.name);//先得到当前iframe层的索引
    parent.layer.close(index); //再执行关闭
  }


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