<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <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" type="text/css" 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;
        }
        .hide{
            display: none;
        }
        td .layui-form-select{
            width: 150px;
            margin-right: 15px;
            float: left;
        }
        .load-icon{background: url('${ctxPlugin}/static/img/shili_img.png') center center no-repeat; width: 12px; height: 12px; display: inline-block; border-radius: 50%;
            vertical-align: text-bottom;transform: translate(0px, -1px);margin-right: 2px;}

        .w-130{width: 110px;}
        .w-130+.layui-input-block{margin-left: 120px;}
        .form-box .layui-inline {margin-bottom: 5px;}
        .layui-form-checkbox i{border-left: 1px solid #d2d2d2;}
        .layui-table th{text-align: center}
        .layui-table td{text-align: center}
        .layui-table tr{height: 48px}
        .inline-block{
            display:inline-block
        }
    </style>
</head>
<body>
<input type="hidden"  class="layui-input"  id="partnerId" name="partnerId">
<div class="layui-form">
    <div class="layui-card">
        <div class="layui-card-body pt-20 over-auto">
            <div class="layui-col-xs12 form-box">
                <input hidden id="id"  value="${changeRecord.columns.id}">
                <div class="layui-inline layui-col-xs3">
                    <label class="layui-form-label w-130">电站编码：</label>
                    <div class="layui-input-block ">
                        <input type="text" autocomplete="off" disabled  name="stationCode" lay-verify="stationCode" class="layui-input"  value="${changeRecord.columns.power_station_code}">
                        <input type="text" id="entryId" lay-verify="stationCode" class="layui-input hide" value="${changeRecord.columns.entry_id}">
                        <a href="#" class="pos-a h-32 lh-32 layui-span-unit pl-10 layui-table-link" onclick="selectEntry()" style="font-size: 20px">+</a>
                        <%--  <button type="button" class="layui-btn layui-btn-sm <c:if test="${not empty changeRecord.columns.id}">layui-hide</c:if>" onclick="searchCode()">
                              <i class="layui-icon">&#xe615;</i>
                          </button>--%>
                    </div>
                </div>
                <div class="layui-inline layui-col-xs3">
                    <label class="layui-form-label w-130">电站状态：</label>
                    <div class="layui-input-block ">
                        <input type="text" name="entryStatus" value="${changeRecord.columns.entry_status}" class="layui-input" disabled>
                    </div>
                </div>
                <div class="layui-inline layui-col-xs3">
                    <label class="layui-form-label w-130">代理商：</label>
                    <div class="layui-input-block ">
                        <input type="text"  name="traderName" class="layui-input"  disabled value="${changeRecord.columns.trader_name}">
                    </div>
                </div>
                <%--<div class="layui-inline layui-col-xs3">
                    <label class="layui-form-label w-130">审核状态：</label>
                    <div class="layui-input-block ">
                        <input type="text"  name="proName" class="layui-input" value="" disabled>
                    </div>
                </div>--%>
                <div class="layui-inline layui-col-xs3">
                    <label class="layui-form-label w-130">产品名称：</label>
                    <div class="layui-input-block ">
                        <input type="text"  name="projectName" class="layui-input" disabled value="${changeRecord.columns.project_name}">
                    </div>
                </div>

                <div class="layui-inline layui-col-xs3">
                    <label class="layui-form-label w-130">项目公司：</label>
                    <div class="layui-input-block ">
                        <input type="text"  name="projectCompanyName" class="layui-input" disabled value="${changeRecord.columns.project_company_name}">
                    </div>
                </div>

                <div class="layui-inline layui-col-xs3">
                    <label class="layui-form-label w-130">业主姓名：</label>
                    <div class="layui-input-block ">
                        <input type="text"  name="tenantName" class="layui-input" value="${changeRecord.columns.tenant_name}" disabled>
                    </div>
                </div>
                <div class="layui-inline layui-col-xs3">
                    <label class="layui-form-label w-130">所属资方：</label>
                    <div class="layui-input-block ">
                        <input type="text" name="partnerName" class="layui-input" value="" disabled>
                    </div>
                </div>
                <div class="layui-inline layui-col-xs3">
                    <label class="layui-form-label w-130">身份证号：</label>
                    <div class="layui-input-block ">
                        <input type="text" name="idCode" class="layui-input" value="${changeRecord.columns.id_code}" disabled>
                    </div>
                </div>
                <div class="layui-inline layui-col-xs12">
                    <label class="layui-form-label w-130">安装地址：</label>
                    <div class="layui-input-block ">
                        <input type="text"  name="address" class="layui-input" disabled value="${changeRecord.columns.customerAddress}">
                    </div>
                </div>

                <%--<div class="layui-inline layui-col-xs3">
                    <label class="layui-form-label w-130">变更类型：</label>
                    <div class="layui-input-block ">
                        <input type="text"  class="layui-input" value="客户信息变更" disabled>
                    </div>
                </div>
                <div class="layui-inline layui-col-xs3">
                    <label class="layui-form-label w-130">变更单号：</label>
                    <div class="layui-input-block ">
                        <input type="text"  name="tel" class="layui-input" value="" disabled>
                    </div>
                </div>
                <div class="layui-inline layui-col-xs3">
                    <label class="layui-form-label w-130">变更申请人：</label>
                    <div class="layui-input-block ">
                        <input type="text"  name="creator" class="layui-input" value="" disabled>
                    </div>
                </div>
                <div class="layui-inline layui-col-xs3">
                    <label class="layui-form-label w-130">申请时间：</label>
                    <div class="layui-input-block ">
                        <input type="text"  name="createDate" class="layui-input" value="" disabled>
                    </div>
                </div>--%>

                <div class="layui-inline layui-col-xs12">
                    <label class="layui-form-label w-130"><i class="mark">*</i> 变更原因：</label>
                    <div class="layui-input-block ">
                        <textarea name="reason" id="reason" placeholder="" class="layui-textarea">${changeRecord.columns.change_reason}</textarea>
                        <%--                        <input type="text"  name="reason" class="layui-input" value="${changeRecord.columns.change_reason}">--%>
                    </div>
                </div>

            </div>
        </div>
        <div  id="LAY_app">
            <div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
                <ul class="layui-tab-title" id="changeTabId" lay-filter="changeTab" >
                    <li class="layui-this">客户信息</li>
                </ul>
                <div class="layui-tab-content">
                    <div class="layui-col-xs12" style="margin-bottom: 60px">
                        <table class="layui-table" id="test" lay-filter="test">
                            <thead>
                            <tr>
                                <th width="30">选择</th>
                                <th width="30">序号</th>
                                <th width="80">数据项</th>
                                <th width="300">变更前信息</th>
                                <th width="300">变更后信息</th>
                                <th width="80">影响合同变更</th>
                            </tr>
                            </thead>
                            <tbody id="productParaListBody" >
                            <%--联系方式--%>
                            <tr class="hide" data-ppara_code="mobile" data-value="1">
                                <td class="idx"><input type="checkbox" lay-skin="primary" lay-filter="ifChecked" <c:if test="${'1' eq mapDetails.mobile.columns.if_change}">checked</c:if>><input hidden name="ifChange" value="${mapDetails.mobile.columns.if_change}"></td>
                                <td class="idx">1<input type="hidden" value="" class="setsort"></td>
                                <td class="">联系方式</td>
                                <td class="mobile">${mapDetails.mobile.columns.before_change}</td>
                                <td class=""><input id="mobile"  class="layui-input <c:if test="${empty mapDetails.mobile.columns.if_change ||  '0' eq mapDetails.mobile.columns.if_change}">hide</c:if>" name="afterChange" value="${mapDetails.mobile.columns.after_change}" ></td>
                                <td class=""><input type="checkbox" lay-skin="primary" disabled <c:if test="${'1' eq mapDetails.mobile.columns.if_affect_contract}">checked</c:if>><input hidden name="ifAffectContract" value="${mapDetails.mobile.columns.if_affect_contract}"></td>
                            </tr>
                            <%--开户行--%>
                            <tr class="hide"  data-ppara_code="tssBankNumName" data-value="1">
                                <td class="idx"><input type="checkbox" lay-skin="primary" lay-filter="ifChecked" <c:if test="${'1' eq mapDetails.tssBankNumName.columns.if_change}">checked</c:if>><input hidden name="ifChange" value="${mapDetails.tssBankNumName.columns.if_change}"></td>
                                <td class="idx">2<input type="hidden" value="" class="setsort"></td>
                                <td class="">开户行</td>
                                <td class="tssBankNumName" data-value="${mapDetails.tssBankNum.columns.before_change}">${mapDetails.tssBankNumName.columns.before_change}</td>
                                <%--<input  class="layui-input <c:if test="${empty mapDetails.tssBankNumName.columns.if_change || '0' eq mapDetails.tssBankNumName.columns.if_change}">hide</c:if>" name="afterChange" value="${mapDetails.tssBankNumName.columns.after_change}" >
                                --%>
                                <td class=""><div id="tssBank" class="<c:if test="${empty mapDetails.tssBankNumName.columns.if_change || '0' eq mapDetails.tssBankNumName.columns.if_change}">hide</c:if>"></div></td>
                                <td class=""><input type="checkbox" lay-skin="primary" disabled <c:if test="${'1' eq mapDetails.tssBankNumName.columns.if_affect_contract}">checked</c:if>><input hidden name="ifAffectContract" value="${ mapDetails.tssBankNumName.columns.if_affect_contract}"></td>
                            </tr>
                            <%--银行账号--%>
                            <tr class="hide"  data-ppara_code="bankCode" data-value="1">
                                <td class="idx"><input type="checkbox" lay-skin="primary" lay-filter="ifChecked" <c:if test="${'1' eq mapDetails.bankCode.columns.if_change}">checked</c:if>><input hidden name="ifChange" value="${mapDetails.bankCode.columns.if_change}"></td>
                                <td class="idx">3<input type="hidden" value="" class="setsort"></td>
                                <td class="">银行账号</td>
                                <td class="bankCode">${mapDetails.bankCode.columns.before_change}</td>
                                <td class=""><input id="bankCode"  class="layui-input <c:if test="${empty mapDetails.bankCode.columns.if_change || '0' eq mapDetails.bankCode.columns.if_change}">hide</c:if>" name="afterChange" value="${mapDetails.bankCode.columns.after_change}"></td>
                                <td class=""><input type="checkbox" lay-skin="primary" disabled <c:if test="${'1' eq mapDetails.bankCode.columns.if_affect_contract}">checked</c:if>><input hidden name="ifAffectContract" value="${mapDetails.bankCode.columns.if_affect_contract}"></td>
                            </tr>
                            <%--身份证--%>
                            <tr class="hide" data-ppara_code="idCardImg" data-value="2"> <%--idCardFront idCardBack--%>
                                <td class="idx"><input type="checkbox" lay-skin="primary" lay-filter="ifChecked" <c:if test="${'1' eq mapDetails.idCardFront.columns.if_change}">checked</c:if>><input hidden name="ifChange" value="${mapDetails.idCardFront.columns.if_change}"></td>
                                <td class="idx">4<input type="hidden" value="2" class="setsort"></td>
                                <td class="">身份证</td>
                                <td class="idCardFront">
                                    <div class="img-box <c:if test="${empty changeRecord.columns.id}">hide</c:if>">
                                        <div>
                                            <div class="bj-img imgSpan">
                                                <img src="${commonStaticImgPath}${mapDetails.idCardFront.columns.before_change}">
                                                <input hidden id="idCardFront" value="${mapDetails.idCardFront.columns.before_change}">
                                            </div>
                                            <div style="width: 80px; text-align: center; color: #FF0000">正面</div>
                                        </div>
                                        <div>
                                            <div class="bj-img imgSpan">
                                                <img src="${commonStaticImgPath}${mapDetails.idCardBack.columns.before_change}">
                                                <input hidden id="idCardBack" value="${mapDetails.idCardBack.columns.before_change}">
                                            </div>
                                            <div style="width: 80px; text-align: center; color: #FF0000">反面</div>
                                        </div>
                                    </div>
                                </td>
                                <td class="">
                                    <div class="img-box <c:if test="${empty changeRecord.columns.id}">hide</c:if>">
                                        <div>
                                            <div class="imgsDiv">
                                                <c:if test="${not empty mapDetails.idCardFront.columns.after_change}">
                                                    <div class="bj-img imgSpan">
                                                        <span class="layui-icon-close layui-icon" onclick="delMoreImg(this)"></span>
                                                        <img src="${commonStaticImgPath}${mapDetails.idCardFront.columns.after_change}">
                                                        <input type="hidden" class="data-input" name="idCardFront" value="${mapDetails.idCardFront.columns.after_change}">
                                                    </div>
                                                </c:if>
                                            </div>
                                            <div class="upload-container moreUpload <c:if test="${not empty mapDetails.idCardFront.columns.after_change}">hide</c:if>" id="uploader1" data-type="1" data-title="idCardFront">
                                                <img src="" alt="img placeholder" id="imgsAdd1">
                                            </div>
                                            <div style="width: 80px; text-align: center; color: #FF0000">正面</div>
                                        </div>
                                        <div>
                                            <div class="imgsDiv">
                                                <c:if test="${not empty mapDetails.idCardBack.columns.after_change}">
                                                    <div class="bj-img imgSpan">
                                                        <span class="layui-icon-close layui-icon" onclick="delMoreImg(this)"></span>
                                                        <img src="${commonStaticImgPath}${mapDetails.idCardBack.columns.after_change}">
                                                        <input type="hidden" class="data-input" name="idCardBack" value="${mapDetails.idCardBack.columns.after_change}">
                                                    </div>
                                                </c:if>
                                            </div>
                                            <div class="upload-container moreUpload <c:if test="${not empty mapDetails.idCardBack.columns.after_change}">hide</c:if>" id="uploader2" data-type="1" data-title="idCardBack">
                                                <img src="" alt="img placeholder" id="imgsAdd2">
                                            </div>
                                            <div style="width: 80px; text-align: center; color: #FF0000">反面</div>
                                        </div>
                                    </div>
                                </td>
                                <td class=""><input type="checkbox" lay-skin="primary" disabled <c:if test="${'1' eq mapDetails.idCardBack.columns.if_affect_contract}">checked</c:if>><input hidden name="ifAffectContract" value="${mapDetails.idCardBack.columns.if_affect_contract}"></td>
                            </tr>
                            <%--房产证--%>
                            <tr  class="hide" data-ppara_code="HouseOwnership" data-value="2">
                                <td class="idx"><input type="checkbox" lay-skin="primary" lay-filter="ifChecked" <c:if test="${'1' eq mapDetails.HouseOwnership.columns.if_change}">checked</c:if>><input hidden name="ifChange" value="${mapDetails.HouseOwnership.columns.if_change}"></td>
                                <td class="idx">5<input type="hidden" value="2" class="setsort"></td>
                                <td class="">房产证</td>
                                <td class="HouseOwnership">
                                    <div class="img-box <c:if test="${empty changeRecord.columns.id}">hide</c:if>">
                                        <div id="HouseOwnershipImg">
                                            <c:if test="${not empty mapDetails.HouseOwnership.columns.before_change}">
                                                <c:forEach items="${fn:split(mapDetails.HouseOwnership.columns.before_change,',')}" var="img">
                                                    <div class="bj-img imgSpan">
                                                        <img src="${commonStaticImgPath}${img}">
                                                        <input hidden name="HouseOwner" value="${img}">
                                                    </div>
                                                </c:forEach>
                                            </c:if>
                                        </div>
                                    </div>
                                </td>
                                <td class="">
                                    <div style="display: flex;flex-wrap: wrap;" class="img-box <c:if test="${empty changeRecord.columns.id}">hide</c:if>">
                                        <div class="imgsDiv">
                                            <c:if test="${not empty mapDetails.HouseOwnership.columns.after_change}">
                                                <c:forEach items="${fn:split(mapDetails.HouseOwnership.columns.after_change,',')}" var="img">
                                                    <div class="bj-img imgSpan">
                                                        <span class="layui-icon-close layui-icon" onclick="delMoreImg(this)"></span>
                                                        <img src="${commonStaticImgPath}${img}">
                                                        <input type="hidden" class="data-input" name="HouseOwnership" value="${img}">
                                                    </div>
                                                </c:forEach>
                                            </c:if>
                                        </div>
                                        <div class="upload-container moreUpload <c:if test="${fn:length(fn:split(mapDetails.HouseOwnership.columns.after_change,',')) eq 8 }">hide</c:if>" id="uploader9" data-type="8" data-title="HouseOwnership">
                                            <img src="" alt="img placeholder" id="imgsAdd9">
                                        </div>
                                    </div>
                                </td>
                                <td class=""><input type="checkbox" lay-skin="primary" disabled <c:if test="${'1' eq mapDetails.bankCard.columns.if_affect_contract}">checked</c:if>><input hidden name="ifAffectContract" value="${mapDetails.bankCard.columns.if_affect_contract}"></td>
                            </tr>
                            <%--银行卡--%>
                            <tr  class="hide" data-ppara_code="bankCard" data-value="2">
                                <td class="idx"><input type="checkbox" lay-skin="primary" lay-filter="ifChecked" <c:if test="${'1' eq mapDetails.bankCard.columns.if_change}">checked</c:if>><input hidden name="ifChange" value="${mapDetails.bankCard.columns.if_change}"></td>
                                <td class="idx">6<input type="hidden" value="2" class="setsort"></td>
                                <td class="">银行卡</td>
                                <td class="bankCard">
                                    <div class="img-box <c:if test="${empty changeRecord.columns.id}">hide</c:if>">
                                        <div>
                                            <div class="bj-img imgSpan">
                                                <img src="${commonStaticImgPath}${mapDetails.bankCard.columns.before_change}">
                                                <input hidden id="bankCard" value="${mapDetails.bankCard.columns.before_change}">
                                            </div>
                                        </div>
                                    </div>
                                </td>
                                <td class="">
                                    <div class="img-box <c:if test="${empty changeRecord.columns.id}">hide</c:if>">
                                        <div class="imgsDiv">
                                            <c:if test="${not empty mapDetails.bankCard.columns.after_change}">
                                                <div class="bj-img imgSpan">
                                                    <span class="layui-icon-close layui-icon" onclick="delMoreImg(this)"></span>
                                                    <img src="${commonStaticImgPath}${mapDetails.bankCard.columns.after_change}">
                                                    <input type="hidden" class="data-input" name="bankCard" value="${mapDetails.bankCard.columns.after_change}">
                                                </div>
                                            </c:if>
                                        </div>
                                        <div class="upload-container moreUpload <c:if test="${not empty mapDetails.bankCard.columns.after_change}">hide</c:if>" id="uploader8" data-type="1" data-title="bankCard">
                                            <img src="" alt="img placeholder" id="imgsAdd8">
                                        </div>
                                    </div>
                                </td>
                                <td class=""><input type="checkbox" lay-skin="primary" disabled <c:if test="${'1' eq mapDetails.bankCard.columns.if_affect_contract}">checked</c:if>><input hidden name="ifAffectContract" value="${mapDetails.bankCard.columns.if_affect_contract}"></td>
                            </tr>
                            <%--地址--%>
                            <tr  class="hide" data-ppara_code="address" data-value="3">
                                <td class="idx"><input type="checkbox" lay-skin="primary" lay-filter="ifChecked" <c:if test="${'1' eq mapDetails.address.columns.if_change}">checked</c:if>><input hidden name="ifChange" value="${mapDetails.address.columns.if_change}"></td>
                                <td class="idx">7<input type="hidden" value="" class="setsort"></td>
                                <td class="">安装地址</td>
                                <td class="address">${mapDetails.address.columns.before_change}</td>
                                <td class=""><span class="entryAddress hide" name="entryAddress"></span><input id="address" style="margin-left: 10px;width: 60%;"  placeholder="详细地址" class="layui-input <c:if test="${empty mapDetails.address.columns.if_change ||  '0' eq mapDetails.address.columns.if_change}">hide</c:if>" name="afterChange" value="${mapDetails.address.columns.after_change}" ></td>
                                <td class=""><input type="checkbox" lay-skin="primary" disabled <c:if test="${'1' eq mapDetails.address.columns.if_affect_contract}">checked</c:if>><input hidden name="ifAffectContract" value="${mapDetails.address.columns.if_affect_contract}"></td>
                            </tr>
                            <%--共签人身份证--%>
                            <tr class="hide" id="bpCardImgDiv" data-ppara_code="bpCardImg" data-value="2">
                                <td class="idx"><input type="checkbox" lay-skin="primary" lay-filter="ifChecked" <c:if test="${'1' eq mapDetails.bpCardFront.columns.if_change}">checked</c:if>><input hidden name="ifChange" value="${mapDetails.bpCardFront.columns.if_change}"></td>
                                <td class="idx">8<input type="hidden" value="2" class="setsort"></td>
                                <td class="">共签人身份证</td>
                                <td class="bpCardFront">
                                    <div class="img-box <c:if test="${empty changeRecord.columns.id}">hide</c:if>">
                                        <div>
                                            <div class="bj-img imgSpan">
                                                <img src="${commonStaticImgPath}${mapDetails.bpCardFront.columns.before_change}">
                                                <input hidden id="bpCardFront" value="${mapDetails.bpCardFront.columns.before_change}">
                                            </div>
                                            <div style="width: 80px; text-align: center; color: #FF0000">正面</div>
                                        </div>
                                        <div>
                                            <div class="bj-img imgSpan">
                                                <img src="${commonStaticImgPath}${mapDetails.bpCardBack.columns.before_change}">
                                                <input hidden id="bpCardBack" value="${mapDetails.bpCardBack.columns.before_change}">
                                            </div>
                                            <div style="width: 80px; text-align: center; color: #FF0000">反面</div>
                                        </div>
                                    </div>
                                </td>
                                <td class="">
                                    <div class="img-box <c:if test="${empty changeRecord.columns.id}">hide</c:if>">
                                        <div>
                                            <div class="imgsDiv">
                                                <c:if test="${not empty mapDetails.bpCardFront.columns.after_change}">
                                                    <div class="bj-img imgSpan">
                                                        <span class="layui-icon-close layui-icon" onclick="delMoreImg(this)"></span>
                                                        <img src="${commonStaticImgPath}${mapDetails.bpCardFront.columns.after_change}">
                                                        <input type="hidden" class="data-input" name="bpCardFront" value="${mapDetails.bpCardFront.columns.after_change}">
                                                    </div>
                                                </c:if>
                                            </div>
                                            <div class="upload-container moreUpload <c:if test="${not empty mapDetails.bpCardFront.columns.after_change}">hide</c:if>" id="uploader3" data-type="1" data-title="bpCardFront">
                                                <img src="" alt="img placeholder" id="imgsAdd3">
                                            </div>
                                            <div style="width: 80px; text-align: center; color: #FF0000">正面</div>
                                        </div>
                                        <div>
                                            <div class="imgsDiv">
                                                <c:if test="${not empty mapDetails.bpCardBack.columns.after_change}">
                                                    <div class="bj-img imgSpan">
                                                        <span class="layui-icon-close layui-icon" onclick="delMoreImg(this)"></span>
                                                        <img src="${commonStaticImgPath}${mapDetails.bpCardBack.columns.after_change}">
                                                        <input type="hidden" class="data-input" name="bpCardBack" value="${mapDetails.bpCardBack.columns.after_change}">
                                                    </div>
                                                </c:if>
                                            </div>
                                            <div class="upload-container moreUpload <c:if test="${not empty mapDetails.bpCardBack.columns.after_change}">hide</c:if>" id="uploader4" data-type="1" data-title="bpCardBack">
                                                <img src="" alt="img placeholder" id="imgsAdd4">
                                            </div>
                                            <div style="width: 80px; text-align: center; color: #FF0000">反面</div>
                                        </div>
                                    </div>
                                </td>
                                <td class=""><input type="checkbox" lay-skin="primary" disabled <c:if test="${'1' eq mapDetails.bpCardBack.columns.if_affect_contract}">checked</c:if>><input hidden name="ifAffectContract" value="${mapDetails.bpCardBack.columns.if_affect_contract}"></td>
                            </tr>
                            <%--子女证明材料--%>
                            <tr  class="hide" id="bpFileDiv" data-ppara_code="bpFile" data-value="2">
                                <td class="idx"><input type="checkbox" lay-skin="primary" lay-filter="ifChecked" <c:if test="${'1' eq mapDetails.bpFile.columns.if_change}">checked</c:if>><input hidden name="ifChange" value="${mapDetails.bpFile.columns.if_change}"></td>
                                <td class="idx">9<input type="hidden" value="2" class="setsort"></td>
                                <td class="">共签人子女证明</td>
                                <td class="bpFile">
                                    <div class="img-box <c:if test="${empty changeRecord.columns.id}">hide</c:if>">
                                        <div id="bpFile">
                                            <c:if test="${not empty mapDetails.bpFile.columns.before_change}">
                                                <c:forEach items="${fn:split(mapDetails.bpFile.columns.before_change,',')}" var="img">
                                                    <div class="bj-img imgSpan">
                                                        <img src="${commonStaticImgPath}${img}">
                                                        <input hidden name="bpFile1" value="${img}">
                                                    </div>
                                                </c:forEach>
                                            </c:if>
                                        </div>
                                    </div>
                                </td>
                                <td class="">
                                    <div style="display: flex;flex-wrap: wrap;" class="img-box <c:if test="${empty changeRecord.columns.id}">hide</c:if>">
                                        <div class="imgsDiv">
                                            <c:if test="${not empty mapDetails.bpFile.columns.after_change}">
                                                <c:forEach items="${fn:split(mapDetails.bpFile.columns.after_change,',')}" var="img">
                                                    <div class="bj-img imgSpan">
                                                        <span class="layui-icon-close layui-icon" onclick="delMoreImg(this)"></span>
                                                        <img src="${commonStaticImgPath}${img}">
                                                        <input type="hidden" class="data-input" name="bpFile" value="${img}">
                                                    </div>
                                                </c:forEach>
                                            </c:if>
                                        </div>
                                        <div class="upload-container moreUpload <c:if test="${fn:length(fn:split(mapDetails.bpFile.columns.after_change,',')) eq 4 }">hide</c:if>" id="uploader5" data-type="4" data-title="bpFile">
                                            <img src="" alt="img placeholder" id="imgsAdd5">
                                        </div>
                                    </div>
                                </td>
                                <td class=""><input type="checkbox" lay-skin="primary" disabled <c:if test="${'1' eq mapDetails.bpFile.columns.if_affect_contract}">checked</c:if>><input hidden name="ifAffectContract" value="${mapDetails.bpFile.columns.if_affect_contract}"></td>
                            </tr>
                            <%--村民代表大会决议书--%>
                            <tr class=" hide"  data-ppara_code="resolutionPaperUrl" data-value="2">
                                <td class="idx"><input type="checkbox" lay-skin="primary" lay-filter="ifChecked" <c:if test="${'1' eq mapDetails.resolutionPaperUrl.columns.if_change}">checked</c:if>><input hidden name="ifChange" value="${mapDetails.resolutionPaperUrl.columns.if_change}"></td>
                                <td class="idx">4<input type="hidden" value="2" class="setsort"></td>
                                <td class="">村民代表大会决议书</td>
                                <td class="resolutionPaperUrl">
                                    <div class="img-box <c:if test="${empty changeRecord.columns.id}">hide</c:if>">
                                        <div>
                                            <div class="bj-img imgSpan">
                                                <img src="${commonStaticImgPath}${mapDetails.resolutionPaperUrl.columns.before_change}">
                                                <input hidden id="resolutionPaperUrl" value="${mapDetails.resolutionPaperUrl.columns.before_change}">
                                            </div>
                                        </div>
                                    </div>
                                </td>
                                <td class="">
                                    <div class="img-box <c:if test="${empty changeRecord.columns.id}">hide</c:if>">
                                        <div class="imgsDiv">
                                            <c:if test="${not empty mapDetails.resolutionPaperUrl.columns.after_change}">
                                                <div class="bj-img imgSpan">
                                                    <span class="layui-icon-close layui-icon" onclick="delMoreImg(this)"></span>
                                                    <img src="${commonStaticImgPath}${mapDetails.resolutionPaperUrl.columns.after_change}">
                                                    <input type="hidden" class="data-input" name="resolutionPaperUrl" value="${mapDetails.resolutionPaperUrl.columns.after_change}">
                                                </div>
                                            </c:if>
                                        </div>
                                        <div class="upload-container moreUpload <c:if test="${not empty mapDetails.resolutionPaperUrl.columns.after_change}">hide</c:if>" id="uploader12" data-type="1" data-title="resolutionPaperUrl">
                                            <img src="" alt="img placeholder" id="imgsAdd12">
                                        </div>
                                    </div>
                                </td>
                                <td class=""><input type="checkbox" lay-skin="primary" disabled <c:if test="${'1' eq mapDetails.resolutionPaperUrl.columns.if_affect_contract}">checked</c:if>><input hidden name="ifAffectContract" value="${mapDetails.resolutionPaperUrl.columns.if_affect_contract}"></td>
                            </tr>
                            <%--村委议事章程--%>
                            <tr class="hide"  data-ppara_code="yszcUrl" data-value="2">
                                <td class="idx"><input type="checkbox" lay-skin="primary" lay-filter="ifChecked" <c:if test="${'1' eq mapDetails.yszcUrl.columns.if_change}">checked</c:if>><input hidden name="ifChange" value="${mapDetails.yszcUrl.columns.if_change}"></td>
                                <td class="idx">5<input type="hidden" value="2" class="setsort"></td>
                                <td class="">村委议事章程</td>
                                <td class="yszcUrl">
                                    <div class="img-box <c:if test="${empty changeRecord.columns.id}">hide</c:if>">
                                        <div>
                                            <div class="bj-img imgSpan">
                                                <img src="${commonStaticImgPath}${mapDetails.yszcUrl.columns.before_change}">
                                                <input hidden id="yszcUrl" value="${mapDetails.yszcUrl.columns.before_change}">
                                            </div>
                                        </div>
                                    </div>
                                </td>
                                <td class="">
                                    <div class="img-box <c:if test="${empty changeRecord.columns.id}">hide</c:if>">
                                        <div class="imgsDiv">
                                            <c:if test="${not empty mapDetails.yszcUrl.columns.after_change}">
                                                <div class="bj-img imgSpan">
                                                    <span class="layui-icon-close layui-icon" onclick="delMoreImg(this)"></span>
                                                    <img src="${commonStaticImgPath}${mapDetails.yszcUrl.columns.after_change}">
                                                    <input type="hidden" class="data-input" name="yszcUrl" value="${mapDetails.yszcUrl.columns.after_change}">
                                                </div>
                                            </c:if>
                                        </div>
                                        <div class="upload-container moreUpload <c:if test="${not empty mapDetails.yszcUrl.columns.after_change}">hide</c:if>" id="uploader13" data-type="1" data-title="yszcUrl">
                                            <img src="" alt="img placeholder" id="imgsAdd13">
                                        </div>
                                    </div>
                                </td>
                                <td class=""><input type="checkbox" lay-skin="primary" disabled <c:if test="${'1' eq mapDetails.yszcUrl.columns.if_affect_contract}">checked</c:if>><input hidden name="ifAffectContract" value="${mapDetails.yszcUrl.columns.if_affect_contract}"></td>
                            </tr>
                            <%--对公账户信息--%>
                            <tr class="hide"  data-ppara_code="accountInfoUrl" data-value="2">
                                <td class="idx"><input type="checkbox" lay-skin="primary" lay-filter="ifChecked" <c:if test="${'1' eq mapDetails.accountInfoUrl.columns.if_change}">checked</c:if>><input hidden name="ifChange" value="${mapDetails.accountInfoUrl.columns.if_change}"></td>
                                <td class="idx">6<input type="hidden" value="2" class="setsort"></td>
                                <td class="">对公账户信息</td>
                                <td class="accountInfoUrl">
                                    <div class="img-box <c:if test="${empty changeRecord.columns.id}">hide</c:if>">
                                        <div>
                                            <div class="bj-img imgSpan">
                                                <img src="${commonStaticImgPath}${mapDetails.accountInfoUrl.columns.before_change}">
                                                <input hidden id="accountInfoUrl" value="${mapDetails.accountInfoUrl.columns.before_change}">
                                            </div>
                                        </div>
                                    </div>
                                </td>
                                <td class="">
                                    <div class="img-box <c:if test="${empty changeRecord.columns.id}">hide</c:if>">
                                        <div class="imgsDiv">
                                            <c:if test="${not empty mapDetails.accountInfoUrl.columns.after_change}">
                                                <div class="bj-img imgSpan">
                                                    <span class="layui-icon-close layui-icon" onclick="delMoreImg(this)"></span>
                                                    <img src="${commonStaticImgPath}${mapDetails.accountInfoUrl.columns.after_change}">
                                                    <input type="hidden" class="data-input" name="accountInfoUrl" value="${mapDetails.accountInfoUrl.columns.after_change}">
                                                </div>
                                            </c:if>
                                        </div>
                                        <div class="upload-container moreUpload <c:if test="${not empty mapDetails.accountInfoUrl.columns.after_change}">hide</c:if>" id="uploader14" data-type="1" data-title="accountInfoUrl">
                                            <img src="" alt="img placeholder" id="imgsAdd14">
                                        </div>
                                    </div>
                                </td>
                                <td class=""><input type="checkbox" lay-skin="primary" disabled <c:if test="${'1' eq mapDetails.accountInfoUrl.columns.if_affect_contract}">checked</c:if>><input hidden name="ifAffectContract" value="${mapDetails.accountInfoUrl.columns.if_affect_contract}"></td>
                            </tr>
                            <%--产权证明-集体土地使用证--%>
                            <tr class="hide"  data-ppara_code="ownershipCertificateUrl" data-value="2">
                                <td class="idx"><input type="checkbox" lay-skin="primary" lay-filter="ifChecked" <c:if test="${'1' eq mapDetails.ownershipCertificateUrl.columns.if_change}">checked</c:if>><input hidden name="ifChange" value="${mapDetails.ownershipCertificateUrl.columns.if_change}"></td>
                                <td class="idx">7<input type="hidden" value="2" class="setsort"></td>
                                <td class="">产权证明-集体土地使用证</td>
                                <td class="ownershipCertificateUrl">
                                    <div class="img-box <c:if test="${empty changeRecord.columns.id}">hide</c:if>">
                                        <div>
                                            <div class="bj-img imgSpan">
                                                <img src="${commonStaticImgPath}${mapDetails.ownershipCertificateUrl.columns.before_change}">
                                                <input hidden id="ownershipCertificateUrl" value="${mapDetails.ownershipCertificateUrl.columns.before_change}">
                                            </div>
                                        </div>
                                    </div>
                                </td>
                                <td class="">
                                    <div class="img-box <c:if test="${empty changeRecord.columns.id}">hide</c:if>">
                                        <div class="imgsDiv">
                                            <c:if test="${not empty mapDetails.ownershipCertificateUrl.columns.after_change}">
                                                <div class="bj-img imgSpan">
                                                    <span class="layui-icon-close layui-icon" onclick="delMoreImg(this)"></span>
                                                    <img src="${commonStaticImgPath}${mapDetails.ownershipCertificateUrl.columns.after_change}">
                                                    <input type="hidden" class="data-input" name="ownershipCertificateUrl" value="${mapDetails.ownershipCertificateUrl.columns.after_change}">
                                                </div>
                                            </c:if>
                                        </div>
                                        <div class="upload-container moreUpload <c:if test="${not empty mapDetails.ownershipCertificateUrl.columns.after_change}">hide</c:if>" id="uploader15" data-type="1" data-title="ownershipCertificateUrl">
                                            <img src="" alt="img placeholder" id="imgsAdd15">
                                        </div>
                                    </div>
                                </td>
                                <td class=""><input type="checkbox" lay-skin="primary" disabled <c:if test="${'1' eq mapDetails.ownershipCertificateUrl.columns.if_affect_contract}">checked</c:if>><input hidden name="ifAffectContract" value="${mapDetails.ownershipCertificateUrl.columns.if_affect_contract}"></td>
                            </tr>
                            <%--产权证明-不动产证书/查册证明/相关确权文件--%>
                            <tr class="hide"  data-ppara_code="otherOwnershipCertificateUrl" data-value="2">
                                <td class="idx"><input type="checkbox" lay-skin="primary" lay-filter="ifChecked" <c:if test="${'1' eq mapDetails.otherOwnershipCertificateUrl.columns.if_change}">checked</c:if>><input hidden name="ifChange" value="${mapDetails.otherOwnershipCertificateUrl.columns.if_change}"></td>
                                <td class="idx">8<input type="hidden" value="2" class="setsort"></td>
                                <td class="">产权证明-不动产证书/查册证明/相关确权文件</td>
                                <td class="otherOwnershipCertificateUrl">
                                    <div class="img-box <c:if test="${empty changeRecord.columns.id}">hide</c:if>">
                                        <div>
                                            <div class="bj-img imgSpan">
                                                <img src="${commonStaticImgPath}${mapDetails.otherOwnershipCertificateUrl.columns.before_change}">
                                                <input hidden id="otherOwnershipCertificateUrl" value="${mapDetails.otherOwnershipCertificateUrl.columns.before_change}">
                                            </div>
                                        </div>
                                    </div>
                                </td>
                                <td class="">
                                    <div class="img-box <c:if test="${empty changeRecord.columns.id}">hide</c:if>">
                                        <div class="imgsDiv">
                                            <c:if test="${not empty mapDetails.otherOwnershipCertificateUrl.columns.after_change}">
                                                <div class="bj-img imgSpan">
                                                    <span class="layui-icon-close layui-icon" onclick="delMoreImg(this)"></span>
                                                    <img src="${commonStaticImgPath}${mapDetails.otherOwnershipCertificateUrl.columns.after_change}">
                                                    <input type="hidden" class="data-input" name="otherOwnershipCertificateUrl" value="${mapDetails.otherOwnershipCertificateUrl.columns.after_change}">
                                                </div>
                                            </c:if>
                                        </div>
                                        <div class="upload-container moreUpload <c:if test="${not empty mapDetails.otherOwnershipCertificateUrl.columns.after_change}">hide</c:if>" id="uploader16" data-type="1" data-title="otherOwnershipCertificateUrl">
                                            <img src="" alt="img placeholder" id="imgsAdd16">
                                        </div>
                                    </div>
                                </td>
                                <td class=""><input type="checkbox" lay-skin="primary" disabled <c:if test="${'1' eq mapDetails.otherOwnershipCertificateUrl.columns.if_affect_contract}">checked</c:if>><input hidden name="ifAffectContract" value="${mapDetails.otherOwnershipCertificateUrl.columns.if_affect_contract}"></td>
                            </tr>
                            <%--营业执照--%>
                            <tr class="hide"  data-ppara_code="regnoUrl" data-value="2">
                                <td class="idx"><input type="checkbox" lay-skin="primary" lay-filter="ifChecked" <c:if test="${'1' eq mapDetails.regnoUrl.columns.if_change}">checked</c:if>><input hidden name="ifChange" value="${mapDetails.regnoUrl.columns.if_change}"></td>
                                <td class="idx">10<input type="hidden" value="2" class="setsort"></td>
                                <td class="">统一社会信用代码证书/营业执照</td>
                                <td class="regnoUrl">
                                    <div class="img-box <c:if test="${empty changeRecord.columns.id}">hide</c:if>">
                                        <div>
                                            <div class="bj-img imgSpan">
                                                <img src="${commonStaticImgPath}${mapDetails.regnoUrl.columns.before_change}">
                                                <input hidden id="regnoUrl" value="${mapDetails.regnoUrl.columns.before_change}">
                                            </div>
                                        </div>
                                    </div>
                                </td>
                                <td class="">
                                    <div class="img-box <c:if test="${empty changeRecord.columns.id}">hide</c:if>">
                                        <div class="imgsDiv">
                                            <c:if test="${not empty mapDetails.regnoUrl.columns.after_change}">
                                                <div class="bj-img imgSpan">
                                                    <span class="layui-icon-close layui-icon" onclick="delMoreImg(this)"></span>
                                                    <img src="${commonStaticImgPath}${mapDetails.regnoUrl.columns.after_change}">
                                                    <input type="hidden" class="data-input" name="regnoUrl" value="${mapDetails.regnoUrl.columns.after_change}">
                                                </div>
                                            </c:if>
                                        </div>
                                        <div class="upload-container moreUpload <c:if test="${not empty mapDetails.regnoUrl.columns.after_change}">hide</c:if>" id="uploader18" data-type="1" data-title="regnoUrl">
                                            <img src="" alt="img placeholder" id="imgsAdd18">
                                        </div>
                                    </div>
                                </td>
                                <td class=""><input type="checkbox" lay-skin="primary" disabled <c:if test="${'1' eq mapDetails.regnoUrl.columns.if_affect_contract}">checked</c:if>><input hidden name="ifAffectContract" value="${mapDetails.regnoUrl.columns.if_affect_contract}"></td>
                            </tr>
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="operate-footer">
        <%--<button type="button" class="layui-btn" id="tempSave" >暂存</button>--%>
        <button type="button" class="layui-btn" id="subSave" >提交</button>
        <button type="button" class="layui-btn layui-btn-primary " onclick="closeDiv();" >取消</button>
    </div>
</div>
<script src="${ctxPlugin}/lib/xm-select.js"></script>
<script src="${ctxPlugin}/lib/layuiAdmin/dist/layuiadmin/layui/layui.js"></script>
<script src="${ctxPlugin}/lib/layuiAdmin/dist/layuiadmin/layui/data.js"></script>
<script src="${ctxPlugin}/lib/layuiAdmin/dist/layuiadmin/dist/viewer.js"></script>

<script type="text/javascript">
    var viewer = new Viewer(document.getElementById('LAY_app'));
    //初始数据
    var $form;
    var form;
    var $;
    var table;
    var firstApply='${firstApply}';
    var whetherItAffectsTheContractChange = true;
    var reg = /^(\d{2})(\d{4})(\d{4})(\d{2})(\d{2})\d{2}(\d)(\d|X)$/;
    var accountReg=/^[0-9]{8,25}$/;

    // 联行号
    var tssBankNum = '${tssBankNum}';
    // 银行名称
    var tssBankNumName = '${tssBankNumName}';
    var formSet = null;
    layui.config({
        base: '${ctxPlugin}/lib/layuiAdmin/dist/layuiadmin/' //静态资源所在路径
    }).extend({
        index: 'lib/index' //主入口模块
    }).use(['index', 'tableExt', 'jquery', 'layer','laydate', 'upload','form'], function(){
        $ = layui.jquery;
        form = layui.form;
        upload = layui.upload;
        laydate = layui.laydate;
        $form = $('form');
        tableExt = layui.tableExt;
        table = tableExt.getLayTable();

        /* tableExt.render({
             elem: '#test'
             , height: 'full-360'
         })*/

        form.on('checkbox(ifChecked)', function(data){
            var elem = data.elem; // 获得 checkbox 原始 DOM 对象
            var checked = elem.checked; // 获得 checkbox 选中状态
            var value = elem.value; // 获得 checkbox 值
            var othis = data.othis; // 获得 checkbox 元素被替换后的 jQuery 对象
            if(checked){
                //判断是否有内容
                var co= $(othis).parents("tr").find("td:eq(3)").find(".imgSpan").length;
                var dataValue= $(othis).parents("tr").attr("data-value");
                if(co==0 && dataValue==2){
                    $(othis).prop("checked",false);
                    $(othis).next("input[name='ifChange']").val("0");
                    layer.msg("该项不需要变更!");
                    return;
                }
                if (dataValue == 3){
                    $(othis).parents("tr").find("td:eq(4)").find("span").removeClass("hide");
                    $(othis).parents("tr").find("td:eq(4)").find("input").addClass("inline-block");
                }
                $(othis).parents("tr").find("td:eq(4)").find("div").removeClass("hide");
                $(othis).parents("tr").find("td:eq(4)").find("input").removeClass("hide");

                let partnerId = $("#partnerId").val();
                let flag = false;
                if (partnerId ==  "01"){
                    if((!isBlank(firstApply) && (firstApply=='NEW' || firstApply=='APPROVING' || firstApply=='APPROVED'))&&whetherItAffectsTheContractChange){
                        flag = true;
                    }
                }else if (partnerId ==  "03"){
                    if((!isBlank(firstApply) && (firstApply=='20' || firstApply=='25' || firstApply=='30'))&&whetherItAffectsTheContractChange){
                        flag = true;
                    }
                }else if (partnerId ==  "04"){
                    if((!isBlank(firstApply) && (firstApply=='FT'))&&whetherItAffectsTheContractChange){
                        flag = true;
                    }
                }
                if (flag){
                    var typeCode= $(othis).parents("tr").attr("data-ppara_code");
                    if (partnerId ==  "01" || partnerId ==  "03"){
                        if('HouseOwnership'!=typeCode){
                            $(othis).parents("tr").find("td:eq(5)").find("input[type='checkbox']").prop("checked",true);
                            $(othis).parents("tr").find("td:eq(5)").find("input[name='ifAffectContract']").val(1);
                        }
                    }else if (partnerId ==  "04"){
                        if ('mobile'==typeCode || 'tssBankNumName'==typeCode || 'bankCode'==typeCode || 'address'==typeCode){
                            $(othis).parents("tr").find("td:eq(5)").find("input[type='checkbox']").prop("checked",true);
                            $(othis).parents("tr").find("td:eq(5)").find("input[name='ifAffectContract']").val(1);
                        }
                    }
                }

                $(othis).next("input[name='ifChange']").val("1");
                $(othis).parents("tr").find("#tssBank").removeClass("hide");
            }else{
                $(othis).parents("tr").find("td:eq(4)").find("input").removeClass("inline-block");
                $(othis).parents("tr").find("td:eq(4)").find("div").addClass("hide");
                $(othis).parents("tr").find("td:eq(4)").find("span").addClass("hide");
                $(othis).parents("tr").find("td:eq(4)").find("input").val("");
                $(othis).parents("tr").find("td:eq(4)").find(".imgsDiv").html("");
                $(othis).parents("tr").find("td:eq(4)").find("input").addClass("hide");
                $(othis).parents("tr").find("td:eq(5)").find("input[type='checkbox']").prop("checked",false);
                $(othis).parents("tr").find("td:eq(5)").find("input[name='ifAffectContract']").val(0);
                $(othis).next("input[name='ifChange']").val("0");
                $(othis).parents("tr").find("#tssBank").addClass("hide");
                $(othis).parents("tr").find("td:eq(4)").find(".moreUpload").show();
            }
            form.render();
        });

        upload.render({
            elem: '.moreUpload' //绑定元素
            , url: '${ctx}/common/uploadFile' //上传接口
            ,before: function(obj){
                //预读本地文件示例，不支持ie8
                obj.preview(function (index, file, result) {
                });
            }
            , done: function (res, index, upload) {
                var titleName = $(this.item).attr("data-title");
                var html='';
                html+='<div class="bj-img imgSpan">';
                html+=' <span class="layui-icon-close layui-icon" onclick="delMoreImg(this)"></span>';
                html += '<img src="${commonStaticImgPath}' + res.path + '">';
                html += '<input type="hidden" class="data-input" name="' + titleName + '" value="' + res.path + '"/>';
                html+='</div>';
                $(this.item).prev(".imgsDiv").append(html);
                var maxNum = $(this.item).attr("data-type");
                if ($(this.item).prev(".imgsDiv").find(".imgSpan").length == maxNum) {
                    $(this.item).hide();
                }
                viewer.update();
            }
            , error: function () {
                //请求异常回调
            }
        });

        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:$("#partnerId").val()
                }, 'name');
            },
            on: function (data) {
                if (data.isAdd && data.arr.length > 0) {
                    appendTr(data);
                }
            }
        });

        var tempFlg=false
        $("#tempSave").click(function (){
            if(tempFlg){
                return;
            }
            var entryId = $("#entryId").val();
            var powerStationCode=$('input[name="stationCode"]').val();
            var entryStatus=$('input[name="entryStatus"]').val();
            var id=$("#id").val();
            if (isBlank(entryId)) {
                layer.msg("请选择电站");
                return;
            }
            // var reason = $("input[name='reason']").val();
            var reason = $("#reason").val();
            var arr=[];
            var i=1;
            var checkFg=true;
            var mobile=$("#mobile").val();
            if (!isBlank(mobile) && !isPhoneNo($.trim(mobile))) {
                layer.msg("联系方式格式不正确", {icon: 2});
                return;
            }
            var idCode=$("#idCode").val();
            if(!isBlank(idCode) && !reg.test($.trim(idCode))){
                layer.msg("请输入正确的身份证号!", {icon: 2});
                return;
            }
            var bankCode=$("#bankCode").val();
            if (!isBlank(bankCode) && !accountReg.test(bankCode)) {
                layer.msg("银行账号格式不正确",{icon:2});
                return;
            }
            $("#productParaListBody tr").each(function (index) {
                var itemCode=$(this).attr("data-ppara_code");
                var type=$(this).attr("data-value");
                var itemName=$(this).find("td:eq(2)").text();
                var ifChange=$(this).find("td:eq(0)").find("input[name='ifChange']").val();
                var beforeChange;
                var afterChange;
                var ifAffectContract;
                if("1"==type || "3" == type){
                    beforeChange=$(this).find("td:eq(3)").text();
                    afterChange=$(this).find("td:eq(4)").find("input[name='afterChange']").val();
                    if(itemCode=='tssBankNumName'){
                        afterChange=tssBankNumName;
                    }
                }else{
                    if(itemCode=='idCardImg'){
                       itemCode='idCardFront';
                        beforeChange=$("#idCardFront").val();
                        afterChange=$(this).find("td:eq(4)").find("input[name="+itemCode+"]").val();
                    }
                    if(itemCode=='bankCard'){
                        beforeChange=$("#bankCard").val();
                        afterChange=$(this).find("td:eq(4)").find("input[name="+itemCode+"]").val();
                    }

                    if(itemCode=='HouseOwnership'){
                        var HouseOwnership = [];
                        $("input[name='HouseOwnership']").each(function(){
                            HouseOwnership.push($(this).val());
                        })
                        afterChange=HouseOwnership.join(",");
                        var HouseOwner=[];
                        $("input[name='HouseOwner']").each(function(){
                            HouseOwner.push($(this).val());
                        })
                        beforeChange=HouseOwner.join(",");
                    }
                }
                ifAffectContract=$(this).find("td:eq(5)").find("input[name='ifAffectContract']").val();
                if("1"==ifChange){
                    if(isBlank(afterChange)){
                        layer.msg(itemName+",没有录入变更后信息。");
                        checkFg=false;
                        return false;
                    }
                }else{
                    afterChange="";
                    ifAffectContract="0";
                }
                var data={};
                data.itemCode=itemCode;
                data.type=type;
                data.itemName=itemName;
                data.ifChange=ifChange;
                data.beforeChange=beforeChange;
                data.afterChange=afterChange;
                data.ifAffectContract=ifAffectContract;
                data.sort=i;
                i++;
                arr.push(data);
                if(itemCode=='idCardFront'){
                    itemCode='idCardBack';
                    beforeChange=$("#idCardBack").val();
                    if("1"==ifChange){
                        afterChange=$(this).find("td:eq(4)").find("input[name="+itemCode+"]").val();
                    }
                    var data={};
                    data.itemCode=itemCode;
                    data.type=type;
                    data.itemName=itemName;
                    data.ifChange=ifChange;
                    data.beforeChange=beforeChange;
                    data.afterChange=afterChange;
                    data.ifAffectContract=ifAffectContract;
                    data.sort=i;
                    i++;
                    arr.push(data);
                }else if(itemCode=='tssBankNumName'){
                    itemCode='tssBankNum';
                    beforeChange=$("td[class='tssBankNumName']").attr("data-value");
                    if("1"==ifChange){
                        afterChange=tssBankNum;
                    }
                    var data={};
                    data.itemCode=itemCode;
                    data.type=type;
                    data.itemName=itemName;
                    data.ifChange=ifChange;
                    data.beforeChange=beforeChange;
                    data.afterChange=afterChange;
                    data.ifAffectContract=ifAffectContract;
                    data.sort=i;
                    i++;
                    arr.push(data);
                }

            })
            if(!checkFg){
                return;
            }
            tempFlg=true;
            $.ajax({
                type: 'post',
                url: '${ctx}/entryChanges/customerInformationChange/savaEntryChange',
                contentType: 'application/json',
                dataType: 'json',
                data:JSON.stringify(
                    {
                        id:id,
                     saveType:1,
                     entryId: entryId,
                     powerStationCode:powerStationCode,
                     entryStatus,entryStatus,
                     details: arr,
                     reason: reason
                    }
                ),
                success: function(data){
                    if (data.code == "200") {
                        top.layer.msg("操作成功");
                        closeSelf();
                        parent.location.reload();
                    } else {
                        layer.msg(data.errMsg);
                    }
                },
                complete: function(){
                    tempFlg = false;
                }
            });

        })

        var tempFlg2=false
        $("#subSave").click(function (){
            if(tempFlg2){
                return;
            }
            var entryId = $("#entryId").val();
            var powerStationCode=$('input[name="stationCode"]').val();
            var entryStatus=$('input[name="entryStatus"]').val();
            var id=$("#id").val();
            if (isBlank(entryId)) {
                layer.msg("请选择电站");
                return;
            }
            var mobile=$("#mobile").val();
            if (!isBlank(mobile) && !isPhoneNo($.trim(mobile))) {
                layer.msg("联系方式格式不正确", {icon: 2});
                return;
            }
            var idCode=$("#idCode").val();
            if(!isBlank(idCode) && !reg.test($.trim(idCode))){
                layer.msg("请输入正确的身份证号!", {icon: 2});
                return;
            }
            var bankCode=$("#bankCode").val();
            if (!isBlank(bankCode) && !accountReg.test(bankCode)) {
                layer.msg("银行账号格式不正确",{icon:2});
                return;
            }
            // var reason = $("input[name='reason']").val();
            var reason = $("#reason").val();
            if (isBlank(reason)) {
                layer.msg("变更原因不能为空", {icon: 2});
                return;
            }
            var arr=[];
            var i=1;
            var checkFg=true;
            $("#productParaListBody tr").each(function (index) {
                var itemCode=$(this).attr("data-ppara_code");
                var type=$(this).attr("data-value");
                var itemName=$(this).find("td:eq(2)").text();
                var ifChange=$(this).find("td:eq(0)").find("input[name='ifChange']").val();
                var beforeChange;
                var afterChange;
                var ifAffectContract;
                if("1"==type || "3" == type){
                    beforeChange=$(this).find("td:eq(3)").text();
                    afterChange=$(this).find("td:eq(4)").find("input[name='afterChange']").val();
                    if(itemCode=='tssBankNumName'){
                        afterChange=tssBankNumName;
                    }
                }else{
                    if(itemCode=='idCardImg'){
                        itemCode='idCardFront';
                        beforeChange=$("#idCardFront").val();
                        afterChange=$(this).find("td:eq(4)").find("input[name="+itemCode+"]").val();
                    }else if(itemCode=='bankCard'){
                        beforeChange=$("#bankCard").val();
                        afterChange=$(this).find("td:eq(4)").find("input[name="+itemCode+"]").val();
                    }else if(itemCode=='HouseOwnership'){
                        var HouseOwnership = [];
                        $("input[name='HouseOwnership']").each(function(){
                            HouseOwnership.push($(this).val());
                        })
                        afterChange=HouseOwnership.join(",");
                        var HouseOwner=[];
                        $("input[name='HouseOwner']").each(function(){
                            HouseOwner.push($(this).val());
                        })
                        beforeChange=HouseOwner.join(",");
                    }else if (itemCode=='bpCardImg') {
                        itemCode = 'bpCardFront'
                        beforeChange=$("#bpCardFront").val();
                        afterChange=$(this).find("td:eq(4)").find("input[name="+itemCode+"]").val();
                    }else if(itemCode=='bpFile'){
                        var bpFile = [];
                        $("input[name='bpFile']").each(function(){
                            bpFile.push($(this).val());
                        })
                        afterChange=bpFile.join(",");
                        var bpFile1=[];
                        $("input[name='bpFile1']").each(function(){
                            bpFile1.push($(this).val());
                        })
                        beforeChange=bpFile1.join(",");
                    }else if(itemCode=='resolutionPaperUrl'){
                        beforeChange=$("#resolutionPaperUrl").val();
                        afterChange=$(this).find("td:eq(4)").find("input[name="+itemCode+"]").val();
                    }else if(itemCode=='yszcUrl'){
                        beforeChange=$("#yszcUrl").val();
                        afterChange=$(this).find("td:eq(4)").find("input[name="+itemCode+"]").val();
                    }else if(itemCode=='accountInfoUrl'){
                        beforeChange=$("#accountInfoUrl").val();
                        afterChange=$(this).find("td:eq(4)").find("input[name="+itemCode+"]").val();
                    }else if(itemCode=='ownershipCertificateUrl'){
                        beforeChange=$("#ownershipCertificateUrl").val();
                        afterChange=$(this).find("td:eq(4)").find("input[name="+itemCode+"]").val();
                    }else if(itemCode=='otherOwnershipCertificateUrl'){
                        beforeChange=$("#otherOwnershipCertificateUrl").val();
                        afterChange=$(this).find("td:eq(4)").find("input[name="+itemCode+"]").val();
                    }else if(itemCode=='regnoUrl'){
                        beforeChange=$("#regnoUrl").val();
                        afterChange=$(this).find("td:eq(4)").find("input[name="+itemCode+"]").val();
                    }
                }
                ifAffectContract=$(this).find("td:eq(5)").find("input[name='ifAffectContract']").val();
                if("1"==ifChange){
                    if(isBlank(afterChange)){
                        layer.msg(itemName+",没有录入变更后信息。");
                        checkFg=false;
                        return false;
                    }
                }else{
                    afterChange="";
                    ifAffectContract="0";
                }
                var data={};
                data.itemCode=itemCode;
                data.type=type;
                data.itemName=itemName;
                data.ifChange=ifChange;
                data.beforeChange=beforeChange;
                data.afterChange=afterChange;
                data.ifAffectContract=ifAffectContract;
                data.sort=i;
                i++;
                arr.push(data);
                if(itemCode=='idCardFront'){
                    itemCode='idCardBack';
                    beforeChange=$("#idCardBack").val();
                    if("1"==ifChange){
                        afterChange=$(this).find("td:eq(4)").find("input[name="+itemCode+"]").val();
                    }
                    var data={};
                    data.itemCode=itemCode;
                    data.type=type;
                    data.itemName=itemName;
                    data.ifChange=ifChange;
                    data.beforeChange=beforeChange;
                    data.afterChange=afterChange;
                    data.ifAffectContract=ifAffectContract;
                    data.sort=i;
                    i++;
                    arr.push(data);
                }else if(itemCode=='tssBankNumName'){
                    itemCode='tssBankNum';
                    beforeChange=$("td[class='tssBankNumName']").attr("data-value");
                    if("1"==ifChange){
                        afterChange=tssBankNum;
                    }
                    var data={};
                    data.itemCode=itemCode;
                    data.type=type;
                    data.itemName=itemName;
                    data.ifChange=ifChange;
                    data.beforeChange=beforeChange;
                    data.afterChange=afterChange;
                    data.ifAffectContract=ifAffectContract;
                    data.sort=i;
                    i++;
                    arr.push(data);
                }else if(itemCode=='bpCardFront'){
                    itemCode='bpCardBack';
                    beforeChange=$("#bpCardBack").val();
                    if("1"==ifChange){
                        afterChange=$(this).find("td:eq(4)").find("input[name="+itemCode+"]").val();
                    }
                    var data={};
                    data.itemCode=itemCode;
                    data.type=type;
                    data.itemName=itemName;
                    data.ifChange=ifChange;
                    data.beforeChange=beforeChange;
                    data.afterChange=afterChange;
                    data.ifAffectContract=ifAffectContract;
                    data.sort=i;
                    i++;
                    arr.push(data);
                }

            })
            if(!checkFg){
                return;
            }
            var index= layer.load(2, {shade: [0.5,'#fff'], content:''});
            tempFlg2=true;
            $.ajax({
                type: 'post',
                url: '${ctx}/entryChanges/customerInformationChange/savaEntryChange',
                contentType: 'application/json',
                dataType: 'json',
                data:JSON.stringify(
                    {
                        id:id,
                        saveType:2,
                        entryId: entryId,
                        powerStationCode:powerStationCode,
                        details: arr,
                        reason: reason,
                        entryStatus:entryStatus
                    }
                ),
                success: function(data){
                    if (data.code == "200") {
                        top.layer.msg("操作成功");
                        closeSelf();
                        parent.location.reload();
                    }else if(data.code == "208"){
                        layer.confirm(data.errMsg, {
                            icon: 3,
                            btn: ['确定', '取消'] //按钮
                        }, function () {
                            $.ajax({
                                type: 'post',
                                url: '${ctx}/entryChanges/customerInformationChange/savaEntryChange',
                                contentType: 'application/json',
                                dataType: 'json',
                                data:JSON.stringify(
                                    {
                                        id:id,
                                        saveType:2,
                                        entryId: entryId,
                                        powerStationCode:powerStationCode,
                                        details: arr,
                                        reason: reason,
                                        confirmTrue:'true',
                                        entryStatus:entryStatus
                                    }
                                ),
                                success: function (data) {
                                    if (data.code == "200") {
                                        top.layer.msg("操作成功");
                                        closeSelf();
                                        parent.location.reload();
                                    }else {
                                        layer.msg(data.errMsg);
                                    }
                                }
                            })
                        });
                    } else {
                        layer.msg(data.errMsg);
                    }
                },
                complete: function(){
                    tempFlg2 = false;
                    layer.close(index);
                }
            });

        })

    })

    window.closeSelf = function () {
        var index = parent.layer.getFrameIndex(window.name);
        parent.layer.close(index);//关闭当前页
    }


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

    function searchCode(stationCode){
        if (isBlank(stationCode)) {
            return;
        }
        $("input[name='stationCode']").val(stationCode);
        $.ajax({
            type: 'post',
            url: '${ctx}/entryChanges/customerInformationChange/selectNumber/' + stationCode,
            dataType: 'json',
            data: {
                stationCode: stationCode
            },
            success: function(res){
                if (res.code == "200") {
                    var customerEntry = res.data.customerEntry;
                    var project = res.data.project;
                    var surveyRecord = res.data.surveyRecord;
                    var  orgFiles = res.data.orgFiles;
                    formSet = res.data.info6;
                    var tenantType = customerEntry.tenantType;//1.个人 2.单位
                    $("#entryId").val(customerEntry.id);
                    $("input[name='entryStatus']").val(getStatus(customerEntry));
                    $("input[name='traderName']").val(customerEntry.createTraderName);
                    $("input[name='projectName']").val(project.name);
                    $("input[name='projectCompanyName']").val(customerEntry.projectCompanyName);
                    $("input[name='tenantName']").val(customerEntry.tenantName);
                    $("input[name='partnerName']").val(customerEntry.partnerName);
                    $("input[name='idCode']").val(customerEntry.idCode);
                    $("input[name='address']").val(customerEntry.province + customerEntry.city + customerEntry.area + customerEntry.address);
                        if (customerEntry.age >= 65 &&  tenantType == '1') {
                            $("#bpCardImgDiv").removeClass("hide");
                            $("#bpFileDiv").removeClass("hide");
                            $(".bpCardFront").find("img:eq(0)").attr("src",'${commonStaticImgPath}'+customerEntry.bpCardFront);
                            $(".bpCardFront").find("img:eq(1)").attr("src",'${commonStaticImgPath}'+customerEntry.bpCardBack);
                            $("#bpCardFront").val(customerEntry.bpCardFront);
                            $("#bpCardBack").val(customerEntry.bpCardBack);
                            $(".bpCardFront").find("div").removeClass("hide");
                            var html2 = '';
                            if (!isBlank(customerEntry.bpFile)) {
                                var imgsArr = customerEntry.bpFile.split(",");
                                for (var i = 0; i < imgsArr.length; i++) {
                                    html2 +='<div class="bj-img imgSpan">';
                                    html2 +='   <img src="${commonStaticImgPath}' + imgsArr[i] + '">';
                                    html2 +='  <input hidden name="bpFile1" value="'+imgsArr[i]+'"> ';
                                    html2 +='</div>';
                                }
                            }
                            $("#bpFile").empty().append(html2);
                            $(".bpFile").find("div").removeClass("hide");
                        }else {
                            $("#bpCardImgDiv").addClass("hide");
                            $("#bpFileDiv").addClass("hide");
                        }

                        $(".address").text(customerEntry.province + customerEntry.city + customerEntry.area + customerEntry.address);
                        $(".entryAddress").text(customerEntry.province + customerEntry.city + customerEntry.area);
                        $(".tenantName").text(customerEntry.tenantName);
                        $(".idCode").text(customerEntry.idCode);
                        $(".mobile").text(customerEntry.mobile);
                        $(".tssBankNumName").text(customerEntry.tssBankNumName);
                        $("td[class='tssBankNumName']").attr("data-value",customerEntry.tssBankNum);
                        $(".bankCode").text(customerEntry.bankCode);
                        $(".idCardFront").find("img:eq(0)").attr("src",'${commonStaticImgPath}'+customerEntry.idCardFront);
                        $(".idCardFront").find("img:eq(1)").attr("src",'${commonStaticImgPath}'+customerEntry.idCardBack);
                        $("#idCardFront").val(customerEntry.idCardFront);
                        $("#idCardBack").val(customerEntry.idCardBack);
                        $(".idCardFront").find("div").removeClass("hide");
                        $("#partnerId").val(customerEntry.partnerId);

                        var html = '';
                        if (!isBlank(surveyRecord.houseOwnership)) {
                            var imgsArr = surveyRecord.houseOwnership.split(",");
                            for (var i = 0; i < imgsArr.length; i++) {
                                html +='<div class="bj-img imgSpan">';
                                html +='   <img src="${commonStaticImgPath}' + imgsArr[i] + '">';
                                html +='  <input hidden name="HouseOwner" value="'+imgsArr[i]+'"> ';
                                html +='</div>';
                            }
                        }
                        $("#HouseOwnershipImg").empty().append(html);
                        $(".HouseOwnership").find("div").removeClass("hide");
                        if(isBlank(customerEntry.bankCard)){
                            $(".bankCard").find("img").attr("src",'');
                            $('#bankCard').val("");
                            $(".bankCard").find("div").addClass("hide");
                        }else{
                            $(".bankCard").find("img").attr("src",'${commonStaticImgPath}'+customerEntry.bankCard);
                            $('#bankCard').val(customerEntry.bankCard);
                            $(".bankCard").find("div").removeClass("hide");
                        }
                        if(tenantType == '2'){
                            //村民代表大会决议书
                            if(isBlank(orgFiles.resolutionPaperUrl)){
                                $(".resolutionPaperUrl").find("img").attr("src",'');
                                $('#resolutionPaperUrl').val("");
                                $(".resolutionPaperUrl").find("div").addClass("hide");
                            }else{
                                $(".resolutionPaperUrl").find("img").attr("src",'${commonStaticImgPath}'+orgFiles.resolutionPaperUrl);
                                $('#resolutionPaperUrl').val(orgFiles.resolutionPaperUrl);
                                $(".resolutionPaperUrl").find("div").removeClass("hide");
                            }
                            //村委议事章程
                            if(isBlank(orgFiles.yszcUrl)){
                                $(".yszcUrl").find("img").attr("src",'');
                                $('#yszcUrl').val("");
                                $(".yszcUrl").find("div").addClass("hide");
                            }else{
                                $(".yszcUrl").find("img").attr("src",'${commonStaticImgPath}'+orgFiles.yszcUrl);
                                $('#yszcUrl').val(orgFiles.yszcUrl);
                                $(".yszcUrl").find("div").removeClass("hide");
                            }
                            //对公账户信息
                            if(isBlank(orgFiles.accountInfoUrl)){
                                $(".accountInfoUrl").find("img").attr("src",'');
                                $('#accountInfoUrl').val("");
                                $(".accountInfoUrl").find("div").addClass("hide");
                            }else{
                                $(".accountInfoUrl").find("img").attr("src",'${commonStaticImgPath}'+orgFiles.accountInfoUrl);
                                $('#accountInfoUrl').val(orgFiles.accountInfoUrl);
                                $(".accountInfoUrl").find("div").removeClass("hide");
                            }
                            //产权证明-集体土地使用证
                            if(isBlank(orgFiles.ownershipCertificateUrl)){
                                $(".ownershipCertificateUrl").find("img").attr("src",'');
                                $('#ownershipCertificateUrl').val("");
                                $(".ownershipCertificateUrl").find("div").addClass("hide");
                            }else{
                                $(".ownershipCertificateUrl").find("img").attr("src",'${commonStaticImgPath}'+orgFiles.ownershipCertificateUrl);
                                $('#ownershipCertificateUrl').val(orgFiles.ownershipCertificateUrl);
                                $(".ownershipCertificateUrl").find("div").removeClass("hide");
                            }
                            //产权证明-不动产证书/查册证明/相关确权文件
                            if(isBlank(orgFiles.otherOwnershipCertificateUrl)){
                                $(".otherOwnershipCertificateUrl").find("img").attr("src",'');
                                $('#otherOwnershipCertificateUrl').val("");
                                $(".otherOwnershipCertificateUrl").find("div").addClass("hide");
                            }else{
                                $(".otherOwnershipCertificateUrl").find("img").attr("src",'${commonStaticImgPath}'+orgFiles.otherOwnershipCertificateUrl);
                                $('#otherOwnershipCertificateUrl').val(orgFiles.otherOwnershipCertificateUrl);
                                $(".otherOwnershipCertificateUrl").find("div").removeClass("hide");
                            }
                            //营业执照
                            if(isBlank(orgFiles.regnoUrl)){
                                $(".regnoUrl").find("img").attr("src",'');
                                $('#regnoUrl').val("");
                                $(".regnoUrl").find("div").addClass("hide");
                            }else{
                                $(".regnoUrl").find("img").attr("src",'${commonStaticImgPath}'+orgFiles.regnoUrl);
                                $('#regnoUrl').val(orgFiles.regnoUrl);
                                $(".regnoUrl").find("div").removeClass("hide");
                            }
                    }
                    hideOrShowHtml(formSet,customerEntry);
                    firstApply=customerEntry.firstApplyStatus;
                    whetherItAffectsTheContractChange =  res.data.whetherItAffectsTheContractChange;
                } else {
                    layer.msg(res.errMsg, {time: 2500});
                }
                viewer.update();
            }
        });
    }
    //页面显示与隐藏
    function hideOrShowHtml(formSet,customerEntry) {
        let tenantType = customerEntry.tenantType;
        //联系方式
        if(formSet.columns.mobile.status == '1'){
            $('tr[data-ppara_code="mobile"]').removeClass("hide");
        }else {
            $('tr[data-ppara_code="mobile"]').addClass("hide");
        }
        //开户行 个人
        if(formSet.columns.tss_bank_num_name.status == '1'){
            $('tr[data-ppara_code="tssBankNumName"]').removeClass("hide");
        }else {
            $('tr[data-ppara_code="tssBankNumName"]').addClass("hide");
        }
        //银行账号
        if(formSet.columns.bank_code.status == '1'){
            $('tr[data-ppara_code="bankCode"]').removeClass("hide");
        }else {
            $('tr[data-ppara_code="bankCode"]').addClass("hide");
        }
        //身份证正反面
        if(formSet.columns.id_card_front.status == '1'){
            $('tr[data-ppara_code="idCardImg"]').removeClass("hide");
        }else {
            $('tr[data-ppara_code="idCardImg"]').addClass("hide");
        }
        //房产证
        if(formSet.columns.house_ownership.status == '1'){
            $('tr[data-ppara_code="HouseOwnership"]').removeClass("hide");
        }else {
            $('tr[data-ppara_code="HouseOwnership"]').addClass("hide");
        }
        //银行卡
        if(formSet.columns.bank_card.status == '1'){
            $('tr[data-ppara_code="bankCard"]').removeClass("hide");
        }else {
            $('tr[data-ppara_code="bankCard"]').addClass("hide");
        }
        //安装地址
        if(formSet.columns.address.status == '1'){
            $('tr[data-ppara_code="address"]').removeClass("hide");
        }else {
            $('tr[data-ppara_code="address"]').addClass("hide");
        }
        //共签人身份证正反面
        if(formSet.columns.bp_card_front.status == '1' && tenantType == '1' && customerEntry.age >= 65){
            $('tr[data-ppara_code="bpCardImg"]').removeClass("hide");
        }else {
            $('tr[data-ppara_code="bpCardImg"]').addClass("hide");
        }
        //共签人关系材料证明
        if(formSet.columns.bp_file.status == '1' && tenantType == '1' && customerEntry.age >= 65){
            $('tr[data-ppara_code="bpFile"]').removeClass("hide");
        }else {
            $('tr[data-ppara_code="bpFile"]').addClass("hide");
        }
        // 村民代表大会决议书
        if(formSet.columns.resolution_paper_url.status == '1' && tenantType == '2' ){
            $('tr[data-ppara_code="resolutionPaperUrl"]').removeClass("hide");
        }else {
            $('tr[data-ppara_code="resolutionPaperUrl"]').addClass("hide");
        }
        // 村委议事章程
        if(formSet.columns.yszc_url.status == '1' && tenantType == '2' ){
            $('tr[data-ppara_code="yszcUrl"]').removeClass("hide");
        }else {
            $('tr[data-ppara_code="yszcUrl"]').addClass("hide");
        }

        // 对公账户信息
        if(formSet.columns.account_info_url.status == '1' && tenantType == '2' ){
            $('tr[data-ppara_code="accountInfoUrl"]').removeClass("hide");
        }else {
            $('tr[data-ppara_code="accountInfoUrl"]').addClass("hide");
        }

        // 产权证明-集体土地使用证
        if(formSet.columns.ownership_certificate_url.status == '1' && tenantType == '2' ){
            $('tr[data-ppara_code="ownershipCertificateUrl"]').removeClass("hide");
        }else {
            $('tr[data-ppara_code="ownershipCertificateUrl"]').addClass("hide");
        }

        // 产权证明-不动产证书/查册证明/相关确权文件
        if(formSet.columns.other_ownership_certificate_url.status == '1' && tenantType == '2' ){
            $('tr[data-ppara_code="otherOwnershipCertificateUrl"]').removeClass("hide");
        }else {
            $('tr[data-ppara_code="otherOwnershipCertificateUrl"]').addClass("hide");
        }

        // 营业执照
        if(formSet.columns.regno_url.status == '1' && tenantType == '2' ){
            $('tr[data-ppara_code="regnoUrl"]').removeClass("hide");
        }else {
            $('tr[data-ppara_code="regnoUrl"]').addClass("hide");
        }


        // //开户行 单位
        // if(formSet.columns.tss_bank_num_name.status == '1' && tenantType == '2' ){
        //     $('tr[data-ppara_code="tssBankAnother"]').removeClass("hide");
        // }else {
        //     $('tr[data-ppara_code="tssBankAnother"]').addClass("hide");
        // }

        resetSort();
    }

    //重置序号
    function resetSort(){
        var sort = 1;
        $("#productParaListBody").find("tr").each(function (index) {
            if (!$(this).hasClass("hide")) {
                $(this).find("td:eq(1)").text(sort);
                sort++;
            }
        });
    }

    function selectEntry(){
        layer.open({
            type: 2,
            title: '选择电站',
            content: '${ctx}/entryChanges/customerInformationChange/toSelectEntry',
            area: ['80%','80%']
        });
    }

    function delMoreImg(that){
        $(that).parent("div").parent("div").parent("div").find(".moreUpload").removeClass("hide");
        $(that).parent("div").parent("div").parent("div").find(".moreUpload").show();
        $(that).parent("div").remove();
    }


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

    function getStatus(d) {
        var status =d.status;
        if (status == '0') {
            //预审状态 0.暂存 1.待预审 2.预审待审批 3.预审审批中 4.预审通过 5.预审拒绝
            if(d.credit=='1'){
                return '待预审';
            }else if(d.credit=='2'){
                return '预审审批中';
            }else if(d.credit=='3'){
                return '预审审批中';
            }else if(d.credit=='4'){
                if(d.designAuditFlag == '3'){
                    return '自审驳回';
                }else if(d.designAuditFlag == 'a'){
                    return '待设计';
                }else {
                    return '待踏勘';
                }
            }else if(d.credit=='5'){
                return '预审拒绝';
            }
            return '暂存';
        }
        if (status == '1') {
            //设计审核状态：1.待踏勘 2.待自审 3.自审驳回 4.自审通过 5.设计审核驳回 6.设计审核通过/已完成 7.进件审核驳回
            if(d.designAuditFlag=='1'){
                return '待踏勘';
            }else if(d.designAuditFlag=='2'){
                return '待自审';
            }  else if(d.designAuditFlag=='3'){
                return '自审驳回';
            } else if(d.designAuditFlag=='4'){
                return '自审通过';
            } else if(d.designAuditFlag=='5'){
                return '设计审核驳回';
            } else if(d.designAuditFlag=='6'){
                return '设计审核通过';
            }else if(d.designAuditFlag=='7'){
                return '进件审核驳回';
            }else if (d.designAuditFlag == '8') {
                return "进件审核中";
            } else if (d.designAuditFlag == '9') {
                return "进件审核通过";
            } else if (d.designAuditFlag == 'a') {
                return "待设计";
            }
            return '待审核';
        }
        if (status == '2') {
            return '审核驳回';
        }
        if (status == '3') {
            return '待下单';
        }
        if (status == '4') {
            if (d.installFlag == '1'){
                return '待派工';
            }else if (d.installFlag == '2'){
                return '待安装';
            }else if (d.installFlag == '3'){
                return '自审驳回';
            }else if (d.installFlag == '4'){
                return '安装完成';
            }
        }
        if(status == '5'){
            return '待安装验收';
        }
        if(status == 'f'){
            return '安装验收退回';
        }
        if(status == '6'){
            return '待并网';
        }
        if(status == '7'){
            return '待并网验收';
        }
        if(status == '8'){
            return '待交付';
        }
        if(status == '9'){
            return '待归档';
        }
        if(status == '10'){
            return '验收驳回';
        }
        if(status == '11'){
            return '归档驳回';
        }
        if(status == 'a'){
            return '已完成';
        }if(status == 'c'){
            return '待代理商确认';
        }
        // if(status == 'd'){
        //     return '待上传发票';
        // }
        if(status == 'e'){
            return '待签署合同';
        }
        if(status == 'w'){
            return '信息登记';
        }
        if(status == 'g'){
            return '设计审核';
        }
        if(status == 'AN'){
            return '待安装确认';
        }
        if(status == 'AT'){
            return '安装确认驳回';
        }
        if(status == 'BW'){
            return '待并网确认';
        }
        if(status == 'BN'){
            return '并网确认驳回';
        }
        if(status == 'h'){
            return '设计自审';
        }
        if(status == 'i'){
            return '安装自审';
        }
    }

    // 验证手机号
    function isPhoneNo(phone) {
        var tel = /^1[3|4|5|6|7|8|9][0-9]{9}$/;
        return tel.test($.trim(phone));
    }

    let initBankData = [];
    if (!isBlank(tssBankNumName) && !isBlank(tssBankNum)) {
        initBankData = [{name: tssBankNumName, value: tssBankNum, selected: true}];
    }



    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([]);
        }
    }

    function appendTr(data) {
        let d = data.arr[0].origin;
        tssBankNum = d.columns.number;
        tssBankNumName = d.columns.bank_name;
    }
</script>
</body>
</html>


