<!DOCTYPE html>
<html lang="zh">
<#include "/include/header.html">
<body>
<div class="lyear-layout-web">
    <div class="lyear-layout-container">
        <!--左侧导航-->
        <#include "/include/left.html">
        <!--End 左侧导航-->
        <!--头部信息-->
        <#include "/include/topbar.html">
        <!--End 头部信息-->
        <!--页面主要内容-->
        <main class="lyear-layout-content">

            <div class="container-fluid">
                <div class="row">
                    <div class="col-lg-12">
                        <div class="card">
                            <div class="panel" style="margin-bottom: auto">
                                <div class="panel-heading">
                                    <h3 class="panel-title">
                                        组合条件筛选
                                    </h3>
                                </div>
                                <!--组合条件组件-->
                                <#include "/include/table/table-query.html">
                            </div>
                            <div class="card-toolbar clearfix" style="padding: 0px 24px 0px 24px">
                                <div class="toolbar-btn-action" id="toolBar">
                                    <#include "/include/table/table-batch.html">
                                </div>
                            </div>
                            <!--快速搜索框-->
                            <div class="card-body" style="padding: 10px 15px">
                                <div class="pull-right" id="id_search_column"
                                     style="position: absolute;right: 295px;margin-top: 10px;">
                                    <input type="hidden" name="search_field" id="search-field" value="">
                                    <button class="btn btn-default dropdown-toggle" id="search-btn"
                                            data-toggle="dropdown" type="button" aria-haspopup="true"
                                            aria-expanded="false">
                                        全部 <span class="caret"></span>
                                    </button>
                                    <ul class="dropdown-menu" style="min-width: auto">
                                        <li><a tabindex="-1" href="javascript:void(0)" data-field="">全部</a></li>
                                        <#list pageTemplate.tableSearch as search>
                                            <li><a tabindex="-1" href="javascript:void(0)" data-field="${search.key!}">${search.name}</a></li>
                                        </#list>
                                    </ul>
                                </div>
                                <!--Bootstarp Table插入-->
                                <#include "/include/table/table-data.html">
                            </div>
                        </div>

                    </div>

                </div>
            </div>

        </main>
        <!--End 页面主要内容-->
    </div>
</div>
<!--审核模态框-->
<div id="id_model_verify" class="modal fade bs-example-modal-lg" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel">
    <div class="modal-dialog modal-md" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
                <h4 class="modal-title">结算审核</h4>
            </div>
            <div class="modal-body">
                <input type="hidden" id="id_model_verify_hide_id">
                <div class="input-group">
                    <span class="input-group-addon">提现加盟商:</span>
                    <input id="id_model_verify_fran" type="text" class="form-control" readonly>
                </div>
                <br>
                <div class="input-group">
                    <span class="input-group-addon">申请人:</span>
                    <input id="id_model_verify_user" type="text" class="form-control" readonly>
                </div>
                <br>
                <div class="input-group">
                    <span class="input-group-addon">打款方式：</span>
                    <select class="form-control selectpicker" id="id_model_verify_method">
                        <option>微信</option>
                        <option>支付宝</option>
                    </select>
                </div>
                <br>
                <div class="input-group">
                    <span class="input-group-addon">备注：</span>
                    <textarea id="id_model_verify_remarks" class="form-control" placeholder="如驳回申请请填写驳回理由..." rows="2"></textarea>
                </div>

                <div class="modal-footer">
                    <button type="button" class="btn btn-success" data-dismiss="modal" onclick="verifySubmit('SUCCESS')">审核通过</button>
                    <button type="button" class="btn btn-danger" data-dismiss="modal" onclick="verifySubmit('FAIL')">驳回申请</button>
                    <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                </div>
            </div>
        </div>
    </div>
</div>
<!--安全验证模态框结束-->
<#include "/include/footer.html">
<#include "/include/table/table-event.html">
<#include "/include/table/table-model.html">
<!--页面生成二维码插件-->
<script type="text/javascript" src="https://oss.bhynm.com/delivery/upload/2022/3/29/164852354402792.js"></script>
<!--以下为业务流程处理-->
<script>

    /**
     * 打开审核模态框
     **/
    function toVerify(){
        let row=getTableSelectOne();
        if (row.settStatus==='核算中'){
            lightyear.notify("该笔记录系统正在核算中，请等待一会儿再试...", 'danger');
            search();
            return;
        }
        if (row.settStatus!=="审核中"){
            lightyear.notify("该笔记录已经审核过了...", 'danger');
            return;
        }
        openModel("id_model_verify",function (){

            $("#id_model_verify_hide_id").val(row.id);
            $("#id_model_verify_fran").val(getEntity("t_franchisee_information",row.franName).fran_name);
            $("#id_model_verify_user").val(getEntity("sys_user",row.settInitiator).user_name);
        });
    }
    /**
     * 审核通过
     * */
    function verifySubmit(type){
        let row=getTableSelectOne();
        let data ={
            id:row.id,
            method:$("#id_model_verify_method").val(),
            rmk:$("#id_model_verify_remarks").val()
        }
        if ("SUCCESS"===type){
            sendAjax("${ctx}/company/fran/get/verify/success","GET",data);
        }
        if ("FAIL"===type){
           sendAjax("${ctx}/company/fran/get/verify/fail","GET",data);
        }
    }
</script>
</body>
</html>