<div class="panel-content">
    <div class="panel-title fluid">
        <div class="title-main d-flex justify-content-between">
            <div></div>
            <div>
                <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>
            </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 class="sjs-height-1" id="ledger-spread">
                </div>
            </div>
            <!--右栏-->
            <div class="c-body col-0" style="display: none;">
                <div class="tab-content">
                    <div id="deal-bills" class="tab-pane">
                        <div class="sjs-height-1" id="deal-bills-spread">
                        </div>
                    </div>
                    <div id="opinion" class="tab-pane">
                        <div class="side-bar">
                            <select class="form-control form-control-sm">
                                <% for (const a of auditors) { %>
                                    <option value="<%- a.audit_id %>"><%- a.name %></option>
                                <% } %>
                            </select>
                        </div>
                        <div class="sjs-height-2" style="overflow:auto">
                            <% if (curAuditor && curAuditor.audit_id === ctx.session.sessionUser.accountId) { %>
                            <div class="card my-3">
                                <div class="card-header">添加清单意见</div>
                                <div class="card-body">
                                    <!--无清单 提示添加清单-->
                                    <div class="alert alert-primary  px-2 py-1" role="alert">
                                        台帐清单右键，添加至"清单意见"
                                    </div>
                                    <!--已添加清单-->
                                    <table class="table table-sm table-bordered mb-2" id="rela_bills">
                                    </table>
                                    <textarea class="form-control" placeholder="审批内容" id="content"></textarea>
                                    <div class="alert alert-warning px-2 py-1 mt-2 mb-1" role="alert" id="opinionHint">
                                        请填写审批内容。
                                    </div>
                                    <div class="alert alert-warning px-2 py-1 mt-2 mb-1" role="alert" id="billsHint">
                                        至少需要一条清单。
                                    </div>
                                    <button class="btn btn-sm btn-primary mt-1" id="addContent">添加</button>
                                </div>
                            </div>
                            <% } %>
                            <legend><%- auditors[0].name %> 清单意见</legend>
                            <% for (const c of content) { %>
                            <div name="auditContent" class="card my-3">
                                <div class="card-body">
                                    <table class="table table-sm table-bordered mb-2">
                                        <% const bills = JSON.parse(c.rela_bills); %>
                                        <% for (const b of bills) { %>
                                        <tr bid="<%- b.ledger_id %>"><td><%- b.code ? b.code : b.b_code %></td><td><%- b.name %></td></tr>
                                        <% } %>
                                    </table>
                                    <p><%- c.content %></p>
                                    <span class="text-muted"><%- c.in_time.toLocaleString() %></span>
                                </div>
                            </div>
                            <% } %>
                        </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>
                <li class="nav-item">
                    <a class="nav-link" href="javascript: void(0);" role="tab" content="#opinion">清单意见</a>
                </li>
            </ul>
        </div>
    </div>
</div>
<script type="text/javascript">
    let ledger = '<%- ledger %>';
    ledger = JSON.parse(ledger);
    let ledgerSpreadSetting = '<%- ledgerSpreadSetting %>';
    ledgerSpreadSetting = JSON.parse(ledgerSpreadSetting);
    ledgerSpreadSetting.readOnly = <%- readOnly %>;
    const userName = '<%- ctx.session.sessionUser.name %>';
</script>
<script src="/public/js/spreadjs/sheets/gc.spread.sheets.all.10.0.1.min.js"></script>
<script>
    GC.Spread.Sheets.LicenseKey = "559432293813965#A0y3iTOzEDOzkjMyMDN9UTNiojIklkI1pjIEJCLi4TPB9mM5AFNTd4cvZ7SaJUVy3CWKtWYXx4VVhjMpp7dYNGdx2ia9sEVlZGOTh7NRlTUwkWR9wEV4gmbjBDZ4ElR8N7cGdHVvEWVBtCOwIGW0ZmeYVWVr3mI0IyUiwCMzETN8kzNzYTM0IicfJye&Qf35VfiEzRwEkI0IyQiwiIwEjL6ByUKBCZhVmcwNlI0IiTis7W0ICZyBlIsIyNyMzM5ADI5ADNwcTMwIjI0ICdyNkIsIibj9SbvNmL4N7bjRnch56ciojIz5GRiwiI8+Y9sWY9QmZ0Jyp96uL9v6L0wap9biY9qiq95q197Wr9g+89iojIh94Wiqi";
</script>
<script src="/public/js/spreadjs_rela/spreadjs_zh<%= min %>.js"></script>
<script src="/public/js/path_tree<%= min %>.js"></script>
<script src="/public/js/ledger_audit.js"></script>