<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <meta name="decorator" content="base"/>
    <link rel="stylesheet" href="${ctxPlugin}/lib/layuiAdmin/dist/layuiadmin/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="${ctxPlugin}/lib/layuiAdmin/dist/layuiadmin/style/admin.css" media="all">
    <link rel="stylesheet" type="text/css" href="${ctxPlugin}/static/css/reset.css" />
    <style>
        html{
            background-color: #fff;
        }
        .hide{
            display: none;
        }
        td .layui-form-select{
            width: 150px;
            margin-right: 15px;
            float: left;
        }
        .load-icon{background: url('${ctxPlugin}/static/img/shili_img.png') center center no-repeat; width: 12px; height: 12px; display: inline-block; border-radius: 50%;
            vertical-align: text-bottom;transform: translate(0px, -1px);margin-right: 2px;}

        .w-130{width: 110px;}
        .w-130+.layui-input-block{margin-left: 120px;}
    </style>
</head>
<body>
<div class="layui-form">
    <div class="layui-card">
        <div class="layui-card-body pt-20 pb-40 over-auto">
            <div class="layui-col-xs12 form-box">
                <div class="layui-inline layui-col-xs4">
                    <label class="layui-form-label w-130">电站编码：</label>
                    <div class="layui-input-block ">
                        <input type="text" name="code" class="layui-input" value="${insurance.columns.power_station_code}" disabled>
                    </div>
                </div>
                <div class="layui-inline layui-col-xs4">
                    <label class="layui-form-label w-130">产品名称：</label>
                    <div class="layui-input-block ">
                        <input type="text"  name="proName" class="layui-input" value="${insurance.columns.project_name}" disabled>
                    </div>
                </div>
                <div class="layui-inline layui-col-xs4">
                    <label class="layui-form-label w-130">代理商：</label>
                    <div class="layui-input-block ">
                        <input type="text"  name="dls" class="layui-input" value="${insurance.columns.trader_name}" disabled>
                    </div>
                </div>
                <div class="layui-inline layui-col-xs4">
                    <label class="layui-form-label w-130">项目公司：</label>
                    <div class="layui-input-block ">
                        <input type="text"  name="projectName" class="layui-input" value="${insurance.columns.project_company_name}" disabled>
                    </div>
                </div>
                <div class="layui-inline layui-col-xs4">
                    <label class="layui-form-label w-130">备案类型：</label>
                    <div class="layui-input-block ">
                        <c:if test="${insurance.columns.filing_type eq '1'}">
                            <input type="text"  name="baType" class="layui-input" value="农户备案" disabled>
                        </c:if>
                        <c:if test="${insurance.columns.filing_type eq '2'}">
                            <input type="text"  name="baType" class="layui-input" value="项目公司备案" disabled>
                        </c:if>
                    </div>
                </div>
                <div class="layui-inline layui-col-xs4">
                    <label class="layui-form-label w-130">创建时间：</label>
                    <div class="layui-input-block ">
                        <input type="text"  name="createDate" class="layui-input" value="<fmt:formatDate value="${insurance.columns.create_time}" pattern="yyyy-MM-dd HH:mm:ss"/>" disabled>
                    </div>
                </div>
                <div class="layui-inline layui-col-xs4">
                    <label class="layui-form-label w-130">业主姓名：</label>
                    <div class="layui-input-block ">
                        <input type="text"  name="name" class="layui-input" value="${insurance.columns.tenant_name}" disabled>
                    </div>
                </div>
                <div class="layui-inline layui-col-xs4">
                    <label class="layui-form-label w-130">联系电话：</label>
                    <div class="layui-input-block ">
                        <input type="text"  name="tel" class="layui-input" value="${insurance.columns.mobile}" disabled>
                    </div>
                </div>
                <div class="layui-inline layui-col-xs4">
                    <label class="layui-form-label w-130">身份证号：</label>
                    <div class="layui-input-block ">
                        <input type="text" name="idCard" class="layui-input" value="${insurance.columns.id_code}" disabled>
                    </div>
                </div>
                <div class="layui-inline layui-col-xs8">
                    <label class="layui-form-label w-130">安装地址：</label>
                    <div class="layui-input-block ">
                        <c:choose>
                            <c:when test="${insurance.columns.province eq insurance.columns.city}">
                                <input type="text"  name="adr" class="layui-input" value="${insurance.columns.province}${insurance.columns.area}${insurance.columns.address}" disabled>
                            </c:when>
                            <c:otherwise>
                                <input type="text"  name="adr" class="layui-input" value="${insurance.columns.province}${insurance.columns.city}${insurance.columns.area}${insurance.columns.address}" disabled>
                            </c:otherwise>
                        </c:choose>
                    </div>
                </div>
            </div>
        </div>
        <div id="insuranceType over-auto">
            <div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
                <ul class="layui-tab-title" id="changeTabId" lay-filter="changeTab" >
                    <li class="layui-this">投保信息</li>
                    <c:if test="${insurance.columns.partner_id ne '03'}"> <li>过程信息</li> </c:if>
                </ul>
                <div class="layui-tab-content">
                    <div class="layui-tab-item layui-show" id="commonTab">
                        <div class="layui-form mt-20 pr-20">
                            <div class="layui-col-xs12 form-box">
                                <div class="layui-inline layui-col-xs4">
                                    <label class="layui-form-label w-130"><i class="red">*</i>保险名称：</label>
                                    <div class="layui-input-block ">
                                        <input type="text" name="code" class="layui-input" value="${insurance.columns.insurance_name}" disabled>
                                    </div>
                                </div>
                                <div class="layui-inline layui-col-xs4">
                                    <label class="layui-form-label w-130">保险类型：</label>
                                    <div class="layui-input-block ">
                                        <c:if test="${insurance.columns.insurance_type eq '0'}">
                                            <input type="text" name="code" class="layui-input" value="财产险" disabled>
                                        </c:if>
                                        <c:if test="${insurance.columns.insurance_type eq '1'}">
                                            <input type="text" name="code" class="layui-input" value="商业险" disabled>
                                        </c:if>
                                        <c:if test="${insurance.columns.insurance_type eq '2'}">
                                            <input type="text" name="code" class="layui-input" value="交强险" disabled>
                                        </c:if>
                                        <c:if test="${insurance.columns.insurance_type eq '3'}">
                                            <input type="text" name="code" class="layui-input" value="其他" disabled>
                                        </c:if>
                                        <c:if test="${insurance.columns.insurance_type eq '4'}">
                                            <input type="text" name="code" class="layui-input" value="工程安装一切险" disabled>
                                        </c:if>
                                    </div>
                                </div>
                                <div class="layui-inline layui-col-xs4">
                                    <label class="layui-form-label w-130">保险公司：</label>
                                    <div class="layui-input-block ">
                                        <input type="text" name="code" class="layui-input" value="${insurance.columns.insurance_company_name}" disabled>
                                    </div>
                                </div>
                                <c:if test="${insurance.columns.partner_id ne '03'}">
                                    <div class="layui-inline layui-col-xs4">
                                        <label class="layui-form-label w-130">投保人：</label>
                                        <div class="layui-input-block ">
                                            <input type="text" name="code" class="layui-input" value="${insurance.columns.policyholder}" disabled>
                                        </div>
                                    </div>
                                    <div class="layui-inline layui-col-xs8">
                                        <label class="layui-form-label w-130">被保人：</label>
                                        <div class="layui-input-block ">
                                            <input type="text" name="code" class="layui-input" value="${insurance.columns.insurant}" disabled>
                                        </div>
                                    </div>
                                </c:if>
                            </div>
                            <div class="layui-col-xs12 form-box">
                                <div class="layui-inline layui-col-xs4">
                                    <label class="layui-form-label w-130"><i class="red">*</i>保险编号：</label>
                                    <div class="layui-input-block ">
                                        <input type="text" disabled name="code" class="layui-input" value="${insurance.columns.number}">
                                    </div>
                                </div>
                            <c:if test="${insurance.columns.partner_id ne '03'}">
                                <div class="layui-inline layui-col-xs4">
                                    <label class="layui-form-label w-130"><i class="red">*</i>投保金额：</label>
                                    <div class="layui-input-block ">
                                        <input type="text" disabled name="code" class="layui-input" value="${insurance.columns.insurance_money}">
                                        <span class="pos-a h-32 lh-32 layui-span-unit">元</span>
                                    </div>
                                </div>
                                <div class="layui-inline layui-col-xs4">
                                    <label class="layui-form-label w-130"><i class="red">*</i>保费：</label>
                                    <div class="layui-input-block ">
                                        <input type="text" disabled name="code" class="layui-input" value="${insurance.columns.price}">
                                        <span class="pos-a h-32 lh-32 layui-span-unit">元</span>
                                    </div>
                                </div>
                                <div class="layui-inline layui-col-xs4">
                                    <label class="layui-form-label w-130"><i class="red">*</i>保险开始日期：</label>
                                    <div class="layui-input-block ">
                                        <input type="text" disabled name="timeMin" class="layui-input" id="timeMin" placeholder="请选择" value="${insurance.columns.start_time}">
                                    </div>
                                </div>
                                <div class="layui-inline layui-col-xs4">
                                    <label class="layui-form-label w-130"><i class="red">*</i>保险结束日期：</label>
                                    <div class="layui-input-block ">
                                        <input type="text" disabled name="timeMax" class="layui-input" id="timeMax" placeholder="请选择" value="${insurance.columns.end_time}">
                                    </div>
                                </div>
                            </c:if>
                            </div>
                            <div class="layui-col-xs12 form-box over-auto mb-50">
                                <div class="layui-inline layui-col-xs12">
                                    <label class="layui-form-label w-130">保单：</label>
                                    <div class="layui-input-block ">
                                        <c:if test="${insurance.columns.down_url ne null}">
                                            <a class="upload-txt" target="_blank" href="${commonStaticImgPath}${insurance.columns.down_url}">查看</a>
                                        </c:if>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="layui-tab-item" id="processTab">
                        <table class="layui-table" style="margin-bottom: 30px;">
                            <colgroup>
                                <col width="20%">
                                <col width="15%">
                                <col width="65%">
                            </colgroup>
                            <thead>
                            <tr>
                                <th>时间</th>
                                <th>操作人</th>
                                <th>描述</th>
                            </tr>
                            </thead>
                            <tbody id="tableTr">
                            <c:forEach items="${processList}" var="process">
                                <tr>
                                    <td>${process.d}</td>
                                    <td>${process.p}</td>
                                    <td>${process.c}</td>
                                </tr>
                            </c:forEach>
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="operate-footer">
        <button type="button" class="layui-btn layui-btn-primary " onclick="closeDiv();" >关闭</button>
    </div>
