<%@ 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/dist/viewer.css" media="all">
    <style>
        html {
            background-color: #fff;
            padding-bottom: 50px;
        }
        .form-span {
            display: block;
            padding: 8px 0;
            margin-left: 110px;
        }

        .page-iframe {
            border: none;
            width: 100%;
            min-height: calc(100vh - 250px);
        }
        .mb-10{
            margin-bottom: 10px !important;
        }
        .pd-10{
            padding: 10px;
        }
        .idea-text{
            width: 320px; height: 100px;outline: none; padding: 3px
        }
        .msg-title{
            text-align: center;
            margin: 10px 0;
            font-size: 16px;
        }
        .title1 {
            border-left: 4px solid #1b6073;
            padding-left: 20px;
            font-size: 14px;
            margin: 10px auto;
            font-weight: 600;
            height: 34px;
            line-height: 34px;
            background-color: #f4f6f9;
            color: #666666;
        }
        .layui-input-block {
            margin-left: 110px;
        }

        .layui-form-label {
            width: 110px;
        }
        .clearfix{*zoom:1;}
        .clearfix:before,.clearfix:after{display:table; line-height:0; content:"";}
        .clearfix:after{clear:both;}

        .layui-tab-title{
            margin: 0 0 0 20px;
        }
        .layui-tab-content{
            margin: 0 0 0 20px;
        }
        .bj-img {
            margin-right: 5px;
        }
        .blank-img {
            background: url('${ctxPlugin}/static/imgs/blankImg.png') center center no-repeat;
            width: 80px;
            height: 80px;
            display: inline-block;
        }
        .link-blue{ color: #1b6073; cursor: pointer;}
    </style>
</head>
<body>
<div class="layui-fluid pd-10">
    <div class="order-win layui-form">
        <div class="layui-card-body pt-20 pb-40">
            <div class="layui-col-xs12 form-box">
                <div class="layui-inline layui-col-xs3">
                    <label class="layui-form-label w-130">电站编码：</label>
                    <div class="layui-input-block ">
                        <input type="text" autocomplete="off" disabled name="stationCode" lay-verify="stationCode" class="layui-input" value="">
                        <input type="hidden"   id="stationId" lay-verify="stationCode" class="layui-input" value="">
                        <a href="#" class="pos-a h-32 lh-32 layui-span-unit pl-10 layui-table-link" onclick="selectEntry('${partnerId}')"   style="font-size: 20px">+</a>
                    </div>
                </div>
                <div class="layui-inline layui-col-xs3">
                    <label class="layui-form-label w-130">电站状态：</label>
                    <div class="layui-input-block ">
                        <input type="text"  name="status" class="layui-input" value="" disabled>
                    </div>
                </div>
                <div class="layui-inline layui-col-xs3">
                    <label class="layui-form-label w-130">代理商：</label>
                    <div class="layui-input-block ">
                        <input type="text" name="traderName" class="layui-input" value="" disabled>
                    </div>
                </div>
                <div class="layui-inline layui-col-xs3">
                    <label class="layui-form-label w-130">业主姓名：</label>
                    <div class="layui-input-block ">
                        <input type="text" name="tenantName"  class="layui-input" value="" disabled>
                    </div>
                </div>
                <div class="layui-inline layui-col-xs3">
                    <label class="layui-form-label w-130">所属资方：</label>
                    <div class="layui-input-block ">
                        <input type="text" name="partnerName" class="layui-input" value="" disabled>
                    </div>
                </div>
                <div class="layui-inline layui-col-xs3">
                    <label class="layui-form-label w-130">身份证号：</label>
                    <div class="layui-input-block ">
                        <input type="text" name="idCode" class="layui-input" value="" disabled>
                    </div>
                </div>
                <div class="layui-inline layui-col-xs9">
                    <label class="layui-form-label w-130">安装地址：</label>
                    <div class="layui-input-block ">
                        <input type="text" name="address" class="layui-input" value="" disabled>
                    </div>
                </div>
            </div>
        </div>
        <div class="clear-both">
            <p class="layui-elem-quote" style="margin: 0px 0px 0px 10px">产品信息</p>
            <div class="layui-form-item layui-row">
                <div class="layui-col-sm3 layui-col-md3">
                    <label class="layui-form-label">备案类型：</label>
                    <span class="form-span" id="filingType"></span>
                </div>
                <div class="layui-col-sm3 layui-col-md3">
                    <label class="layui-form-label">项目公司：</label>
                    <span class="form-span" id="projectCompanyName"></span>
                </div>
                <div class="layui-col-sm3 layui-col-md3">
                    <label class="layui-form-label">业务属性：</label>
                    <span class="form-span" id="productLine"></span>
                </div>
                <div class="layui-col-sm12 layui-col-md12">
                    <table class="layui-table">
                        <colgroup>
                            <col width="25%">
                            <col width="25%">
                            <col width="25%">
                            <col width="25%">
                        </colgroup>
                        <thead>
                        <tr style="background: white">
                            <th style="text-align: center">序号</th>
                            <th style="text-align: center">产品编号</th>
                            <th style="text-align: center">产品名称</th>
                            <th style="text-align: center">屋顶类型</th>
                        </tr>
                        </thead>
                        <tbody id="projectList">

                        </tbody>
                    </table>
                </div>
            </div>
            <div class="layui-inline layui-col-xs12 mb-10">
                <label class="layui-form-label w-130">变更原因：</label>
                <div class="layui-input-block ">
                    <textarea name="reason" id="reason" placeholder="" class="layui-textarea"></textarea>
                </div>
            </div>
        </div>
        <div class="clear-both">
            <p class="layui-elem-quote" style="margin: 0px 0px 0px 10px">勘测信息</p>
            <div class="layui-tab layui-tab-brief" id="surveyImgTab" lay-filter="docDemoTabBriefSurvey">
            <ul class="layui-tab-title" id="surveyImgUl"></ul>
            </div>
        </div>
    </div>
</div>
<div class="layui-form-item text-c operate-footer">
    <button type="button" class="layui-btn" id="save">提交</button>
    <button class="layui-btn layui-btn-primary" onclick="closeSelf()">取消</button>
</div>

<script src="${ctxPlugin}/lib/layuiAdmin/dist/layuiadmin/layui/layui.js"></script>
<script src="${ctxPlugin}/lib/layuiAdmin/dist/layuiadmin/dist/viewer.js"></script>
<script>
    //图片查看效果
    var viewer = new Viewer(document.getElementById('surveyImgTab'));
    var formSet = null;
    var partnerId = null;
    layui.config({
        base: '${ctxPlugin}/lib/layuiAdmin/dist/layuiadmin/' //静态资源所在路径
    }).extend({
        index: 'lib/index' //主入口模块
    }).use(['index', 'jquery', 'layer','upload'], function () {
        $ = layui.$;
        element = layui.element;
        upload = layui.upload;
        layer = layui.layer;

        element.on('tab(docDemoTabBriefSurvey)', function (data) {
            $('.surveyTabContent').eq(data.index).removeClass('layui-hide').siblings('.surveyTabContent').addClass('layui-hide');
        });



        $("#save").click(function(){
            commit();
        })
    })

    var opeRep = false;
    function commit() {
        if(opeRep){
            return;
        }
        var entryId = $("#stationId").val();
        if (isBlank(entryId)) {
            layer.msg("请选择电站");
            return;
        }
        var addEntryReqSurveyDetails = [];

        var projectTrs =$("#surveyImgUl li");
        var checkRe = true;
        projectTrs.each(function (index) {
            let projectId = $(this).attr("data-value");


            let imgTab = $("#surveyImgTab").find("#surveyImgDiv"+(index+1));

            var flyImgs = [];//屋顶高空俯视图
            imgTab.find("input[name='flyImgs']").each(function(){
                flyImgs.push($(this).val());
            })
            var roofPhotoOne = []; // 整体照片
            imgTab.find("input[name='roofPhotoOne']").each(function(){
                roofPhotoOne.push($(this).val());
            })

            var roofPhotoTwo = [];  // 东南角照片
            imgTab.find("input[name='roofPhotoTwo']").each(function(){
                roofPhotoTwo.push($(this).val());
            })

            var roofPhotoThree = [];  // 西南角照片
            imgTab.find("input[name='roofPhotoThree']").each(function(){
                roofPhotoThree.push($(this).val());
            })

            var roofPhotoFour = []; // 正南照片
            imgTab.find("input[name='roofPhotoFour']").each(function(){
                roofPhotoFour.push($(this).val());
            })
            if (roofPhotoFour.length == 0) {
                layer.msg(  $("#roof_photo_four_name").text()+"不能为空");
                return;
            }
            var roofPhotoFive = []; //细节照片
            imgTab.find("input[name='roofPhotoFive']").each(function(){
                roofPhotoFive.push($(this).val());
            })

            var roofPhotoFacade = [];  //内部结构照片
            imgTab.find("input[name='roofPhotoFacade']").each(function(){
                roofPhotoFacade.push($(this).val());
            })

            var roofPhotoInterior = [];//内部环境照片
            imgTab.find("input[name='roofPhotoInterior']").each(function(){
                roofPhotoInterior.push($(this).val());
            })
            var houseSupplementOne = [];   //其他障碍物照片
            imgTab.find("input[name='houseSupplementOne']").each(function(){
                houseSupplementOne.push($(this).val());
            })
            var detailSupplementOne = [];//逆变器、配电箱预安装位置照片
            imgTab.find("input[name='detailSupplementOne']").each(function(){
                detailSupplementOne.push($(this).val());
            })
            var surveyVideo = [];  // 补充视频
            imgTab.find("input[name='surveyVideo']").each(function(){
                surveyVideo.push($(this).val());
            })
            var surveyFiles = [];   // 踏勘记录表
            imgTab.find("input[name='surveyFiles']").each(function(){
                surveyFiles.push($(this).val());
            })
            var houseOutlinePhoto = [];//房屋轮廓照片
            imgTab.find("input[name='houseOutlinePhoto']").each(function(){
                houseOutlinePhoto.push($(this).val());
            })
            var vrRoofOne = [];  // 房屋整体图（VR全景）
            imgTab.find("input[name='vrRoofOne']").each(function(){
                vrRoofOne.push($(this).val());
            })
            var vrRoofTwo = [];   // 房屋整体俯视图（VR）
            imgTab.find("input[name='vrRoofTwo']").each(function(){
                vrRoofTwo.push($(this).val());
            })
            var vrRoofThree = [];    // 房屋内部结构图（VR）
            imgTab.find("input[name='vrRoofThree']").each(function(){
                vrRoofThree.push($(this).val());
            })

            var vrRoofFour = []; // 入户全景照片（VR）
            imgTab.find("input[name='vrRoofFour']").each(function(){
                vrRoofFour.push($(this).val());
            })
            var fwImg1 = [];   //房屋整体图
            imgTab.find("input[name='fwImg1']").each(function(){
                fwImg1.push($(this).val());
            })
            var fwImg2 = [];   //房屋内部结构图
            imgTab.find("input[name='fwImg2']").each(function(){
                fwImg2.push($(this).val());
            })
            var fwImg3 = [];   //房屋屋顶东南侧图片
            imgTab.find("input[name='fwImg3']").each(function(){
                fwImg3.push($(this).val());
            })
            var fwImg4 = [];  //房屋屋顶西南侧图片
            imgTab.find("input[name='fwImg4']").each(function(){
                fwImg4.push($(this).val());
            })
            var fwImg5 = [];   //遮阴物与房屋距离、高度
            imgTab.find("input[name='fwImg5']").each(function(){
                fwImg5.push($(this).val());
            })


            for (i = 0; i < formSet.length; i++) {
                let columnKey = formSet[i].columnKey;
                let useFlag = formSet[i].useFlag;
                let mustFillFlag = formSet[i].mustFillFlag;
                if (columnKey.includes(partnerId)) {
                    columnKey = columnKey.substring(0, columnKey.indexOf(partnerId)-1);
                }
                if (useFlag=='1' && columnKey=='fly_imgs_04' && mustFillFlag=='1') {
                    if(flyImgs.length == 0){
                        layer.msg(  $("#fly_imgs_name").text()+"不能为空");
                        checkRe = false;
                        return;
                    }
                    if(flyImgs.length>0 && flyImgs.length<3){
                        layer.msg(  $("#fly_imgs_name").text()+"最少上传3张");
                        checkRe = false;
                        return;
                    }
                }

                //安装区域整体照片
               else if (useFlag=='1' && columnKey=='roof_photo_one' && mustFillFlag=='1') {
                    if(roofPhotoOne.length == 0){
                        layer.msg(  $("#roof_photo_one_name").text()+"不能为空");
                        checkRe = false;
                        return;
                    }
                    if(roofPhotoOne.length>0 && roofPhotoOne.length<2){
                        layer.msg(  $("#roof_photo_one_name").text()+"最少上传2张");
                        checkRe = false;
                        return;
                    }
                }

                //安装区域东南角照片
                if (useFlag=='1' && columnKey=='roof_photo_two_04' && mustFillFlag=='1' &&roofPhotoTwo.length == 0) {
                    layer.msg(  $("#roof_photo_two_name").text()+"不能为空");
                    checkRe = false;
                    return;
                }
                //屋顶西南照片
                if (useFlag=='1' && columnKey=='roof_photo_three_04' && mustFillFlag=='1' &&roofPhotoThree.length == 0) {
                    layer.msg(  $("#roof_photo_three_name").text()+"不能为空");
                    checkRe = false;
                    return;
                }
                //屋顶正南照片
                if (useFlag=='1' && columnKey=='roof_photo_four_04' && mustFillFlag=='1' &&roofPhotoFour.length == 0) {
                    layer.msg(  $("#roof_photo_four_name").text()+"不能为空");
                    checkRe = false;
                    return;
                }
                //房屋内部结构
                if(useFlag=='1' && columnKey=='roof_photo_facade' && mustFillFlag=='1'){
                    if(roofPhotoFacade.length == 0){
                        layer.msg(  $("#roof_photo_facade_name").text()+"不能为空");
                        checkRe = false;
                        return;
                    }
                    if( roofPhotoFacade.length<2){
                        layer.msg(  $("#roof_photo_facade_name").text()+"最少上传2张");
                        checkRe = false;
                        return;
                    }
                }
               //房屋内部环境
                if (useFlag=='1' && columnKey=='roof_photo_interior' && mustFillFlag=='1') {
                    if (roofPhotoInterior.length == 0) {
                        layer.msg(  $("#roof_photo_interior_name").text()+"不能为空");
                        checkRe = false;
                        return;
                    }
                    if(roofPhotoInterior.length>0 && roofPhotoInterior.length<2){
                        layer.msg(  $("#roof_photo_interior_name").text()+"最少上传2张");
                        checkRe = false;
                        return;
                    }
                }
                 //安装区域细节照片
                if (useFlag=='1' && columnKey=='roof_photo_five' && mustFillFlag=='1' &&roofPhotoFive.length == 0) {
                    layer.msg(  $("#roof_photo_five_name").text()+"不能为空");
                    checkRe = false;
                    return;
                }

                //逆变器、配电箱预安装位置照片
                if (useFlag=='1' && columnKey=='detail_supplement_one' && mustFillFlag=='1'&&detailSupplementOne.length == 0) {
                    layer.msg(  $("#detail_supplement_one_name").text()+"不能为空");
                    checkRe = false;
                    return;
                }
                //房屋轮廓照片
                if(useFlag=='1' && columnKey=='house_outline_photo' && mustFillFlag=='1' && houseOutlinePhoto.length==0){
                    layer.msg(  $("#house_outline_photo_name").text()+"不能为空");
                    checkRe = false;
                    return;
                }
                //踏勘补充证明视频
                if(useFlag=='1' && columnKey=='survey_video' && mustFillFlag=='1' && surveyVideo.length==0){
                    layer.msg(  $("#survey_video_name").text()+"不能为空");
                    checkRe = false;
                    return;
                }
                //现场踏勘表
                if(useFlag=='1' && columnKey=='survey_files_04' && mustFillFlag=='1' && surveyFiles.length==0){
                    layer.msg(  $("#survey_files_name").text()+"不能为空");
                    checkRe = false;
                    return;
                }
                // 房屋整体图（VR全景）
                if(useFlag=='1' && columnKey=='vr_roof_one' && mustFillFlag=='1' && vrRoofOne.length==0){
                    layer.msg(  $("#vr_roof_one_name").text()+"不能为空");
                    checkRe = false;
                    return;
                }
                // 房屋整体俯视图（无人机）
                if(useFlag=='1' && columnKey=='vr_roof_two' && mustFillFlag=='1' && vrRoofTwo.length==0){
                    layer.msg(  $("#vr_roof_two_name").text()+"不能为空");
                    checkRe = false;
                    return;
                }
                // 房屋内部结构图（VR）
                if(useFlag=='1' && columnKey=='vr_roof_three' && mustFillFlag=='1' && vrRoofThree.length==0){
                    layer.msg(  $("#vr_roof_three_name").text()+"不能为空");
                    checkRe = false;
                    return;
                }
                // 入户全景照片(VR)
                if(useFlag=='1' && columnKey=='vr_roof_four_04' && mustFillFlag=='1' && vrRoofFour.length==0){
                    layer.msg(  $("#vr_roof_four_name").text()+"不能为空");
                    checkRe = false;
                    return;
                }
                //房屋整体图
                if(useFlag=='1' && columnKey=='fw_img1' && mustFillFlag=='1' && fwImg1.length==0){
                    layer.msg(  $("#fw_img1_name").text()+"不能为空");
                    checkRe = false;
                    return;
                }
                //房屋内部结构图
                if(useFlag=='1' && columnKey=='fw_img2' && mustFillFlag=='1' && fwImg2.length==0){
                    layer.msg(  $("#fw_img2_name").text()+"不能为空");
                    checkRe = false;
                    return;
                }
                //房屋屋顶东南侧图片
                if(useFlag=='1' && columnKey=='fw_img3' && mustFillFlag=='1' && fwImg3.length==0){
                    layer.msg(  $("#fw_img3_name").text()+"不能为空");
                    checkRe = false;
                    return;
                }
                //房屋屋顶西南侧图片
                if(useFlag=='1' && columnKey=='fw_img4' && mustFillFlag=='1' && fwImg4.length==0){
                    layer.msg(  $("#fw_img4_name").text()+"不能为空");
                    checkRe = false;
                    return;
                }
                //遮阴物与房屋距离、高度
                if(useFlag=='1' && columnKey=='fw_img5' && mustFillFlag=='1' && fwImg5.length==0){
                    layer.msg(  $("#fw_img5_name").text()+"不能为空");
                    checkRe = false;
                    return;
                }
            }

            let addEntryReqSurveyDetail = {
                projectId:projectId,
                flyImgs: flyImgs.join(","),
                roofPhotoOne: roofPhotoOne.join(","),
                roofPhotoTwo: roofPhotoTwo.join(","),
                roofPhotoThree: roofPhotoThree.join(","),
                roofPhotoFour: roofPhotoFour.join(","),
                roofPhotoFive: roofPhotoFive.join(","),
                roofPhotoFacade: roofPhotoFacade.join(","),
                roofPhotoInterior: roofPhotoInterior.join(","),
                houseSupplementOne: houseSupplementOne.join(","),
                detailSupplementOne: detailSupplementOne.join(","),
                surveyVideo: surveyVideo.join(","),
                surveyFiles: surveyFiles.join(","),
                houseOutlinePhoto: houseOutlinePhoto.join(","),
                vrRoofOne: vrRoofOne.join(","),
                vrRoofTwo: vrRoofTwo.join(","),
                vrRoofThree: vrRoofThree.join(","),
                vrRoofFour: vrRoofFour.join(","),
                fwImg1: fwImg1.join(","),
                fwImg2: fwImg2.join(","),
                fwImg3: fwImg3.join(","),
                fwImg4: fwImg4.join(","),
                fwImg5: fwImg5.join(","),
            }

            addEntryReqSurveyDetails.push(addEntryReqSurveyDetail);
        })
        // console.log(addEntryReqSurveyDetails);

        if(!checkRe){
            return;
        }
        var reason = $("#reason").val();
        var changeRecord={
            entryId: entryId,
            type: '0',
            status: status,
            addEntryReqSurveyDetails:addEntryReqSurveyDetails,
            reason: reason
        }
        // console.log(JSON.stringify(changeRecord));
        opeRep = true;
        $.ajax({
            url: '${ctx}/customer/entry/change/survey/addAnyProductSurveyChangeRecord',
            type: "POST",
            contentType: "application/json;charsetset=UTF-8",
            data: JSON.stringify(changeRecord),
            success: function(data){
                if (data.code == "200") {
                    top.layer.msg("操作成功");
                    closeSelf();
                    parent.location.reload();
                } else {
                    layer.msg(data.errMsg);
                }
            },
            complete: function(){
                opeRep = false;
            }
        });
    }

    function selectEntry(partnerId){
        layer.open({
            type: 2,
            title: '选择电站',
            content: '${ctx}/customer/entry/change/survey/toSelectEntry?partnerId='+partnerId,
            area: ['80%','80%']
        });
    }


    function searchCode(stationCode){
        if (isBlank(stationCode)) {
            return;
        }
        $("input[name='stationCode']").val(stationCode);
        $.ajax({
            type: 'post',
            url: '${ctx}/customer/entry/change/survey/selectNumber/' + stationCode,
            dataType: 'json',
            data: {
                stationCode: stationCode
            },
            success: function(res){
                clearHtml();
                if (res.code == "200") {
                    // var surveyRecord = res.data.surveyRecord;
                    var customerEntry = res.data.customerEntry;
                    var projectList = res.data.projectList;
                    var projectDetailList = res.data.projectDetailList;
                    formSet = res.data.formSet;
                    partnerId = res.data.customerEntry.partnerId;

                    $("#stationId").val(customerEntry.id);
                    $("input[name='status']").val(getStatus(customerEntry));
                    $("input[name='traderName']").val(customerEntry.createTraderName);
                    $("#projectCompanyName").text(customerEntry.projectCompanyName);
                    $("input[name='tenantName']").val(customerEntry.tenantName);
                    $("input[name='partnerName']").val(customerEntry.partnerName);
                    if ("1"==customerEntry.filingType){
                        $("#filingType").text("农户备案");
                    }else if ("2"==customerEntry.filingType){
                        $("#filingType").text("项目公司备案");
                    }
                    let productLine = "";
                    if (customerEntry.productLine == "1"){
                        productLine="纯租25年业务";
                    }else if (customerEntry.productLine == "2"){
                        productLine="经营性租赁";
                    }else if (customerEntry.productLine == "3"){
                        productLine="融资租赁";
                    }else if (customerEntry.productLine == "4"){
                        productLine="光伏贷";
                    }else if (customerEntry.productLine == "5"){
                        productLine="全款";
                    }else if (customerEntry.productLine == "6"){
                        productLine="其他";
                    }else {
                        productLine="其他";
                    }
                    $("#productLine").text(productLine);
                    $("input[name='idCode']").val(customerEntry.idCode);
                    $("input[name='address']").val(customerEntry.province + customerEntry.city + customerEntry.area + customerEntry.address);
                    let html = "";
                    // 产品信息
                    let index = 1;
                    for (let i = 0; i < projectList.length; i++) {
                        let projectId = projectList[i].columns.projectId;
                        let projectCode = projectList[i].columns.projectCode;
                        let projectName = projectList[i].columns.projectName;
                        let roofType = projectList[i].columns.roofType;
                        html += '<tr style="text-align: center" data-id="'+projectId+'" class="projectTr" >';
                        html += '<td>'+index+'</td>';
                        html += '<td>'+projectCode+'</td>';
                        html += '<td>'+projectName+'</td>';
                        html += '<td>'+roofType+'</td>';
                        html += '</tr>';
                        index++;
                    }
                    $("#projectList").empty();
                    $("#projectList").append(html);
                    //勘测图片信息
                    let html1 = "";
                    for (let i = 0; i <projectDetailList.length; i++) {
                        let projectCode = projectDetailList[i].columns.projectCode;
                        let roofType = projectDetailList[i].columns.roofType;
                        let projectName = projectDetailList[i].columns.projectName;
                        let projectId=projectDetailList[i].columns.projectId;
                        if (i == 0){
                            html1 += '<li class="layui-this" id="'+projectCode+'" data-value="'+projectId+'">';
                        }else {
                            html1 += '<li id="'+projectCode+'" data-value="'+projectId+'">';
                        }
                        if (!isBlank(roofType)){
                            html1 += roofType;
                        }else {
                            html1 += projectName;
                        }
                        html1 += '</li>';
                    }
                    $("#surveyImgUl").empty();
                    $("#surveyImgUl").append(html1);
                    let html2 = "";
                    let j = 1;
                    for (let i = 0; i <projectDetailList.length; i++) {
                        if (i==0){
                            html2+= '<div class="layui-tab-content surveyTabContent " id="surveyImgDiv'+j+'" style="padding: 0px"> ';
                        }else {
                            html2+= '<div class="layui-tab-content surveyTabContent  layui-hide " id="surveyImgDiv'+j+'" style="padding: 0px"> ';
                        }
                        html2 += '<table class="layui-table" style="text-align: center;">'
                        html2+='<thead>';
                        html2+='<tr>';
                        html2+='<th width="5%">序号</th>';
                        html2+='<th width="15%">文件名称</th>';
                        html2+='<th width="40%">变更前信息</th>';
                        html2+='<th width="40%">变更后信息</th>';
                        html2+='</tr>';
                        html2+='</thead>';
                        html2+='<tbody id="contentBody'+i+'">'
                        let contentBody = `<tr id="fly_imgs" class="change hide">
                                                <td>1</td>
                                                <td id="fly_imgs_name">无人机航拍图</td>
                                                <td id="flyImgs">
                                                </td>
                                                <td>
                                                    <div class="hide moreDiv">

                                                    </div>
                                                    <div class="upload-container moreUpload" data-span-name="flyImgs">
                                                        <img src="" alt="img placeholder">
                                                    </div>
                                                    <input type="text" class="hide numMin" value="3">
                                                    <input type="text" class="hide numMax" value="9">
                                                </td>
                                            </tr>
                                            <tr id="roof_photo_one" class="change hide">
                                                <td>2</td>
                                                <td id="roof_photo_one_name">安装区域整体照片</td>
                                                <td id="roofPhotoOne">
                                                </td>
                                                <td>
                                                    <div class="hide moreDiv">

                                                    </div>
                                                    <div class="upload-container moreUpload" data-span-name="roofPhotoOne">
                                                        <img src="" alt="img placeholder">
                                                    </div>
                                                    <input type="text" class="hide numMin" value="2">
                                                    <input type="text" class="hide numMax" value="9">
                                                </td>
                                            </tr>
                                            <tr id="roof_photo_two" class="change hide">
                                                <td>3</td>
                                                <td id="roof_photo_two_name">安装区域东南角照片</td>
                                                <td id="roofPhotoTwo">
                                                </td>
                                                <td>
                                                    <div class="hide moreDiv">

                                                    </div>
                                                    <div class="upload-container moreUpload" data-span-name="roofPhotoTwo">
                                                        <img src="" alt="img placeholder">
                                                    </div>
                                                    <input type="text" class="hide numMin" value="1">
                                                    <input type="text" class="hide numMax" value="9">
                                                </td>
                                            </tr>
                                            <tr id="roof_photo_four" class="change hide">
                                                <td>5</td>
                                                <td id="roof_photo_four_name">安装区域正南照片</td>
                                                <td id="roofPhotoFour">

                                                </td>
                                                <td>
                                                    <div class="hide moreDiv">

                                                    </div>
                                                    <div class="upload-container moreUpload" data-span-name="roofPhotoFour">
                                                        <img src="" alt="img placeholder">
                                                    </div>
                                                    <input type="text" class="hide numMin" value="1">
                                                    <input type="text" class="hide numMax" value="9">
                                                </td>
                                            </tr>
                                            <tr id="roof_photo_three" class="change hide">
                                                <td>4</td>
                                                <td id="roof_photo_three_name">安装区域西南角照片</td>
                                                <td id="roofPhotoThree">
                                                </td>
                                                <td>
                                                    <div class="hide moreDiv">

                                                    </div>
                                                    <div class="upload-container moreUpload" data-span-name="roofPhotoThree">
                                                        <img src="" alt="img placeholder">
                                                    </div>
                                                    <input type="text" class="hide numMin" value="1">
                                                    <input type="text" class="hide numMax" value="9">
                                                </td>
                                            </tr>
                                             <tr id="fw_img3" class="change hide">
                                                <td>10</td>
                                                <td id="fw_img3_name"></td>
                                                <td id="fwImg3">
                                                </td>
                                                <td>
                                                    <div class="hide moreDiv">

                                                    </div>
                                                    <div class="upload-container moreUpload" data-span-name="fwImg3">
                                                        <img src="" alt="img placeholder">
                                                    </div>
                                                    <input type="text" class="hide numMax" value="9">
                                                </td>
                                            </tr>
                                            <tr id="fw_img4" class="change hide">
                                                <td>10</td>
                                                <td id="fw_img4_name"></td>
                                                <td id="fwImg4">
                                                </td>
                                                <td>
                                                    <div class="hide moreDiv">

                                                    </div>
                                                    <div class="upload-container moreUpload" data-span-name="fwImg4">
                                                        <img src="" alt="img placeholder">
                                                    </div>
                                                    <input type="text" class="hide numMax" value="9">
                                                </td>
                                            </tr>

                                            <tr id="fw_img5" class="change hide">
                                                <td>10</td>
                                                <td id="fw_img5_name"></td>
                                                <td id="fwImg5">
                                                </td>
                                                <td>
                                                    <div class="hide moreDiv">

                                                    </div>
                                                    <div class="upload-container moreUpload" data-span-name="fwImg5">
                                                        <img src="" alt="img placeholder">
                                                    </div>
                                                    <input type="text" class="hide numMax" value="9">
                                                </td>
                                            </tr>
                                           <tr id="roof_photo_five" class="change hide">
                                                <td>6</td>
                                                <td id="roof_photo_five_name">安装区域细节照片</td>
                                                <td id="roofPhotoFive">

                                                </td>
                                                <td>
                                                    <div class="hide moreDiv">

                                                    </div>
                                                    <div class="upload-container moreUpload" data-span-name="roofPhotoFive">
                                                        <img src="" alt="img placeholder">
                                                    </div>
                                                    <input type="text" class="hide numMin" value="4">
                                                    <input type="text" class="hide numMax" value="9">
                                                </td>
                                            </tr>

                                          <tr id="roof_photo_interior" class="change hide">
                                                <td>9</td>
                                                <td id="roof_photo_interior_name">房屋内部环境照片</td>
                                                <td id="roofPhotoInterior">
                                                </td>
                                                <td>
                                                    <div class="hide moreDiv">

                                                    </div>
                                                    <div class="upload-container moreUpload"  data-span-name="roofPhotoInterior">
                                                        <img src="" alt="img placeholder">
                                                    </div>
                                                    <input type="text" class="hide numMin" value="2">
                                                    <input type="text" class="hide numMax" value="9">
                                                </td>
                                            </tr>

                                            <tr id="roof_photo_facade" class="change hide">
                                                <td>8</td>
                                                <td id="roof_photo_facade_name">房屋内部结构照片</td>
                                                <td id="roofPhotoFacade">
                                                </td>
                                                <td>
                                                    <div class="hide moreDiv">

                                                    </div>
                                                    <div class="upload-container moreUpload"  data-span-name="roofPhotoFacade">
                                                        <img src="" alt="img placeholder">
                                                    </div>
                                                    <input type="text" class="hide numMin" value="2">
                                                    <input type="text" class="hide numMax" value="9">
                                                </td>
                                            </tr>

                                            <tr id="house_outline_photo" class="change hide">
                                                <td>4</td>
                                                <td id="house_outline_photo_name">房屋轮廓照片</td>
                                                <td id="houseOutlinePhoto">
                                                </td>
                                                <td>
                                                    <div class="hide moreDiv">
                                                    </div>
                                                    <div class="upload-container moreUpload" data-span-name="houseOutlinePhoto">
                                                        <img src="" alt="img placeholder">
                                                    </div>
                                                    <input type="text" class="hide numMin" value="1">
                                                    <input type="text" class="hide numMax" value="9">
                                                </td>
                                            </tr>



                                            <tr id="detail_supplement_one" class="change hide">
                                                <td>7</td>
                                                <td id="detail_supplement_one_name">逆变器、配电箱预安装位置照片</td>
                                                <td id="detailSupplementOne">

                                                </td>
                                                <td>
                                                    <div class="hide moreDiv">

                                                    </div>
                                                    <div class="upload-container moreUpload" data-span-name="detailSupplementOne">
                                                        <img src="" alt="img placeholder">
                                                    </div>
                                                    <input type="text" class="hide numMin" value="1">
                                                    <input type="text" class="hide numMax" value="9">
                                                </td>
                                            </tr>
                                            <tr id="house_supplement_one" class="change hide">
                                                <td>10</td>
                                                <td id="house_supplement_one_name">其他障碍物照片</td>
                                                <td id="houseSupplementOne">
                                                </td>
                                                <td>
                                                    <div class="hide moreDiv">

                                                    </div>
                                                    <div class="upload-container moreUpload" data-span-name="houseSupplementOne">
                                                        <img src="" alt="img placeholder">
                                                    </div>
                                                    <input type="text" class="hide numMax" value="9">
                                                </td>
                                            </tr>
                                            <tr id="survey_video" class="change hide">
                                                <td>11</td>
                                                <td id="survey_video_name">踏勘补充证明视频</td>
                                                <td id="surveyVideo">
                                                </td>
                                                <td>
                                                    <div class="hide videoDiv">

                                                    </div>
                                                    <div class="upload-container videoUpload"  data-span-name="surveyVideo">
                                                        <img src="" alt="img placeholder">
                                                    </div>
                                                    <input type="text" class="hide numMax" value="8">
                                                </td>
                                            </tr>
                                            <tr id="survey_files" class="change hide">
                                                <td>12</td>
                                                <td id="survey_files_name">踏勘记录表</td>
                                                <td id="surveyFiles" style="text-align: left">

                                                </td>
                                                <td style="text-align: left">
                                                    <div class="imgSpan hide" style="text-align: left;">

                                                    </div>
                                                    <div class="udFile"  data-span-name="surveyFiles" style="cursor: pointer;color: #0a6597;">
                                                        上传
                                                    </div>
                                                    <input type="text" class="hide numMax" value="4">
                                                </td>
                                            </tr>
                                            <tr id="vr_roof_one" class="change hide">
                                                <td>10</td>
                                                <td id="vr_roof_one_name"></td>
                                                <td id="vrRoofOne">
                                                </td>
                                                <td>
                                                    <div class="hide moreDiv">

                                                    </div>
                                                    <div class="upload-container moreUpload" data-span-name="vrRoofOne">
                                                        <img src="" alt="img placeholder">
                                                    </div>
                                                    <input type="text" class="hide numMax" value="9">
                                                </td>
                                            </tr>
                                            <tr id="vr_roof_two" class="change hide">
                                                <td>10</td>
                                                <td id="vr_roof_two_name"></td>
                                                <td id="vrRoofTwo">
                                                </td>
                                                <td>
                                                    <div class="hide moreDiv">

                                                    </div>
                                                    <div class="upload-container moreUpload" data-span-name="vrRoofTwo">
                                                        <img src="" alt="img placeholder">
                                                    </div>
                                                    <input type="text" class="hide numMax" value="9">
                                                </td>
                                            </tr>
                                            <tr id="vr_roof_three" class="change hide">
                                                <td>10</td>
                                                <td id="vr_roof_three_name"></td>
                                                <td id="vrRoofThree">
                                                </td>
                                                <td>
                                                    <div class="hide moreDiv">

                                                    </div>
                                                    <div class="upload-container moreUpload" data-span-name="vrRoofThree">
                                                        <img src="" alt="img placeholder">
                                                    </div>
                                                    <input type="text" class="hide numMax" value="9">
                                                </td>
                                            </tr>
                                            <tr id="vr_roof_four" class="change hide">
                                                <td>10</td>
                                                <td id="vr_roof_four_name"></td>
                                                <td id="vrRoofFour">
                                                </td>
                                                <td>
                                                    <div class="hide moreDiv">

                                                    </div>
                                                    <div class="upload-container moreUpload" data-span-name="vrRoofFour">
                                                        <img src="" alt="img placeholder">
                                                    </div>
                                                    <input type="text" class="hide numMax" value="9">
                                                </td>
                                            </tr>
                                            <tr id="fw_img1" class="change hide">
                                                <td>10</td>
                                                <td id="fw_img1_name"></td>
                                                <td id="fwImg1">
                                                </td>
                                                <td>
                                                    <div class="hide moreDiv">

                                                    </div>
                                                    <div class="upload-container moreUpload" data-span-name="fwImg1">
                                                        <img src="" alt="img placeholder">
                                                    </div>
                                                    <input type="text" class="hide numMax" value="9">
                                                </td>
                                            </tr>
                                            <tr id="fw_img2" class="change hide">
                                                <td>10</td>
                                                <td id="fw_img2_name"></td>
                                                <td id="fwImg2">
                                                </td>
                                                <td>
                                                    <div class="hide moreDiv">

                                                    </div>
                                                    <div class="upload-container moreUpload" data-span-name="fwImg2">
                                                        <img src="" alt="img placeholder">
                                                    </div>
                                                    <input type="text" class="hide numMax" value="9">
                                                </td>
                                            </tr>


                                            </tbody>`;
                        html2+= contentBody;
                        html2 += '</table>';
                        html2 += '</div>';
                        j++;
                    }
                    $("#surveyImgTab").append(html2);

                    if (!isBlank(projectDetailList)) {
                        appendHtml(projectDetailList,customerEntry);
                        hideOrShowHtml(formSet,customerEntry.partnerId,projectDetailList);
                    }


                    upload.render({
                        elem: '.moreUpload' //绑定元素
                        , url: '${ctx}/common/uploadFile' //上传接口
                        ,multiple:true
                        ,before: function(obj){
                            //预读本地文件示例，不支持ie8
                            obj.preview(function (index, file, result) {

                            });
                        }
                        , done: function (res, index, upload) {
                            var titleName = $(this.item).attr("data-span-name");
                            var html='';
                            html+='<div class="bj-img imgSpan">';
                            html+=' <span class="layui-icon-close layui-icon" onclick="delMoreImg(this)"></span>';
                            html += '<img src="${commonStaticImgPath}' + res.path + '">';
                            html += '<input type="hidden" class="data-input" name="' + titleName + '" value="' + res.path + '"/>';
                            html+='</div>';
                            $(this.item).parent("td").find(".moreDiv").append(html);
                            $(this.item).parent("td").find(".moreDiv").show();
                            var maxNum = $(this.item).parent("td").find(".numMax").val();
                            if ($(this.item).parent("td").find(".moreDiv").find(".imgSpan").length == maxNum) {
                                $(this.item).hide();
                            }
                            viewer.update();
                        }
                        , error: function () {
                            //请求异常回调
                        }
                    });

                    upload.render({
                        elem: '.videoUpload' //绑定元素
                        ,accept: 'video'
                        ,multiple:true
                        , url: '${ctx}/common/uploadFile' //上传接口
                        ,before: function(obj){
                            //预读本地文件示例，不支持ie8
                            obj.preview(function (index, file, result) {

                            });
                        }
                        , done: function (res, index, upload) {
                            $(this.item).parent("td").find(".videoDiv").show();
                            var html = '';
                            html += '<div class="bj-img videoSpan" style="width: 150px;">';
                            html += '<span  class="layui-icon-close layui-icon" style="z-index: 9;"  onClick="delVideoImg(this)"></span>';
                            html += '<video class="showVideo" controls width="150px" height="78px" src="${commonStaticImgPath}' + res.path + '"/>';
                            html += '<input type="hidden" class="data-input" name="surveyVideo" value="' + res.path + '"/>';
                            html += '</div>';
                            $(this.item).parent("td").find(".videoDiv").append(html);
                            var maxNum = $(this.item).parent("td").find(".numMax").val();
                            if ($(this.item).parent("td").find(".showVideo").length == maxNum) {
                                $(this.item).hide();
                            }
                        }
                        , error: function () {
                            //请求异常回调
                        }
                    });

                    upload.render({
                        elem: '.udFile' //绑定元素
                        , accept: 'file'
                        ,multiple:true
                        , url: '${ctx}/common/uploadFileKeepName' //上传接口
                        , before: function (obj) {
                            //预读本地文件示例，不支持ie8
                            obj.preview(function (index, file, result) {
                            });
                        }
                        , done: function (res, index, upload) {
                            var titleName = $(this.item).attr("data-span-name");
                            $(this.item).parent("td").find(".imgSpan").show();
                            var html='';
                            html += '<div>';
                            html += '<a href="${commonStaticImgPath}' + res.path + '" target="_blank" class="fileH">' + res.filename + '</a>';
                            html += '<span onclick="delFile(this)" style="cursor:pointer;"><i class="layui-icon">&#xe640;</i></span>';
                            html += '<input name="' + titleName + '" class="hide" value="' + res.path + '">';
                            html += '</div>';
                            $(this.item).parent("td").find(".imgSpan").append(html);
                            var maxNum = $(this.item).parent("td").find(".numMax").val();
                            if ($(this.item).parent("td").find(".fileH").length == maxNum) {
                                $(this.item).hide();
                            }
                        }
                        , error: function () {
                            //请求异常回调
                        }
                    });

                } else {
                    formSet = null;
                    clearHtml();
                    layer.msg(res.errMsg);
                }
            }
        });
    }

    function clearHtml(){
        $("#stationId").val("");
        $("input[name='status']").val("");
        $("input[name='traderName']").val("");
        $("#projectCompanyName").text("");
        $("input[name='tenantName']").val("");
        $("input[name='partnerName']").val("");
        $("#filingType").text("");
        $("#productLine").text("");
        $("input[name='idCode']").val("");
        $("input[name='address']").val("");
        $("#surveyImgTab").empty();
        let surveyImgTabHtml = `<ul class="layui-tab-title" id="surveyImgUl"></ul>`;
        $("#surveyImgTab").append(surveyImgTabHtml);
    }

    function hideOrShowHtml(setData,partnerId,projectDetailList) {
        for (var i = 0; i < setData.length; i++) {
            let columnKey = setData[i].columnKey;
            if (setData[i].useFlag == '0') {//不启用
                for (let j = 0; j < projectDetailList.length; j++) {
                    $("#contentBody"+j+" #" + columnKey).addClass("hide");
                }

            } else {
                if (columnKey.includes(partnerId)) {
                    columnKey = columnKey.substring(0, columnKey.indexOf(partnerId)-1);
                }
                for (let j = 0; j < projectDetailList.length; j++) {
                    $("#contentBody"+j+" #" + columnKey).removeClass('hide');
                    $("#contentBody"+j+" #" + columnKey+'_name').text(setData[i].columnName);
                }

            }
        }
        resetSort(projectDetailList);
    }

    function appendHtml(data, entryData) {
        for (let a = 0; a <data.length; a++) {
            if (!isBlank(data[a].columns.flyImgs)) {
                var imgsArr = data[a].columns.flyImgs.split(",");
                var html = '';
                var h2 = '';
                for (var i = 0; i < imgsArr.length; i++) {
                    html += '<div class="bj-img">';
                    html += '   <img src="${commonStaticImgPath}' + imgsArr[i] + '">';
                    html += '</div>';

                    h2 += '<div class="bj-img imgSpan">';
                    h2 += ' <span class="layui-icon-close layui-icon" onclick="delMoreImg(this)"></span>';
                    h2 += '<img src="${commonStaticImgPath}' + imgsArr[i] + '">';
                    h2 += '<input type="hidden" class="data-input" name="flyImgs" value="' + imgsArr[i] + '"/>';
                    h2 += '</div>';
                }
                $("#contentBody"+a+" #flyImgs").empty().append(html);
                $("#contentBody"+a+" #flyImgs").next().find(".moreDiv").show();
                $("#contentBody"+a+" #flyImgs").next().find(".moreDiv").empty().append(h2);
                var maxNum = $("#contentBody"+a+" #flyImgs").next().find(".numMax").val();
                if (imgsArr.length == maxNum) {
                    $("#contentBody"+a+" #flyImgs").next().find(".moreUpload").hide();
                }
            }
            if (!isBlank(data[a].columns.roofPhotoOne)) {
                var imgs = data[a].columns.roofPhotoOne.split(",");
                var html = '';
                var h2 = '';
                for (var i = 0; i < imgs.length; i++) {
                    html += '<div class="bj-img">';
                    html += '   <img src="${commonStaticImgPath}' + imgs[i] + '">';
                    html += '</div>';

                    h2 += '<div class="bj-img imgSpan">';
                    h2 += ' <span class="layui-icon-close layui-icon" onclick="delMoreImg(this)"></span>';
                    h2 += '<img src="${commonStaticImgPath}' + imgs[i] + '">';
                    h2 += '<input type="hidden" class="data-input" name="roofPhotoOne" value="' + imgs[i] + '"/>';
                    h2 += '</div>';
                }
                $("#contentBody"+a+" #roofPhotoOne").empty().append(html);
                $("#contentBody"+a+" #roofPhotoOne").next().find(".moreDiv").show();
                $("#contentBody"+a+" #roofPhotoOne").next().find(".moreDiv").empty().append(h2);
                var maxNum = $("#contentBody"+a+" #roofPhotoOne").next().find(".numMax").val();
                if (imgs.length == maxNum) {
                    $("#contentBody"+a+" #roofPhotoOne").next().find(".moreUpload").hide();
                }
            }
            if (!isBlank(data[a].columns.roofPhotoTwo)) {
                var imgsArr = data[a].columns.roofPhotoTwo.split(",");
                var html = '';
                var h2 = '';
                for (var i = 0; i < imgsArr.length; i++) {
                    html += '<div class="bj-img">';
                    html += '   <img src="${commonStaticImgPath}' + imgsArr[i] + '">';
                    html += '</div>';

                    h2 += '<div class="bj-img imgSpan">';
                    h2 += ' <span class="layui-icon-close layui-icon" onclick="delMoreImg(this)"></span>';
                    h2 += '<img src="${commonStaticImgPath}' + imgsArr[i] + '">';
                    h2 += '<input type="hidden" class="data-input" name="roofPhotoTwo" value="' + imgsArr[i] + '"/>';
                    h2 += '</div>';
                }
                $("#contentBody"+a+" #roofPhotoTwo").empty().append(html);
                $("#contentBody"+a+" #roofPhotoTwo").next().find(".moreDiv").show();
                $("#contentBody"+a+" #roofPhotoTwo").next().find(".moreDiv").empty().append(h2);
                var maxNum = $("#contentBody"+a+" #roofPhotoTwo").next().find(".numMax").val();
                if (imgsArr.length == maxNum) {
                    $("#contentBody"+a+" #roofPhotoTwo").next().find(".moreUpload").hide();
                }
            }
            if (!isBlank(data[a].columns.roofPhotoThree)) {
                var imgsArr = data[a].columns.roofPhotoThree.split(",");
                var html = '';
                var h2 = '';
                for (var i = 0; i < imgsArr.length; i++) {
                    html += '<div class="bj-img">';
                    html += '   <img src="${commonStaticImgPath}' + imgsArr[i] + '">';
                    html += '</div>';

                    h2 += '<div class="bj-img imgSpan">';
                    h2 += ' <span class="layui-icon-close layui-icon" onclick="delMoreImg(this)"></span>';
                    h2 += '<img src="${commonStaticImgPath}' + imgsArr[i] + '">';
                    h2 += '<input type="hidden" class="data-input" name="roofPhotoThree" value="' + imgsArr[i] + '"/>';
                    h2 += '</div>';
                }
                $("#contentBody"+a+" #roofPhotoThree").empty().append(html);

                $("#contentBody"+a+" #roofPhotoThree").next().find(".moreDiv").show();
                $("#contentBody"+a+" #roofPhotoThree").next().find(".moreDiv").empty().append(h2);
                var maxNum = $("#contentBody"+a+" #roofPhotoThree").next().find(".numMax").val();
                if (imgsArr.length == maxNum) {
                    $("#contentBody"+a+" #roofPhotoThree").next().find(".moreUpload").hide();
                }
            }
            if (!isBlank(data[a].columns.roofPhotoFour)) {
                var imgsArr = data[a].columns.roofPhotoFour.split(",");
                var html = '';
                var h2 = '';
                for (var i = 0; i < imgsArr.length; i++) {
                    html += '<div class="bj-img">';
                    html += '   <img src="${commonStaticImgPath}' + imgsArr[i] + '">';
                    html += '</div>';

                    h2 += '<div class="bj-img imgSpan">';
                    h2 += ' <span class="layui-icon-close layui-icon" onclick="delMoreImg(this)"></span>';
                    h2 += '<img src="${commonStaticImgPath}' + imgsArr[i] + '">';
                    h2 += '<input type="hidden" class="data-input" name="roofPhotoFour" value="' + imgsArr[i] + '"/>';
                    h2 += '</div>';
                }
                $("#contentBody"+a+" #roofPhotoFour").empty().append(html);
                $("#contentBody"+a+" #roofPhotoFour").next().find(".moreDiv").show();
                $("#contentBody"+a+" #roofPhotoFour").next().find(".moreDiv").empty().append(h2);
                var maxNum = $("#contentBody"+a+" #roofPhotoFour").next().find(".numMax").val();
                if (imgsArr.length == maxNum) {
                    $("#contentBody"+a+" #roofPhotoFour").next().find(".moreUpload").hide();
                }
            }
            if (!isBlank(data[a].columns.houseOutlinePhoto)) {
                var imgsArr = data[a].columns.houseOutlinePhoto.split(",");
                var html = '';
                var h2 = '';
                for (var i = 0; i < imgsArr.length; i++) {
                    html += '<div class="bj-img">';
                    html += '   <img src="${commonStaticImgPath}' + imgsArr[i] + '">';
                    html += '</div>';

                    h2 += '<div class="bj-img imgSpan">';
                    h2 += ' <span class="layui-icon-close layui-icon" onclick="delMoreImg(this)"></span>';
                    h2 += '<img src="${commonStaticImgPath}' + imgsArr[i] + '">';
                    h2 += '<input type="hidden" class="data-input" name="houseOutlinePhoto" value="' + imgsArr[i] + '"/>';
                    h2 += '</div>';
                }
                $("#contentBody"+a+" #houseOutlinePhoto").empty().append(html);
                $("#contentBody"+a+" #houseOutlinePhoto").next().find(".moreDiv").show();
                $("#contentBody"+a+" #houseOutlinePhoto").next().find(".moreDiv").empty().append(h2);
                var maxNum = $("#contentBody"+a+" #houseOutlinePhoto").next().find(".numMax").val();
                if (imgsArr.length == maxNum) {
                    $("#contentBody"+a+" #houseOutlinePhoto").next().find(".moreUpload").hide();
                }
            }
            if (!isBlank(data[a].columns.roofPhotoFive)) {
                var imgsArr = data[a].columns.roofPhotoFive.split(",");
                var html = '';
                var h2 = '';
                for (var i = 0; i < imgsArr.length; i++) {
                    html += '<div class="bj-img">';
                    html += '   <img src="${commonStaticImgPath}' + imgsArr[i] + '">';
                    html += '</div>';

                    h2 += '<div class="bj-img imgSpan">';
                    h2 += ' <span class="layui-icon-close layui-icon" onclick="delMoreImg(this)"></span>';
                    h2 += '<img src="${commonStaticImgPath}' + imgsArr[i] + '">';
                    h2 += '<input type="hidden" class="data-input" name="roofPhotoFive" value="' + imgsArr[i] + '"/>';
                    h2 += '</div>';
                }
                $("#contentBody"+a+" #roofPhotoFive").empty().append(html);
                $("#contentBody"+a+" #roofPhotoFive").next().find(".moreDiv").show();
                $("#contentBody"+a+" #roofPhotoFive").next().find(".moreDiv").empty().append(h2);
                var maxNum = $("#contentBody"+a+" #roofPhotoFive").next().find(".numMax").val();
                if (imgsArr.length == maxNum) {
                    $("#contentBody"+a+" #roofPhotoFive").next().find(".moreUpload").hide();
                }
            }
            if (!isBlank(data[a].columns.detailSupplementOne)) {
                var flyImgsArr = data[a].columns.detailSupplementOne.split(",");
                var html = '';
                var h2 = '';
                for (var i = 0; i < flyImgsArr.length; i++) {
                    html += '<div class="bj-img">';
                    html += '   <img src="${commonStaticImgPath}' + flyImgsArr[i] + '">';
                    html += '</div>';

                    h2 += '<div class="bj-img imgSpan">';
                    h2 += ' <span class="layui-icon-close layui-icon" onclick="delMoreImg(this)"></span>';
                    h2 += '<img src="${commonStaticImgPath}' + flyImgsArr[i] + '">';
                    h2 += '<input type="hidden" class="data-input" name="detailSupplementOne" value="' + flyImgsArr[i] + '"/>';
                    h2 += '</div>';
                }
                $("#contentBody"+a+" #detailSupplementOne").empty().append(html);
                $("#contentBody"+a+" #detailSupplementOne").next().find(".moreDiv").show();
                $("#contentBody"+a+" #detailSupplementOne").next().find(".moreDiv").empty().append(h2);
                var maxNum = $("#contentBody"+a+" #detailSupplementOne").next().find(".numMax").val();
                if (imgsArr.length == maxNum) {
                    $("#contentBody"+a+" #detailSupplementOne").next().find(".moreUpload").hide();
                }
            }
            if (!isBlank(data[a].columns.roofPhotoFacade)) {
                var imgsArr = data[a].columns.roofPhotoFacade.split(",");
                var html = '';
                var h2 = '';
                for (var i = 0; i < imgsArr.length; i++) {
                    html += '<div class="bj-img">';
                    html += '   <img src="${commonStaticImgPath}' + imgsArr[i] + '">';
                    html += '</div>';

                    h2 += '<div class="bj-img imgSpan">';
                    h2 += ' <span class="layui-icon-close layui-icon" onclick="delMoreImg(this)"></span>';
                    h2 += '<img src="${commonStaticImgPath}' + imgsArr[i] + '">';
                    h2 += '<input type="hidden" class="data-input" name="roofPhotoFacade" value="' + imgsArr[i] + '"/>';
                    h2 += '</div>';
                }
                $("#contentBody"+a+" #roofPhotoFacade").empty().append(html);
                $("#contentBody"+a+" #roofPhotoFacade").next().find(".moreDiv").show();
                $("#contentBody"+a+" #roofPhotoFacade").next().find(".moreDiv").empty().append(h2);
                var maxNum = $("#contentBody"+a+" #roofPhotoFacade").next().find(".numMax").val();
                if (imgsArr.length == maxNum) {
                    $("#contentBody"+a+" #roofPhotoFacade").next().find(".moreUpload").hide();
                }
            }
            if (!isBlank(data[a].columns.roofPhotoInterior)) {
                var imgsArr = data[a].columns.roofPhotoInterior.split(",");
                var html = '';
                var h2 = '';
                for (var i = 0; i < imgsArr.length; i++) {
                    html += '<div class="bj-img">';
                    html += '   <img src="${commonStaticImgPath}' + imgsArr[i] + '">';
                    html += '</div>';

                    h2 += '<div class="bj-img imgSpan">';
                    h2 += ' <span class="layui-icon-close layui-icon" onclick="delMoreImg(this)"></span>';
                    h2 += '<img src="${commonStaticImgPath}' + imgsArr[i] + '">';
                    h2 += '<input type="hidden" class="data-input" name="roofPhotoInterior" value="' + imgsArr[i] + '"/>';
                    h2 += '</div>';
                }
                $("#contentBody"+a+" #roofPhotoInterior").empty().append(html);
                $("#contentBody"+a+" #roofPhotoInterior").next().find(".moreDiv").show();
                $("#contentBody"+a+" #roofPhotoInterior").next().find(".moreDiv").empty().append(h2);
                var maxNum = $("#contentBody"+a+" #roofPhotoInterior").next().find(".numMax").val();
                if (imgsArr.length == maxNum) {
                    $("#contentBody"+a+" #roofPhotoInterior").next().find(".moreUpload").hide();
                }
            }
            if (!isBlank(data[a].columns.houseSupplementOne)) {
                var imgsArr = data[a].columns.houseSupplementOne.split(",");
                var html = '';
                var h2 = '';
                for (var i = 0; i < imgsArr.length; i++) {
                    html += '<div class="bj-img">';
                    html += '   <img src="${commonStaticImgPath}' + imgsArr[i] + '">';
                    html += '</div>';

                    h2 += '<div class="bj-img imgSpan">';
                    h2 += ' <span class="layui-icon-close layui-icon" onclick="delMoreImg(this)"></span>';
                    h2 += '<img src="${commonStaticImgPath}' + imgsArr[i] + '">';
                    h2 += '<input type="hidden" class="data-input" name="houseSupplementOne" value="' + imgsArr[i] + '"/>';
                    h2 += '</div>';
                }
                $("#contentBody"+a+" #houseSupplementOne").empty().append(html);
                $("#contentBody"+a+" #houseSupplementOne").next().find(".moreDiv").show();
                $("#contentBody"+a+" #houseSupplementOne").next().find(".moreDiv").empty().append(h2);
                var maxNum = $("#contentBody"+a+" #houseSupplementOne").next().find(".numMax").val();
                if (imgsArr.length == maxNum) {
                    $("#contentBody"+a+" #houseSupplementOne").next().find(".moreUpload").hide();
                }
            }
            if (!isBlank(data[a].columns.surveyVideo)) {
                var imgsArr = data[a].columns.surveyVideo.split(",");
                var html = '';
                var h2 = '';
                for (var i = 0; i < imgsArr.length; i++) {
                    html += '<div class="bj-img videoSpan" style="width: 150px;">';
                    html += '<video class="showVideo" controls width="150px" height="78px" src="${commonStaticImgPath}' + imgsArr[i] + '"/>';
                    html += '</div>';
                    h2 += '<div class="bj-img videoSpan" style="width: 150px;">';
                    h2 += '<span  class="layui-icon-close layui-icon" style="z-index: 9;" onClick="delVideoImg(this)"></span>';
                    h2 += '<video class="showVideo" controls width="150px" height="78px" src="${commonStaticImgPath}' + imgsArr[i] + '"/>';
                    h2 += '<input type="hidden" className="data-input" name="surveyVideo" value="' + imgsArr[i] + '"/>';
                    h2 += '</div>';
                }
                $("#contentBody"+a+" #surveyVideo").empty().append(html);
                $("#contentBody"+a+" #surveyVideo").next().find(".videoDiv").show();
                $("#contentBody"+a+" #surveyVideo").next().find(".videoDiv").empty().append(h2);
                var maxNum = $("#contentBody"+a+" #surveyVideo").next().find(".numMax").val();
                if (imgsArr.length == maxNum) {
                    $("#contentBody"+a+" #surveyVideo").next().find(".videoUpload").hide();
                }
            }
            if (!isBlank(data[a].columns.surveyFiles)) {
                var imgsArr = data[a].columns.surveyFiles.split(",");
                var html = '';
                var h2 = '';
                for (var i = 0; i < imgsArr.length; i++) {
                    var fileName = imgsArr[i].substring(imgsArr[i].lastIndexOf("/") + 1, imgsArr[i].length);
                    html += '<div>';
                    html += '<a href="${commonStaticImgPath}' + imgsArr[i] + '" target="_blank">' + fileName + '</a>';
                    html += '</div>';

                    var fname = imgsArr[i].substring(imgsArr[i].lastIndexOf("/") + 1, imgsArr[i].length);
                    h2 += '<div>';
                    h2 += '<a href="${commonStaticImgPath}' + imgsArr[i] + '" target="_blank" class="fileH">' + fname + '</a>';
                    h2 += '<span onclick="delFile(this)" style="cursor:pointer;"><i class="layui-icon">&#xe640;</i></span>';
                    h2 += '<input name="surveyFiles" class="hide" value="' + imgsArr[i] + '">';
                    h2 += '</div>';
                }
                $("#contentBody"+a+" #surveyFiles").empty().append(html);

                $("#contentBody"+a+" #surveyFiles").next().find(".imgSpan").show();
                $("#contentBody"+a+" #surveyFiles").next().find(".imgSpan").empty().append(h2);
                var maxNum = $("#contentBody"+a+" #surveyFiles").next().find(".numMax").val();
                if (imgsArr.length == maxNum) {
                    $("#contentBody"+a+" #surveyFiles").next().find(".udFile").hide();
                }
            }
            if (!isBlank(data[a].columns.vrRoofOne)) {
                var imgsArr = data[a].columns.vrRoofOne.split(",");
                var html = '';
                var h2 = '';
                for (var i = 0; i < imgsArr.length; i++) {
                    html += '<div class="bj-img">';
                    html += '   <img src="${commonStaticImgPath}' + imgsArr[i] + '">';
                    html += '</div>';

                    h2 += '<div class="bj-img imgSpan">';
                    h2 += ' <span class="layui-icon-close layui-icon" onclick="delMoreImg(this)"></span>';
                    h2 += '<img src="${commonStaticImgPath}' + imgsArr[i] + '">';
                    h2 += '<input type="hidden" class="data-input" name="vrRoofOne" value="' + imgsArr[i] + '"/>';
                    h2 += '</div>';
                }
                $("#contentBody"+a+" #vrRoofOne").empty().append(html);
                $("#contentBody"+a+" #vrRoofOne").next().find(".moreDiv").show();
                $("#contentBody"+a+" #vrRoofOne").next().find(".moreDiv").empty().append(h2);
                var maxNum = $("#contentBody"+a+" #vrRoofOne").next().find(".numMax").val();
                if (imgsArr.length == maxNum) {
                    $("#contentBody"+a+" #vrRoofOne").next().find(".moreUpload").hide();
                }
            }
            if (!isBlank(data[a].columns.vrRoofTwo)) {
                var imgsArr = data[a].columns.vrRoofTwo.split(",");
                var html = '';
                var h2 = '';
                for (var i = 0; i < imgsArr.length; i++) {
                    html += '<div class="bj-img">';
                    html += '   <img src="${commonStaticImgPath}' + imgsArr[i] + '">';
                    html += '</div>';

                    h2 += '<div class="bj-img imgSpan">';
                    h2 += ' <span class="layui-icon-close layui-icon" onclick="delMoreImg(this)"></span>';
                    h2 += '<img src="${commonStaticImgPath}' + imgsArr[i] + '">';
                    h2 += '<input type="hidden" class="data-input" name="vrRoofTwo" value="' + imgsArr[i] + '"/>';
                    h2 += '</div>';
                }
                $("#contentBody"+a+" #vrRoofTwo").empty().append(html);
                $("#contentBody"+a+" #vrRoofTwo").next().find(".moreDiv").show();
                $("#contentBody"+a+" #vrRoofTwo").next().find(".moreDiv").empty().append(h2);
                var maxNum = $("#contentBody"+a+" #vrRoofTwo").next().find(".numMax").val();
                if (imgsArr.length == maxNum) {
                    $("#contentBody"+a+" #vrRoofTwo").next().find(".moreUpload").hide();
                }
            }
            if (!isBlank(data[a].columns.vrRoofThree)) {
                var imgsArr = data[a].columns.vrRoofThree.split(",");
                var html = '';
                var h2 = '';
                for (var i = 0; i < imgsArr.length; i++) {
                    html += '<div class="bj-img">';
                    html += '   <img src="${commonStaticImgPath}' + imgsArr[i] + '">';
                    html += '</div>';

                    h2 += '<div class="bj-img imgSpan">';
                    h2 += ' <span class="layui-icon-close layui-icon" onclick="delMoreImg(this)"></span>';
                    h2 += '<img src="${commonStaticImgPath}' + imgsArr[i] + '">';
                    h2 += '<input type="hidden" class="data-input" name="vrRoofThree" value="' + imgsArr[i] + '"/>';
                    h2 += '</div>';
                }
                $("#contentBody"+a+" #vrRoofThree").empty().append(html);
                $("#contentBody"+a+" #vrRoofThree").next().find(".moreDiv").show();
                $("#contentBody"+a+" #vrRoofThree").next().find(".moreDiv").empty().append(h2);
                var maxNum = $("#contentBody"+a+" #vrRoofThree").next().find(".numMax").val();
                if (imgsArr.length == maxNum) {
                    $("#contentBody"+a+" #vrRoofThree").next().find(".moreUpload").hide();
                }
            }
            if (!isBlank(data[a].columns.vrRoofFour)) {
                var imgsArr = data[a].columns.vrRoofFour.split(",");
                var html = '';
                var h2 = '';
                for (var i = 0; i < imgsArr.length; i++) {
                    html += '<div class="bj-img">';
                    html += '   <img src="${commonStaticImgPath}' + imgsArr[i] + '">';
                    html += '</div>';

                    h2 += '<div class="bj-img imgSpan">';
                    h2 += ' <span class="layui-icon-close layui-icon" onclick="delMoreImg(this)"></span>';
                    h2 += '<img src="${commonStaticImgPath}' + imgsArr[i] + '">';
                    h2 += '<input type="hidden" class="data-input" name="vrRoofFour" value="' + imgsArr[i] + '"/>';
                    h2 += '</div>';
                }
                $("#contentBody"+a+" #vrRoofFour").empty().append(html);
                $("#contentBody"+a+" #vrRoofFour").next().find(".moreDiv").show();
                $("#contentBody"+a+" #vrRoofFour").next().find(".moreDiv").empty().append(h2);
                var maxNum = $("#contentBody"+a+" #vrRoofFour").next().find(".numMax").val();
                if (imgsArr.length == maxNum) {
                    $("#contentBody"+a+" #vrRoofFour").next().find(".moreUpload").hide();
                }
            }
            if (!isBlank(data[a].columns.fwImg1)) {
                var imgsArr = data[a].columns.fwImg1.split(",");
                var html = '';
                var h2 = '';
                for (var i = 0; i < imgsArr.length; i++) {
                    html += '<div class="bj-img">';
                    html += '   <img src="${commonStaticImgPath}' + imgsArr[i] + '">';
                    html += '</div>';

                    h2 += '<div class="bj-img imgSpan">';
                    h2 += ' <span class="layui-icon-close layui-icon" onclick="delMoreImg(this)"></span>';
                    h2 += '<img src="${commonStaticImgPath}' + imgsArr[i] + '">';
                    h2 += '<input type="hidden" class="data-input" name="fwImg1" value="' + imgsArr[i] + '"/>';
                    h2 += '</div>';
                }
                $("#contentBody"+a+" #fwImg1").empty().append(html);
                $("#contentBody"+a+" #fwImg1").next().find(".moreDiv").show();
                $("#contentBody"+a+" #fwImg1").next().find(".moreDiv").empty().append(h2);
                var maxNum = $("#contentBody"+a+" #fwImg1").next().find(".numMax").val();
                if (imgsArr.length == maxNum) {
                    $("#contentBody"+a+" #fwImg1").next().find(".moreUpload").hide();
                }
            }
            if (!isBlank(data[a].columns.fwImg2)) {
                var imgsArr = data[a].columns.fwImg2.split(",");
                var html = '';
                var h2 = '';
                for (var i = 0; i < imgsArr.length; i++) {
                    html += '<div class="bj-img">';
                    html += '   <img src="${commonStaticImgPath}' + imgsArr[i] + '">';
                    html += '</div>';

                    h2 += '<div class="bj-img imgSpan">';
                    h2 += ' <span class="layui-icon-close layui-icon" onclick="delMoreImg(this)"></span>';
                    h2 += '<img src="${commonStaticImgPath}' + imgsArr[i] + '">';
                    h2 += '<input type="hidden" class="data-input" name="fwImg2" value="' + imgsArr[i] + '"/>';
                    h2 += '</div>';
                }
                $("#contentBody"+a+" #fwImg2").empty().append(html);
                $("#contentBody"+a+" #fwImg2").next().find(".moreDiv").show();
                $("#contentBody"+a+" #fwImg2").next().find(".moreDiv").empty().append(h2);
                var maxNum = $("#contentBody"+a+" #fwImg2").next().find(".numMax").val();
                if (imgsArr.length == maxNum) {
                    $("#contentBody"+a+" #fwImg2").next().find(".moreUpload").hide();
                }
            }
            if (!isBlank(data[a].columns.fwImg3)) {
                var imgsArr = data[a].columns.fwImg3.split(",");
                var html = '';
                var h2 = '';
                for (var i = 0; i < imgsArr.length; i++) {
                    html += '<div class="bj-img">';
                    html += '   <img src="${commonStaticImgPath}' + imgsArr[i] + '">';
                    html += '</div>';

                    h2 += '<div class="bj-img imgSpan">';
                    h2 += ' <span class="layui-icon-close layui-icon" onclick="delMoreImg(this)"></span>';
                    h2 += '<img src="${commonStaticImgPath}' + imgsArr[i] + '">';
                    h2 += '<input type="hidden" class="data-input" name="fwImg3" value="' + imgsArr[i] + '"/>';
                    h2 += '</div>';
                }
                $("#contentBody"+a+" #fwImg3").empty().append(html);
                $("#contentBody"+a+" #fwImg3").next().find(".moreDiv").show();
                $("#contentBody"+a+" #fwImg3").next().find(".moreDiv").empty().append(h2);
                var maxNum = $("#contentBody"+a+" #fwImg3").next().find(".numMax").val();
                if (imgsArr.length == maxNum) {
                    $("#contentBody"+a+" #fwImg3").next().find(".moreUpload").hide();
                }
            }
            if (!isBlank(data[a].columns.fwImg4)) {
                var imgsArr = data[a].columns.fwImg4.split(",");
                var html = '';
                var h2 = '';
                for (var i = 0; i < imgsArr.length; i++) {
                    html += '<div class="bj-img">';
                    html += '   <img src="${commonStaticImgPath}' + imgsArr[i] + '">';
                    html += '</div>';

                    h2 += '<div class="bj-img imgSpan">';
                    h2 += ' <span class="layui-icon-close layui-icon" onclick="delMoreImg(this)"></span>';
                    h2 += '<img src="${commonStaticImgPath}' + imgsArr[i] + '">';
                    h2 += '<input type="hidden" class="data-input" name="fwImg4" value="' + imgsArr[i] + '"/>';
                    h2 += '</div>';
                }
                $("#contentBody"+a+" #fwImg4").empty().append(html);
                $("#contentBody"+a+" #fwImg4").next().find(".moreDiv").show();
                $("#contentBody"+a+" #fwImg4").next().find(".moreDiv").empty().append(h2);
                var maxNum = $("#contentBody"+a+" #fwImg4").next().find(".numMax").val();
                if (imgsArr.length == maxNum) {
                    $("#contentBody"+a+" #fwImg4").next().find(".moreUpload").hide();
                }
            }
            if (!isBlank(data[a].columns.fwImg5)) {
                var imgsArr = data[a].columns.fwImg5.split(",");
                var html = '';
                var h2 = '';
                for (var i = 0; i < imgsArr.length; i++) {
                    html += '<div class="bj-img">';
                    html += '   <img src="${commonStaticImgPath}' + imgsArr[i] + '">';
                    html += '</div>';

                    h2 += '<div class="bj-img imgSpan">';
                    h2 += ' <span class="layui-icon-close layui-icon" onclick="delMoreImg(this)"></span>';
                    h2 += '<img src="${commonStaticImgPath}' + imgsArr[i] + '">';
                    h2 += '<input type="hidden" class="data-input" name="fwImg5" value="' + imgsArr[i] + '"/>';
                    h2 += '</div>';
                }
                $("#contentBody"+a+" #fwImg5").empty().append(html);
                $("#contentBody"+a+" #fwImg5").next().find(".moreDiv").show();
                $("#contentBody"+a+" #fwImg5").next().find(".moreDiv").empty().append(h2);
                var maxNum = $("#contentBody"+a+" #fwImg5").next().find(".numMax").val();
                if (imgsArr.length == maxNum) {
                    $("#contentBody"+a+" #fwImg5").next().find(".moreUpload").hide();
                }
            }
        }
        viewer.update();
    }

    function resetSort(projectDetailList){
        for (let i = 0; i <projectDetailList.length; i++) {
            var sort = 1;
            $("#contentBody"+i).find("tr").each(function (index) {
                if (!$(this).hasClass("hide")) {
                    $(this).find("td:first").text(sort);
                    sort++;
                }
            });
        }

    }

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

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

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

    function delVideoImg(that){
        $(that).parent("div").parent("div").parent("td").find(".videoUpload").show();
        $(that).parent("div").remove();
    }

    function delFile(that){
        $(that).hide();
        $(that).parent("div").parent("div").parent("td").find(".udFile").show();
        $(that).parent("div").remove();
        // $(that).parent("div").parent("div").parent("td").find(".udFile").show();
    }

    function isBlank(val) {
        if (val == null || val == '' || val == undefined) {
            return true;
        }
        return false;
    }
    // window.addEventListener('beforeunload', function (event) {
    //     console.log("进来了没有")
    //     // 这里可以执行一些清理工作或者发送数据给服务器
    //     event.preventDefault(); // 阻止默认行为
    //     // 可以返回一个提示信息或设置 `return` 值
    //     return '您确定要离开吗？';
    // });
</script>
</body>
</html>

