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

<body>
<div class="layui-form">
    <div class="layui-card-body layui-col-xs12" id="LAY_app">
       <%-- <blockquote class="layui-elem-quote">订单信息</blockquote>
        <div class="layui-card">

        </div>--%>
           <div class="layui-card-body">
               <input value="${detailRecord.columns.id}" hidden  id="id">
               <div class="layui-row layui-col-space12 layui-form-item mt-5">
                   <div class="layui-col-xs3">
                       <label class="layui-form-label">代理商：</label>
                       <div class="layui-input-block">
                           <input type="text" class="layui-input layui-bg-gray" value="${detailRecord.columns.trader_name}" disabled>
                       </div>
                   </div>
                   <c:if test="${detailRecord.columns.type eq '1'}">
                       <div class="layui-col-xs3">
                           <label class="layui-form-label">区域：</label>
                           <div class="layui-input-block">
                               <input type="text" class="layui-input layui-bg-gray"
                                      value="${detailRecord.columns.region_province}${detailRecord.columns.region_city}${detailRecord.columns.region_area}" disabled>
                           </div>
                       </div>
                   </c:if>

                   <div class="layui-col-xs3">
                       <label class="layui-form-label">质检单号：</label>
                       <div class="layui-input-block">
                           <input type="text" autocomplete="off"  class="layui-input layui-bg-gray" readonly  value="${detailRecord.columns.number}">
                       </div>
                   </div>
                   <div class="layui-col-xs3">
                       <label class="layui-form-label">生成时间：</label>
                       <div class="layui-input-block">
                           <input type="text" autocomplete="off" id="createTime" name="createTime" class="layui-input layui-bg-gray" value="${detailRecord.columns.createTime}" readonly>
                       </div>
                   </div>
               </div>
           </div>
        <div class="layui-card">

            <blockquote class="layui-elem-quote">电站信息</blockquote>
            <div class="layui-card-body ">
                <div class="layui-row layui-col-space12 layui-form-item">
                    <div class="layui-col-xs12 mb-10 pr-30 pl-30">

                        <table class="layui-table">
                            <thead>
                            <tr>
                                <th style="width: 5%">序号</th>
                                <th>电站编号</th>
                                <th>业主</th>
                                <th>项目地址</th>
                                <th>组件数</th>
                                <th>安装容量(W)</th>
                                <th>验收状态</th>
                                <th>操作</th>
                            </tr>
                            </thead>
                            <tbody id="materialBody">
                            <c:if test="${not empty listEntry}">
                                <c:forEach items="${listEntry}" var="de" varStatus="vs">
                                    <tr>
                                        <td>${vs.count}</td>
                                        <td>${de.columns.power_station_code}</td>
                                        <td>${de.columns.tenant_name}</td>
                                        <td>${de.columns.entryAddress}</td>
                                        <td>${de.columns.component_num}</td>
                                        <td>${de.columns.capacity}</td>
                                        <td>
                                            <c:choose>
                                                <c:when test="${'1' eq detailRecord.columns.status}">待派工</c:when>
                                                <c:when test="${'0' eq de.columns.status}">--</c:when>
                                                <c:when test="${'3' eq de.columns.status}">无法验收</c:when>
                                                <c:when test="${'0' eq de.columns.accept_status}">待验收</c:when>
                                                <c:when test="${'1' eq de.columns.accept_status}">验收通过</c:when>
                                                <c:when test="${'2' eq de.columns.accept_status}">待整改</c:when>
                                                <c:when test="${'3' eq de.columns.accept_status}">待整改验收</c:when>
                                                <c:when test="${'4' eq de.columns.accept_status}">整改验收驳回</c:when>
                                            </c:choose>
                                        </td>
                                        <td>
                                            <c:choose>
                                                <c:when test="${'1' eq detailRecord.columns.status}">--</c:when>
                                                <c:when test="${'3' eq de.columns.status}"><a class="layui-table-opt-link" onclick="canNotAcceptanceDetail('${de.columns.id}')">查看</a></c:when>
                                                <c:when test="${'1' eq de.columns.accept_status || '2' eq de.columns.accept_status || '3' eq de.columns.accept_status || '4' eq de.columns.accept_status}"><a class="layui-table-opt-link" onclick="lookDetail('${de.columns.id}')">查看</a></c:when>
                                                <c:otherwise>--</c:otherwise>
                                            </c:choose>
                                        </td>
                                    </tr>
                                </c:forEach>
                            </c:if>
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
        </div>

        <div class="layui-form-item operate-footer" style="text-align: center;">
            <input type="button"   value="取消" class="layui-btn layui-btn-primary " onclick="closeDiv();" >
        </div>

    </div>

</div>

<script src="${ctxPlugin}/lib/layuiAdmin/dist/layuiadmin/layui/layui.js"></script>
<script src="${ctxPlugin}/lib/xm-select.js"></script>
<script type="text/javascript">
    //初始数据
    var $form;
    var form;
    var $;
    var imgs = '';
    var myreg = /^[1][3,4,5,6,7,8,9][0-9]{9}$/;
    var matypeList ;
    layui.config({
        base: '${ctxPlugin}/lib/layuiAdmin/dist/layuiadmin/' //静态资源所在路径
    }).extend({
        index: 'lib/index' //主入口模块
    }).use(['form', 'layedit', 'laydate', 'jquery', 'layer'], function () {
        $ = layui.jquery;
        form = layui.form;
        $form = $('form');

    })

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

    function lookDetail(detailId){
        layer.open({
            title:'详情',
            type: 2,
            content: '${ctx}/entryQuality/qualityManagement/waitChangeQualityDetail?detailId='+detailId,
            area: ['100%','100%']
        })
    }

    function canNotAcceptanceDetail(detailId){
        layer.open({
            title:'详情',
            type: 2,
            content: '${ctx}/entryQuality/qualityManagement/canNotAcceptanceDetail?detailId='+detailId,
            area: ['50%','50%']
        })
    }

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


