<% include ../tender/tender_sub_menu.ejs %>
<div class="panel-content">
    <div class="panel-title">
        <div class="title-main  d-flex justify-content-between"><!--工具-->
            <div>
                <div class="btn-group">
                    <a href="javascript:void(0)" id="insert" class="btn btn-sm" data-toggle="tooltip" data-placement="bottom" title=""
                       data-original-title="插入"><i class="fa fa-sign-in" aria-hidden="true"></i></a>
                    <a href="javascript:void(0)" id="copy" class="btn btn-sm" data-toggle="tooltip" data-placement="bottom" title=""
                       data-original-title="复制"><i class="fa fa-files-o" aria-hidden="true"></i></a>
                    <a href="javascript:void(0)" id="cut" class="btn btn-sm" data-toggle="tooltip" data-placement="bottom" title=""
                       data-original-title="剪切"><i class="fa fa-scissors" aria-hidden="true"></i></a>
                    <a href="javascript:void(0)" id="paste" class="btn btn-sm" data-toggle="tooltip" data-placement="bottom" title=""
                       data-original-title="粘贴"><i class="fa fa-clipboard" aria-hidden="true"></i></a>
                    <a href="javascript:void(0)" id="delete" class="btn btn-sm" data-toggle="tooltip" data-placement="bottom" title=""
                       data-original-title="删除"><i class="fa fa-remove" aria-hidden="true"></i></a>
                    <a href="javascript:void(0)" id="up-level" class="btn btn-sm" data-toggle="tooltip" data-placement="bottom" title=""
                       data-original-title="升级"><i class="fa fa-arrow-left" aria-hidden="true"></i></a>
                    <a href="javascript:void(0)" id="down-level" class="btn btn-sm" data-toggle="tooltip" data-placement="bottom" title=""
                       data-original-title="降级"><i class="fa fa-arrow-right" aria-hidden="true"></i></a>
                    <a href="javascript:void(0)" id="down-move" class="btn btn-sm" data-toggle="tooltip" data-placement="bottom" title=""
                       data-original-title="下移"><i class="fa fa-arrow-down" aria-hidden="true"></i></a>
                    <a href="javascript:void(0)" id="up-move" class="btn btn-sm" data-toggle="tooltip" data-placement="bottom" title=""
                       data-original-title="上移"><i class="fa fa-arrow-up" aria-hidden="true"></i></a>
                </div>
                <div class="d-inline-block">
                    <div class="input-group input-group-sm ml-2 mt-1">
                        <div class="input-group-prepend">
                            <span class="input-group-text" id="basic-addon1">表达式</span>
                        </div>
                        <input type="text" class="form-control m-0">
                    </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) { %>
                    <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-secondary btn-sm pull-right">审批完成</a>
                <% } %>
                <% if (ctx.session.sessionUser.accountId === tender.user_id) { %>
                    <% if (tender.ledger_status === auditConst.status.uncheck) { %>
                        <a href="#sub-sp" data-toggle="modal" data-target="#sub-sp" class="btn btn-primary btn-sm pull-right">上报审批</a>
                    <% } else if (tender.ledger_status === auditConst.status.checkNo) { %>
                        <a href="#sub-sp" data-toggle="modal" data-target="#sub-sp2" class="btn btn-primary btn-sm pull-right">重新上报</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 col-12">
                <div id="ledger-spread" class="<% if (tender.measure_type === measureType.tz.value) { %>sjs-height-1<% } else { %>sjs-height-0<% } %>"></div>
                <% if (tender.measure_type === measureType.tz.value) { %>
                <div id="main-resize" r-Type="height" div1="#ledger-spread" div2="#main-bottom" store-id="explode-main" 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 col-0" style="display: none;">
                <div class="tab-content">
                    <div id="search" class="tab-pane active">
                        <div class="sjs-bar-1">
                            <div class="input-group input-group-sm">
                                <input id="searchKeyword" type="text" class="form-control" placeholder="项目节编号/清单编号/名称" aria-label="Recipient's username" aria-describedby="button-addon2">
                                <div class="input-group-append">
                                    <button class="btn btn-outline-secondary" type="button" id="searchLedger">搜索</button>
                                </div>
                            </div>
                        </div>
                        <div id="search-result" class="sjs-sh-1">
                        </div>
                    </div>
                    <div id="std-chapter" class="tab-pane active">
                        <div class="sjs-bar-2">
                            <select class="form-control form-control-sm"><option>0号计量台帐部位参考(项目节)</option></select>
                        </div>
                        <div id="std-chapter-spread" class="sjs-sh-2">
                        </div>
                    </div>
                    <div id="std-bills" class="tab-pane">
                        <div class="sjs-bar-3">
                            <select class="form-control form-control-sm"><option>0号计量台帐部位参考(项目节)</option></select>
                        </div>
                        <div id="std-bills-spread" class="sjs-sh-3">
                        </div>
                    </div>
                    <div id="deal-bills" class="tab-pane">
                        <div class="sjs-bar-4">
                            <a href="#upload-deal" data-toggle="modal" data-target="#upload-deal" class="btn btn-sm btn-primary">上传签约清单</a>
                        </div>
                        <div id="deal-bills-spread" class="sjs-sh-4">
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <!--右侧菜单-->
        <div class="side-menu">
            <ul class="nav flex-column right-nav" id="side-menu">
                <li>
                    <a class="nav-link" content="#search" href="javascript: void(0);">查找定位</a>
                </li>
                <li class="nav-item">
                    <a class="nav-link" content="#std-chapter" href="javascript: void(0);">项目节</a>
                </li>
                <li class="nav-item">
                    <a class="nav-link" content="#std-bills" href="javascript: void(0);">工程量清单</a>
                </li>
                <li class="nav-item">
                    <a class="nav-link" content="#deal-bills" href="javascript: void(0);">签约清单</a>
                </li>
            </ul>
        </div>
    </div>
</div>
<script type="text/javascript">
    const tender = JSON.parse('<%- JSON.stringify(tender) %>');
    const tenderInfo = JSON.parse('<%- JSON.stringify(tenderInfo) %>');
    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>
<script>
    GC.Spread.Sheets.LicenseKey = "559432293813965#A0y3iTOzEDOzkjMyMDN9UTNiojIklkI1pjIEJCLi4TPB9mM5AFNTd4cvZ7SaJUVy3CWKtWYXx4VVhjMpp7dYNGdx2ia9sEVlZGOTh7NRlTUwkWR9wEV4gmbjBDZ4ElR8N7cGdHVvEWVBtCOwIGW0ZmeYVWVr3mI0IyUiwCMzETN8kzNzYTM0IicfJye&Qf35VfiEzRwEkI0IyQiwiIwEjL6ByUKBCZhVmcwNlI0IiTis7W0ICZyBlIsIyNyMzM5ADI5ADNwcTMwIjI0ICdyNkIsIibj9SbvNmL4N7bjRnch56ciojIz5GRiwiI8+Y9sWY9QmZ0Jyp96uL9v6L0wap9biY9qiq95q197Wr9g+89iojIh94Wiqi";
</script>