<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ include file="/webpage/include/taglib.jsp"%>
<html>
<head>
    <title>查看详情</title>
    <link rel="stylesheet" href="${ctxp}/static/plugin/assets/layui/css/layui.css">
    <link rel="stylesheet" href="${ctxp}/static/plugin/assets/common.css"/>
    <script type="text/javascript" src="${ctxp}/static/plugin/assets/jquery-3.2.1.min.js"></script>
    <script src="${ctxp}/static/plugin/assets/layui/layui.js"></script>
</head>
<style>
    .layui-input{height: 28px;margin-top: 6px;background: whitesmoke;line-height: 28px}
    .layui-form-label {float: left;display: block;padding: 9px 15px;width: 100px;font-weight: 400;line-height: 20px;text-align: right;}
    .layui-table-view .layui-table {width:100%}
</style>
<body style="height: 100%">
<c:if test="${ not empty list}">
    <c:forEach items="${list}" var="data" varStatus="index">
<div class="layui-form-item" style="margin-top: 10px;">
    <div class="layui-inline">
        <label class="layui-form-label">单体工程名称</label>
        <div class="layui-input-inline">
            <input type="text" name="projectName" autocomplete="off" class="layui-input" readonly="readonly" value="${data.projectName}">
        </div>
    </div>
    <div class="layui-inline">
        <label class="layui-form-label">创建时间</label>
        <div class="layui-input-inline">
            <input type="text" name="createDate" id="beginDate1" readonly="readonly" placeholder="yyyy-MM-dd" autocomplete="off"
                   class="layui-input" value="<fmt:formatDate value="${data.createDate}" pattern="yyyy/MM/dd "/>">
        </div>
    </div>
    <div class="layui-inline">
        <label class="layui-form-label">单体工程编号</label>
        <div class="layui-input-inline">
            <input type="text" name="projectNo" autocomplete="off" class="layui-input" readonly="readonly" value="${data.projectNo}">
        </div>
    </div>
</div>
<div style="margin: 20px;">
    <fieldset class="layui-elem-field layui-field-title">
        <legend style="font-size: 15px;">结算书信息</legend>
    </fieldset>
    <table class="layui-hide" id="looktable" lay-filter="looktable"></table>
</div>
<script>
    //生成layui 表格
    layui.use(['table','form','layedit', 'laydate'], function(){
        var table = layui.table
            ,form = layui.form;
        form.render();
        table.render({
            elem: '#looktable'
            ,cols: [[
                {field:'xmmc',title:'结算书名称'}
                ,{field:'sgdw',title:'供应商'}
                ,{field:'xmlx',title:'结算书类型'}
                // ,{field:'xmbh',title:'结算书编号'}
                ,{field:'op',align:'center',title:"操作",templet:function(d){
                    ////对操作进行初始化
                    var xml = "<a class='layui-btn layui-btn-xs' style='margin-top: 3px' onclick=\"view( '" + d.id + "','" + d.type + "','" + d.projectId + "')\">编辑</a>";
                    return xml;
                 }}
            ]]
            ,data:[
                <c:if test="${ not empty data.wbsItems}">
            <c:forEach items="${data.wbsItems}" var="data1" varStatus="index">
                {
                    "id":"${data1.id}",
                    "projectId":"${data1.projectId}",
                    "type":"${data1.type}",
                    "xmmc": "${data1.itemName}",
                    "sgdw": "${data1.unit}",
                    "xmlx":<c:if test="${data1.type eq '1'}">"架空线路"</c:if><c:if test="${data1.type eq '2'}">"电缆线路"</c:if><c:if test="${data1.type eq '3'}">"变电站工程"</c:if>,
                    <%--"xmbh":"${data1.itemNo}"--%>
                },
                </c:forEach>
                </c:if>
            ]
            ,page: true
        });
    });
</script>
    </c:forEach>
</c:if>
<script>
    //编辑进行页面跳转
    function view(id,type,projectId) {
        var url = '${ctx}/jkxl/list?id='+id+'&type='+type+'&projectId='+projectId;
        parent.location.href=url;
    }
</script>
</body>
</html>
