<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp" %>
<!DOCTYPE HTML>
<html>
<head>
    <meta name="decorator" content="base"/>
    <link rel="stylesheet" href="${ctxPlugin}/lib/layuiAdmin/dist/layuiadmin/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="${ctxPlugin}/lib/layuiAdmin/dist/layuiadmin/style/admin.css" media="all">
    <link rel="stylesheet" href="${ctxPlugin}/static/css/reset.css">
    <link rel="stylesheet" href="${ctxPlugin}/lib/layuiAdmin/dist/layuiadmin/dist/viewer.css" media="all">
    <style>
        html {
            background-color: #fff;
            padding-bottom: 50px;
        }

        .bj-img {
            margin-right: 0px;
        }
        .bj-img > span{
            z-index: 1;
        }
        .lookBtn{
            color: #2890ac;
            width: 10px;
            padding: 11px;
        }
        .bj-img{width: 80px;
            height: 80px;
            border: 1px solid #ddd;
            float: inherit;
            margin-right: 10px;
            display: inline-block;
            position: relative;
        }
    </style>
</head>
<body>
<div class="layui-form ">
    <div class="layui-card">
        <div class="layui-card-body layui-col-xs12" id="LAY_app">
            <div class="layui-card">
                <blockquote class="layui-elem-quote">项目信息</blockquote>
                <div class="layui-card-body">
                    <div class="layui-row layui-col-space12 layui-form-item">
                        <div class="layui-col-lg3 layui-col-sm3">
                            <label class="layui-form-label"><i class="mark">*</i>产品编号：</label>
                            <div class="layui-input-block">
                                <input type="text" id="projectCode" class="layui-input layui-bg-gray" value="${entry.projectCode}" disabled>
                            </div>
                        </div>
                        <div class="layui-col-lg3 layui-col-sm3">
                            <label class="layui-form-label"><i class="mark">*</i>产品名称：</label>
                            <div class="layui-input-block">
                                <select name="projectId" id="projectId" lay-filter="projectId" lay-search>
                                    <option value="">请选择</option>
                                    <c:forEach items="${project}" var="ject">
                                        <option value="${ject.columns.id}"
                                                title="${ject.columns.code}"
                                                data-filingType="${ject.columns.filing_type}"
                                                data-companyName="${ject.columns.companyName}"
                                                <c:if test="${ject.columns.id eq entry.projectId}"> selected</c:if>
                                        >${ject.columns.name}</option>
                                    </c:forEach>
                                </select>
                            </div>
                        </div>
                        <div class="layui-col-lg3 layui-col-sm3">
                            <label class="layui-form-label"><i class="mark">*</i>项目公司：</label>
                            <div class="layui-input-block">
                                <input type="text" id="projectCompanyName" disabled class="layui-input" value="${entry.projectCompanyName}">
                            </div>
                        </div>
                        <div class="layui-col-lg3 layui-col-sm3 ">
                            <label class="layui-form-label">租金支付周期：</label>
                            <div class="layui-input-block pos-r">
                                <input type="text" disabled placeholder=""
                                       autocomplete="off" class="layui-input" id="payCycle"
                                <c:choose>
                                <c:when test="${entry.payCycle eq '1'}">
                                       value="按月支付"
                                </c:when>
                                <c:when test="${entry.payCycle eq '2'}">
                                       value="按季支付"
                                </c:when>
                                <c:when test="${entry.payCycle eq '3'}">
                                       value="按年支付"
                                </c:when>
                                </c:choose>
                                >
                            </div>
                        </div>
                    </div>

                    <div class="layui-row layui-col-space12 layui-form-item">
                        <div class="layui-col-lg3 layui-col-sm3">
                            <label class="layui-form-label"><i class="mark">*</i>备案类型：</label>
                            <div class="layui-input-block">
                                <input type="text" id="filingType" disabled class="layui-input"
                                <c:choose>
                                <c:when test="${entry.filingType eq '1'}">
                                       value="农户备案"
                                </c:when>
                                <c:when test="${entry.filingType eq '2'}">
                                       value="项目公司备案"
                                </c:when>
                                </c:choose>
                                >
                            </div>
                        </div>
                        <div class="layui-col-lg3 layui-col-sm3">
                            <label class="layui-form-label"><i class="mark">*</i>预估组件：</label>
                            <div class="layui-input-block">
                                <input type="text" oninput="if(value.length>9)value=value.slice(0,9)" name="estimateCapacity" id="estimateCapacity" autocomplete="off"
                                       class="layui-input" placeholder="请输入预估组件" value="${entry.estimateCapacity}">
                                <span class="pos-a h-32 lh-32 layui-span-unit">块</span>
                            </div>
                        </div>
                        <div class="layui-col-lg3 layui-col-sm3">
                            <label class="layui-form-label">创建时间：</label>
                            <div class="layui-input-block">
                                <input type="text" disabled class="layui-input layui-bg-gray" value="<fmt:formatDate value="${entry.createTime}" pattern="yyyy-MM-dd HH:mm:ss"/>">
                            </div>
                        </div>
                    </div>

                </div>
            </div>
            <div class="layui-card ">
                <blockquote class="layui-elem-quote">业主信息</blockquote>

                <div class="layui-card-body">

                    <div class="layui-row layui-col-space12 layui-form-item">

                        <div class="layui-col-lg3 layui-col-sm3">
                            <label class="layui-form-label"><i class="mark">*</i>业主姓名：</label>
                            <div class="layui-input-block">
                                <input type="text" name="tenantName"
                                       class="layui-input" value="${entry.tenantName}">
                            </div>
                        </div>
                        <div class="layui-col-lg3 layui-col-sm3">
                            <label class="layui-form-label"><i class="mark">*</i>性别：</label>
                            <div class="layui-input-block">
                                <input type="radio" name="gender" title="男"
                                       value="MALE" ${entry.gender eq 'MALE' ? 'checked' : ''}/>
                                <input type="radio" name="gender" title="女"
                                       value="FEMALE" ${entry.gender eq 'FEMALE' ? 'checked' : ''}/>
                            </div>
                        </div>
                        <div class="layui-col-lg3 layui-col-sm3">
                            <div>
                                <label class="layui-form-label"><i class="mark">*</i>年龄：</label>
                                <div class="layui-input-block">
                                    <input type="text" lay-filter="age" onkeyup="change()" name="age" id="age"  class="layui-input age" value="${entry.age}">
                                </div>
                            </div>
                        </div>

                        <div class="layui-col-lg3 layui-col-sm3" style="position:relative;">
                            <div>
                                <label class="layui-form-label"><i class="mark">*</i>联系电话：</label>
                                <div class="layui-input-block">
                                    <input type="text" name="mobile"
                                           class="layui-input" value="${entry.mobile}">
                                </div>
                            </div>
                        </div>
                        <div class="layui-col-lg3 layui-col-sm3">
                            <label class="layui-form-label"><i class="mark">*</i>身份证号：</label>
                            <div class="layui-input-block">
                                <input type="text" name="idCode"
                                       class="layui-input" value="${entry.idCode}">
                            </div>
                        </div>
                        <div class="layui-col-lg9 layui-col-sm9">
                            <label class="layui-form-label"><i class="mark">*</i>安装地址：</label>
                            <div class="layui-input-block">
                                <div class="layui-col-lg2 layui-col-sm2 pr-10">
                                    <select name="province" id="province" lay-verify="required"
                                            lay-filter="province" lay-search>
                                        <option value="">请选择省</option>
                                        <c:forEach items="${pros}" var="pro">
                                            <option value="${pro.columns.ProvinceName}"
                                                    title="${pro.columns.ProvinceID }"
                                                    <c:if test="${entry.province eq pro.columns.ProvinceName}">selected</c:if>>${pro.columns.ProvinceName}</option>
                                        </c:forEach>
                                    </select>
                                </div>
                                <div class="layui-col-lg2 layui-col-sm2 pr-10">
                                    <select name="city" id="city" lay-verify="required" lay-filter="city"
                                            lay-search>
                                        <option value="">请选择市</option>
                                        <option value="${entry.city}" selected>${entry.city}</option>
                                    </select>
                                </div>
                                <div class="layui-col-lg2 layui-col-sm2 pr-10">
                                    <select name="area" id="area" lay-verify="required" lay-search>
                                        <option value="">请选择县/区</option>
                                        <option value="${entry.area}" selected>${entry.area}</option>
                                    </select>
                                </div>
                                <div class="layui-col-lg6 layui-col-sm6">
                                    <div class="layui-inline">
                                        <input type="text" name="customerAddress" lay-verify="required"
                                               autocomplete="off" class="layui-input layui-col-lg2 "
                                               value="${entry.address}">
                                    </div>
                                </div>
                            </div>
                        </div>



                        <div class="layui-col-lg4 layui-col-sm4">
                            <label class="layui-form-label"><i class="mark">*</i>身份证：</label>
                            <div class="layui-input-block img-box">
                                <div>
                                    <div id="imgsDiv1">
                                        <c:if test="${not empty entry.idCardFront}">
                                            <div class="bj-img imgSpan">
                                                <span class="layui-icon-close layui-icon" onclick="delImg(this,'uploader1')"></span>
                                                <img src="${commonStaticImgPath}${entry.idCardFront}" height="700" width="1200"/>
                                                <input type="hidden" class="idCardFront" value="${entry.idCardFront}"/>
                                            </div>
                                        </c:if>
                                    </div>
                                    <div class="upload-container <c:if test="${not empty entry.idCardFront}">hide</c:if>" id="uploader1">
                                        <img src="" alt="img placeholder" id="imgsAdd1">
                                    </div>
                                    <div style="width: 80px; text-align: center; color: #FF0000">正面</div>
                                </div>
                                <div>
                                    <div id="imgsDiv2">
                                        <c:if test="${not empty entry.idCardBack}">
                                            <div class="bj-img imgSpan">
                                                <span class="layui-icon-close layui-icon" onclick="delImg(this,'uploader2')"></span>
                                                <img src="${commonStaticImgPath}${entry.idCardBack}" height="700" width="1200"/>
                                                <input type="hidden" class="idCardBack" value="${entry.idCardBack}"/>
                                            </div>
                                        </c:if>
                                    </div>
                                    <div class="upload-container <c:if test="${not empty entry.idCardBack}">hide</c:if>" id="uploader2">
                                        <img src="" alt="img placeholder" id="imgsAdd2">
                                    </div>
                                    <div style="width: 80px; text-align: center; color: #FF0000">反面</div>
                                </div>
                            </div>
                        </div>
                        <div class="layui-col-lg4 layui-col-sm4">
                            <label class="layui-form-label w-120">户口本复印件：</label>
                            <div class="layui-input-block img-box ml-120">
                                <div>
                                    <div id="imgsDiv3">
                                        <c:set var="imgsDiv3Count" value="0"/>
                                        <c:if test="${not empty entry.residenceBooklet}">
                                            <c:forEach var="quaim" items="${entry.residenceBooklet.split(',')}" varStatus="vs">
                                                <div class="bj-img imgSpan">
                                                    <span class="layui-icon-close layui-icon" onclick="delImg(this,'uploader3')"></span>
                                                    <img src="${commonStaticImgPath}${quaim}" height="700" width="1200"/>
                                                    <input type="hidden" class="residenceBooklet" value="${quaim}"/>
                                                </div>
                                                <c:set var="imgsDiv3Count" value="${vs.count}"/>
                                            </c:forEach>

                                        </c:if>

                                    </div>
                                    <div class="upload-container <c:if test="${imgsDiv3Count>=4}">hide</c:if>" id="uploader3">
                                        <img src="" alt="img placeholder" id="imgsAdd3">
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="layui-col-lg9 layui-col-sm9" style="margin-bottom: 24px">
                            <label class="layui-form-label"><i class="mark">*</i>银行卡照片：</label>
                            <div class="layui-input-block img-box">
                                <div>
                                    <div id="imgsDiv4">
                                        <c:if test="${not empty entry.bankCard}">
                                            <div class="bj-img imgSpan">
                                                <span class="layui-icon-close layui-icon" onclick="delImg(this,'uploader4')"></span>
                                                <img src="${commonStaticImgPath}${entry.bankCard}" height="700" width="1200"/>
                                                <input type="hidden" class="bankCard" value="${entry.bankCard}"/>
                                            </div>
                                        </c:if>
                                    </div>
                                    <div class="upload-container <c:if test="${not empty entry.bankCard}">hide</c:if>" id="uploader4">
                                        <img src="" alt="img placeholder" id="imgsAdd4">
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="layui-col-lg3 layui-col-sm3">
                            <label class="layui-form-label"><i class="mark">*</i>银行账户名：</label>
                            <div class="layui-input-block">
                                <input type="text" name="bankName" id="bankName" lay-verify="required"
                                       class="layui-input" value="${entry.bankName}">
                            </div>
                        </div>
                        <div class="layui-col-lg3 layui-col-sm3">
                            <label class="layui-form-label"><i class="mark">*</i>银行账户：</label>
                            <div class="layui-input-block">
                                <input type="text" name="bankCode" id="bankCode" lay-verify="required"
                                       class="layui-input" value="${entry.bankCode}">
                            </div>
                        </div>
                        <div class="layui-col-lg4 layui-col-sm4">
                            <label class="layui-form-label"><i class="mark">*</i>开户行：</label>
                            <div class="layui-input-block">
                                <div id="tssBank"></div>
                            </div>
                        </div>


                    </div>
                </div>
            </div>
            <div class="layui-card <c:if test="${entry.age <= 65 || empty entry.age}">hide</c:if> " id="bcxx">
                <blockquote class="layui-elem-quote">补充信息</blockquote>
                <div class="layui-card-body ">
                    <div class="layui-row layui-col-space12 layui-form-item">
                        <div class="layui-col-lg3 layui-col-sm3">
                            <label class="layui-form-label"><i class="mark">*</i>共签人名称：</label>
                            <div class="layui-input-block">
                                <input type="text" name="bpName" id="bpName" class="layui-input " value="${entry.bpName}" >
                            </div>
                        </div>
                        <div class="layui-col-lg3 layui-col-sm3">
                            <label class="layui-form-label"><i class="mark">*</i>证件号码：</label>
                            <div class="layui-input-block">
                                <input type="text" name="bpIdCard" id="bpIdCard" class="layui-input " value="${entry.bpIdCard}" >
                            </div>
                        </div>
                        <div class="layui-col-lg3 layui-col-sm3">
                            <label class="layui-form-label"><i class="mark">*</i>手机号：</label>
                            <div class="layui-input-block">
                                <input type="text" name="bpMobile" id="bpMobile" class="layui-input " value="${entry.bpMobile}" >
                            </div>
                        </div>

                        <div class="layui-col-lg4 layui-col-sm4">
                            <label class="layui-form-label"><i class="mark">*</i>身份证：</label>
                            <div class="layui-input-block img-box">
                                <div>
                                    <div id="imgsDiv30">
                                        <c:if test="${not empty entry.bpCardFront}">
                                            <div class="bj-img imgSpan">
                                                <span class="layui-icon-close layui-icon" onclick="delImg(this,'uploader30')"></span>
                                                <img src="${commonStaticImgPath}${entry.bpCardFront}" height="700" width="1200"/>
                                                <input type="hidden" class="bpCardFront" value="${entry.bpCardFront}"/>
                                            </div>
                                        </c:if>
                                    </div>
                                    <div class="upload-container <c:if test="${not empty entry.bpCardFront}">hide</c:if>" id="uploader30">
                                        <img src="" alt="img placeholder" id="imgsAdd30">
                                    </div>
                                    <div style="width: 80px; text-align: center; color: #FF0000">正面</div>
                                </div>
                                <div>
                                    <div id="imgsDiv31">
                                        <c:if test="${not empty entry.bpCardBack}">
                                            <div class="bj-img imgSpan">
                                                <span class="layui-icon-close layui-icon" onclick="delImg(this,'uploader31')"></span>
                                                <img src="${commonStaticImgPath}${entry.bpCardBack}" height="700" width="1200"/>
                                                <input type="hidden" class="bpCardBack" value="${entry.bpCardBack}"/>
                                            </div>
                                        </c:if>
                                    </div>
                                    <div class="upload-container <c:if test="${not empty entry.bpCardBack}">hide</c:if>" id="uploader31">
                                        <img src="" alt="img placeholder" id="imgsAdd31">
                                    </div>
                                    <div style="width: 80px; text-align: center; color: #FF0000">反面</div>
                                </div>
                            </div>
                        </div>
                        <div class="layui-col-lg4 layui-col-sm4">
                            <label class="layui-form-label w-120"><i class="mark">*</i>子女证明材料：</label>
                            <div class="layui-input-block img-box ml-120">
                                <div>
                                    <div id="imgsDiv32">
                                        <c:if test="${not empty entry.bpFile}">
                                            <c:forEach var="quaim" items="${entry.bpFile.split(',')}" varStatus="vs">
                                                <div class="bj-img imgSpan">
                                                    <span class="layui-icon-close layui-icon" onclick="delImg(this,'uploader32')"></span>
                                                    <img src="${commonStaticImgPath}${quaim}" height="700" width="1200"/>
                                                    <input type="hidden" class="bpFile" value="${quaim}"/>
                                                </div>
                                                <c:set var="imgsDiv32Count" value="${vs.count}"/>
                                            </c:forEach>
                                        </c:if>
                                    </div>
                                    <div class="upload-container <c:if test="${imgsDiv32Count>=4}">hide</c:if>" id="uploader32">
                                        <img src="" alt="img placeholder" id="imgsAdd32">
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>

                </div>
            </div>
            <div class="layui-card">
                <blockquote class="layui-elem-quote">房屋信息</blockquote>
                <div class="layui-card-body ">
                    <div class="layui-row layui-col-space12 layui-form-item">
                        <div class="layui-col-lg3 layui-col-sm4">
                            <label class="layui-form-label"><i class="mark">*</i>屋顶类型：</label>
                            <div class="layui-input-block">
                                <select name="roofType" id="roofType" lay-verify="required" lay-filter="roofType" >
                                    <option value="">请选择</option>
                                    <option value="平屋顶"
                                            <c:if test="${entry.roofType eq '平屋顶'}">selected</c:if>>平屋顶
                                    </option>
                                    <option value="斜屋顶"
                                            <c:if test="${entry.roofType eq '斜屋顶'}">selected</c:if>>斜屋顶
                                    </option>
                                </select>
                            </div>
                        </div>
                        <div class="layui-col-lg3 layui-col-sm3">
                            <label class="layui-form-label"><i class="mark">*</i>并网距离：</label>
                            <div class="layui-input-block">
                                <input type="text" name="distance" id="distance" placeholder=""
                                       autocomplete="off" class="layui-input " value="${entry.distance}">
                                <span class="pos-a h-32 lh-32 layui-span-unit">米</span>
                            </div>
                        </div>
                        <div class="layui-col-lg3 layui-col-sm3" style="position:relative;">
                            <div>
                                <label class="layui-form-label"><i class="mark">*</i>方位角：</label>
                                <div class="layui-inline" style="width: 120px;">
                                    <select name="azimuth" id="azimuth" lay-verify="required" lay-filter="azimuth">
                                        <option value="">请选择</option>
                                        <option value="1" ${entry.azimuth eq '1' ? 'selected' : ''}>正南</option>
                                        <option value="2" ${entry.azimuth eq '2' ? 'selected' : ''}>南偏东</option>
                                        <option value="3" ${entry.azimuth eq '3' ? 'selected' : ''}>南偏西</option>
                                    </select>
                                </div>
                                <div class="layui-inline" style="width: 112px">
                                    <c:if test="${entry.azimuth ne '1'}">
                                        <input type="text" name="angle" id="angle" class="layui-input" maxlength="2"
                                               oninput="value=value.replace(/[^\d]/g,'')" value="${entry.angle}" onchange="checkAngle()" />
                                    </c:if>
                                    <c:if test="${entry.azimuth eq '1'}">
                                        <input type="text" name="angle" id="angle" class="layui-input layui-bg-gray" maxlength="2" readonly="readonly"
                                               oninput="value=value.replace(/[^\d]/g,'')" value="${entry.angle}" onchange="checkAngle()" />
                                    </c:if>
                                    <span class="pos-a h-32 lh-32 layui-span-unit">度</span>
                                </div>
                            </div>
                        </div>
                        <div class="layui-col-lg3 layui-col-sm3">
                            <label class="layui-form-label"><i class="mark">*</i>建筑高度：</label>
                            <div class="layui-input-block">
                                <input type="text" name="buildingHeight" id="buildingHeight" autocomplete="off"
                                       class="layui-input" value="${entry.buildingHeight}">
                                <span class="pos-a h-32 lh-32 layui-span-unit">米</span>
                            </div>
                        </div>
                        <div class="layui-col-lg3 layui-col-sm4">
                            <label class="layui-form-label"><i class="mark">*</i>拍摄方式：</label>
                            <div class="layui-input-block">
                                <input type="radio" name="shootType" lay-filter="shootType" title="无人机拍摄"
                                       value="1" ${entry.shootType eq '1' ? 'checked' : ''}/>
                                <input type="radio" name="shootType" lay-filter="shootType" title="手机拍摄"
                                       value="2" ${entry.shootType eq '2' ? 'checked' : ''}/>
                            </div>
                        </div>
                        <div class="layui-col-lg11 layui-col-sm11">
                            <label class="layui-form-label"><i class="mark">*</i>房屋照片：</label>
                            <div class="layui-input-block img-box">
                                <div>
                                    <div id="imgsDiv5">
                                        <c:if test="${not empty entry.roofPhotoOne}">
                                            <div class="bj-img imgSpan">
                                                <span class="layui-icon-close layui-icon" onclick="delImg(this,'uploader5')"></span>
                                                <img src="${commonStaticImgPath}${entry.roofPhotoOne}" height="700" width="1200"/>
                                                <input type="hidden" class="pic5" value="${entry.roofPhotoOne}"/>
                                            </div>
                                        </c:if>
                                    </div>
                                    <div class="upload-container ${not empty entry.roofPhotoOne ? 'hide' : ''}" id="uploader5">
                                        <img src="" alt="img placeholder" id="imgsAdd5">
                                    </div>
                                    <div style="width: 80px; text-align: center; color: #ff0000">房屋正面</div>
                                </div>
                                <div>
                                    <div id="imgsDiv6">
                                        <c:if test="${not empty entry.roofPhotoTwo}">
                                            <div class="bj-img imgSpan">
                                                <span class="layui-icon-close layui-icon" onclick="delImg(this,'uploader6')"></span>
                                                <img src="${commonStaticImgPath}${entry.roofPhotoTwo}" height="700" width="1200"/>
                                                <input type="hidden" class="pic6" value="${entry.roofPhotoTwo}"/>
                                            </div>
                                        </c:if>
                                    </div>
                                    <div class="upload-container ${not empty entry.roofPhotoTwo ? 'hide' : ''}" id="uploader6">
                                        <img src="" alt="img placeholder" id="imgsAdd6">
                                    </div>
                                    <div style="width: 80px; text-align: center; color: #ff0000">东南角</div>
                                </div>
                                <div>
                                    <div id="imgsDiv7">
                                        <c:if test="${not empty entry.roofPhotoThree}">
                                            <div class="bj-img imgSpan">
                                                <span class="layui-icon-close layui-icon" onclick="delImg(this,'uploader7')"></span>
                                                <img src="${commonStaticImgPath}${entry.roofPhotoThree}" height="700" width="1200"/>
                                                <input type="hidden" class="pic7" value="${entry.roofPhotoThree}"/>
                                            </div>
                                        </c:if>
                                    </div>
                                    <div class="upload-container ${not empty entry.roofPhotoThree ? 'hide' : ''}" id="uploader7">
                                        <img src="" alt="img placeholder" id="imgsAdd7">
                                    </div>
                                    <div style="width: 80px; text-align: center; color: #ff0000">西南角</div>
                                </div>
                                <div>
                                    <div id="imgsDiv8">
                                        <c:if test="${not empty entry.roofPhotoFour}">
                                            <div class="bj-img imgSpan">
                                                <span class="layui-icon-close layui-icon" onclick="delImg(this,'uploader8')"></span>
                                                <img src="${commonStaticImgPath}${entry.roofPhotoFour}" height="700" width="1200"/>
                                                <input type="hidden" class="pic8" value="${entry.roofPhotoFour}"/>
                                            </div>
                                        </c:if>
                                    </div>
                                    <div class="upload-container ${not empty entry.roofPhotoFour ? 'hide' : ''}" id="uploader8">
                                        <img src="" alt="img placeholder" id="imgsAdd8">
                                    </div>
                                    <div style="width: 80px; text-align: center; color: #ff0000">正南侧</div>
                                </div>
                                <div>
                                    <div id="imgsDiv9">
                                        <c:if test="${not empty entry.roofPhotoFacade}">
                                            <div class="bj-img imgSpan">
                                                <span class="layui-icon-close layui-icon" onclick="delImg(this,'uploader9')"></span>
                                                <img src="${commonStaticImgPath}${entry.roofPhotoFacade}" height="700" width="1200"/>
                                                <input type="hidden" class="pic9" value="${entry.roofPhotoFacade}"/>
                                            </div>
                                        </c:if>
                                    </div>
                                    <div class="upload-container ${not empty entry.roofPhotoFacade ? 'hide' : ''}" id="uploader9">
                                        <img src="" alt="img placeholder" id="imgsAdd9">
                                    </div>
                                    <div style="width: 80px; text-align: center; color: #ff0000">生活气息照1</div>
                                </div>
                                <div>
                                    <div id="imgsDiv10">
                                        <c:if test="${not empty entry.roofPhotoInterior}">
                                            <div class="bj-img imgSpan">
                                                <span class="layui-icon-close layui-icon" onclick="delImg(this,'uploader10')"></span>
                                                <img src="${commonStaticImgPath}${entry.roofPhotoInterior}" height="700" width="1200"/>
                                                <input type="hidden" class="pic10" value="${entry.roofPhotoInterior}"/>
                                            </div>
                                        </c:if>
                                    </div>
                                    <div class="upload-container ${not empty entry.roofPhotoInterior ? 'hide' : ''}" id="uploader10">
                                        <img src="" alt="img placeholder" id="imgsAdd10">
                                    </div>
                                    <div style="width: 80px; text-align: center; color: #ff0000">生活气息照2</div>
                                </div>
                                <div>
                                    <div id="imgsDiv11">
                                        <c:if test="${not empty entry.roofPhotoFive}">
                                            <div class="bj-img imgSpan">
                                                <span class="layui-icon-close layui-icon" onclick="delImg(this,'uploader11')"></span>
                                                <img src="${commonStaticImgPath}${entry.roofPhotoFive}" height="700" width="1200"/>
                                                <input type="hidden" class="pic11" value="${entry.roofPhotoFive}"/>
                                            </div>
                                        </c:if>
                                    </div>
                                    <div class="upload-container ${not empty entry.roofPhotoFive ? 'hide' : ''}" id="uploader11">
                                        <img src="" alt="img placeholder" id="imgsAdd11">
                                    </div>
                                    <div style="width: 80px; text-align: center; color: #ff0000">补充1</div>
                                </div>
                                <div>
                                    <div id="imgsDiv12">
                                        <c:if test="${not empty entry.roofPhotoSix}">
                                            <div class="bj-img imgSpan">
                                                <span class="layui-icon-close layui-icon" onclick="delImg(this,'uploader12')"></span>
                                                <img src="${commonStaticImgPath}${entry.roofPhotoSix}" height="700" width="1200"/>
                                                <input type="hidden" class="pic12" value="${entry.roofPhotoSix}"/>
                                            </div>
                                        </c:if>
                                    </div>
                                    <div class="upload-container ${not empty entry.roofPhotoSix ? 'hide' : ''}" id="uploader12">
                                        <img src="" alt="img placeholder" id="imgsAdd12">
                                    </div>
                                    <div style="width: 80px; text-align: center; color: #ff0000">补充2</div>
                                </div>
                                <div>
                                    <div id="imgsDiv13">
                                        <c:if test="${not empty entry.houseSupplementOne}">
                                            <div class="bj-img imgSpan">
                                                <span class="layui-icon-close layui-icon" onclick="delImg(this,'uploader13')"></span>
                                                <img src="${commonStaticImgPath}${entry.houseSupplementOne}" height="700" width="1200"/>
                                                <input type="hidden" class="pic13" value="${entry.houseSupplementOne}"/>
                                            </div>
                                        </c:if>
                                    </div>
                                    <div class="upload-container ${not empty entry.houseSupplementOne ? 'hide' : ''}" id="uploader13">
                                        <img src="" alt="img placeholder" id="imgsAdd13">
                                    </div>
                                    <div style="width: 80px; text-align: center; color: #144856">补充1</div>
                                </div>
                                <div>
                                    <div id="imgsDiv14">
                                        <c:if test="${not empty entry.houseSupplementTwo}">
                                            <div class="bj-img imgSpan">
                                                <span class="layui-icon-close layui-icon" onclick="delImg(this,'uploader14')"></span>
                                                <img src="${commonStaticImgPath}${entry.houseSupplementTwo}" height="700" width="1200"/>
                                                <input type="hidden" class="pic14" value="${entry.houseSupplementTwo}"/>
                                            </div>
                                        </c:if>
                                    </div>
                                    <div class="upload-container ${not empty entry.houseSupplementTwo ? 'hide' : ''}" id="uploader14">
                                        <img src="" alt="img placeholder" id="imgsAdd14">
                                    </div>
                                    <div style="width: 80px; text-align: center; color: #144856">补充2</div>
                                </div>
                            </div>
                        </div>
                        <div class="layui-col-lg5 layui-col-sm5">
                            <label class="layui-form-label"><i class="mark">*</i>细节照片：</label>
                            <div class="layui-input-block img-box">
                                <div>
                                    <div id="imgsDiv15">
                                        <c:if test="${not empty entry.roofPhotoSeven}">
                                            <div class="bj-img imgSpan">
                                                <span class="layui-icon-close layui-icon" onclick="delImg(this,'uploader15')"></span>
                                                <img src="${commonStaticImgPath}${entry.roofPhotoSeven}" height="700" width="1200"/>
                                                <input type="hidden" class="pic15" value="${entry.roofPhotoSeven}"/>
                                            </div>
                                        </c:if>
                                    </div>
                                    <div class="upload-container ${not empty entry.roofPhotoSeven ? 'hide' : ''}" id="uploader15">
                                        <img src="" alt="img placeholder" id="imgsAdd15">
                                    </div>
                                    <div style="width: 80px; text-align: center; color: #ff0000">障碍物照片</div>
                                </div>
                                <div class="dimensionsPhotoThickness">
                                    <div id="imgsDiv16">
                                        <c:if test="${not empty entry.dimensionsPhotoThickness}">
                                            <div class="bj-img imgSpan">
                                                <span class="layui-icon-close layui-icon" onclick="delImg(this,'uploader16')"></span>
                                                <img src="${commonStaticImgPath}${entry.dimensionsPhotoThickness}"
                                                     height="700" width="1200"/>
                                                <input type="hidden" class="pic16" value="${entry.dimensionsPhotoThickness}"/>
                                            </div>
                                        </c:if>
                                    </div>
                                    <div class="upload-container ${not empty entry.dimensionsPhotoThickness ? 'hide' : ''}" id="uploader16">
                                        <img src="" alt="img placeholder" id="imgsAdd16">
                                    </div>
                                    <div style="width: 80px; text-align: center; color: #ff0000">楼顶厚度</div>
                                </div>
                                <div>
                                    <div id="imgsDiv17">
                                        <c:if test="${not empty entry.detailSupplementOne}">
                                            <div class="bj-img imgSpan">
                                                <span class="layui-icon-close layui-icon" onclick="delImg(this,'uploader17')"></span>
                                                <img src="${commonStaticImgPath}${entry.detailSupplementOne}" height="700" width="1200"/>
                                                <input type="hidden" class="pic17" value="${entry.detailSupplementOne}"/>
                                            </div>
                                        </c:if>
                                    </div>
                                    <div class="upload-container ${not empty entry.detailSupplementOne ? 'hide' : ''}" id="uploader17">
                                        <img src="" alt="img placeholder" id="imgsAdd17">
                                    </div>
                                    <div style="width: 80px; text-align: center; color: #144856">补充图片1</div>
                                </div>
                                <div>
                                    <div id="imgsDiv18">
                                        <c:if test="${not empty entry.detailSupplementTwo}">
                                            <div class="bj-img imgSpan">
                                                <span class="layui-icon-close layui-icon" onclick="delImg(this,'uploader18')"></span>
                                                <img src="${commonStaticImgPath}${entry.detailSupplementTwo}" height="700" width="1200"/>
                                                <input type="hidden" class="pic18" value="${entry.detailSupplementTwo}"/>
                                            </div>
                                        </c:if>
                                    </div>
                                    <div class="upload-container ${not empty entry.detailSupplementTwo ? 'hide' : ''}" id="uploader18">
                                        <img src="" alt="img placeholder" id="imgsAdd18">
                                    </div>
                                    <div style="width: 80px; text-align: center; color: #144856">补充图片2</div>
                                </div>
                            </div>
                        </div>
                        <div class="layui-col-lg7 layui-col-sm7">
                            <label class="layui-form-label"><i class="mark">*</i>屋顶视频：</label>
                            <div class="layui-input-block ">
                                <div >
                                <div id="imgsDiva1">
                                    <c:if test="${not empty entry.roofValue}">
                                        <div class="bj-img imgSpan">
                                            <span class="layui-icon-close layui-icon" onclick="delImg(this,'uploadera1')"></span>
                                            <video controls width="80px" height="80px" id="videoId1" src="${commonStaticImgPath}${entry.roofValue}"></video>
                                            <input type="hidden" class="roof-value" value="${entry.roofValue}"/>
                                        </div>
                                    </c:if>
                                </div>
                                <div class="upload-container ${not empty entry.roofValue ? 'hide' : ''}" id="uploadera1">
                                    <img src="" alt="img placeholder" id="imgsAdda1">
                                </div>
                                <div style="width: 80px; text-align: center; color: #ff0000">屋顶视频</div>
                                </div>
                            </div>
                        </div>
                        <div class="layui-col-lg5 layui-col-sm5">
                            <label class="layui-form-label"><i class="mark">*</i>房产证：</label>
                            <div class="layui-input-block img-box">
                                <div style="display: flex">
                                    <div id="imgsDiv20">
                                        <c:if test="${not empty entry.houseOwnership}">
                                           <%-- <div class="bj-img imgSpan">
                                                <span class="layui-icon-close layui-icon" onclick="delImg(this,'uploader20')"></span>
                                                <img src="${commonStaticImgPath}${entry.houseOwnership}" height="700" width="1200"/>
                                                <input type="hidden" class="pic20" value="${entry.houseOwnership}"/>
                                            </div>--%>
                                            <c:forEach var="quaim" items="${quaimgs}">
                                                <div class="bj-img imgSpan mr-10">
                                                    <span class="layui-icon-close layui-icon" onclick="delImg(this,'uploader20')"></span>
                                                    <img src="${commonStaticImgPath}${quaim}" height="700" width="1200">
                                                    <input type="hidden" class="pic20" value="${quaim}">
                                                </div>
                                            </c:forEach>
                                        </c:if>
                                    </div>
                                    <div class="upload-container <c:if test="${quaimgsCount*1 >=5}">hide</c:if>" id="uploader20">
                                        <img src="" alt="img placeholder" id="imgsAdd20">
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="layui-col-lg4 layui-col-sm4">
                            <label class="layui-form-label"><i class="mark">*</i>踏勘记录表：</label>
                            <div class="layui-input-block img-box">
                                <div>
                                    <div id="imgsDiv21">
                                        <c:if test="${not empty entry.surveyRecord}">
                                            <div class="bj-img imgSpan">
                                                <span class="layui-icon-close layui-icon" onclick="delImg(this,'uploader21')"></span>
                                                <img src="${commonStaticImgPath}${entry.surveyRecord}" height="700" width="1200"/>
                                                <input type="hidden" class="pic21" value="${entry.surveyRecord}"/>
                                            </div>
                                        </c:if>
                                    </div>
                                    <div class="upload-container <c:if test="${not empty entry.surveyRecord}">hide</c:if>" id="uploader21">
                                        <img src="" alt="img placeholder" id="imgsAdd21">
                                    </div>
                                    <div style="width: 80px; text-align: center; color: #FF0000">记录表</div>
                                </div>
                                <div>
                                    <div id="imgsDiv22">
                                        <c:if test="${not empty entry.surveyRecord2}">
                                            <div class="bj-img imgSpan">
                                                <span class="layui-icon-close layui-icon" onclick="delImg(this,'uploader22')"></span>
                                                <img src="${commonStaticImgPath}${entry.surveyRecord2}" height="700" width="1200"/>
                                                <input type="hidden" class="pic22" value="${entry.surveyRecord2}"/>
                                            </div>
                                        </c:if>
                                    </div>
                                    <div class="upload-container <c:if test="${not empty entry.surveyRecord2}">hide</c:if>" id="uploader22">
                                        <img src="" alt="img placeholder" id="imgsAdd22">
                                    </div>
                                    <div style="width: 80px; text-align: center;">补充</div>
                                </div>
                            </div>
                        </div>

                        <div class="layui-col-lg3 layui-col-sm3" style="margin-bottom: 24px">
                            <label class="layui-form-label">备案文件：</label>
                            <div class="layui-input-block img-box">
                                <div>
                                    <div id="imgsDiv23">
                                        <c:if test="${not empty entry.filingDocumentPhoto}">
                                            <div class="bj-img imgSpan">
                                                <span class="layui-icon-close layui-icon" onclick="delImg(this,'uploader23')"></span>
                                                <img src="${commonStaticImgPath}${entry.filingDocumentPhoto}" height="700" width="1200"/>
                                                <input type="hidden" class="pic23" value="${entry.filingDocumentPhoto}"/>
                                            </div>
                                        </c:if>
                                    </div>
                                    <div class="upload-container <c:if test="${not empty entry.filingDocumentPhoto}">hide</c:if>" id="uploader23">
                                        <img src="" alt="img placeholder" id="imgsAdd23">
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="layui-col-xs12"></div>
                        <div class="layui-col-lg3 layui-col-sm3">
                            <label class="layui-form-label">划款方式：</label>
                            <div class="layui-input-block">
                                <select name="repaymentMethod" id="repaymentMethod">
                                    <option value="">请选择</option>
                                    <option value="1" ${entry.repaymentMethod eq '1' ? 'selected' : ''}>二类卡</option>
                                    <option value="2" ${entry.repaymentMethod eq '2' ? 'selected' : ''}>光E宝</option>
                                    <option value="0" ${entry.repaymentMethod eq '0' ? 'selected' : ''}>其它</option>
                                </select>
                            </div>
                        </div>

                        <%-- <div class="layui-col-lg3 layui-col-sm3">
                             <label class="layui-form-label"><i class="mark">*</i>还款方式：</label>
                             <div class="layui-input-block">
                                 <select name="repaymentMethod" id="repaymentMethod" lay-verify="required" disabled>
                                     <option value="">请选择</option>
                                     <option value="1" ${entry.repaymentMethod eq '1' ? 'selected' : ''}>二类卡</option>
                                     <option value="2" ${entry.repaymentMethod eq '2' ? 'selected' : ''}>光E宝</option>
                                     <option value="0" ${entry.repaymentMethod eq '0' ? 'selected' : ''}>其它</option>
                                 </select>
                             </div>
                         </div>
                         <div class="layui-col-lg3 layui-col-sm3">
                             <label class="layui-form-label"><i class="mark">*</i>二类卡号：</label>
                             <div class="layui-input-block">
                                 <input type="text" name="bankCode"
                                        disabled class="layui-input layui-bg-gray" value="${accountCode}">
                             </div>
                         </div>--%>
                        <div class="layui-col-xs12">
                            <label class="layui-form-label" id="changeDescribe">备注：</label>
                            <div class="layui-input-block">
                                    <textarea name="remarks" id="remarks" placeholder="" class="layui-textarea"
                                              lay-verify="required">${entry.remarks}</textarea>
                            </div>
                        </div>



                    </div>
                </div>
            </div>
            <div class="layui-card">
                <blockquote class="layui-elem-quote">方案信息</blockquote>

                <div class="layui-card-body">

                    <div class="layui-row layui-col-space12 layui-form-item">
                        <div class="layui-col-lg12 layui-col-sm12">
                            <label class="layui-form-label"><i class="mark">*</i>匹配方式：</label>
                            <div class="layui-input-block">
                                <input type="radio" name="schemeType" value="2" title="组合方案" checked
                                       lay-filter="schemeType" ${entry.schemeType eq '2' ? 'checked' : ''}>
                                <input type="radio" name="schemeType" value="1" title="标准方案"
                                       lay-filter="schemeType" ${entry.schemeType eq '1' ? 'checked' : ''}>
                            </div>
                        </div>
                        <div class="${entry.schemeType eq '2' ? 'layui-hide' : ''}" id="showSchemeId">
                            <div class="layui-row planLie" data-scheme-type-name="${entry.schemeTypeName}" data-plan-id="${entry.schemeId}">
                                <div class="planbiao">
                                    <div class="layui-col-lg3 layui-col-sm3">
                                        <label class="layui-form-label"><i class="mark">*</i>方案类型：</label>
                                        <div class="layui-input-block">
                                            <select lay-filter="planType" name="planType" class="planType" lay-search>
                                                <option value="">请选择</option>
                                                <c:forEach items="${insta}" var="ins">
                                                    <option value="${ins.columns.id}" <c:if test="${fn:contains(entry.schemeTypeId,ins.columns.id)}">selected</c:if>>${ins.columns.name}</option>
                                                </c:forEach>
                                            </select>
                                        </div>
                                    </div>
                                    <div class="layui-col-lg3 layui-col-sm3 ">
                                        <label class="layui-form-label"><i class="mark">*</i>方案名称：</label>
                                        <div class="layui-input-block pos-r">
                                            <select lay-filter="planName" name="planName" class="planName" lay-search>
                                                <option value="${entry.schemeName}" selected>${entry.schemeName}</option>
                                            </select>
                                        </div>
                                    </div>
                                    <div class="layui-col-lg3 layui-col-sm3 ">
                                        <label class="layui-form-label"><i class="mark">*</i>参考图纸：</label>
                                        <div class="layui-input-block pos-r view-attachment">
                                            <a class="h-32 lh-32 ml-5 layui-span-unit" target="_blank"
                                                    <c:if test="${not empty composeOne}">
                                                        href="${commonStaticImgPath}${composeOne.columns.attach}"
                                                        style="color:#2890ac;"
                                                    </c:if>
                                            >查看</a>
                                        </div>
                                    </div>
                                    <div class="layui-col-lg3 layui-col-sm3" style="text-align: center">
                                        <input type="hidden" class="planId" value="${composeOne.columns.plan_id}" >
                                        <input type="hidden" class="planCode" value="${composeOne.columns.code}">
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div id="zuhefangan" class="zuhefangan ${entry.schemeType eq '1' ? 'layui-hide' : ''}">
                            <c:if test="${entry.schemeType eq '2' && not empty compose}">
                                <c:forEach varStatus="vs" items="${compose}" var="item">
                                    <div class="layui-row planLie" data-scheme-type-name="${item.columns.plan_type}" data-plan-id="${item.columns.plan_type_id}">
                                        <div class="planbiao">
                                            <div class="layui-col-lg3 layui-col-sm3">
                                                <label class="layui-form-label"><i class="mark">*</i>方案类型：</label>
                                                <div class="layui-input-block">
                                                    <select lay-filter="planType" name="planType" class="planType" lay-search>
                                                        <option value="">请选择</option>
                                                        <c:forEach items="${insta}" var="ins">
                                                            <option value="${ins.columns.id}" <c:if test="${item.columns.plan_type eq ins.columns.name}">selected</c:if>>${ins.columns.name}</option>
                                                        </c:forEach>
                                                    </select>

                                                </div>
                                            </div>
                                            <div class="layui-col-lg3 layui-col-sm3 ">
                                                <label class="layui-form-label"><i class="mark">*</i>方案名称：</label>
                                                <div class="layui-input-block pos-r">
                                                    <select lay-filter="planName" name="planName" class="planName" lay-search>
                                                        <option value="${item.columns.name}" selected>${item.columns.name}</option>
                                                    </select>
                                                </div>
                                            </div>
                                            <div class="layui-col-lg1 layui-col-sm1 ">
                                                <label class="layui-form-label"><i class="mark">*</i>参考图纸：</label>
                                                <div class="layui-input-block pos-r view-attachment">
                                                    <a class="h-32 lh-32 ml-5 layui-span-unit" target="_blank"
                                                            <c:if test="${not empty item.columns.attach}">
                                                                href="${commonStaticImgPath}${item.columns.attach}"
                                                                style="color:#2890ac;"
                                                            </c:if>
                                                    >查看</a>
                                                </div>
                                            </div>
                                            <div class="layui-col-lg2 layui-col-sm2" style="text-align: center">
                                                <input type="hidden" class="planId" value="${item.columns.plan_id}">
                                                <input type="hidden" class="planCode" value="${item.columns.code}">
                                                <button type="button" class="layui-btn savePlan ${vs.index+1 ne compose.size() && compose.size() ne '1' ? 'layui-hide' : ''}" onclick="savePlan(this)">
                                                    新增方案
                                                </button>
                                                <button type="button" class="layui-btn layui-btn-primary deletePlan ${vs.index+1 eq compose.size() || compose.size() eq '1' ? 'layui-hide' : ''}"
                                                        onclick="deletePlan(this)">删除
                                                </button>
                                            </div>
                                        </div>
                                    </div>
                                </c:forEach>
                            </c:if>
                            <c:if test="${empty compose}">
                                <div class="layui-row planLie">
                                    <div class="planbiao">
                                        <div class="layui-col-lg3 layui-col-sm3">
                                            <label class="layui-form-label"><i class="mark">*</i>方案类型：</label>
                                            <div class="layui-input-block">
                                                <select lay-filter="planType" name="planType" class="planType" lay-search>
                                                    <option value="">请选择</option>
                                                    <c:forEach items="${insta}" var="ins">
                                                        <option value="${ins.columns.id}" >${ins.columns.name}</option>
                                                    </c:forEach>
                                                </select>
                                            </div>
                                        </div>
                                        <div class="layui-col-lg3 layui-col-sm3 ">
                                            <label class="layui-form-label"><i class="mark">*</i>方案名称：</label>
                                            <div class="layui-input-block pos-r">
                                                <select lay-filter="planName" name="planName" class="planName" lay-search>
                                                    <option value="">请选择</option>

                                                </select>
                                            </div>
                                        </div>
                                        <div class="layui-col-lg1 layui-col-sm1 ">
                                            <label class="layui-form-label"><i class="mark">*</i>参考图纸：</label>
                                            <div class="layui-input-block pos-r view-attachment">
                                                    <%-- <span class="h-32 lh-32 ml-5 layui-span-unit">查看</span>--%>
                                            </div>
                                        </div>
                                        <div class="layui-col-lg2 layui-col-sm2" style="text-align: center">
                                            <input type="hidden" class="planId">
                                            <input type="hidden" class="planCode">
                                            <button type="button" class="layui-btn savePlan" onclick="savePlan(this)">
                                                新增方案
                                            </button>
                                            <button type="button" class="layui-btn layui-btn-primary deletePlan layui-hide"
                                                    onclick="deletePlan(this)">删除
                                            </button>
                                        </div>
                                    </div>
                                </div>
                            </c:if>
                        </div>
                        <div class="layui-row">
                            <div class="layui-col-lg3 layui-col-sm3 ">
                                <label class="layui-form-label">设计容量：</label>
                                <div class="layui-input-block pos-r">
                                    <input class="layui-input layui-bg-gray" name="designCapacity" value="${entry.designCapacity}" disabled>
                                    <span class="pos-a h-32 lh-32 layui-span-unit">W</span>
                                </div>
                            </div>
                            <%--<div class="layui-col-lg9 layui-col-sm9 ">
                                <label class="layui-form-label"><i class="mark">*</i>设计图纸：</label>
                                <div class="layui-input-block pos-r" style="display: flex; align-items: center">
                                    <div id="attachFile">
                                        <c:if test="${not empty entry.designDrawings}">
                                            <c:choose>
                                                <c:when test="${fns:checkIfImg(entry.designDrawings)}">
                                                    <div class="bj-img imgSpan">
                                                        <span class="layui-icon-close layui-icon" onclick="delImg(this,'uploadBtn')"></span>
                                                        <img src="${commonStaticImgPath}${entry.designDrawings}" height="700" width="1200"/>
                                                        <input type="hidden" class="attachFileImg" value="${entry.designDrawings}"/>
                                                    </div>
                                                </c:when>
                                                <c:otherwise>
                                                    <div class="fileDivs bj-img" style="border: none;height: 30px">
                                                        <span class="layui-icon-close layui-icon" onclick="delImg(this,'uploadBtn')"></span>
                                                        <a class="h-32 lh-32 layui-span-unit lookBtn" target="_blank" href="${commonStaticImgPath}${entry.designDrawings}">查看</a>
                                                        <input type="hidden" class="attachFileImg" value="${entry.designDrawings}"/>
                                                    </div>
                                                </c:otherwise>
                                            </c:choose>
                                        </c:if>
                                    </div>
                                    <div class="pos-r ml-5" id="uploadBtn" <c:if test="${not empty entry.designDrawings}">style="display: none" </c:if> >
                                        <span class="h-32 lh-32 layui-span-unit" style="color:#2890ac;">上传</span>
                                        <input type="file" id="uploadFile" style="position: absolute; z-index: 3; left: 0; top:0; opacity: 0; width: 44px;"/>
                                    </div>
                                </div>
                            </div>--%>
                            <div class="layui-col-lg3 layui-col-sm3 ">
                                <label class="layui-form-label"><i class="mark">*</i>设计图纸：</label>
                                <div class="layui-input-block pos-r">
                                    <span class="h-32 lh-32 layui-span-unit" style="color:#2890ac;">上传</span>
                                    <input type="file" id="uploadFile" style="position: absolute; z-index: 3; opacity: 0; left: 0; width: 44px;"/>
                                    <ul id="attachFile">
                                        <c:if test="${not empty entry.designDrawings}">
                                            <li style="width: 190px;text-overflow: ellipsis;white-space: nowrap;overflow: hidden;" >
                                                <span class="uploadFileName">${entry.designDrawingsName}</span>
                                                <input type="hidden" name="attach" value="${entry.designDrawings}"/>
                                                <input type="hidden" name="attachName" value="${entry.designDrawingsName}"/>
                                            </li>
                                        </c:if>
                                    </ul>
                                </div>
                            </div>
                            <div class="layui-col-lg12 layui-col-sm12 mt-10">
                                <label class="layui-form-label"></label>
                                <div class="layui-input-block img-box">
                                    <div>
                                        <div id="imgsDiv24">
                                            <c:if test="${not empty entry.zjpbImg}">
                                                <div class="bj-img imgSpan">
                                                    <span class="layui-icon-close layui-icon" onclick="delImg(this,'uploader24')"></span>
                                                    <img src="${commonStaticImgPath}${entry.zjpbImg}" height="700" width="1200"/>
                                                    <input type="hidden" class="zjpbImg" value="${entry.zjpbImg}"/>
                                                </div>
                                            </c:if>
                                        </div>
                                        <div class="upload-container <c:if test="${not empty entry.zjpbImg}">hide</c:if>" id="uploader24">
                                            <img src="" alt="img placeholder" id="imgsAdd24">
                                        </div>
                                        <div style="width: 80px; text-align: center;">组件排布图</div>
                                    </div>
                                    <div>
                                        <div id="imgsDiv25">
                                            <c:if test="${not empty entry.zjzxImg}">
                                                <div class="bj-img imgSpan">
                                                    <span class="layui-icon-close layui-icon" onclick="delImg(this,'uploader25')"></span>
                                                    <img src="${commonStaticImgPath}${entry.zjzxImg}" height="700" width="1200"/>
                                                    <input type="hidden" class="zjzxImg" value="${entry.zjzxImg}"/>
                                                </div>
                                            </c:if>
                                        </div>
                                        <div class="upload-container <c:if test="${not empty entry.zjzxImg}">hide</c:if>" id="uploader25">
                                            <img src="" alt="img placeholder" id="imgsAdd25">
                                        </div>
                                        <div style="width: 80px; text-align: center;">组件走线图</div>
                                    </div>
                                    <div>
                                        <div id="imgsDiv26">
                                            <c:if test="${not empty entry.zjcsImg}">
                                                <div class="bj-img imgSpan">
                                                    <span class="layui-icon-close layui-icon" onclick="delImg(this,'uploader26')"></span>
                                                    <img src="${commonStaticImgPath}${entry.zjcsImg}" height="700" width="1200"/>
                                                    <input type="hidden" class="zjcsImg" value="${entry.zjcsImg}"/>
                                                </div>
                                            </c:if>
                                        </div>
                                        <div class="upload-container <c:if test="${not empty entry.zjcsImg}">hide</c:if>" id="uploader26">
                                            <img src="" alt="img placeholder" id="imgsAdd26">
                                        </div>
                                        <div style="width: 80px; text-align: center;">支架侧视图</div>
                                    </div>
                                    <div>
                                        <div id="imgsDiv27">
                                            <c:if test="${not empty entry.zjhsImg}">
                                                <div class="bj-img imgSpan">
                                                    <span class="layui-icon-close layui-icon" onclick="delImg(this,'uploader27')"></span>
                                                    <img src="${commonStaticImgPath}${entry.zjhsImg}" height="700" width="1200"/>
                                                    <input type="hidden" class="zjhsImg" value="${entry.zjhsImg}"/>
                                                </div>
                                            </c:if>
                                        </div>
                                        <div class="upload-container <c:if test="${not empty entry.zjhsImg}">hide</c:if>" id="uploader27">
                                            <img src="" alt="img placeholder" id="imgsAdd27">
                                        </div>
                                        <div style="width: 80px; text-align: center;">支架后视图</div>
                                    </div>
                                    <div>
                                        <div id="imgsDiv28">
                                            <c:if test="${not empty entry.nbqwzImg}">
                                                <div class="bj-img imgSpan">
                                                    <span class="layui-icon-close layui-icon" onclick="delImg(this,'uploader28')"></span>
                                                    <img src="${commonStaticImgPath}${entry.nbqwzImg}" height="700" width="1200"/>
                                                    <input type="hidden" class="nbqwzImg" value="${entry.nbqwzImg}"/>
                                                </div>
                                            </c:if>
                                        </div>
                                        <div class="upload-container <c:if test="${not empty entry.nbqwzImg}">hide</c:if>" id="uploader28">
                                            <img src="" alt="img placeholder" id="imgsAdd28">
                                        </div>
                                        <div style="width: 80px; text-align: center;">逆变器位置</div>
                                    </div>
                                    <div>
                                        <div id="imgsDiv29">
                                            <c:if test="${not empty entry.pdxwzImg}">
                                                <div class="bj-img imgSpan">
                                                    <span class="layui-icon-close layui-icon" onclick="delImg(this,'uploader29')"></span>
                                                    <img src="${commonStaticImgPath}${entry.pdxwzImg}" height="700" width="1200"/>
                                                    <input type="hidden" class="pdxwzImg" value="${entry.pdxwzImg}"/>
                                                </div>
                                            </c:if>
                                        </div>
                                        <div class="upload-container <c:if test="${not empty entry.pdxwzImg}">hide</c:if>" id="uploader29">
                                            <img src="" alt="img placeholder" id="imgsAdd29">
                                        </div>
                                        <div style="width: 80px; text-align: center;">配电箱位置</div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="assembly">
                            <c:if test="${not empty assemblyList}">
                                <c:forEach var="assembly" items="${assemblyList}" varStatus="vs">
                                    <div class="layui-row assemblyDiv">
                                        <div class="layui-col-lg5 layui-col-sm7">
                                            <label class="layui-form-label"><i class="mark">*</i>组件：</label>
                                            <div class="layui-input-block">
                                                <div class="layui-inline">
                                                    <select lay-filter="assembly" name="assembly" class="assembly" lay-search>
                                                        <option value="">请选择</option>
                                                        <c:forEach varStatus="" items="${sysAssemblyList}" var="sysAssembly">
                                                            <option value="${sysAssembly.columns.id}" data-power="${sysAssembly.columns.model}" ${sysAssembly.columns.id eq assembly.columns.item_id ? 'selected' : ''}>${sysAssembly.columns.model}</option>
                                                        </c:forEach>
                                                    </select>
                                                    <span class="pos-a h-32 lh-32 layui-span-unit" style="right: 30px">W</span>
                                                </div>
                                                <span class="layui-inline">X </span>
                                                <div class="layui-inline">
                                                    <input type="text" class="layui-input" style="width: 85px;"
                                                           placeholder="数量" name="optionVal" value="${assembly.columns.num}">
                                                </div>
                                                    <%--                                    <i class="layui-icon layui-icon-add-circle" style="float: right;position: absolute;right: 0px;top: 3px;color: #1b6073;font-size: 25px;" onclick="add1(this)"></i>--%>
                                            </div>
                                        </div>
                                        <div class="layui-col-lg3 layui-col-sm3">
                                            <i class="layui-icon layui-icon-add-circle ${vs.index+1 ne assemblyList.size() && assemblyList.size() ne '1' ? 'layui-hide' : ''}" style="color: #1b6073;font-size: 25px;" onclick="add1(this)"></i>
                                            <i class="layui-icon layui-icon-delete ${assemblyList.size() eq '1' ? 'layui-hide' : ''}" style="color: #1b6073;font-size: 25px;" onclick="delete1(this)"></i>
                                        </div>
                                    </div>
                                </c:forEach>
                            </c:if>
                            <c:if test="${empty assemblyList}">
                                <div class="layui-row assemblyDiv">
                                    <div class="layui-col-lg5 layui-col-sm7">
                                        <label class="layui-form-label"><i class="mark">*</i>组件：</label>
                                        <div class="layui-input-block">
                                            <div class="layui-inline">
                                                <select lay-filter="assembly" name="assembly" class="assembly" lay-search>
                                                    <option value="">请选择</option>
                                                    <c:forEach varStatus="" items="${sysAssemblyList}" var="sysAssembly">
                                                        <option value="${sysAssembly.columns.id}">${sysAssembly.columns.model}</option>
                                                    </c:forEach>
                                                </select>
                                                <span class="pos-a h-32 lh-32 layui-span-unit" style="right: 30px">W</span>
                                            </div>
                                            <span class="layui-inline">X </span>
                                            <div class="layui-inline">
                                                <input type="text" class="layui-input" style="width: 85px;"
                                                       placeholder="数量" name="optionVal">
                                            </div>
                                                <%--                                    <i class="layui-icon layui-icon-add-circle" style="float: right;position: absolute;right: 0px;top: 3px;color: #1b6073;font-size: 25px;" onclick="add1(this)"></i>--%>
                                        </div>
                                    </div>
                                    <div class="layui-col-lg3 layui-col-sm3">
                                        <i class="layui-icon layui-icon-add-circle" style="color: #1b6073;font-size: 25px;" onclick="add1(this)"></i>
                                        <i class="layui-icon layui-icon-delete layui-hide" style="color: #1b6073;font-size: 25px;" onclick="delete1(this)"></i>
                                    </div>
                                </div>
                            </c:if>
                        </div>
                        <div class="inverter">
                            <c:if test="${not empty inverterList}">
                                <c:forEach var="inverter" items="${inverterList}" varStatus="vs">
                                    <div class="layui-row inverterDiv">
                                        <div class="layui-col-lg5 layui-col-sm7">
                                            <label class="layui-form-label"><i class="mark">*</i>逆变器：</label>
                                            <div class="layui-input-block">
                                                <div class="layui-inline">
                                                    <select lay-filter="inverter" name="inverter" class="inverter" lay-search>
                                                        <option value="">请选择</option>
                                                        <c:forEach varStatus="" items="${sysInverterList}" var="sysInverter">
                                                            <option value="${sysInverter.columns.id}" ${sysInverter.columns.id eq inverter.columns.item_id ? 'selected' : ''}>${sysInverter.columns.model}</option>
                                                        </c:forEach>
                                                    </select>
                                                </div>
                                                <span class="layui-inline">X </span>
                                                <div class="layui-inline">
                                                    <input type="text" class="layui-input" style="width: 85px;"
                                                           placeholder="数量" name="optionVal" value="${inverter.columns.num}">
                                                </div>
                                            </div>
                                        </div>
                                        <div class="layui-col-lg3 layui-col-sm3">
                                            <i class="layui-icon layui-icon-add-circle ${vs.index+1 ne inverterList.size() && inverterList.size() ne '1' ? 'layui-hide' : ''}" style="color: #1b6073;font-size: 25px;"
                                               onclick="add2(this)"></i>
                                            <i class="layui-icon layui-icon-delete ${inverterList.size() eq '1' ? 'layui-hide' : ''}"
                                               style="color: #1b6073;font-size: 25px;" onclick="delete2(this)"></i>
                                        </div>
                                    </div>
                                </c:forEach>
                            </c:if>
                            <c:if test="${empty inverterList}">
                                <div class="layui-row inverterDiv">
                                    <div class="layui-col-lg5 layui-col-sm7">
                                        <label class="layui-form-label"><i class="mark">*</i>逆变器：</label>
                                        <div class="layui-input-block">
                                            <div class="layui-inline">
                                                <select lay-filter="inverter" name="inverter" class="inverter" lay-search>
                                                    <option value="">请选择</option>
                                                    <c:forEach varStatus="" items="${sysInverterList}" var="sysInverter">
                                                        <option value="${sysInverter.columns.id}" ${sysInverter.columns.id eq inverter.columns.item_id ? 'selected' : ''}>${sysInverter.columns.model}</option>
                                                    </c:forEach>
                                                </select>
                                            </div>
                                            <span class="layui-inline">X </span>
                                            <div class="layui-inline">
                                                <input type="text" class="layui-input" style="width: 85px;"
                                                       placeholder="数量" name="optionVal">
                                            </div>
                                        </div>
                                    </div>
                                    <div class="layui-col-lg3 layui-col-sm3">
                                        <i class="layui-icon layui-icon-add-circle" style="color: #1b6073;font-size: 25px;"
                                           onclick="add2(this)"></i>
                                        <i class="layui-icon layui-icon-delete layui-hide"
                                           style="color: #1b6073;font-size: 25px;" onclick="delete2(this)"></i>
                                    </div>
                                </div>
                            </c:if>
                        </div>
                        <div class="grid-connection">
                            <c:if test="${not empty gridConnectionList}">
                                <c:forEach var="gridConnection" items="${gridConnectionList}" varStatus="vs">
                                    <div class="layui-row connectionDiv">
                                        <div class="layui-col-lg5 layui-col-sm7">
                                            <label class="layui-form-label">并网箱：</label>
                                            <div class="layui-input-block">
                                                <div class="layui-inline">
                                                    <select lay-filter="grid-connection" name="gridConnection"
                                                            class="grid-connection" lay-search>
                                                        <option value="">请选择</option>
                                                        <c:forEach varStatus="" items="${sysGridConnectionList}" var="sysGridConnection">
                                                            <option value="${sysGridConnection.columns.id}" ${sysGridConnection.columns.id eq gridConnection.columns.item_id ? 'selected' : ''}>${sysGridConnection.columns.model}</option>
                                                        </c:forEach>
                                                    </select>
                                                </div>
                                                <span class="layui-inline">X </span>
                                                <div class="layui-inline">
                                                    <input type="text" class="layui-input" style="width: 85px;" placeholder="数量" name="optionVal" value="${gridConnection.columns.num}">
                                                </div>
                                            </div>
                                        </div>
                                        <div class="layui-col-lg3 layui-col-sm3">

                                            <i class="layui-icon layui-icon-add-circle ${vs.index+1 ne gridConnectionList.size() && gridConnectionList.size() ne '1' ? 'layui-hide' : ''}" style="color: #1b6073;font-size: 25px;" onclick="add3(this)"></i>
                                            <i class="layui-icon layui-icon-delete ${gridConnectionList.size() eq '1' ? 'layui-hide' : ''}" style="color: #1b6073;font-size: 25px;" onclick="delete3(this)"></i>
                                        </div>
                                    </div>
                                </c:forEach>
                            </c:if>
                            <c:if test="${empty gridConnectionList}">
                                <div class="layui-row connectionDiv">
                                    <div class="layui-col-lg5 layui-col-sm7">
                                        <label class="layui-form-label">并网箱：</label>
                                        <div class="layui-input-block">
                                            <div class="layui-inline">
                                                <select lay-filter="grid-connection" name="gridConnection"
                                                        class="grid-connection" lay-search>
                                                    <option value="">请选择</option>
                                                    <c:forEach varStatus="" items="${sysGridConnectionList}" var="sysGridConnection">
                                                        <option value="${sysGridConnection.columns.id}" ${sysGridConnection.columns.id eq gridConnection.columns.item_id ? 'selected' : ''}>${sysGridConnection.columns.model}</option>
                                                    </c:forEach>
                                                </select>
                                            </div>
                                            <span class="layui-inline">X </span>
                                            <div class="layui-inline">
                                                <input type="text" class="layui-input" style="width: 85px;"
                                                       placeholder="数量" name="optionVal">
                                            </div>
                                        </div>
                                    </div>
                                    <div class="layui-col-lg3 layui-col-sm3">
                                        <i class="layui-icon layui-icon-add-circle" style="color: #1b6073;font-size: 25px;"
                                           onclick="add3(this)"></i>
                                        <i class="layui-icon layui-icon-delete layui-hide"
                                           style="color: #1b6073;font-size: 25px;" onclick="delete3(this)"></i>
                                    </div>
                                </div>
                            </c:if>
                        </div>

                        <div class="grid-support">
                            <c:if test="${not empty gridSupportList}">
                                <c:forEach var="gridSupport" items="${gridSupportList}" varStatus="vs">
                                    <div class="layui-row supportDiv">
                                        <div class="layui-col-lg5 layui-col-sm7">
                                            <label class="layui-form-label">支架：</label>
                                            <div class="layui-input-block">
                                                <div class="layui-inline">
                                                    <select lay-filter="grid-support" name="gridSupport"
                                                            class="gridSupport" lay-search>
                                                        <option value="">请选择</option>
                                                        <c:forEach varStatus="" items="${sysGridSupportList}" var="sysGridSupport">
                                                            <option value="${sysGridSupport.columns.id}" ${sysGridSupport.columns.id eq gridSupport.columns.item_id ? 'selected' : ''}>${sysGridSupport.columns.model}</option>
                                                        </c:forEach>
                                                    </select>
                                                </div>
                                                <span class="layui-inline">X </span>
                                                <div class="layui-inline">
                                                    <input type="text" class="layui-input" style="width: 85px;" placeholder="数量" name="optionVal" value="${gridSupport.columns.num}">
                                                </div>
                                            </div>
                                        </div>
                                        <div class="layui-col-lg3 layui-col-sm3">

                                            <i class="layui-icon layui-icon-add-circle ${vs.index+1 ne gridSupportList.size() && gridSupportList.size() ne '1' ? 'layui-hide' : ''}" style="color: #1b6073;font-size: 25px;" onclick="add4(this)"></i>
                                            <i class="layui-icon layui-icon-delete ${gridSupportList.size() eq '1' ? 'layui-hide' : ''}" style="color: #1b6073;font-size: 25px;" onclick="delete4(this)"></i>
                                        </div>
                                    </div>
                                </c:forEach>
                            </c:if>
                            <c:if test="${empty gridSupportList}">
                                <div class="layui-row supportDiv">
                                    <div class="layui-col-lg5 layui-col-sm7">
                                        <label class="layui-form-label">支架：</label>
                                        <div class="layui-input-block">
                                            <div class="layui-inline">
                                                <select lay-filter="grid-support" name="gridSupport"
                                                        class="gridSupport" lay-search>
                                                    <option value="">请选择</option>
                                                    <c:forEach varStatus="" items="${sysGridSupportList}" var="sysGridSupport">
                                                        <option value="${sysGridSupport.columns.id}" }>${sysGridSupport.columns.model}</option>
                                                    </c:forEach>
                                                </select>
                                            </div>
                                            <span class="layui-inline">X </span>
                                            <div class="layui-inline">
                                                <input type="text" class="layui-input" style="width: 85px;"
                                                       placeholder="数量" name="optionVal">
                                            </div>
                                        </div>
                                    </div>
                                    <div class="layui-col-lg3 layui-col-sm3">
                                        <i class="layui-icon layui-icon-add-circle" style="color: #1b6073;font-size: 25px;"
                                           onclick="add4(this)"></i>
                                        <i class="layui-icon layui-icon-delete layui-hide"
                                           style="color: #1b6073;font-size: 25px;" onclick="delete4(this)"></i>
                                    </div>
                                </div>
                            </c:if>
                        </div>

                        <div class="layui-col-xs12">
                            <label class="layui-form-label">方案备注：</label>
                            <div class="layui-input-block">
                                    <textarea name="schemeRemarks" id="schemeRemarks" placeholder=""
                                              class="layui-textarea" lay-verify="required">${entry.schemeRemarks}</textarea>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="operate-footer">
        <button type="button" class="layui-btn saveOrder">暂存</button>
        <button type="button" class="layui-btn layui-btn-primary" onclick="cancel()">取消</button>
    </div>
