<%include ./common.html %>
<div class="panel-content">
    <% if(Object.keys(selectedCompilation).length > 0) {%>
    <div class="panel-title">
        <div class="title-main">
            <h2>
                <%= selectedCompilation.name %>
                <% if(selectedCompilation.is_release) {%>
                <span class="text-muted" style="margin-left: 5px;">已发布 <%= moment(selectedCompilation.update_time).format('YYYY-MM-DD')%></span>
                <% } %>
                <a href="javascript:void(0);" data-id="<%= selectedCompilation._id %>" data-status="<%= selectedCompilation.is_release ? 0 : 1 %>" class="btn btn-primary btn-sm pull-right" id="release"><% if(selectedCompilation.is_release) {%>取消<% }else{ %>发布<% } %>编办</a>
            </h2>
        </div>
    </div>
    <% } %>
    <div class="content-wrap">
        <!--清单模板设置-->
        <div class="c-header" style="padding:0">
            <ul class="nav nav-tabs">
                <% valuationList.forEach(function(valuation) { %>
                <li role="presentation" <% if (valuation.id.toString() === valuationId) { %>class="active"<% } %>><a href="/compilation/valuation/<%= section %>/<%= valuation.id %>"><%= valuation.name %></a></li>
                <% }) %>
            </ul>
        </div>
        <div class="c-body">
            <legend>清单模板设置<a href="/compilation/valuation/<%= section %>/<%= valuationId %>" class="btn btn-default btn-sm pull-right">返回</a><a href="#" class="btn btn-primary btn-sm pull-right" style="margin-right:5px">保存</a></legend>
            <div class="row">
                <div class="col-md-11">
                    <div class="tools-btn btn-group align-top">
                        <a href="" class="btn btn-sm"><i class="fa fa-files-o" aria-hidden="true"></i> 复制</a>
                        <a href="" class="btn btn-sm"><i class="fa fa-scissors" aria-hidden="true"></i> 剪切</a>
                        <a href="" class="btn btn-sm"><i class="fa fa-clipboard" aria-hidden="true"></i> 粘贴</a>
                        <a href="javascript:void(0)" class="btn btn-sm" id="insert"><i class="fa fa-sign-in" aria-hidden="true"></i> 插入</a>
                        <a href="javascript:void(0)" class="btn btn-sm" id="delete"><i class="fa fa-remove" aria-hidden="true"></i> 删除</a>
                        <a href="javascript:void(0)" class="btn btn-sm" id="upLevel"><i class="fa fa-arrow-left" aria-hidden="true"></i> 升级</a>
                        <a href="javascript:void(0)" class="btn btn-sm" id="downLevel"><i class="fa fa-arrow-right" aria-hidden="true"></i> 降级</a>
                        <a href="javascript:void(0)" class="btn btn-sm" id="downMove"><i class="fa fa-arrow-down" aria-hidden="true"></i> 下移</a>
                        <a href="javascript:void(0)" class="btn btn-sm" id="upMove"><i class="fa fa-arrow-up" aria-hidden="true"></i> 上移</a>
                    </div>
                    <div class="mb-qd-height" id="billsSpread" style="height: 500px;">
                    </div>
                </div>
                <div class="col-md-1">
                    <select class="form-control" style="display: none"><option>定额</option></select>
                    <div class="mb-de-height">
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script>
    let billsTemplateData = '<%- billsTemplateData %>';
    let billsFixedFlagList = '<%- billsFixedFlagList %>';
    let billsTypeFlagList = '<%- billsTypeFlagList %>';
    let updateUrl = '/compilation/template/<%= section %>/<%= valuationId %>/<%= engineering %>/update';
</script>
<script type="text/javascript" src="/public/web/id_tree.js"></script>
<script type="text/javascript" src="/public/web/tree_sheet/tree_sheet_helper.js"></script>
<script type="text/javascript" src="/public/web/tree_sheet/tree_sheet_controller.js"></script>
<script type="text/javascript" src="/public/web/common_ajax.js"></script>
<script type="text/javascript" src="/web/users/js/template.js"></script>