<!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">
                                    <button id="batch_finish" class="btn btn-success m-r-5"
                                            onclick="invoke()"><i class="mdi mdi-check"></i>新增
                                    </button>
                                    <#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>
<#include "/include/footer.html">
<#include "/include/table/table-event.html">
<#include "/include/table/table-model.html">
<!--以下为业务流程处理-->
<!--模态框-->
<div class="modal fade" id="id_definition_model" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel">
    <div class="modal-dialog" 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">&times;</span></button>
                <h4 class="modal-title" id="exampleModalLabel">新增审核模板</h4>
            </div>
            <div class="modal-body">
                <div class="form-group">
                    <label class="control-label">模板名称</label>
                    <input value="请输入" name="atdName" class="form-control" id="atdName"/>
                </div>
                <div class="form-group">
                    <label class="control-label">审核模块名称：</label>
                    <select id="id_definition_model_select" class="form-control" >
                        <option value="0" selected="selected">请选择</option>
                        <option value="t_complaint,投诉记录审核">投诉记录审核</option>
                        <option value="t_courier,派送员审核">派送员审核</option>
                    </select>
                </div>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                <button type="button" class="btn btn-primary" onclick="submission()">确认指派</button>
            </div>
        </div>
    </div>
</div>
<script>
    /**
     * 新增调用模块框
     * */
    function invoke() {
        $('#id_definition_model').modal("show");
    }

    /**
     * 提交新增
     */
    function submission() {
        var atdName=$("#atdName").val();
        var auditModule=$("#id_definition_model_select").val();
        var parms={atdName:atdName,auditModule:auditModule};
        $.ajax({
           data:parms,
            type:"post",
            dataType:"json",
            url: "${ctx!}/definition/insert",
            success : function (data) {
                if (data.status==200){
                    lightyear.notify('操作成功!', 'success');
                    $('#id_com_model').modal('hide');
                    search();
                    return data;
                }
                if (data.status!=200){
                    lightyear.notify("操作失败", 'danger');
                    search();
                    return data;
                }
                lightyear.notify(data.message, 'danger');
            }
        });

    }
</script>
</body>
</html>