</div>


<script src="${ctxPlugin}/lib/layuiAdmin/dist/layuiadmin/layui/layui.js"></script>
<script src="${ctxPlugin}/lib/layuiAdmin/dist/layuiadmin/dist/viewer.js"></script>
<script src="${ctxPlugin}/lib/xm-select.js"></script>
<script>
    //图片查看效果
    var viewer = new Viewer(document.getElementById('LAY_app'));
    var number = /^[1-9]\d*$/;//非0正整数正则
    var assemblyOptionHtml = '';// 组件下拉选html
    var inverterOptionHtml = '';// 逆变器下拉选html
    var gridConnectionOptionHtml = '';// 并网箱下拉选html
    var supportOptionHtml = '';// 支架下拉选html
    // 联行号
    var tssBankNum = '${entry.tssBankNum}';
    // 银行名称
    var tssBankNumName = '${entry.tssBankNumName}';
    var quaimgsCount='${quaimgsCount}';
    layui.config({
        base: '${ctxPlugin}/lib/layuiAdmin/dist/layuiadmin/' //静态资源所在路径
    }).extend({
        index: 'lib/index' //主入口模块
    }).use(['index', 'form', 'layedit', 'laydate', 'jquery', 'upload', 'layer'], function () {
        $ = layui.$
            , element = layui.element
            , form = layui.form
            , layer = layui.layer
            , laydate = layui.laydate;
        var upload = layui.upload;

        initElectricSelect();
        if(${empty compose && empty composeOne}){
            initSchemeData();
        }

        laydate.render({
            elem: '#leaseDate'
            ,trigger: 'click'
            ,min:'0'
        });

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        upload.render({
            elem: '#uploadera1' //绑定元素
            , url: '${ctx}/common/uploadFile' //上传接口
            , accept: 'video'
            , before: function (obj) {
                //预读本地文件示例，不支持ie8
                obj.preview(function (index, file, result) {
                });
            }
            , done: function (res) {
                //上传完毕回调
                $("#uploadera1").hide();
                var html = '<div class="bj-img imgSpan"><span class="layui-icon-close layui-icon" onclick="delImg(this,\'uploadera1\')"></span>';
                html+=' <video controls width="80px" height="80px" id="videoId1" src="${commonStaticImgPath}'+ res.path+'"></video>';
                html += '<input type="hidden" class="roof-value" value="' + res.path + '"/> </div>';
                $("#imgsDiva1").append(html);
                //图片查看效果
                viewer.update();
            }
            , error: function () {
                //请求异常回调
            }
        });

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

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

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

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

        //房产证
        upload.render({
            elem: '#uploader20' //绑定元素
            , url: '${ctx}/common/uploadFile' //上传接口
            , before: function (obj) {
                //预读本地文件示例，不支持ie8
                obj.preview(function (index, file, result) {
                });
            }
            , done: function (res) {
                //上传完毕回调
                quaimgsCount++;
                addImg(res.path, "uploader20", "imgsDiv20", "pic20");
                if (quaimgsCount >= 5) {
                    $("#uploader20").hide();
                } else {
                    $("#uploader20").show();
                }
            }
            , error: function () {
                //请求异常回调
            }
        });

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

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

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

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

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

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

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

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

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

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

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

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


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

        /* $('#uploadFile').change(function () {
             var len=$(".attachFileImg").length;
             if(len>=1){
                 layer.msg("最多上传1个文件!")
                 return;
             }
             var file = $(this)[0].files[0];
             var formData = new FormData();
             formData.append("file", file);
             $.ajax({
                 url: "${ctx}/common/uploadFile",
                type: 'POST',
                data: formData,
                processData: false,
                contentType: false,
                success: function (data) {
                    console.log(file.type.indexOf("image"));
                    var html='';
                    if(file.type.indexOf("image")!=-1){
                        html = '<div class="bj-img imgSpan"><span class="layui-icon-close layui-icon" onclick="delImg(this,\'uploadBtn\')"></span>';
                        html += '<img src="${commonStaticImgPath}' + data.path + '" height="700" width="1200"/>';
                        html += '<input type="hidden" class="attachFileImg" value="' + data.path + '"/> </div>';
                    }else{
                        html+='<div class="fileDivs bj-img" style="border: none;height: 30px">'
                        html+='<span class="layui-icon-close layui-icon" onclick="delImg(this,\'uploadBtn\')"></span>';
                        html+='<a class="h-32 lh-32 layui-span-unit lookBtn" target="_blank" href="${commonStaticImgPath}'+data.path+'">查看</a>';
                        html += '<input type="hidden" class="attachFileImg" value="' + data.path + '"/>';
                        html+='</div>';
                    }
                    $('#attachFile').append(html);
                    $("#uploadBtn").hide();
                }
            });
        });*/


        $('#uploadFile').change(function () {

            var file = $(this)[0].files[0];
            if(isBlank(file)){
                console.log(111);
                return;
            }
            var formData = new FormData();
            formData.append("file", file);
            $.ajax({
                url: "${ctx}/common/uploadFile",
                type: 'POST',
                data: formData,
                processData: false,
                contentType: false,
                success: function (data) {
                    $('#attachFile').empty().append('<li><span class="uploadFileName">'+file.name+'</span><input type="hidden" name="attach"  value="'+data.path+'"> <input type="hidden" name="attachName" value="'+file.name+'"/> ');
                }
            });
        });

        //日期
        laydate.render({
            elem: '#applianceBuyTime'
            , trigger: 'click'
        });
        //预约时间
        laydate.render({
            elem: '#promiseTime'
            , trigger: 'click'
        });
        laydate.render({
            elem: '#repairTime'
            , value: '${data}'
            , type: 'datetime'
            , trigger: 'click'
        });
        form.render(null, 'component-form-element');
        //自定义验证规则
        form.verify({
            title: function (value) {
                if (value.length < 5) {
                    return '标题至少得5个字符啊';
                }
            }
            , pass: [
                /^[\S]{6,12}$/
                , '密码必须6到12位，且不能出现空格'
            ]
            , recevierMobile: [/^((0\d{2,3}-\d{7,8})|([1][3,4,5,7,8,8,9][0-9]{9}))$/
                , '请输入正确格式的联系电话！'
            ]
            , content: function (value) {
                layedit.sync(editIndex);
            }
        });

        form.on('select(azimuth)', function (data) {
            var azimuth = data.value;
            if (azimuth === '1') {
                $('input[name=angle]').val('').addClass('layui-bg-gray').prop('readonly', true);
            } else {
                $('input[name=angle]').removeClass('layui-bg-gray').prop('readonly', false);
            }
        });

        form.on('radio(schemeType)', function (data) {
            var type = data.value;
            if ('1' == type) {
                //标准
                $("#showSchemeId").removeClass("layui-hide");
                $("#zuhefangan").addClass("layui-hide");
                //清除
                // $(".planType").empty();
                // $(".planName").empty();
                // $(".componentNum").val('');
                // $("#componentCount").val('0');
                // $(".addplan").remove();
                // $("#componentSpec").val('');
                // form.render('select');
            } else {
                $("#zuhefangan").removeClass("layui-hide");
                $("#showSchemeId").addClass("layui-hide");
                // $("#schemeId").val('');
                // form.render('select');
                // $(".deletePlan").hide();
                // $(".savePlan").show();
            }
        });

        form.on('select(projectId)', function (data) {
            var name = $(data.elem).find("option:selected").attr("title");
            $("#projectCode").val(name);
            var filingType = $(data.elem).find("option:selected").attr("data-filingType");
            if (filingType == '1') {
                filingType = '农户备案';
            } else {
                filingType = '项目公司备案';
            }
            $("#filingType").val(filingType);
            var projectCompanyName = $(data.elem).find("option:selected").attr("data-companyName");
            $("#projectCompanyName").val(projectCompanyName);
        })

        form.on('select(province)', function (data) {
            var province = $(data.elem).find("option:selected").attr("title");
            provinceOrder(province);
        });
        form.on('select(city)', function (data) {
            var city = $(data.elem).find("option:selected").attr("title");
            cityOrder(city);

        });

        form.on('select(area)', function (data) {
            var area = $(data.elem).find("option:selected").attr("title");
            console.log(area);
            areaOrder(area);
        });


        form.on('select(planType)', function (data) {

            var value = $(data.elem).find("option:selected").val();
            if (isBlank(value)) {
                return
            }
            var that_ = $(this);
            var va = $("#componentSpec").val();
            /*   var planName = $(this).parents(".planbiao").find(".planName").find("option:selected").val();
               if(isBlank(planName)){*/
            //获取当前类型下的方案名称
            $.ajax({
                url: "${ctx}/planManage/findPlanByAssembly",
                type: "POST",
                data: {
                    planType: value
                }
                , success: function (result) {
                    that_.parents(".planbiao").find(".planName").empty();
                    var length = result.length;
                    var plan_name_html = "<option value=''>请选择</option>";
                    for (var i = 0; i < length; i++) {
                        plan_name_html += "<option value='" + result[i].columns.id + "' title='" + result[i].columns.assembly_count + "' date='" + result[i].columns.code + "' data-attach='"+result[i].columns.attach+"' data-attach2='"+result[i].columns.attach2+"'>" + result[i].columns.name + "</option>";
                    }
                    that_.parents(".planbiao").find(".planName").append(plan_name_html);
                    form.render('select');
                }
            })

        })


        form.on('select(planName)', function (data) {

            //   var value = data.value;
            var value = $(data.elem).find("option:selected").text();
            if (isBlank(value)) {
                return
            }
            var that_ = $(this);

            //名称已选，获取块数
            var num = $(data.elem).find("option:selected").attr("title");
            var code = $(data.elem).find("option:selected").attr("date");
            var id = data.value;
            $(this).parents(".planbiao").find(".planId").val(id);
            $(this).parents(".planbiao").find(".componentNum").val(num);
            $(this).parents(".planbiao").find(".yuanshiNum").val(num);
            $(this).parents(".planbiao").find(".planCode").val(code);
            componentNum();
            var attach = $(data.elem).find("option:selected").data('attach');
            var attach2 = $(data.elem).find("option:selected").data('attach2');
            var viewAttachHtml = '';
            if (!isBlank(attach)) {
                viewAttachHtml += '<a class="h-32 lh-32 ml-5 layui-span-unit" target="_blank" href="${commonStaticImgPath}'+attach+'" style="color:#2890ac;">查看</a>';
            }
            if (!isBlank(attach2)) {
                viewAttachHtml += '<a class="h-32 lh-32 ml-5 layui-span-unit" target="_blank" href="${commonStaticImgPath}'+attach2+'" style="color:#2890ac;">查看</a>';
            }
            that_.closest('.layui-row').find('.view-attachment').empty().append(viewAttachHtml);
            //  }

        })



        //重新计算组件块数
        function componentNum() {
            var numco = 0;
            $(".componentNum").each(function () {
                if (!isBlank($(this).val())) {
                    numco = numco + parseInt($(this).val());
                }
            });
            $("#componentCount").val(parseInt(numco));
        }

        // 组件数量输入框值改变事件
        $(document).on('change', '.assembly input[name=optionVal]', function () {
            if (isBlank($(this).val())) {
                return;
            }
            statisticsCapacity();
        });

        // 组件下拉选切换事件
        form.on('select(assembly)', function (data) {
            if (isBlank(data.value)) {
                return;
            }
            statisticsCapacity();
        });

        // 统计设计容量
        function statisticsCapacity() {
            var capacity = 0;
            $('.assembly').find('.layui-row').each(function (index, that) {
                var value = $(that).find('select[name=assembly]').val();
                if (isBlank(value)) {

                    return;
                }
                var power = $(that).find('select[name=assembly] option:selected').text();
                // console.log(power);
                var num = $(that).find('input[name=optionVal]').val();
                if (isBlank(that)) {

                    return;
                }
                if (!number.test(num)) {
                    return;
                }
                capacity = capacity + parseInt(power) * parseInt(num);
            });
            $('input[name=designCapacity]').val(capacity);
        }

        function provinceOrder(province) {
            $("#city").empty();
            $("#area").empty();
            if (isBlank(province)) {
                $("#city").append("<option value=''>请选择</option>");
                return "";
            }
            $.ajax({
                type: "POST",
                url: "${ctx}/main/redirect/getCitysByProId",
                data: {
                    province: province
                },
                success: function (result) {

                    if (result == "205") {
                        layer.msg("暂无数据!")
                        return
                    }
                    var html = " <option value=''>请选择</option>";
                    for (var i = 0; i < result.length; i++) {
                        var city = result[i];
                        html = html + '<option value="' + city.columns.CityName + '" title="' + city.columns.CityID + '">' + city.columns.CityName + '</option>';
                    }
                    $("#city").append(html);
                    form.render('select');
                }
            });

        }

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

                    form.render('select');
                }
            });

        }


        //暂存
        var saveFlag = false;
        $(".saveOrder").click(function () {
            if (saveFlag) {
                return;
            }

            var projectId = $("#projectId").val();  //产品名称
            if (isBlank(projectId)) {
                layer.msg("请选择产品名称!", {icon: 2});
                return false;
            }
            var projectName=$("input[name=projectName]").val();
            // 预估组件
            let estimateCapacity = $("#estimateCapacity").val();
            // 使用正则表达式校验正整数
            var regex = /^[1-9]\d*$/;
            if(!isBlank(estimateCapacity) && !regex.test(estimateCapacity)) {
                layer.msg("预估组件请输入正整数!", {icon: 2});
                return ;
            }
            var tenantName = $("input[name=tenantName]").val();//业主姓名
            var mobile = $("input[name=mobile]").val();//联系方式
            var idCode = $("input[name=idCode]").val();//身份证号
            var age=$("input[name='age']").val(); //年龄
            var gender=$("input[name='gender']:checked").val(); //性别

            var province = $("#province").find("option:selected").val();//省
            var city = $("#city").find("option:selected").val();//市
            var area = $("#area").find("option:selected").val();//区
            var address = $("input[name=customerAddress]").val();//用户地址

            var bankName = $("#bankName").val(); //账户名称
            var bankCode = $("#bankCode").val(); //银行账号
            var idCardFront = $('.idCardFront').val();//身份证正面
            var idCardBack = $('.idCardBack').val();//身份证反面

            var residenceBooklet ;//户口本复印件

            $(".residenceBooklet").each(function () {
                if (isBlank(residenceBooklet)) {
                    residenceBooklet = $(this).val();
                } else {
                    residenceBooklet = residenceBooklet + "," + $(this).val();
                }
            });         var bankCard = $('.bankCard').val();//银行卡照片
            var bpName = $('#bpName').val();//共签人名称
            var bpIdCard = $('#bpIdCard').val();//共签人证件号码
            var bpMobile = $('#bpMobile').val();//共签人手机号
            var bpCardFront = $('.bpCardFront').val();//共签人身份证正面
            var bpCardBack = $('.bpCardBack').val();//共签人身份证反面
            var bpFile ;//共签人子女证明材料
            $(".bpFile").each(function () {
                if (isBlank(bpFile)) {
                    bpFile = $(this).val();
                } else {
                    bpFile = bpFile + "," + $(this).val();
                }
            });


            var roofType = $("#roofType").val(); //屋顶类型
            var distance = $("#distance").val(); // 并网距离
            var azimuth = $("#azimuth").val(); //方位角
            var angle = $('input[name=angle]').val();
            if (azimuth !== '1') {
                if (!isBlank(angle) && !number.test(angle)) {
                    layer.msg("角度格式不正确", {icon: 2});
                    return;
                }
                if (!isBlank(angle) && parseInt(angle) >= 90) {
                    layer.msg("方位角角度,限制输入0-90", {icon: 2});
                    return;
                }
            }
            var buildingHeight = $("input[name=buildingHeight]").val();//建筑高度
            if (!isBlank(buildingHeight) && !isNumber($.trim(buildingHeight))) {
                layer.msg("建筑高度格式不正确", {icon: 2});
                return;
            }
            var repaymentMethod = $("#repaymentMethod").val(); //还款方式
            var remarks = $("textarea[name=remarks]").val();//备注

            var shootType = $("input[name=shootType]:checked").val();// 拍摄方式
            // 房屋正面
            let roofPhotoOne = $('.pic5').val();
            // 东南角
            let roofPhotoTwo = $('.pic6').val();
            // 西南角
            let roofPhotoThree = $('.pic7').val();
            // 正南侧
            let roofPhotoFour = $('.pic8').val();
            // 生活气息照1
            let roofPhotoFacade = $('.pic9').val();
            // 生活气息照2
            let roofPhotoInterior = $('.pic10').val();
            // 补充1
            let roofPhotoFive = $('.pic11').val();
            // 补充2
            let roofPhotoSix = $('.pic12').val();
            // 房屋补充1
            let houseSupplementOne = $('.pic13').val();
            // 房屋补充2
            let houseSupplementTwo = $('.pic14').val();
            // 障碍物照片
            let roofPhotoSeven = $('.pic15').val();
            // 楼顶厚度/围墙
            let dimensionsPhotoThickness = $('.pic16').val();
            // 细节补充1
            let detailSupplementOne = $('.pic17').val();
            // 细节补充2
            let detailSupplementTwo = $('.pic18').val();

            var houseOwnership; //房产证
            $(".pic20").each(function () {
                if (isBlank(houseOwnership)) {
                    houseOwnership = $(this).val();
                } else {
                    houseOwnership = houseOwnership + "," + $(this).val();
                }
            });
            var surveyRecord = $('.pic21').val();//踏勘记录
            /* if (isBlank(surveyRecord)) {
                 layer.msg('踏勘记录表不能为空', {icon: 2});
                 return;
             }*/
            var surveyRecord2 = $('.pic22').val();//踏勘记录补充
            var filingDocumentPhoto = $('.pic23').val();//备案文件

            var roofValue = $('.roof-value').val();//屋顶视频
            if(shootType=='2' && isBlank(roofValue)){
                layer.msg('房屋视频不能为空', {icon: 2});
                return;
            }

            // 方案信息
            var schemeType = $("input[name=schemeType]:checked").val();//匹配方式
            var componentPlanArray = [];
            var schemeId = "";
            var schemeTypeId = '';
            if (schemeType === '2') {
                // 组合方案
                var componentPlanFlag = false;
                $('#zuhefangan').find('.layui-row').each(function (index, that) {

                    var planType = $(that).find('.planType').find("option:selected").text();
                    var planTypeId = $(that).find('select[name=planType]').val();
                    var planId = $(that).find(".planId").val();
                    var name = $(that).find(".planName").find("option:selected").text();
                    var code = $(that).find(".planCode").val();
                    var componentPlan = {
                        planTypeId: planTypeId,
                        planType: planType,
                        planId: planId,
                        name: name,
                        code: code
                    }
                    componentPlanArray.push(componentPlan);
                });
                if (componentPlanFlag) {
                    return;
                }
            } else {
                // 标准方案
                schemeId = $('#showSchemeId').find('.planId').val();
                schemeTypeId = $('#showSchemeId').find('select[name=planType]').val();
            }
            // 设计图纸
            /*  var designDrawings = $('input[name=attach]').val();*/

            var zjpbImg = $('.zjpbImg').val();//组件排布图
            var zjzxImg = $('.zjzxImg').val();//组件走线图
            var zjcsImg = $('.zjcsImg').val();//支架侧视图
            var zjhsImg = $('.zjhsImg').val();//支架后视图
            var nbqwzImg = $('.nbqwzImg').val();//逆变器位置
            var pdxwzImg = $('.pdxwzImg').val();//配电箱位置

            /*  var designDrawings='';
              $(".attachFileImg").each(function(){
                  var imgSrc=$(this).val();
                  designDrawings+=','+imgSrc;
              })
              var designDrawingsName = '';

              designDrawings=designDrawings.substring(1);*/
            var designDrawings = $('input[name=attach]').val();
            var designDrawingsName = $('input[name=attachName]').val();
            // 电器材料
            var electricArray = [];
            // 组件
            $('.assembly').find('.layui-row').each(function (index, that) {
                var itemId = $(that).find('select[name=assembly]').val();
                if(!isBlank(itemId)){
                    var itemType = '3';
                    var num = $(that).find('input[name=optionVal]').val();
                    var item = {
                        itemId: itemId,
                        itemType: itemType,
                        num: num
                    }
                    electricArray.push(item);
                }

            });
            // 逆变器
            $('.inverter').find('.layui-row').each(function (index, that) {
                var itemId = $(that).find('select[name=inverter]').val();

                if (!isBlank(itemId)) {
                    var itemType = '1';
                    var num = $(that).find('input[name=optionVal]').val();
                    var item = {
                        itemId: itemId,
                        itemType: itemType,
                        num: num
                    }
                    electricArray.push(item);
                }
            });

            // 并网箱
            $('.grid-connection').find('.layui-row').each(function (index, that) {
                var itemId = $(that).find('select[name=gridConnection]').val();
                if (!isBlank(itemId)) {
                    var itemType = '2';
                    var num = $(that).find('input[name=optionVal]').val();
                    var item = {
                        itemId: itemId,
                        itemType: itemType,
                        num: num
                    }
                    electricArray.push(item);
                }
            });
            // 支架
            $('.grid-support').find('.layui-row').each(function (index, that) {
                var itemId = $(that).find('select[name=gridSupport]').val();
                if (!isBlank(itemId)) {
                    var itemType = '4';
                    var num = $(that).find('input[name=optionVal]').val();
                    var item = {
                        itemId: itemId,
                        itemType: itemType,
                        num: num
                    }
                    electricArray.push(item);
                }
            });
            var schemeRemarks = $("#schemeRemarks").val();//方案备注

            var order = {
                id: '${entry.id}',
                projectId: projectId,
                projectName:projectName,
                estimateCapacity: estimateCapacity,
                /*insuranceFlag: insuranceFlag,
                leaseDate: leaseDate,*/
                tenantName: tenantName,
                mobile: mobile,
                idCode: idCode,
                province: province,
                city: city,
                area: area,
                address: address,
                age:age,
                gender:gender,
                bankName: bankName,
                bankCode: bankCode,
                tssBankNum: tssBankNum,
                idCardFront: idCardFront,
                idCardBack: idCardBack,
                residenceBooklet: residenceBooklet,
                bankCard: bankCard,
                roofType: roofType,
                distance: distance,
                azimuth: azimuth,
                angle: angle,
                buildingHeight: buildingHeight,
                repaymentMethod: repaymentMethod,
                roofValue: roofValue,
                remarks: remarks,
                shootType: shootType,
                houseOwnership: houseOwnership,
                filingDocumentPhoto: filingDocumentPhoto,
                roofPhotoFacade: roofPhotoFacade,
                roofPhotoInterior: roofPhotoInterior,
                dimensionsPhotoThickness: dimensionsPhotoThickness,
                surveyRecord: surveyRecord,
                surveyRecord2: surveyRecord2,
                roofPhotoOne: roofPhotoOne,
                roofPhotoTwo: roofPhotoTwo,
                roofPhotoThree: roofPhotoThree,
                roofPhotoFour: roofPhotoFour,
                roofPhotoFive: roofPhotoFive,
                roofPhotoSix: roofPhotoSix,
                roofPhotoSeven: roofPhotoSeven,
                houseSupplementOne: houseSupplementOne,
                houseSupplementTwo: houseSupplementTwo,
                detailSupplementOne: detailSupplementOne,
                detailSupplementTwo: detailSupplementTwo,
                schemeType: schemeType,
                schemeId: schemeId,
                schemeTypeId: schemeTypeId,
                composePlanLists: componentPlanArray,
                designDrawings: designDrawings,
                designDrawingsName: designDrawingsName,
                itemList: electricArray,
                schemeRemarks: schemeRemarks,
                zjpbImg: zjpbImg,
                zjzxImg: zjzxImg,
                zjcsImg: zjcsImg,
                zjhsImg: zjhsImg,
                nbqwzImg: nbqwzImg,
                pdxwzImg: pdxwzImg,
                bpName: bpName,
                bpIdCard: bpIdCard,
                bpMobile: bpMobile,
                bpCardFront: bpCardFront,
                bpCardBack: bpCardBack,
                bpFile: bpFile,
                type: '0',
                tssBankNumName:tssBankNumName
            };
            saveFlag = true;
            savetemFlag = true;
            console.log(JSON.stringify(order))
            $.ajax({
                url: "${ctx}/customerEntry/saveCustomerEntry",
                type: "POST",
                contentType: "application/json;charsetset=UTF-8",
                data: JSON.stringify(order)
                , success: function (result) {
                    if (result.code === '200') {
                        var index = parent.layer.getFrameIndex(window.name);
                        layer.msg("暂存成功", {icon: 1, time: 1000}, function () {
                            parent.layer.close(index);
                            parent.table.reload('test');
                        })
                    } else {
                        layer.msg(result.errMsg, {icon: 2});
                    }
                    saveFlag = false;
                    savetemFlag = false;

                }, error: function () {
                    layer.msg("暂存失败", {icon: 2});
                    saveFlag = false;
                    savetemFlag = false;
                }
            })
        })


        //取消
        $(".cancelorder").click(function () {
            parent.layer.closeAll();
            parent.searchOrder();

        })


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

        function IsCard(str) {
            var reg = /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/;
            return reg.test(str);
        }

        function isNumber(value) {
            var z_reg = /^(([0-9])|([1-9]([0-9]+)))(.[0-9]+)?$/;
            return z_reg.test(value);
        };

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

        var tssBankXm = xmSelect.render({
            el: '#tssBank',
            name: 'tssBank',
            radio: true,
            tips: '请输入查询',
            size: 'mini',
            style: {
                height: '30px',
            },
            paging: true,
            pageSize: 6,
            data: initBankData,
            clickClose: true,
            filterable: true,
            remoteSearch: true,
            remoteMethod: function (val, cb, show) {
                searchVal(val, cb, {
                    name: val
                }, 'name');
            },
            on: function (data) {
                if (data.isAdd && data.arr.length > 0) {
                    let d = data.arr[0];
                    tssBankNumName = d.name;
                    tssBankNum = d.value;
                } else {
                    tssBankNumName = "";
                    tssBankNum = "";
                }
            }
        });

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

    function deletePlan(that) {
        $(that).closest(".layui-row").remove();
        var numco = 0;
        $(".componentNum").each(function () {
            if (!isBlank($(this).val())) {
                numco = numco + parseInt($(this).val());
            }
        });
        $("#componentCount").val(parseInt(numco));
    }

    function savePlan(that) {
        // var componentSpec = $("#componentSpec").val();
        // if (isBlank(componentSpec)) {
        //     layer.msg("请输入组件规格", {icon: 2});
        //     return
        // }
        var planType = $(that).parents(".planbiao").find(".planType").val();
        var planName = $(that).parents(".planbiao").find(".planName").val();
        // var componentNum = $(that).parents(".planbiao").find(".componentNum").val();
        if (isBlank(planType)) {
            layer.msg("请选择方案类型", {icon: 2});
            return
        }
        if (isBlank(planName)) {
            layer.msg("请选择方案名称", {icon: 2});
            return
        }
        // if (isBlank(componentNum)) {
        //     layer.msg("请输入组件块数", {icon: 2});
        //     return
        // }
        $(that).hide();
        $(that).next().removeClass("layui-hide").show();

        var html = '';
        html += '<div class="layui-row addplan">';
        html += '<div class="planbiao">';
        html += '<div class="layui-col-lg3 layui-col-sm3">';
        html += ' <label class="layui-form-label"><i class="mark">*</i>方案类型：</label>';
        html += '<div class="layui-input-block">';
        html += '<select lay-filter="planType" name="planType" class="planType" lay-search>';
        html += '<option value="">请选择</option>';
        <c:forEach items="${insta}" var="ins">
        html += '<option value="${ins.columns.id}">${ins.columns.name}</option>';
        </c:forEach>

        html += '</select>';
        html += '</div> </div>';
        html += '<div class="layui-col-lg3 layui-col-sm3 " >';
        html += '<label class="layui-form-label"><i class="mark">*</i>方案名称：</label>';
        html += '<div class="layui-input-block pos-r">';
        html += '<select  lay-filter="planName" name="planName" class="planName" lay-search>';
        html += '<option value="">请选择</option>';
        html += '</select>';
        html += '</div> </div>';
        html += ' <div class="layui-col-lg1 layui-col-sm1 " >';
        html += '<label class="layui-form-label"><i class="mark">*</i>参考图纸：</label>';
        html += '<div class="layui-input-block pos-r view-attachment">';
        html += '<span class="h-32 lh-32 layui-span-unit" >查看</span>';
        html += '</div> </div>';
        html += '<div class="layui-col-lg2 layui-col-sm2" style="text-align: center" >';
        html += '<input type="hidden" class="planId">';
        html += '<input type="hidden" class="planCode">';
        html += '<button type="button" class="layui-btn savePlan" onclick="savePlan(this)">新增方案</button>';
        html += '<button type="button" class="layui-btn layui-btn-primary deletePlan layui-hide" onclick="deletePlan(this)">删除</button>';
        html += '</div> </div></div>';
        $(that).parents(".zuhefangan").append(html);
        form.render('select');
    }

    // 新增组件
    function add1(that) {
        $(that).addClass('layui-hide');
        $(that).next().removeClass('layui-hide');
        var html = '';
        html += '<div class="layui-row assemblyDiv">';
        html += '<div class="layui-col-lg5 layui-col-sm7">';
        html += '<label class="layui-form-label"><i class="mark">*</i>组件：</label>';
        html += '<div class="layui-input-block">';
        html += '<div class="layui-inline">';
        html += '<select lay-filter="assembly" name="assembly" class="assembly" lay-search>';
        html += assemblyOptionHtml;
        html += '</select>';
        html += '<span class="pos-a h-32 lh-32 layui-span-unit" style="right: 30px">W</span>';
        html += '</div>';
        html += '<span class="layui-inline">X </span>';
        html += '<div class="layui-inline">';
        html += '<input type="text" class="layui-input" style="width: 85px;" placeholder="数量" name="optionVal">';
        html += '</div>';
        html += '</div>';
        html += '</div>';
        html += '<div class="layui-col-lg3 layui-col-sm3">';
        html += '<i class="layui-icon layui-icon-add-circle" style="color: #1b6073;font-size: 25px;" onclick="add1(this)"></i>';
        html += '<i class="layui-icon layui-icon-delete " style="color: #1b6073;font-size: 25px;" onclick="delete1(this)"></i>';
        html += '</div>';
        html += '</div>';
        $(that).closest('.assembly').append(html);
        form.render('select');
    }

    // 新增逆变器
    function add2(that) {
        $(that).addClass('layui-hide');
        $(that).next().removeClass('layui-hide');
        var html = '';
        html += '<div class="layui-row inverterDiv">';
        html += '<div class="layui-col-lg5 layui-col-sm7">';
        html += '<label class="layui-form-label"><i class="mark">*</i>逆变器：</label>';
        html += '<div class="layui-input-block">';
        html += '<div class="layui-inline">';
        html += '<select lay-filter="inverter" name="inverter" class="inverter" lay-search>';
        html += inverterOptionHtml;
        html += '</select>';
        html += '</div>';
        html += '<span class="layui-inline">X </span>';
        html += '<div class="layui-inline">';
        html += '<input type="text" class="layui-input" style="width: 85px;" placeholder="数量" name="optionVal">';
        html += '</div>';
        html += '</div>';
        html += '</div>';
        html += '<div class="layui-col-lg3 layui-col-sm3">';
        html += '<i class="layui-icon layui-icon-add-circle" style="color: #1b6073;font-size: 25px;" onclick="add2(this)"></i>';
        html += '<i class="layui-icon layui-icon-delete " style="color: #1b6073;font-size: 25px;" onclick="delete2(this)"></i>';
        html += '</div>';
        html += '</div>';
        $(that).closest('.inverter').append(html);
        form.render('select');
    }

    // 新增并网箱
    function add3(that) {
        $(that).addClass('layui-hide');
        $(that).next().removeClass('layui-hide');
        var html = '';
        html += '<div class="layui-row connectionDiv">';
        html += '<div class="layui-col-lg5 layui-col-sm7">';
        html += '<label class="layui-form-label">并网箱：</label>';
        html += '<div class="layui-input-block">';
        html += '<div class="layui-inline">';
        html += '<select lay-filter="grid-connection" name="gridConnection" class="grid-connection" lay-search>';
        html += gridConnectionOptionHtml;
        html += '</select>';
        html += '</div>';
        html += '<span class="layui-inline">X </span>';
        html += '<div class="layui-inline">';
        html += '<input type="text" class="layui-input" style="width: 85px;" placeholder="数量" name="optionVal">';
        html += '</div>';
        html += '</div>';
        html += '</div>';
        html += '<div class="layui-col-lg3 layui-col-sm3">';
        html += '<i class="layui-icon layui-icon-add-circle" style="color: #1b6073;font-size: 25px;" onclick="add3(this)"></i>';
        html += '<i class="layui-icon layui-icon-delete " style="color: #1b6073;font-size: 25px;" onclick="delete3(this)"></i>';
        html += '</div>';
        html += '</div>';
        $(that).closest('.grid-connection').append(html);
        form.render('select');
    }

    function add4(that) {
        $(that).addClass('layui-hide');
        $(that).next().removeClass('layui-hide');
        var html = '';
        html += '<div class="layui-row supportDiv">';
        html += '<div class="layui-col-lg5 layui-col-sm7">';
        html += '<label class="layui-form-label">支架：</label>';
        html += '<div class="layui-input-block">';
        html += '<div class="layui-inline">';
        html += '<select lay-filter="grid-support" name="gridSupport" class="gridSupport" lay-search>';
        html += supportOptionHtml;
        html += '</select>';
        html += '</div>';
        html += '<span class="layui-inline">X </span>';
        html += '<div class="layui-inline">';
        html += '<input type="text" class="layui-input" style="width: 85px;" placeholder="数量" name="optionVal">';
        html += '</div>';
        html += '</div>';
        html += '</div>';
        html += '<div class="layui-col-lg3 layui-col-sm3">';
        html += '<i class="layui-icon layui-icon-add-circle" style="color: #1b6073;font-size: 25px;" onclick="add4(this)"></i>';
        html += '<i class="layui-icon layui-icon-delete " style="color: #1b6073;font-size: 25px;" onclick="delete4(this)"></i>';
        html += '</div>';
        html += '</div>';
        $(that).closest('.grid-support').append(html);
        form.render('select');
    }


    // 删除组件、逆变器、并网箱
    function delete1(that) {
        if (!$(that).parents(".assemblyDiv").next().hasClass("assemblyDiv")) {
            $(that).parents(".assemblyDiv").prev().find(".layui-icon-add-circle").removeClass("layui-hide");
        }
        $(that).closest(".layui-row").remove();
        if ($('.assembly').find('.layui-row').length < 2) {
            $('.assembly').find(".layui-icon-add-circle").removeClass("layui-hide");
            $('.assembly').find(".layui-icon-delete").addClass("layui-hide");
        }

    }

    function delete2(that) {
        if (!$(that).parents(".inverterDiv").next().hasClass("inverterDiv")) {
            $(that).parents(".inverterDiv").prev().find(".layui-icon-add-circle").removeClass("layui-hide");
        }
        $(that).closest(".layui-row").remove();
        if ($('.inverter').find('.layui-row').length < 2) {
            $('.inverter').find(".layui-icon-add-circle").removeClass("layui-hide");
            $('.inverter').find(".layui-icon-delete").addClass("layui-hide");
        }

    }

    function delete3(that) {
        if (!$(that).parents(".connectionDiv").next().hasClass("connectionDiv")) {
            $(that).parents(".connectionDiv").prev().find(".layui-icon-add-circle").removeClass("layui-hide");
        }
        $(that).closest(".layui-row").remove();
        if ($('.grid-connection').find('.layui-row').length < 2) {
            $('.grid-connection').find(".layui-icon-add-circle").removeClass("layui-hide");
            $('.grid-connection').find(".layui-icon-delete").addClass("layui-hide");
        }

    }

    function delete4(that) {
        if (!$(that).parents(".supportDiv").next().hasClass("supportDiv")) {
            $(that).parents(".supportDiv").prev().find(".layui-icon-add-circle").removeClass("layui-hide");
        }
        $(that).closest(".layui-row").remove();
        if ($('.grid-support').find('.layui-row').length < 2) {
            $('.grid-support').find(".layui-icon-add-circle").removeClass("layui-hide");
            $('.grid-support').find(".layui-icon-delete").addClass("layui-hide");
        }

    }

    // 初始化电器材料下拉选
    function initElectricSelect() {
        $.get('${ctx}/planManage/findAllElectric', function(result){
            if (result.code === '200') {
                var electricArray = result.data;
                assemblyOptionHtml += '<option value="">请选择</option>';
                inverterOptionHtml += '<option value="">请选择</option>';
                gridConnectionOptionHtml += '<option value="">请选择</option>';
                supportOptionHtml += '<option value="">请选择</option>';
                for (var i = 0; i < electricArray.length; i++) {
                    var electric = electricArray[i];
                    var type = electric.columns.type;
                    var id = electric.columns.id;
                    var model = electric.columns.model;
                    if (type === '1') {
                        inverterOptionHtml += '<option value="'+id+'">'+model+'</option>';
                    } else if (type === '2') {
                        gridConnectionOptionHtml += '<option value="'+id+'">'+model+'</option>';
                    }else if (type === '4') {
                        supportOptionHtml += '<option value="'+id+'">'+model+'</option>';
                    } else {
                        assemblyOptionHtml += '<option value="'+id+'" data-power="'+model+'">'+model+'</option>';
                    }
                }
                // $('select[name=assembly]').empty().append(assemblyOptionHtml);
                // $('select[name=inverter]').empty().append(inverterOptionHtml);
                // $('select[name=gridConnection]').empty().append(gridConnectionOptionHtml);
                // form.render('select');
            }
        });

    }

    // 初始化方案类型下拉选
    function initSchemeTypeSelectData(selectedId, optionData) {
        var html = '<option>请选择</option>';
        for (var j = 0; j < optionData.length; j ++) {
            var data = optionData[j];
            var selectedFlag = data.name === selectedId ? 'selected' : '';
            html += '<option value="'+data.id+'" '+selectedFlag+'>'+data.name+'</option>';
        }
        return html;
    }

    // 初始化方案数据，下拉选回显
    function initSchemeData() {
        var schemeType = '${entry.schemeType}';
        // var planTypeData = [];
        // var projectId = $('select[name=projectId]').val();
        // if (isBlank(projectId)) {
        //     return;
        // }
        // console.log(projectId);
        // var planTypeId = $('select[name=projectId]').find('option:selected').data('key');
        // var planTypeName = $('select[name=projectId]').find('option:selected').data('type');
        // console.log(planTypeId);
        // console.log(planTypeName);
        // var planTypeIdArray = planTypeId.split(',');
        // var planTypeNameArray = planTypeName.split(',');
        // for (let i = 0; i < planTypeIdArray.length; i++) {
        //     var data = {
        //         id: planTypeIdArray[i],
        //         name: planTypeNameArray[i]
        //     }
        //     planTypeData.push(data);
        // }
        var $rowNode;
        if (schemeType === '1') {
            // 标准方案
            $rowNode = $('#showSchemeId').find('.layui-row');
            // $('#zuhefangan').find('.layui-row').each(function (index, that) {
            //     var html = initSchemeTypeSelectData('', planTypeData);
            //     $(that).find('select[name=planType]').empty().append(html);
            // });
        } else {
            // 组合方案
            $rowNode = $('#zuhefangan').find('.layui-row');
            // $('#showSchemeId').find('.layui-row').each(function (index, that) {
            //     var html = initSchemeTypeSelectData('', planTypeData);
            //     $(that).find('select[name=planType]').empty().append(html);
            // });
        }
        $($rowNode).each(function (index, that) {
            var selectedPlanTypeName = $(that).data('scheme-type-name');
            if ('1' == '${entry.schemeType}') {
                selectedPlanTypeName = $(that).find(".planType").find("option:selected").text();
            }
            var selectedPlanId = $(that).data('plan-id');
            // var html = initSchemeTypeSelectData(selectedPlanTypeName, planTypeData);
            // $(that).find('select[name=planType]').empty().append(html);
            if (!isBlank(selectedPlanTypeName)) {
                $.ajax({
                    url: "${ctx}/planManage/findPlanByAssembly",
                    type: "POST",
                    data: {
                        planType: selectedPlanTypeName
                    }
                    , success: function (result) {
                        $(that).find(".planName").empty();
                        var plan_name_html = "<option value=''>请选择</option>";
                        var viewAttachHtml = '';
                        for (var k = 0; k < result.length; k++) {

                            var selectedFlag = result[k].columns.id === selectedPlanId ? 'selected' : '';
                            if (result[k].columns.id === selectedPlanId) {
                                if (!isBlank(result[k].columns.attach)) {
                                    viewAttachHtml += '<a class="h-32 lh-32 ml-5 layui-span-unit" target="_blank" href="${commonStaticImgPath}'+result[k].columns.attach+'" style="color:#2890ac;">查看</a>';
                                }
                                if (!isBlank(result[k].columns.attach2)) {
                                    viewAttachHtml += '<a class="h-32 lh-32 ml-5 layui-span-unit" target="_blank" href="${commonStaticImgPath}'+result[k].columns.attach2+'" style="color:#2890ac;">查看</a>';
                                }
                            }
                            plan_name_html += "<option value='" + result[k].columns.id + "' title='" + result[k].columns.assembly_count + "' date='" + result[k].columns.code + "' "+selectedFlag+">" + result[k].columns.name + "</option>";
                        }
                        $(that).find('.planId').val(selectedPlanId)
                        $(that).find(".planName").append(plan_name_html);
                        $(that).closest('.layui-row').find('.view-attachment').empty().append(viewAttachHtml);
                        form.render('select');
                        var code = $(that).find(".planName").find("option:selected").attr("date");
                        $(that).find(".planCode").val(code);
                    }
                })
            }
        });
        form.render('select');
    }

    function componentCountq() {
        var numco = 0;
        $(".componentNum").each(function () {
            if (!isBlank($(this).val())) {
                numco = numco + parseInt($(this).val());
            }
            //  numco = numco+parseInt($(this).val());
        });
        $("#componentCount").val(parseInt(numco));
    }

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

    function delImg(that, id) {
        $("#" + id).show();
        $(that).parent().remove();
        if('uploader20'==id){
            quaimgsCount--;
            $("#uploader20").show();
        }
    }
    // 关闭弹框
    function cancel() {
        var index = parent.layer.getFrameIndex(window.name);//先得到当前iframe层的索引
        parent.layer.close(index); //再执行关闭
    }

    function checkAngle() {
        var angle = $('#angle').val();
        if (isBlank(angle)) {
            return;
        }
        if (parseInt(angle) > 90) {
            layer.msg("方位角不能超过90度");
            $('#angle').val('');

            return;
        }
    }

    function change(){
        var age=$("#age").val();
        if(age>=65){
            $("#bcxx").removeClass("hide");
        }else{
            $("#bcxx").addClass("hide");
        }
    }
</script>
</body>
</html>