</div>
<script src="${ctxPlugin}/lib/layuiAdmin/dist/layuiadmin/layui/layui.js"></script>
<script src="${ctxPlugin}/lib/layuiAdmin/dist/layuiadmin/layui/data.js"></script>
<script type="text/javascript">
    //初始数据
    var $form;
    var form;
    var $;
    layui.use(['form', 'table', 'upload', 'jquery','laydate'], function () {
        $ = layui.jquery;
        form = layui.form;
        upload = layui.upload;
        laydate = layui.laydate;
        $form = $('form');

        form.on('select(insuredType)', function (data) {
            var insuredType = $(data.elem).val();
            if (insuredType == '0') {
                $(data.elem).parent("td").find("input[name='insuredAmount']").addClass("hide");
            } else {
                $(data.elem).parent("td").find("input[name='insuredAmount']").removeClass("hide");
            }
        });

       $("#changeTabId li").on("click",function(){
           $("#changeTabId li").removeClass("layui-this");
           $(this).addClass("layui-this");
           if ($(this).text() == '过程信息') {
               $("#commonTab").removeClass("layui-show");
               $("#processTab").addClass("layui-show");
           } else {
               $("#commonTab").addClass("layui-show");
               $("#processTab").removeClass("layui-show");
           }
       })

    })


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

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

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