<% include ./stage_sub_menu.ejs %>
<div class="panel-content">
    <div class="panel-title">
        <div class="title-main d-flex justify-content-between">
            <div>
                <a class="btn btn-sm btn-light">
                    <div class="custom-control custom-checkbox">
                        <input type="checkbox" class="custom-control-input" id="used-change" checked="">
                        <label class="custom-control-label text-primary" for="used-change">本期已用变更</label>
                    </div>
                </a>
            </div>
            <div class="ml-auto">
            </div>
        </div>
    </div>
    <div class="content-wrap">
        <div class="c-header p-0">
        </div>
        <div class="c-body">
            <!--左栏-->
            <div class="w-100 sub-content">
                <!--上部分-->
                <div class="sjs-height-1" id="bgl-spread">
                </div>
                <!--下部分-->
                <div class="bcontent-wrap" id="bottom-view">
                    <div id="main-resize" class="resize-y" r-Type="height" div1="#bgl-spread" div2="#bottom-view" store-id="stage-change" store-version="1.0.0" min="150"></div>
                    <div class="bc-bar mb-1">
                        <ul class="nav nav-tabs">
                            <li class="nav-item">
                                <a class="nav-link active" data-toggle="tab" href="#qingdan" role="tab">变更清单</a>
                            </li>
                            <li class="nav-item">
                                <a class="nav-link" data-toggle="tab" href="#detail" role="tab">变更信息</a>
                            </li>
                            <li class="nav-item">
                                <a class="nav-link" data-toggle="tab" href="#fujian" role="tab">附件</a>
                            </li>
                            <li>
                                <div id="qd-filter">
                                    <a class="btn btn-sm btn-light">
                                        <div class="custom-control custom-checkbox">
                                            <input type="checkbox" class="custom-control-input" id="used-bills">
                                            <label class="custom-control-label text-primary" for="used-bills">只显示本期使用</label>
                                        </div>
                                    </a>
                                </div>
                            </li>
                        </ul>
                    </div>
                    <div class="tab-content">
                        <div class="tab-pane active" id="qingdan">
                            <div class="row">
                                <div class="col-6" id="left-view">
                                    <div class="sp-wrap" id="bills-spread">
                                    </div>
                                </div>
                                <div class="col-6" id="right-view">
                                    <div id="bills-resize" class="resize-x" r-Type="width" div1="#left-spread" div2="#right-view" store-id="stage-change-bills" store-version="1.0.0" min="150"></div>
                                    <div class="tab-content">
                                        <div class="tab-pane active" id="tz">
                                            <div class="sp-wrap" id="pos-spread">
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="tab-pane col-12" id="detail">
                            <div class="sp-wrap" style="overflow: auto">
                                <div class="form-group">
                                    <label>变更类型</label>
                                    <div class="checkbox">
                                        <% for (const t in changeConst.type) { %>
                                        <% const cType = changeConst.type[t] %>
                                        <label class="checkbox-inline">
                                            <input value="<%- cType.value %>" name="type" type="checkbox" disabled><%- cType.name %>
                                        </label>
                                        <% } %>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label>变更类别 </label>
                                    <select class="form-control form-control-sm" name="class" disabled>
                                        <% for (const c in changeConst.class) { %>
                                        <% const cClass = changeConst.class[c] %>
                                        <option value="<%- cClass.value %>"><%- cClass.name %></option>
                                        <% } %>
                                    </select>
                                </div>
                                <div class="form-group">
                                    <label>变更性质 </label>
                                    <select class="form-control form-control-sm" name="quality" disabled>
                                        <% for (const q in changeConst.quality) { %>
                                        <% const cQuality = changeConst.quality[q] %>
                                        <option value="<%- cQuality.value %>"><%- cQuality.name %></option>
                                        <% } %>
                                    </select>
                                </div>
                                <div class="form-group">
                                    <label>桩号</label>
                                    <input class="form-control form-control-sm" name="peg" value="K0+532" readonly="" type="text">
                                </div>
                                <div class="form-group">
                                    <label>原设计图名称</label>
                                    <input class="form-control form-control-sm" name="org_name" placeholder="" readonly="" type="text">
                                </div>
                                <div class="form-group">
                                    <label>原图号</label>
                                    <input class="form-control form-control-sm" name="org_code" placeholder="" readonly="" type="text">
                                </div>
                                <div class="form-group">
                                    <label>变更设计图名称</label>
                                    <input class="form-control form-control-sm" name="new_name" placeholder="" readonly="" type="text">
                                </div>
                                <div class="form-group">
                                    <label>变更图号</label>
                                    <input class="form-control form-control-sm" name="new_code" placeholder="" readonly="" type="text">
                                </div>
                                <div class="form-group">
                                    <label>工程变更理由及内容</label>
                                    <textarea class="form-control form-control-sm" name="content" rows="6" readonly=""></textarea>
                                </div>
                                <div class="form-group">
                                    <label>工程变更合同依据</label>
                                    <textarea class="form-control form-control-sm" name="basis" rows="6" readonly=""></textarea>
                                </div>
                                <div class="form-group">
                                    <label>变更提出单位</label>
                                    <select class="form-control form-control-sm" name="company" disabled>
                                    </select>
                                </div>
                                <div class="form-group">
                                    <label>费用承担方</label>
                                    <div class="radio">
                                        <% for (const c in changeConst.charge) { %>
                                        <% const cCharge = changeConst.charge[c] %>
                                        <label class="radio-inline">
                                            <input value="<%- cCharge.value %>" name="charge" type="radio" disabled> <%- cCharge.name %>
                                        </label>
                                        <% } %>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label>备注</label>
                                    <textarea name="memo" class="form-control form-control-sm" rows="3" readonly=""></textarea>
                                </div>
                            </div>
                        </div>
                        <div class="tab-pane col-12" id="fujian">
                            <div class="sp-wrap" style="overflow: auto">
                                <table class="table table-bordered">
                                    <thead><tr><th>名称</th><th>上传者</th></tr></thead>
                                    <tbody id="attachment">
                                    </tbody>
                                </table>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<img src="/public/images/icon-ok.png" id="icon-ok" />
<script>
    const changes = JSON.parse('<%- JSON.stringify(changes) %>');
    const usedChangesId = JSON.parse('<%- JSON.stringify(usedChangesId) %>')
    const ledger = JSON.parse('<%- JSON.stringify(ledger) %>');
</script>