<% include ./stage_sub_menu.ejs %>
<div class="panel-content">
    <div class="panel-title">
        <div class="title-main d-flex justify-content-between">
            <div>
                <div class="d-inline-block">
                    <a href="javascript: void(0);" id="add" class="btn btn-sm" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="添加"><i class="fa fa-plus" aria-hidden="true"></i></a>
                    <a href="javascript: void(0);" id="del" 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="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" <% if (stage.readOnly) { %> readonly="" <% } %> id="expr">
                    </div>
                </div>
            </div>
            <div class="ml-auto">
                <!--完成中间计量-->
                <% if (!ctx.stage.check_detail) { %>
                <span class="text-success" id="locked-hint">已完成，请继续完成「上报审批」 <a href="/tender/<%- ctx.tender.id %>/measure/stage/<%- ctx.stage.order %>/detail/unlock">解锁编辑</a></span>
                <% } %>
            </div>
        </div>
    </div>
    <div class="content-wrap">
        <div class="c-header p-0"></div>
        <div class="row w-100 sub-content">
            <div class="c-body col-8">
                <div class="sjs-height-1" id="pay-spread">
                </div>
            </div>
            <div class="c-body col">
                <div class="side-bar-1 sjs-bar"></div>
                <div class="sjs-sh-1">
                    <table class="table table-bordered">
                        <tr><th></th><th>可选基数</th><th>计算代号</th><th>值</th></tr>
                        <% for (let iBase = 0; iBase < calcBase.length; iBase++) { %>
                        <tr>
                            <td><%- iBase + 1 %></td>
                            <td><%- calcBase[iBase].name %></td>
                            <td><%- calcBase[iBase].code %></td>
                            <td><%- calcBase[iBase].value %></td>
                        </tr>
                        <% } %>
                    </table>
                </div>
            </div>
        </div>
    </div>
</div>
<div style="display: none">
    <img src="/public/images/file_clip.png" id="rela-file-icon" />
    <img src="/public/images/file_clip_hover.png" id="rela-file-hover" />
</div>
<script>
    const tender = JSON.parse('<%- JSON.stringify(tender) %>');
    const stage = JSON.parse('<%- JSON.stringify(ctx.stage) %>');
    const readOnly = <%- stage.readOnly %>;
    const dealPay = JSON.parse('<%- JSON.stringify(dealPay) %>');
    const calcBase = JSON.parse('<%- JSON.stringify(calcBase) %>');
    const decimal = JSON.parse('<%- JSON.stringify(ctx.tender.info.decimal) %>');
    const whiteList = JSON.parse('<%- JSON.stringify(whiteList) %>');
    const uploadPermission = <%- uploadPermission %>;
    const userID = '<%- ctx.session.sessionUser.accountId %>';
</script>
