<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>验收报告</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <%--    <meta name="decorator" content="base" />--%>
    <%--    <link rel="stylesheet" type="text/css" href="${ctxPlugin}/static/css/reset.css" />--%>
    <link rel="stylesheet" href="${ctxPlugin}/lib/layuiAdmin/dist/layuiadmin/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="${ctxPlugin}/lib/layuiAdmin/dist/layuiadmin/dist/viewer.css" media="all">
    <style>
        *{
            padding: 0;
            margin: 0;
        }
        table{
            text-align: left;
        }
        .tableHeader{
            height: 38px;
            /*line-height: 38px;*/
            background-color: #d2b790 !important; color: #FFF;
        }
        .title{
            font-weight: bold;
            font-size: 14px;
            line-height: 30px;
            text-align: left;
        }
        td{
            padding: 0 5px;
        }
        .add{
            width: 60px;
            height: 60px;
            bordeR:1px solid #dddddd;
            position: relative;
            /*float: left;*/
            margin: 5px auto;
        }
        .add span{
            position: absolute;
            left: 0;top: 0;
            z-index: 0;
            width: 100%;
            height: 100%;
            font-size: 20px;
            text-align: center;
            line-height: 60px;
            font-weight: normal;
        }
        .add input{
            width: 100%;
            height: 100%;
            opacity: 0;
            position: absolute;
            z-index:10;
            left: 0;
            top: 0;
        }
        .bj-img > span {
            position: absolute;
            right: 0;
            top: 0;
            background-color: #f00;
            width: 20px;
            height: 20px;
            line-height: 20px;
            text-align: center;
            color: #fff;
            cursor: pointer;
            display: none;
        }
        .bj-img:hover span {
            display: block;
        }
        .img{
            overflow: hidden;
            padding: 5px 0;
            display: flex;
            justify-content: center;
        }
        .img>ul{
            float: left;
            list-style: none;
        }
        .img li{
            width: 60px;
            height: 60px;
            bordeR:1px solid #dddddd;
            position: relative;
            float: left;
            margin-right: 10px;
        }
        .img li img{
            object-fit: scale-down;
            width: 100%;
            height: 100%;
        }
        .img+span{
            line-height: 30px;
            font-size: 12px;
            color: red;
        }
        .pd-20{
            padding: 20px;
        }
        .form-title{
            line-height: 40px;
            font-weight: bold;
        }
        .form-input{
            width: 100%;
            padding: 5px 0;
            border: none;
            outline: none;
        }
        .red{
            color: red;
        }
        .unit{
            position: absolute;
            right: 30px;
            top: 8px;
            font-weight: bold;
        }
        .pos-r{
            position: relative;
        }

        .no-resize{
            resize: none;
        }
        .flex{
            display: flex;
        }
        .text-r{
            text-align: right;
        }
        .m-10{
            margin: 10px;
        }
        .operate-footer {
            width: 100%;
            position: fixed;
            bottom: 0;
            z-index: 30000;
            background: #F8F8F8;
            padding: 10px 0;
            text-align: center;
        }
        .footer-btn {
            height: 27px;
            line-height: 27px;
            padding: 0 18px;
            border-radius: 2px;
            font-size: 14px;
            cursor: pointer;
            border: 1px solid #C9C9C9;
            background-color: #fff;
            outline: none;
        }
        .pb-50{
            padding-bottom: 50px;
        }
        .pd-10{
            padding: 10px;
        }
        .normal-btn{
            border: 1px solid #D9B589;
            background-color: #D9B589 !important;
            color: #fff;
        }
        .layui-layer-btn0{
            border-color:#D9B589 !important;
            background-color: #D9B589 !important;
        }
        .idea-text{
            width: 320px; height: 100px;outline: none; padding: 3px
        }
        .hide{
            display: none;
        }
        .f-l{
            float: left;
        }
        .title1 {
            /*border-left: 4px solid #D9B589;*/
            padding-left: 10px;
            font-size: 14px;
            margin: 10px auto 0 auto;
            font-weight: 600;
            height: 42px;
            line-height: 42px;
            background-color: #848484;
            color: #FFF;
        }
        .mark {
            color: #ff0000;
            line-height: 15px;
            width: 8px;
            display: inline-block;
            text-align: left;
        }
        .report-table{background: #fff}
        .report-table td{border: 1px solid #dddddd; padding: 5px 10px}
        .report-table tr:nth-child(even) {
            background-color: #f7f7f7;
        }
        .report-table tr:nth-child(odd) {
            background-color: #ffffff;
        }
        .blank-img {
            background: url('${ctxPlugin}/static/imgs/blankImg.png') center center no-repeat;
            width: 62px;
            height: 62px;
            display: inline-block;
        }
    </style>
</head>
<body>

<div class="layui-fluid pd-20"  id="LAY_app" style="padding-bottom: 70px;">
    <c:if test="${opt eq 'merge' || opt eq 'view' || opt eq 'TwoMergeAccept' || opt eq 'view2' }">
        <h1 class="title1">发电户号</h1>
        <table border cellpadding="0" cellspacing="0" width="100%" class="report-table">
            <tr>
                <td width="10%"><i class="mark">*</i>发电户号</td>
                <td ><input type="text" class="form-input" id="generatorNo" ${opt eq 'merge'? '': 'readonly'}
                                       name="generatorNo" value="${entry.generatorNo}"/></td>
                <td width="10%"><i class="mark">*</i>电力公司</td>
                <td >
                    <div class="layui-form">
                        <div class="layui-input-block" style="margin-left: 0">
                    <select name="provinceCode" id="provinceCode" lay-search ${opt eq 'merge'? '': 'disabled'}>
                        <option value="">请选择省</option>
                        <c:choose>
                            <c:when test="${empty entry.provinceCode}">
                                <c:forEach items="${procodes}" var="code">
                                    <option value="${code.columns.code}"
                                            <c:if test="${entry.province eq code.columns.name}">selected</c:if>
                                    >${code.columns.power_company}</option>
                                </c:forEach>
                            </c:when>
                            <c:otherwise>
                                <c:forEach items="${procodes}" var="code">
                                    <option value="${code.columns.code}"
                                            <c:if test="${entry.provinceCode eq code.columns.code}">selected</c:if>
                                    >${code.columns.power_company}</option>
                                </c:forEach>
                            </c:otherwise>
                        </c:choose>

                    </select>
                        </div>
                    </div>
                </td>
            </tr>
        </table>
        <h1 class="title1">用户电站验收报告</h1>

        <c:if test="${opt eq 'view'}">
            <c:choose>
                <c:when test="${not empty entry.checkAcceptImgs}">
                    <sfTags:pagePermission authFlag="XMGL_YWCXM_YWCXM_XZYSBG_B" html='<a class="layui-table-opt-link" href="${commonStaticImgPath}${entry.checkAcceptImgs}" target ="_blank" style="color: #d9b589;float: right;cursor:pointer;" >下载报告</a> '/>
                </c:when>
                <c:otherwise>
                    <sfTags:pagePermission authFlag="XMGL_YWCXM_YWCXM_XZYSBG_B" html=' <a class="layui-table-opt-link downloadPro" style="color: #d9b589;float: right;cursor:pointer;" >下载报告</a> '/>
                </c:otherwise>
            </c:choose>
        </c:if>
    </c:if>

    <table border cellpadding="0" cellspacing="0" width="100%" class="report-table">

        <%--<tr class="form-title">
            <td colspan="8" style="text-align: center">户用电站验收报告
                <c:if test="${opt eq 'view'}">
                    <c:choose>
                        <c:when test="${not empty entry.checkAcceptImgs}">
                            <a class="layui-table-opt-link" href="${commonStaticImgPath}${entry.checkAcceptImgs}" target ="_blank" style="color: #0e8ee7;float: right;cursor:pointer;" >下载报告</a>
                        </c:when>
                        <c:otherwise>
                            <a class="layui-table-opt-link downloadPro" style="color: #0e8ee7;float: right;cursor:pointer;" >下载报告</a>
                        </c:otherwise>
                    </c:choose>
                </c:if>
            </td>
        </tr>--%>
        <tr class="tableHeader">
            <td colspan="8">一、电站基本信息</td>
        </tr>

        <tr>
            <td width="25%" colspan="2">产品名称</td>
            <td width="25%" colspan="2"><input type="text" class="form-input" disabled value="${project.name}"/></td>
            <td width="25%" colspan="2">产品编号</td>
            <td width="25%" colspan="2"><input type="text" class="form-input" value="${project.code}" disabled/></td>

        </tr>
        <%--  电站信息新增【项目名称】字段，字段命名规则为【省+县+业主姓名+实际安装容量+光伏电站】，需要在项目管理下全菜单的电站列表上展示。--%>
        <tr>
            <td width="25%" colspan="2">项目名称</td>
            <td width="25%" colspan="2"><input type="text" class="form-input" disabled
                                               value="${entry.province}${entry.area}${entry.street}${entry.tenantName}${entry.actualCapacity==0.00?(entry.designCapacity/1000):(entry.actualCapacity/1000)}KW光伏电站"/>
            </td>
            <td width="25%" colspan="2">电站编号</td>
            <td width="25%" colspan="2"><input type="text" class="form-input" value="${entry.powerStationCode}"
                                               disabled/></td>

        </tr>
        <tr>
            <td colspan="2">代理商名称</td>
            <td colspan="2"><input type="text" class="form-input" disabled value="${trader.name}"/></td>
            <td colspan="2">代理商电话</td>
            <td colspan="2"><input type="text" class="form-input" disabled value="${trader.telephone}"/></td>
        </tr>
        <tr>
            <td colspan="2">业主姓名</td>
            <td colspan="2"><input type="text" class="form-input" disabled value="${entry.tenantName}"/></td>
            <td colspan="2">身份证号码</td>
            <td colspan="2"><input type="text" class="form-input" disabled value="${entry.idCode}"/></td>
        </tr>

        <tr>
            <td width="25%" colspan="2">开户银行</td>
            <td width="25%" colspan="2"><input type="text" class="form-input" disabled value="${entry.bankName}"/></td>
            <td width="25%" colspan="2">银行账号</td>
            <td width="25%" colspan="2"><input type="text" class="form-input" disabled value="${entry.bankCode}"/></td>
        </tr>
        <tr>
            <td width="25%" colspan="2">业主联系电话</td>
            <td width="25%" colspan="2"><input type="text" class="form-input" disabled value="${entry.mobile}"/>
            </td>
            <td width="25%" colspan="2">安装方案</td>
            <td width="25%" colspan="2"><input type="text" class="form-input" disabled value="${entry.schemeName}"/>
            </td>
        </tr>
        <tr>
            <td width="25%" colspan="2"><i class="mark addressDiv">*</i>安装地址</td>
            <td width="75%" colspan="6">
                <input type="text" class="form-input" disabled id="addressInput"
                       <c:if test="${entry.addressConsistent eq 'N' && opt eq 'merge'}">style="display: none"</c:if>
                                               value="${entry.province}${entry.city}${entry.area}${entry.address}"/>
            <c:if test="${opt eq 'merge'}">
                <div class="layui-form addressDiv" <c:if test="${entry.addressConsistent ne 'N'}">style="display: none"</c:if> >
                    <div class="layui-input-block" style="margin-left: 0">
                        <div class="layui-col-sm2 pr-10" style="width: 22%">
                            <select name="province" id="province" 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-sm2 pr-10" style="width: 22%">
                            <select name="city" id="city" lay-filter="city" lay-search>
                                <option value="">请选择市</option>
                                <c:forEach items="${faccitys}" var="city">
                                    <option value="${city.columns.CityName}"
                                            <c:if test="${entry.city eq city.columns.CityName}">selected</c:if>
                                            title="${city.columns.CityID}">${city.columns.CityName}</option>
                                </c:forEach>
                            </select>
                        </div>
                        <div class="layui-col-sm2 pr-10" style="width: 22%">
                            <select name="area" id="area" lay-search>
                                <option value="">请选择县/区</option>
                                <c:forEach items="${areas}" var="area">
                                    <option value="${area.columns.DistrictName}"
                                            <c:if test="${entry.area eq area.columns.DistrictName}">selected</c:if>
                                            title="${area.columns.DistrictID}">${area.columns.DistrictName}</option>
                                </c:forEach>
                            </select>
                        </div>

                        <div class="layui-col-sm4">
                            <input type="text" name="address" id="address" placeholder=""
                                   autocomplete="off" class="layui-input layui-col-lg2 "
                                   value="${entry.address}">
                        </div>
                    </div>
                </div>

            </c:if>
            </td>
        </tr>
        <c:if test="${opt eq 'merge'}">
            <tr>
                <td colspan="2"><i class="mark">*</i>购售电地址是否一致</td>
                <td colspan="2">
                    <div class="layui-form">
                        <div class="layui-input-block" style="margin-left: 0">
                            <select name="addressConsistent" id="addressConsistent" lay-filter="addressConsistent">
                                <option value="">请选择</option>
                                <option value="Y" <c:if test="${entry.addressConsistent eq 'Y'}">selected</c:if> >是</option>
                                <option value="N" <c:if test="${entry.addressConsistent eq 'N'}">selected</c:if> >否</option>
                            </select>
                        </div>
                    </div>
                </td>
                <td colspan="2">
                <td colspan="2">
            </tr>
        </c:if>

        <tr class="tableHeader">
            <td colspan="8">二、电站设备信息</td>
        </tr>
        <tr>
            <td width="25%" colspan="2">组件品牌</td>
            <td width="25%" colspan="2"><input type="text" class="form-input" value="${map.zujBrand}" disabled/></td>
            <td width="25%" colspan="2">组件规格</td>
            <td width="25%" colspan="2" class="pos-r"><input type="text" class="form-input" disabled value="${report.componentSpec}"/><span class="unit">W</span></td>
        </tr>
        <tr>
            <td width="25%" colspan="2">安装组件数量</td>
            <td width="25%" colspan="2" class="pos-r"><input type="text" value="${report.componentNum}" disabled
                                                             id="componentNum" class="form-input changeInput"/><span
                    class="unit">块</span></td>
            <td width="25%" colspan="2">安装组件容量</td>
            <td width="25%" colspan="2" class="pos-r"><input type="text" id="capacity" value="${report.capacity}"
                                                             class="form-input" disabled/><span
                    class="unit">W</span></td>
        </tr>
        <tr>
            <td colspan="2">逆变器1品牌</td>
            <td colspan="2"><input type="text" class="form-input" disabled value="${map.nbqBrandOne}"/></td>
            <td colspan="2">逆变器1-SN码</td>
            <td colspan="2"><input type="text" class="form-input" disabled
                                   value="${empty map.nbqSnOne?'无':map.nbqSnOne}"/></td>
        </tr>

        <tr>
            <td width="25%" colspan="2">逆变器1规格</td>
            <td width="25%" colspan="2" class="pos-r"><input type="text" class="form-input" disabled value="${map.nbqSpecOne}"/><%--<span
                        class="unit">${map.nbqUnitOne}</span>--%>
            </td>
            <td width="25%" colspan="2">通讯棒1-SN码</td>
            <td width="25%" colspan="2"><input type="text" class="form-input" disabled
                                               value="${empty map.snOne?'无':map.snOne}"/></td>
        </tr>
        <tr>
            <td width="25%" colspan="2">逆变器2品牌</td>
            <td width="25%" colspan="2"><input type="text" class="form-input" disabled
                                               value="${empty map.nbqBrandTwo?'无':map.nbqBrandTwo}"/></td>
            <td width="25%" colspan="2">逆变器2-SN码</td>
            <td width="25%" colspan="2"><input type="text" class="form-input" disabled
                                               value="${empty map.nbqSnTwo ?'无':map.nbqSnTwo}"/></td>
        </tr>
        <tr>
            <td width="25%" colspan="2">逆变器2规格</td>
            <td width="25%" colspan="2" class="pos-r"><input type="text" class="form-input" disabled
                                                             value="${empty map.nbqSpecTwo? '无':map.nbqSpecTwo}"/><%--<span
                        class="unit">${map.nbqUnitTwo}</span>--%>
            </td>
            <td width="25%" colspan="2">通讯棒2-SN码</td>
            <td width="25%" colspan="2" class="pos-r"><input type="text" value="${empty map.snTwo?'无':map.snTwo}"
                                                             disabled class="form-input "/></td>
        </tr>
        <tr>
            <td width="25%" colspan="2">并网箱品牌</td>
            <td width="25%" colspan="2" class="pos-r"><input type="text"
                                                             value="${empty map.bwxBrand?'无':map.bwxBrand}" disabled
                                                             class="form-input "/></td>
            <td width="25%" colspan="2">并网箱规格</td>
            <td width="25%" colspan="2" class="pos-r"><input type="text"
                                                             value="${empty map.bwxSpec?'无':map.bwxSpec}"
                                                             class="form-input" disabled/></td>
        </tr>
        <tr>
            <td width="25%" colspan="2">并网箱数量</td>
            <td width="25%" colspan="2" class="pos-r"><input type="text"
                                                             value="${empty map.bwxCOunt?0:map.bwxCOunt} "
                                                             disabled class="form-input "/><span
                    class="unit">${map.bwxUnit}</span></td>
            <td width="25%" colspan="2">支架品牌</td>
            <td width="25%" colspan="2" class="pos-r"><input type="text"
                                                             value="${empty map.zjBrand?'无':map.zjBrand}"
                                                             class="form-input" disabled/></td>
        </tr>
        <c:forEach items="${map.zhijialist}" var="zj" varStatus="sta">
            <tr>
                <c:if test="${sta.first}">
                    <td width="25%" colspan="2" rowspan="${map.zjCount}">支架规格</td>
                </c:if>
                <td width="25%" colspan="2" class="pos-r"><input type="text"
                                                                 value="${empty zj.columns.spec?'无':zj.columns.spec}"
                                                                 disabled class="form-input "/></td>
                <td width="25%" colspan="2">数量</td>
                <td width="25%" colspan="2" class="pos-r"><input type="text"
                                                                 value="${empty zj.columns.amount?0:zj.columns.amount} "
                                                                 class="form-input" disabled/><span
                        class="unit">${zj.columns.unit_name}</span></td>
            </tr>
        </c:forEach>

        <tr class="tableHeader">
            <td colspan="8">三、电站安装完成验收条款项</td>
        </tr>
        <tr>
            <td rowspan="4" colspan="2">1.设备信息照片</td>
            <td colspan="2">①序列号</td>
            <td colspan="2">②序列号</td>
            <td colspan="2">③组件铭牌照片</td>
        </tr>
        <tr>
            <td colspan="2">
                <ul class="img">
                    <li class="imgsLi bj-img ">
                        <img src="${commonStaticImgPaths}${report.nbqPlateImg}" alt="">
                    </li>
                </ul>
            </td>
            <td colspan="2">
                <ul class="img">
                    <li class="imgsLi bj-img ">
                        <img src="${commonStaticImgPaths}${report.txPlateImg}" alt="">
                    </li>
                </ul>
            </td>
            <td colspan="2">
                <ul class="img">
                    <li class="imgsLi bj-img ">
                        <img src="${commonStaticImgPaths}${report.zjPlateImg}" alt="">
                    </li>
                </ul>
            </td>
        </tr>
        <tr>
            <td colspan="6">④组件SN</td>
          <%--  <td colspan="2">⑤通讯棒2铭牌照片</td>
            <td colspan="2"></td>--%>
        </tr>
        <tr>
            <td colspan="6">
                <ul class="img">
                    <c:if test="${not empty report.zjSnImgs}">
                        <c:forEach items="${report.zjSnImgs}" var="zjSnImg">
                            <li class="imgsLi bj-img ">
                                <img src="${commonStaticImgPaths}${zjSnImg}" alt="">
                            </li>
                        </c:forEach>
                    </c:if>
                    <c:if test="${empty report.zjSnImgs}">
                        <i class="blank-img"></i>
                    </c:if>
                </ul>
            </td>

        </tr>
        <tr>
            <td rowspan="12" colspan="2">2.支架及组件安装照片</td>
            <td colspan="2">①膨胀螺栓</td>
            <td colspan="2">②基座安装固定</td>
            <td colspan="2">③底座防水</td>
        </tr>
        <tr>
            <td colspan="2">
                <ul class="img">
                    <li class="imgsLi bj-img ">
                        <img src="${commonStaticImgPaths}${report.zjImg1}" alt="">
                    </li>
                </ul>
            </td>
            <td colspan="2">
                <ul class="img">
                    <li class="imgsLi bj-img ">
                        <img src="${commonStaticImgPaths}${report.zjImg2}" alt="">
                    </li>
                </ul>
            </td>
            <td colspan="2">
                <ul class="img">
                    <li class="imgsLi bj-img ">
                        <img src="${commonStaticImgPaths}${report.zjImg3}" alt="">
                    </li>
                </ul>
            </td>
        </tr>
        <tr>
            <td colspan="2">④支架基础距离房檐的距离</td>
            <td colspan="2">⑤支架东向西拍摄</td>
            <td colspan="2">⑥支架西向东拍摄</td>
        </tr>
        <tr>
            <td colspan="2">
                <ul class="img">
                    <li class="imgsLi bj-img ">
                        <c:if test="${not empty report.zjImg4}">
                            <img src="${commonStaticImgPaths}${report.zjImg4}" alt="">
                        </c:if>
                        <c:if test="${empty report.zjImg4}">
                            <i class="blank-img"></i>
                        </c:if>
                    </li>
                </ul>
            </td>
            <td colspan="2">
                <ul class="img">
                    <li class="imgsLi bj-img ">
                        <c:if test="${not empty report.zjImg5}">
                            <img src="${commonStaticImgPaths}${report.zjImg5}" alt="">
                        </c:if>
                        <c:if test="${empty report.zjImg5}">
                            <i class="blank-img"></i>
                        </c:if>
                    </li>
                </ul>
            </td>
            <td colspan="2">
                <ul class="img">
                    <c:if test="${not empty report.zjImg6}">
                        <li class="imgsLi bj-img ">
                            <img src="${commonStaticImgPaths}${report.zjImg6}" alt="">
                        </li>
                    </c:if>
                    <c:if test="${empty report.zjImg6}">
                        <i class="blank-img"></i>
                    </c:if>
                </ul>
            </td>
        </tr>
        <tr>
            <td colspan="2">⑦支架南向北拍摄</td>
            <td colspan="2">⑧支架北向南拍摄</td>
            <td colspan="2">⑨支架角度</td>
        </tr>
        <tr>
            <td colspan="2">
                <ul class="img">
                    <li class="imgsLi bj-img ">
                        <c:if test="${not empty report.zjImg7}">
                            <img src="${commonStaticImgPaths}${report.zjImg7}" alt="">
                        </c:if>
                        <c:if test="${empty report.zjImg7}">
                            <i class="blank-img"></i>
                        </c:if>
                    </li>
                </ul>
            </td>
            <td colspan="2">
                <ul class="img">
                    <li class="imgsLi bj-img ">
                        <c:if test="${not empty report.zjImg8}">
                            <img src="${commonStaticImgPaths}${report.zjImg8}" alt="">
                        </c:if>
                        <c:if test="${empty report.zjImg8}">
                            <i class="blank-img"></i>
                        </c:if>
                    </li>
                </ul>
            </td>
            <td colspan="2">
                <ul class="img">
                    <li class="imgsLi bj-img ">
                        <c:if test="${not empty report.zjImg9}">
                            <img src="${commonStaticImgPaths}${report.zjImg9}" alt="">
                        </c:if>
                        <c:if test="${empty report.zjImg9}">
                            <i class="blank-img"></i>
                        </c:if>
                    </li>
                </ul>
            </td>
        </tr>

            <tr>
                <td colspan="2">⑩支架节点（斜支撑）</td>
                <td colspan="2">⑪支架距照片（南北）</td>
                <td colspan="2">⑫支架距照片（东西）</td>
            </tr>
            <tr>
                <td colspan="2">
                    <ul class="img">
                        <li class="imgsLi bj-img ">
                            <c:if test="${not empty report.componentImg1}">
                                <img src="${commonStaticImgPaths}${report.componentImg1}" alt="">
                            </c:if>
                            <c:if test="${empty report.componentImg1}">
                                <i class="blank-img"></i>
                            </c:if>
                        </li>
                    </ul>
                </td>
                <td colspan="2">
                    <ul class="img">
                        <li class="imgsLi bj-img ">
                            <c:if test="${not empty report.componentImg2}">
                                <img src="${commonStaticImgPaths}${report.componentImg2}" alt="">
                            </c:if>
                            <c:if test="${empty report.componentImg2}">
                                <i class="blank-img"></i>
                            </c:if>
                        </li>
                    </ul>
                </td>
                <td colspan="2">
                    <ul class="img">
                        <li class="imgsLi bj-img ">
                            <c:if test="${not empty report.componentImg3}">
                                <img src="${commonStaticImgPaths}${report.componentImg3}" alt="">
                            </c:if>
                            <c:if test="${empty report.componentImg3}">
                                <i class="blank-img"></i>
                            </c:if>
                        </li>
                    </ul>
                </td>
            </tr>

            <tr>
                <td colspan="6">⑬防风加固</td>
            </tr>
            <tr>
                <td colspan="6">
                    <ul class="img">
                        <c:if test="${not empty report.componentImg4}">
                            <c:forEach items="${report.componentImg4}" var="img4">
                                <li class="imgsLi bj-img ">
                                    <img src="${commonStaticImgPaths}${img4}" alt="">
                                </li>
                            </c:forEach>
                        </c:if>
                        <c:if test="${empty report.componentImg4}">
                            <i class="blank-img"></i>
                        </c:if>
                    </ul>
                </td>

            </tr>
            <tr>
                <td colspan="6">⑭方管尺寸测量</td>
            </tr>
            <tr>
                <td colspan="6">
                    <ul class="img">
                        <c:if test="${not empty report.sizeMeasureImgs}">
                            <c:forEach items="${report.sizeMeasureImgs}" var="img4">
                                <li class="imgsLi bj-img ">
                                    <img src="${commonStaticImgPaths}${img4}" alt="">
                                </li>
                            </c:forEach>
                        </c:if>
                        <c:if test="${empty report.sizeMeasureImgs}">
                            <i class="blank-img"></i>
                        </c:if>
                    </ul>
                </td>

            </tr>
        <tr>
            <td rowspan="4" colspan="2">3.电气设备安装照片</td>
            <td colspan="2">①并网箱、逆变器外部安装照片、接地引下线</td>
            <td colspan="2">②并网箱内部</td>
            <td colspan="2">③直流线缆保护</td>
        </tr>
        <tr>
            <td colspan="2">
                <ul class="img">
                    <li class="imgsLi bj-img ">
                        <c:if test="${not empty report.totalImgs}">
                            <img src="${commonStaticImgPaths}${report.totalImgs}" alt="">
                        </c:if>
                        <c:if test="${empty report.totalImgs}">
                            <i class="blank-img"></i>
                        </c:if>
                    </li>
                </ul>
            </td>
            <td colspan="2">
                <ul class="img">
                    <li class="imgsLi bj-img ">
                        <c:if test="${not empty report.bwInnerImg}">
                            <img src="${commonStaticImgPaths}${report.bwInnerImg}" alt="">
                        </c:if>
                        <c:if test="${empty report.bwInnerImg}">
                            <i class="blank-img"></i>
                        </c:if>
                    </li>
                </ul>
            </td>
            <td colspan="2">
                <ul class="img">
                    <li class="imgsLi bj-img ">
                        <c:if test="${not empty report.dqsbAnImgOne}">
                            <img src="${commonStaticImgPaths}${report.dqsbAnImgOne}" alt="">
                        </c:if>
                        <c:if test="${empty report.dqsbAnImgOne}">
                            <i class="blank-img"></i>
                        </c:if>
                    </li>
                </ul>
            </td>
        </tr>
        <tr>
            <td colspan="2">④直流线缆固定</td>
            <td colspan="2"></td>
            <td colspan="2"></td>
        </tr>
        <tr>
            <td colspan="2">
                <ul class="img">
                    <li class="imgsLi bj-img ">
                        <c:if test="${not empty report.dqsbAnImgTwo}">
                            <img src="${commonStaticImgPaths}${report.dqsbAnImgTwo}" alt="">
                        </c:if>
                        <c:if test="${empty report.dqsbAnImgTwo}">
                            <i class="blank-img"></i>
                        </c:if>
                    </li>
                </ul>
            </td>
            <td colspan="2">
            </td>
            <td colspan="2">
            </td>
        </tr>
        <tr>
            <td rowspan="2" colspan="2">4.接地系统照片</td>
            <td colspan="2">①引下线与支架连接点、南北坡接地连接点</td>
            <td colspan="2">②接地电阻</td>
            <td colspan="2">③组件边框接地</td>
        </tr>
        <tr>
            <td colspan="2">
                <ul class="img">
                    <c:if test="${not empty report.zjJdImgs}">
                        <c:forEach var="img" items="${report.zjJdImgs}">
                            <li class="imgsLi bj-img ">
                                <img src="${commonStaticImgPaths}${img}" alt="">
                            </li>
                        </c:forEach>
                    </c:if>
                    <c:if test="${empty report.zjJdImgs}">
                        <i class="blank-img"></i>
                    </c:if>
                </ul>
            </td>
            <td colspan="2">
                <ul class="img">
                    <c:if test="${not empty report.groundResistanceImgs}">
                        <c:forEach var="img" items="${report.groundResistanceImgs}">
                            <li class="imgsLi bj-img ">
                                <img src="${commonStaticImgPaths}${img}" alt="">
                            </li>
                        </c:forEach>
                    </c:if>
                    <c:if test="${empty report.groundResistanceImgs}">
                        <i class="blank-img"></i>
                    </c:if>

                </ul>
            </td>
            <td colspan="2">
                <ul class="img">
                    <li class="imgsLi bj-img ">
                        <c:if test="${not empty report.zujianJdImg}">
                            <img src="${commonStaticImgPaths}${report.zujianJdImg}" alt="">
                        </c:if>
                        <c:if test="${empty report.zujianJdImg}">
                            <i class="blank-img"></i>
                        </c:if>
                    </li>
                </ul>
            </td>
        </tr>

        <tr>
            <td rowspan="2"  colspan="2">5.调试记录照片</td>
            <td colspan="6">①开路电压</td>
        </tr>
        <tr>
            <td colspan="6">
                <ul class="img">
                    <c:if test="${not empty report.openWayVoltageImgs}">
                        <c:forEach var="img" items="${report.openWayVoltageImgs}">
                            <li class="imgsLi bj-img ">
                                <img src="${commonStaticImgPaths}${img}" alt="">
                            </li>
                        </c:forEach>
                    </c:if>
                    <c:if test="${empty report.openWayVoltageImgs}">
                        <i class="blank-img"></i>
                    </c:if>
                </ul>
            </td>
        </tr>

        <tr>
            <td colspan="2" rowspan="10">6.方阵安装完毕整体照片</td>
            <td colspan="2">①东向西航拍</td>
            <td colspan="2">②西向东航拍</td>
            <td colspan="2">③南向北航拍</td>
        </tr>
        <tr>
            <td colspan="2">
                <ul class="img">
                    <li class="imgsLi bj-img ">
                        <c:if test="${not empty report.directionAirImg1}">
                            <img src="${commonStaticImgPaths}${report.directionAirImg1}" alt="">
                        </c:if>
                        <c:if test="${empty report.directionAirImg1}">
                            <i class="blank-img"></i>
                        </c:if>
                    </li>
                </ul>
            </td>
            <td colspan="2">
                <ul class="img">
                    <li class="imgsLi bj-img ">
                        <c:if test="${not empty report.directionAirImg2}">
                            <img src="${commonStaticImgPaths}${report.directionAirImg2}" alt="">
                        </c:if>
                        <c:if test="${empty report.directionAirImg2}">
                            <i class="blank-img"></i>
                        </c:if>
                    </li>
                </ul>
            </td>
            <td colspan="2">
                <ul class="img">
                    <li class="imgsLi bj-img ">
                        <c:if test="${not empty report.directionAirImg3}">
                            <img src="${commonStaticImgPaths}${report.directionAirImg3}" alt="">
                        </c:if>
                        <c:if test="${empty report.directionAirImg3}">
                            <i class="blank-img"></i>
                        </c:if>
                    </li>
                </ul>
            </td>
        </tr>

            <tr>
                <td colspan="2">④北向南航拍</td>
                <td colspan="2">⑤组件近景</td>
                <td colspan="2">⑥组件角度</td>
            </tr>
            <tr>
                <td colspan="2">
                    <ul class="img">
                        <li class="imgsLi bj-img ">
                            <c:if test="${not empty report.directionAirImg4}">
                                <img src="${commonStaticImgPaths}${report.directionAirImg4}" alt="">
                            </c:if>
                            <c:if test="${empty report.directionAirImg4}">
                                <i class="blank-img"></i>
                            </c:if>
                        </li>
                    </ul>
                </td>
                <td colspan="2">
                    <ul class="img">
                        <li class="imgsLi bj-img ">
                            <c:if test="${not empty report.zjNearImg}">
                                <img src="${commonStaticImgPaths}${report.zjNearImg}" alt="">
                            </c:if>
                            <c:if test="${empty report.zjNearImg}">
                                <i class="blank-img"></i>
                            </c:if>
                        </li>
                    </ul>
                </td>
                <td colspan="2">
                    <ul class="img">
                        <li class="imgsLi bj-img ">
                            <c:if test="${not empty report.zjAngleImg}">
                                <img src="${commonStaticImgPaths}${report.zjAngleImg}" alt="">
                            </c:if>
                            <c:if test="${empty report.zjAngleImg}">
                                <i class="blank-img"></i>
                            </c:if>
                        </li>
                    </ul>
                </td>
            </tr>

                <tr>
                    <td colspan="2">⑦檩条出组件照片</td>
                    <td colspan="2">⑧水槽照片</td>
                    <td colspan="2">⑨中压固定照片</td>
                </tr>
                <tr>
                    <td colspan="2">
                        <ul class="img">
                            <li class="imgsLi bj-img ">
                                <c:if test="${not empty report.zjItemImg}">
                                    <img src="${commonStaticImgPaths}${report.zjItemImg}" alt="">
                                </c:if>
                                <c:if test="${empty report.zjItemImg}">
                                    <i class="blank-img"></i>
                                </c:if>
                            </li>
                        </ul>
                    </td>
                    <td colspan="2">
                        <ul class="img">
                            <li class="imgsLi bj-img ">
                                <c:if test="${not empty report.waterChannelImg}">
                                    <img src="${commonStaticImgPaths}${report.waterChannelImg}" alt="">
                                </c:if>
                                <c:if test="${empty report.waterChannelImg}">
                                    <i class="blank-img"></i>
                                </c:if>
                            </li>
                        </ul>
                    </td>
                    <td colspan="2">
                        <ul class="img">
                            <li class="imgsLi bj-img ">
                                <c:if test="${not empty report.mediumFixImg}">
                                    <img src="${commonStaticImgPaths}${report.mediumFixImg}" alt="">
                                </c:if>
                                <c:if test="${empty report.mediumFixImg}">
                                    <i class="blank-img"></i>
                                </c:if>
                            </li>
                        </ul>
                    </td>
                </tr>
                <tr>
                    <td colspan="2">⑩安全警示牌</td>
                    <td colspan="2">⑪现场安全交底文件</td>
                    <td colspan="2">⑫现场交底照片</td>
                </tr>
                <tr>
                    <td colspan="2">
                        <ul class="img">
                            <li class="imgsLi bj-img ">
                                <c:if test="${not empty report.safetyWarningImg}">
                                    <img src="${commonStaticImgPaths}${report.safetyWarningImg}" alt="">
                                </c:if>
                                <c:if test="${empty report.safetyWarningImg}">
                                    <i class="blank-img"></i>
                                </c:if>
                            </li>
                        </ul>
                    </td>
                    <td colspan="2">
                        <ul class="img">
                            <li class="imgsLi bj-img ">
                                <c:if test="${not empty report.safetyDiscloseDocImg}">
                                    <img src="${commonStaticImgPaths}${report.safetyDiscloseDocImg}" alt="">
                                </c:if>
                                <c:if test="${empty report.safetyDiscloseDocImg}">
                                    <i class="blank-img"></i>
                                </c:if>
                            </li>
                        </ul>
                    </td>
                    <td colspan="2">
                        <ul class="img">
                            <li class="imgsLi bj-img ">
                                <c:if test="${not empty report.discloseDocImg}">
                                    <img src="${commonStaticImgPaths}${report.discloseDocImg}" alt="">
                                </c:if>
                                <c:if test="${empty report.discloseDocImg}">
                                    <i class="blank-img"></i>
                                </c:if>
                            </li>
                        </ul>
                    </td>
                </tr>
                <tr>
                    <td colspan="2">⑬记录表</td>
                    <td colspan="2"></td>
                    <td colspan="2"></td>
                </tr>
                <tr>
                    <td colspan="2">
                        <ul class="img">
                            <li class="imgsLi bj-img ">
                                <c:if test="${not empty report.recordDocImg}">
                                    <img src="${commonStaticImgPaths}${report.recordDocImg}" alt="">
                                </c:if>
                                <c:if test="${empty report.recordDocImg}">
                                    <i class="blank-img"></i>
                                </c:if>
                            </li>
                        </ul>
                    </td>
                    <td colspan="2">
                        <ul class="img">

                        </ul>
                    </td>
                    <td colspan="2">
                        <ul class="img">

                        </ul>
                    </td>
                </tr>
        <c:if test="${opt eq 'merge' || opt eq 'TwoMergeAccept' || opt eq 'view'}">
            <tr class="tableHeader">
                <td colspan="8">四、电站并网验收条款项</td>
            </tr>
            <tr>
                <td colspan="4" >①近3天发电量<i class="mark">*</i></td>
                <td colspan="4" >②补充
                        <%-- <c:if test="${entry.repaymentMethod eq '1' || entry.repaymentMethod eq '2'}">
                             <i class="mark">*</i>
                         </c:if>--%>
                </td>
            </tr>
            <tr>
                <td colspan="4" id="yxImgTD">
                    <c:if test="${opt eq 'merge'}">
                        <c:if test="${not empty report.yxImg}">
                            <ul class="img">
                                <li class="imgsLi bj-img ">
                                    <span class="layui-icon-close layui-icon" onclick="delImg(this,1)"></span>
                                    <img src="${commonStaticImgPaths}${report.yxImg}" alt="">
                                    <input type="hidden" class="imgValues" id="yxImg" value="${report.yxImg}">
                                </li>
                            </ul>
                            <div class="add layui-hide">
                                <span>+</span>
                                <input type="file" class="uploadFile" max-num="1">
                            </div>
                        </c:if>
                        <c:if test="${empty report.yxImg}">
                            <div class="add">
                                <span>+</span>
                                <input type="file" class="uploadFile" max-num="1">
                            </div>
                        </c:if>
                    </c:if>
                    <c:if test="${opt ne 'merge'}">
                        <ul class="img">
                            <li class="imgsLi bj-img ">
                                <img src="${commonStaticImgPaths}${report.yxImg}" alt="">
                            </li>
                        </ul>
                    </c:if>
                </td>
                <td colspan="4" id="gebImgTD">
                    <c:if test="${opt eq 'merge'}">
                        <c:if test="${not empty report.gebImg}">
                            <ul class="img">
                                <li class="imgsLi bj-img ">
                                    <span class="layui-icon-close layui-icon" onclick="delImg(this,1)"></span>
                                    <img src="${commonStaticImgPaths}${report.gebImg}" alt="">
                                    <input type="hidden" class="imgValues" id="gebImg" value="${report.gebImg}">
                                </li>
                            </ul>
                            <div class="add layui-hide">
                                <span>+</span>
                                <input type="file" class="uploadFile" max-num="1">
                            </div>
                        </c:if>
                        <c:if test="${empty report.gebImg}">
                            <div class="add">
                                <span>+</span>
                                <input type="file" class="uploadFile" max-num="1">
                            </div>
                        </c:if>
                    </c:if>
                    <c:if test="${opt ne 'merge'}">
                        <ul class="img">
                            <li class="imgsLi bj-img ">
                                <c:if test="${not empty report.gebImg}">
                                    <img src="${commonStaticImgPaths}${report.gebImg}" alt="">
                                </c:if>
                                <c:if test="${empty report.gebImg}">
                                    <i class="blank-img"></i>
                                </c:if>
                            </li>
                        </ul>
                    </c:if>
                </td>
            </tr>
        </c:if>
        <tr class="tableHeader">
            <td colspan="8">${(opt ne 'merge' && opt ne 'TwoMergeAccept' && opt ne 'view') ? '四': '五'}
                、验收结论
            </td>
        </tr>
        <tr>
            <td >踏勘设计审核意见</td>
            <td colspan="2">${examine.examineTwo}</td>
            <td>审核人</td>
            <td>${examine.operatorTwo}</td>
            <td>审核时间</td>
            <td><fmt:formatDate value="${examine.examineTimeTwo}" pattern="yyyy-MM-dd HH:mm"/></td>

        </tr>
        <tr>
            <td >完工验收审核意见</td>
            <td colspan="2">${examine.examineFive}</td>
            <td>审核人</td>
            <td>${examine.operatorFive}</td>
            <td>审核时间</td>
            <td><fmt:formatDate value="${examine.examineTimeFive}" pattern="yyyy-MM-dd HH:mm"/></td>

        </tr>
        <tr>
            <td >并网验收审核意见</td>
            <td colspan="2">${examine.examineEight}</td>
            <td>审核人</td>
            <td>${examine.operatorEight}</td>
            <td>审核时间</td>
            <td><fmt:formatDate value="${examine.examineTimeEight}" pattern="yyyy-MM-dd HH:mm"/></td>

        </tr>
        <c:if test="${opt eq 'TwoMergeAccept' || opt eq 'fixAccept'}">
            <tr class="form-textarea">
                <td>备注</td>
                <td colspan="7"><textarea class="form-input no-resize" id="fixConclusionSh" name="fixConclusionSh" ></textarea></td>
            </tr>
        </c:if>
        <tr class="">
            <td style="height: 25px;">终验结论</td>
            <td colspan="3"><c:if test="${entry.status eq 'a'}">已完成验收</c:if></td>
            <td>验收时间</td>
            <td colspan="3"><fmt:formatDate value="${examine.examineTimeEight}" pattern="yyyy-MM-dd HH:mm"/></td>
        </tr>

    </table>
</div>
<c:if test="${opt eq 'view'}">
    <div class="operate-footer">
        <button class="layui-btn layui-btn-primary" onclick="closeSelf();">取消</button>
    </div>
</c:if>
<c:if test="${opt eq 'fixAccept'}">
    <!-- 安装验收 -->
    <div class="operate-footer">
        <button class="footer-btn normal-btn TwoAcceptPassBtn">同意</button>
        <button class="footer-btn normal-btn fixAcceptRefuseBtn">驳回</button>
        <button class="footer-btn" onclick="closeSelf();">取消</button>
    </div>
</c:if>
<c:if test="${opt eq 'merge'}">
    <!-- 并网 -->
    <div class="operate-footer">
        <button class="footer-btn normal-btn mergeTmpBtn">暂存</button>
        <button class="footer-btn normal-btn mergeSubmitBtn">提交</button>
        <button class="footer-btn" onclick="closeSelf();">取消</button>
    </div>
</c:if>
<c:if test="${opt eq 'TwoMergeAccept'}">
    <!-- 并网验收审核 -->
    <div class="operate-footer">
        <button class="footer-btn normal-btn TwomergeAcceptPassBtn">同意</button>
        <button class="footer-btn normal-btn TwomergeAcceptRefuseBtn">驳回</button>
        <button class="footer-btn" onclick="closeSelf();">取消</button>
    </div>
</c:if>

<script src="https://cdn.bootcss.com/html2canvas/0.5.0-beta4/html2canvas.min.js"></script>
<script src="${ctxPlugin}/lib/layuiAdmin/dist/layuiadmin/layui/layui.js"></script>
<script src="${ctxPlugin}/lib/factory.js"></script>
<script src="${ctxPlugin}/lib/layuiAdmin/dist/layuiadmin/dist/viewer.js"></script>
<script>
    //图片查看效果
    var viewer = new Viewer(document.getElementById('LAY_app'));
    layui.config({
        base: '${ctxPlugin}/lib/layuiAdmin/dist/layuiadmin/' //静态资源所在路径
    }).extend({
        index: 'lib/index' //主入口模块
    }).use(['index', 'tableExt', 'jquery', 'layer','laypage','laydate','form'], function(){
        //layui.use(['table','layer','laypage','laydate','form'], function(){
        $ = layui.$;
        tableExt = layui.tableExt;
        layer = layui.layer;
        laypage = layui.laypage;
        laydate = layui.laydate;
        form = layui.form;
        table = tableExt.getLayTable();

        $('.changeInput').change(function(){
            var spec = $('#componentSpec').val().trim();
            var num = $('#componentNum').val().trim();
            if(!isNaN(spec) && !isNaN(num)){
                $('#capacity').val(spec*num);
            }
        });

        function getImgs(selector){
            var arr = [];
            $(selector).find('input.imgValues').each(function(){
                arr.push($(this).val());
            });
            return arr.join();
        }

        /*$('.imgsLi img').on('click', function () {
            layer.photos({
                photos: '.imgsLi',
                shadeClose: false,
                closeBtn: 2,
                anim: 0
            });
        });*/

        $('.uploadFile').change(function(){
            var $this = $(this);
            var file = $(this)[0].files[0];
            if(isBlank(file)){
                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) {
                    var maxNum = $this.attr('max-num');
                    var html = '<ul class="img"> ' +
                        '         <li class="imgsLi bj-img ">' +
                        '           <span class="layui-icon-close layui-icon" onclick="delImg(this,'+maxNum+')"></span>'+
                        '            <img src="${commonStaticImgPaths}' + data.path + '" alt="">' +
                        '            <input type="hidden" class="imgValues" value="' + data.path + '">'+
                        '          </li>' +
                        '        </ul>';
                    $this.closest('.add').before(html);
                    var length = $this.closest('td').find('ul').length;
                    if(!isBlank(maxNum) && length >= maxNum){
                        $this.closest('.add').addClass('layui-hide');
                    }
                }
            });
        });

        function updateFileEntry(id) {
            $.ajax({
                type: 'post',
                url: '${ctx}/customerEntry/uploadTwoAttachment',
                data: {
                    id: id,
                    type:'1'
                },
                success: function(data){
                    console.log(data)
                }
            });
        }

        function afterSuccess(data) {
            console.log(data)
            if (data.code === '200') {
                parent.layer.msg('操作成功', {icon: 1});
                closeSelf();
                parent.searchOrder();
            } else if (data.code === '500') {
                layer.msg(data.errMsg, {icon: 2});
            } else if (data.code === '501') {
                layer.msg(data.errMsg, {icon: 2});
            }else if (data.code === '400' && !isBlank(data.errMsg)) {
                layer.msg(data.errMsg, {icon: 2});
            } else {
                layer.msg('操作失败', {icon: 2});
            }
        }

        function uploadAttachment(id) {
            $.ajax({
                type: 'post',
                url: '${ctx}/customerEntry/createEntryPdf',
                data: {
                    id: id
                },
                success: function(data){
                    console.log(data)
                }
            });
        }


        //安装验收通过
        $('.fixAcceptPassBtn').click(function(){
            var $this = $(this);
            //安装验收意见
            var fixRemark = $('textarea[name="fixConclusionSh"]').val();

            // if (isBlank(fixRemark)) {
            //     layer.msg('请填写备注');
            //     return;
            // }
            $this.prop('disabled', true);
            $.ajax({
                type: 'post',
                url: '${ctx}/customerEntry/fixAcceptPass',
                data: {
                    id: '${entry.id}',
                    fixConclusion: fixRemark
                },
                success: function(data){
                    afterSuccess(data);
                },
                complete: function(){
                    $this.prop('disabled', false);
                }
            })
        });
        //安装验收退回
        $('.fixAcceptRefuseBtn').click(function(){
            var $this = $(this);
            //安装验收意见
            var fixRemark = $('textarea[name="fixConclusionSh"]').val();
            if (isBlank(fixRemark)) {
                layer.msg('请填写备注');
                return;
            }
            $this.prop('disabled', true);
            $.ajax({
                type: 'post',
                url: '${ctx}/customerEntry/fixAcceptRefuse',
                data: {
                    id: '${entry.id}',
                    fixConclusion: fixRemark
                },
                success: function(data){
                    afterSuccess(data);
                },
                complete: function(){
                    $this.prop('disabled', false);
                }
            })
        });

        //安装验收通过
        $('.TwoAcceptPassBtn').click(function(){
            var index= layer.load(2, {shade: [0.5,'#fff'], content:''});
            var $this = $(this);
            //二次安装验收意见
            var fixRemark = $('textarea[name="fixConclusionSh"]').val();
            // if (isBlank(fixRemark)) {
            //     layer.msg('请填写备注');
            //     return;
            // }

            $this.prop('disabled', true);
            $.ajax({
                type: 'post',
                url: '${ctx}/customerEntry/toNetAcceptPass',
                data: {
                    id: '${entry.id}',
                    type:'1',
                    fixConclusionSh: fixRemark
                },
                success: function(data){
                    afterSuccess(data);
                },
                complete: function(){
                    layer.close(index);
                    $this.prop('disabled', false);
                }
            })
        });
        //二次安装验收退回
        $('.TwoAcceptRefuseBtn').click(function(){
            var $this = $(this);
            //安装验收意见
            var fixRemark = $('textarea[name="fixConclusionSh"]').val();
            if (isBlank(fixRemark)) {
                layer.msg('请填写备注');
                return;
            }
            $this.prop('disabled', true);
            $.ajax({
                type: 'post',
                url: '${ctx}/customerEntry/toNetAcceptPass',
                data: {
                    id: '${entry.id}',
                    type:'2',
                    fixConclusionSh: fixRemark
                },
                success: function(data){
                    afterSuccess(data);
                },
                complete: function(){
                    $this.prop('disabled', false);
                }
            })
        });

        //并网暂存
        $('.mergeTmpBtn').click(function(){
            var $this = $(this);
            //发电户号
            var generatorNo = $('input[name="generatorNo"]').val();
            var provinceCode = $("#provinceCode").val()
            var addressConsistent = $("#addressConsistent").val();//购售电地址是否一致
            var province = $("#province").val();
            var city = $("#city").val();
            var area = $("#area").val();
            var address = $("#address").val();

            //近3天发电量
            var yxImg = getImgs($('#yxImgTD'));
            //划转截图
            var gebImg = getImgs($('#gebImgTD'));
            $this.prop('disabled', true);
            var order = {
                entryId: '${entry.id}',
                generatorNo: generatorNo,
                yxImg: yxImg,
                gebImg: gebImg,
                addressConsistent: addressConsistent,
                province: province,
                city: city,
                area: area,
                address: address,
                provinceCode:provinceCode
            }
            $.ajax({
                type: 'post',
                url: '${ctx}/customerEntry/mergeTmp',
                contentType: "application/json;charsetset=UTF-8",
                data: JSON.stringify(order),
                success: function(data){
                    afterSuccess(data);
                },
                complete: function(){
                    $this.prop('disabled', false);
                }
            })
        });
        //并网提交
        $('.mergeSubmitBtn').click(function(){
            var $this = $(this);
            //发电户号
            var generatorNo = $('input[name="generatorNo"]').val();
            var provinceCode = $("#provinceCode").val()
            var addressConsistent = $("#addressConsistent").val();//购售电地址是否一致
            if (isBlank(addressConsistent)) {
                layer.msg("请选择购售电地址是否一致");
                return;
            }
            var province = $("#province").val();
            var city = $("#city").val();
            var area = $("#area").val();
            var address = $("#address").val();
            if (addressConsistent === 'N') {
                if (isBlank(province) || isBlank(city) || isBlank(area) || isBlank(address)) {
                    layer.msg("安装地址不能为空");
                    return;
                }
            }

            //近3天发电量
            var yxImg = getImgs($('#yxImgTD'));
            //划转截图
            var gebImg = getImgs($('#gebImgTD'));


            if (isBlank(generatorNo)) {
                layer.msg('发电户号不能为空');
                return;
            }
            if (isBlank(provinceCode)) {
                layer.msg('请选择所属电力公司');
                return;
            }
            if (isBlank(yxImg)) {
                layer.msg('近3天发电量不能为空');
                return;
            }
            $this.prop('disabled', true);
            var order = {
                entryId: '${entry.id}',
                generatorNo: generatorNo,
                yxImg: yxImg,
                gebImg: gebImg,
                addressConsistent: addressConsistent,
                province: province,
                city: city,
                area: area,
                address: address,
                provinceCode:provinceCode
            }
            $.ajax({
                type: 'post',
                url: '${ctx}/customerEntry/mergeSubmit',
                contentType: "application/json;charsetset=UTF-8",
                data: JSON.stringify(order),
                success: function(data){
                    afterSuccess(data);
                },
                complete: function(){
                    $this.prop('disabled', false);
                }
            })
        });
        //并网验收退回
        $('.mergeAcceptRefuseBtn').click(function(){
            var $this = $(this);
            var mergeConclusion = $('textarea[name="fixConclusionSh"]').val();
            if (isBlank(mergeConclusion)) {
                layer.msg('请填写备注');
                return;
            }
            $this.prop('disabled', true);
            $.ajax({
                type: 'post',
                url: '${ctx}/customerEntry/mergeAcceptRefuse',
                data: {
                    id: '${entry.id}',
                    mergeConclusion: mergeConclusion
                },
                success: function(data){
                    afterSuccess(data);
                },
                complete: function(){
                    $this.prop('disabled', false);
                }
            });
        });

        //并网验收通过
        $('.mergeAcceptPassBtn').click(function(){
            var $this = $(this);
            var fixConclusionSh = $('textarea[name="fixConclusionSh"]').val();
            // if (isBlank(fixConclusionSh)) {
            //     layer.msg('请填写备注');
            //     return;
            // }
            $this.prop('disabled', true);
            $.ajax({
                type: 'post',
                url: '${ctx}/customerEntry/mergeAcceptPass',
                data: {
                    id: '${entry.id}',
                    mergeConclusion: fixConclusionSh
                },
                success: function(data){
                    afterSuccess(data);
                },
                complete: function(){
                    $this.prop('disabled', false);
                }
            });
        });

        //并网验收审核退回
        $('.TwomergeAcceptRefuseBtn').click(function(){
            var $this = $(this);

            var fixConclusionSh = $('textarea[name="fixConclusionSh"]').val();
            if (isBlank(fixConclusionSh)) {
                layer.msg('请填写备注');
                return;
            }
            $this.prop('disabled', true);
            $.ajax({
                type: 'post',
                url: '${ctx}/customerEntry/twoMergeAcceptRefuse',
                data: {
                    id: '${entry.id}',
                    type:'2',
                    finalConclusion: fixConclusionSh
                },
                success: function(data){
                    afterSuccess(data);
                },
                complete: function(){
                    $this.prop('disabled', false);
                }
            });
        });

        //并网验收审核通过
        $('.TwomergeAcceptPassBtn').click(function(){
            var $this = $(this);

            var finalConclusion = $('textarea[name="fixConclusionSh"]').val();
            // if (isBlank(finalConclusion)) {
            //     layer.msg('请填写备注');
            //     return;
            // }
            var index= layer.load(2, {shade: [0.5,'#fff'], content:''});

            $this.prop('disabled', true);
            $.ajax({
                type: 'post',
                url: '${ctx}/customerEntry/twoMergeAcceptRefuse',
                data: {
                    id: '${entry.id}',
                    type: '1',
                    finalConclusion: finalConclusion
                },
                success: function(data){
                    afterSuccess(data);
                },
                complete: function(){
                    $this.prop('disabled', false);
                    layer.close(index);
                }
            });
        });

        $('.downloadPro').click(function(){

            var check_accept_imgs ="${entry.checkAcceptImgs}";
            if(!isBlank(check_accept_imgs)){
                // url="technical/imgDownload";
                // window.open('http://192.168.2.24/sfimggroup/'+check_accept_imgs)
                //  var name ="${entry.traderName}-${entry.powerStationCode}-户用电站验收报告.";
                location.href = '${commonStaticImgPath}' + check_accept_imgs;
            }else{
                var hideSubmitForm = document.createElement("form");
                hideSubmitForm.id = "tempForm1";
                hideSubmitForm.method = "post";
                hideSubmitForm.action = "${ctx}/customerEntry/downLoadPDF";
                hideSubmitForm.target = "_blank";
                hideSubmitForm.appendChild(createHideInput("id", "${entry.id}"));
                hideSubmitForm.addEventListener('onsubmit', function(){
                    // this.openDownloadWindow(name);
                });
                document.body.appendChild(hideSubmitForm);
                hideSubmitForm.submit();
                document.body.removeChild(hideSubmitForm);
            }
        })

        function  createHideInput(name, value){
            var hideInput = document.createElement("input");
            hideInput.type = "hidden";
            hideInput.name = name;
            hideInput.value = value;
            return hideInput;
        }


        form.on('select(addressConsistent)', function (data) {
            var addressConsistent = $("#addressConsistent").val();
            if (addressConsistent === 'N') {
                $(".addressDiv").show();
                $("#addressInput").hide();
            } else {
                $(".addressDiv").hide();
                $("#addressInput").show();
            }
        });
        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);

        });
    })

    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) {
        $("#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 + '" title="' + area.columns.DistrictID + '">' + area.columns.DistrictName + '</option>';
                }
                $("#area").append(html);

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

    }

    window.closeSelf = function() {
        var index = parent.layer.getFrameIndex(window.name);
        // window.parent.location.reload();//刷新父级页面
        parent.layer.close(index);//关闭当前页
    }

    function delImg(that,maxNum){
        $(that).closest('td').find('.add').removeClass("layui-hide");

        $(that).closest('ul').remove();
    }

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

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

