<!--设置生成规则-->
<div class="modal fade" id="choose" data-backdrop="static">
    <div class="modal-dialog " role="document">
        <div class="modal-content">
            <div class="modal-header">
                <h5 class="modal-title">设置中间计量生成规则</h5>
            </div>
            <div class="modal-body">
                <div class="form-group">
                    <label>中间计量模式 <a href="/public/images/example/jiliangmoshi.png" target="_blank" data-toggle="tooltip" data-placement="bottom" data-original-title="点击查看相关报表"><i class="fa fa-question-circle-o"></i></a></label>
                    <div class="row" id="im-type">
                        <% for (const iT in imType) { %>
                        <% const t = imType[iT]; %>
                        <div class="col-6">
                            <div class="card border-primary" name="im-type" im-type="<%- t.value %>" <% if (ctx.stage.im_type !== t.value) { %> style="cursor:pointer;"<% } %>>
                                <div class="card-body<% if (ctx.stage.im_type === t.value) { %> text-primary<% } %>">
                                    <h5 class="card-title mb-0" im-type="<%- t.value %>">
                                        <% if (ctx.stage.im_type === t.value) { %><i class="fa fa-check pull-right"></i><% } %>
                                        <%- t.name %>
                                    </h5>
                                </div>
                            </div>
                        </div>
                        <% }%>
                    </div>
                </div>
                <div class="form-group">
                    <label>中间计量表号前缀</label>
                    <input type="text" class="form-control form-control-sm" value="<%- ctx.stage.im_pre ? ctx.stage.im_pre : '' %>" id="im-pre" maxlength="10">
                </div>
                <div class="form-group">
                    <label> </label>
                    <a  href="#choose2" data-toggle="modal" data-target="#choose2">高级设置</a>
                </div>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-secondary" data-dismiss="modal">关闭</button>
                <% if (!stage.readOnly) { %>
                <button type="button" class="btn btn-primary" id="choose-ok">重新生成</button>
                <% } %>
            </div>
        </div>
    </div>
</div>
<!--设置生成规则2-->
<div class="modal fade" id="choose2" data-backdrop="static">
    <div class="modal-dialog modal-lg" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <h5 class="modal-title">高级设置</h5>
            </div>
            <div class="modal-body">
                <div class="custom-control custom-checkbox mb-2">
                    <input type="checkbox" class="custom-control-input" id="im-gather-check" <% if (ctx.stage.im_gather) { %> checked="checked"<% } %>>
                    <label class="custom-control-label" for="im-gather-check">汇总计量节点</label>
                </div>
                <div class="modal-height-500" id="im-gather-spread">
                </div>
                <div class="popover bs-popover-right" role="tooltip" id="gather-confirm" style="display: none">
                    <div class="arrow" style="top:30px"></div>
                    <div class="popover-body">
                        <p id="gather-confirm-hint">父项已勾选，继续将取消父项勾选。</p>
                        <p class="mb-0 d-flex justify-content-end">
                            <button class="btn btn-sm btn-secondary" id="gather-confirm-cancel">取消</button>&nbsp;<button class="btn btn-sm btn-success" id="gather-confirm-ok">继续</button>
                        </p>
                    </div>
                </div>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-secondary" data-dismiss="modal">关闭</button>
                <% if (!stage.readOnly) { %>
                <button type="button" class="btn btn-primary" id="choose2-ok">确定</button>
                <% } %>
            </div>
        </div>
    </div>
</div>
<!--添加草图-->
<div class="modal fade" id="edit-img" data-backdrop="static">
    <div class="modal-dialog modal-lgx" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <h5 class="modal-title">添加草图</h5>
            </div>
            <div class="modal-body">
                <p>
                    <input type="file" id="upload-img-file" style="display: none;">
                    <a href="javascript: void(0);" class="btn btn-outline-primary btn-sm" id="upload-img">上传图片</a>
                </p>
                <div class="img-view">
                </div>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-secondary" data-dismiss="modal">关闭</button>
                <button type="button" class="btn btn-primary" id="edit-img-ok">确认</button>
            </div>
        </div>
    </div>
</div>
<!--计量汇总-->
<div class="modal fade" id="choose" data-backdrop="static">
    <div class="modal-dialog modal-lg" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <h5 class="modal-title">计量汇总</h5>
            </div>
            <div class="modal-body">
                <div class="modal-height-500">
                    <table class="table table-sm table-bordered">
                        <tr><th width="70">计量汇总</th><th>项目节编号</th><th>清单编号</th><th>名称</th><th>单位</th></tr>
                        <tr><td><input type="checkbox"></td><td>1</td><td></td><td>第一部分 建筑安装工程费</td><td></td></tr>
                        <tr><td><input type="checkbox"></td><td>1-2</td><td></td><td>路基工程</td><td></td></tr>
                        <tr><td><input type="checkbox"></td><td>1-2-2</td><td></td><td>挖方</td><td></td></tr>
                        <tr><td><input type="checkbox"></td><td>1-2-2-1</td><td></td><td>挖土方</td><td></td></tr>
                        <tr><td><input type="checkbox"></td><td>1-2-2-1-1</td><td></td><td>挖路基土方</td><td></td></tr>
                        <tr><td><input type="checkbox"></td><td></td><td>203-1-a</td><td>挖土方</td><td></td></tr>
                    </table>
                </div>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-secondary" data-dismiss="modal">关闭</button>
                <% if (!stage.readOnly) { %>
                <button type="button" class="btn btn-primary" >确认</button>
                <% } %>
            </div>
        </div>
    </div>
</div>
<!--完成中间计量-->
<div class="modal fade" id="done" data-backdrop="static">
    <div class="modal-dialog " role="document" >
        <div class="modal-content">
            <div class="modal-header">
                <h5 class="modal-title">完成中间计量</h5>
            </div>
            <div class="modal-body">
                <h5>完成中间计量后，将锁定编辑，无法修改数据。</h5>
                <h5>确认完成后，即可上报本期计量。</h5>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-secondary" data-dismiss="modal">取消</button>
                <a href="/tender/<%- ctx.tender.id %>/measure/stage/<%- ctx.stage.order %>/detail/done" class="btn btn-success" >确认完成</a>
            </div>
        </div>
    </div>
</div>
<% include ./audit_modal.ejs %>