<% include ../tender/tender_sub_menu.ejs %>
<div class="panel-content">
    <div class="panel-title">
        <div class="title-main d-flex justify-content-between">
            <div class="d-inline-block">
                <div class="dropdown">
                    <button class="btn btn-sm btn-light dropdown-toggle text-primary" type="button" id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                        <i class="fa fa-list-ol"></i> 显示层级
                    </button>
                    <div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
                        <a class="dropdown-item" name="showLevel" tag="1" href="javascirpt: void(0);">第一层</a>
                        <a class="dropdown-item" name="showLevel" tag="2" href="javascirpt: void(0);">第二层</a>
                        <a class="dropdown-item" name="showLevel" tag="3" href="javascirpt: void(0);">第三层</a>
                        <a class="dropdown-item" name="showLevel" tag="4" href="javascirpt: void(0);">第四层</a>
                        <a class="dropdown-item" name="showLevel" tag="5" href="javascirpt: void(0);">第五层</a>
                        <a class="dropdown-item" name="showLevel" tag="last" href="javascirpt: void(0);">最底层</a>
                        <a class="dropdown-item" name="showLevel" tag="leafXmj" href="javascirpt: void(0);">只显示项目节</a>
                    </div>
                </div>
            </div>
            <div></div>
            <div>
                <% if (tender.ledger_status === auditConst.status.checkNo) { %>
                    <a href="#sp-list" data-toggle="modal" data-target="#sp-list" class="btn btn-outline-warning btn-sm pull-right text-dark">退回意见</a>
                <% } else if (tender.ledger_status === auditConst.status.checking) { %>
                    <% if (curAuditor.audit_id === ctx.session.sessionUser.accountId) { %>
                        <a href="#sp-done" data-toggle="modal" data-target="#sp-done" class="btn btn-success btn-sm pull-right">审批通过</a>
                        <a href="#sp-back" data-toggle="modal" data-target="#sp-back" class="btn btn-warning btn-sm pull-right">审批退回</a>
                    <% } else {%>
                        <a href="#sp-list" data-toggle="modal" data-target="#sp-list" class="btn btn-outline-warning btn-sm pull-right text-dark">审批中</a>
                    <% } %>
                <% } else if (tender.ledger_status === auditConst.status.checked) { %>
                <a href="#sp-list" data-toggle="modal" data-target="#sp-list" class="btn btn-outline-success btn-sm pull-right text-dark">审批通过</a>
                <% } %>
            </div>
        </div>
    </div>
    <div class="content-wrap row pr-46">
        <div class="c-header p-0 col-12">
        </div>
        <!--核心内容（两栏）-->
        <div class="row w-100 sub-content">
            <!--左栏-->
            <div class="c-body" id="left-view" style="width: 100%">
                <div class="sjs-height-1" id="ledger-spread">
                </div>
                <% if (tender.measure_type === measureType.tz.value) { %>
                <div id="main-resize" r-Type="height" div1="#ledger-spread" div2="#main-bottom" store-id="audit-main" store-version="1.0.0" min="100"></div>
                <div class="bcontent-wrap" id="main-bottom">
                    <div class="bc-bar mb-1">
                        <ul class="nav nav-tabs">
                            <li class="nav-item">
                                <a class="nav-link active" href="javascript:void(0)">部位明细</a>
                            </li>
                        </ul>
                    </div>
                    <div class="sp-wrap" id="pos-spread">
                    </div>
                </div>
                <% } %>
            </div>
            <!--右栏-->
            <div class="c-body" id="right-view" style="display: none; width: 33%">
                <div class="resize-x" id="right-spr" r-Type="width" div1="#left-view" div2="#right-view" title="调整大小" a-type="percent"><!--调整左右高度条--></div>
                <div class="tab-content">
                    <div id="deal-bills" class="tab-pane">
                        <div class="sjs-bar-1"></div>
                        <div class="sjs-sh-1" id="deal-bills-spread">
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <!--右侧菜单-->
        <div class="side-menu">
            <!--右侧菜单-->
            <ul class="nav flex-column right-nav">
                <li class="nav-item">
                    <a class="nav-link" href="javascript: void(0);" role="tab" content="#deal-bills">签约清单</a>
                </li>
            </ul>
        </div>
    </div>
</div>
<script type="text/javascript">
    const tender = JSON.parse('<%- JSON.stringify(tender) %>');
    const measureType = JSON.parse('<%- JSON.stringify(measureType) %>');
    let ledger = '<%- ledger %>';
    ledger = JSON.parse(ledger);
    let ledgerSpreadSetting = '<%- ledgerSpreadSetting %>';
    ledgerSpreadSetting = JSON.parse(ledgerSpreadSetting);
    let posSpreadSetting = JSON.parse('<%- posSpreadSetting %>');
</script>